teleren/devto huggingface dataset:
Fix LightDM error "The name org.freedesktop.Accounts was not provided by any .service files"
Tags: x11, lightdm, displaymanager, accountsservice
Published: 2021-01-26 21:36:28

I found such a log in LightDM log (`/var/log/lightdm/lightdm.log`).

```console
WARNING: Error getting user list from org.freedesktop.Accounts: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Accounts was not provided by any .service files
```

It means the system lacked [D-Bus](https://dbus.freedesktop.org/) [AccountsService](https://www.freedesktop.org/wiki/Software/AccountsService/) of [freedesktop.org](https://www.freedesktop.org/).
This is my Artix (Arch-based) Linux output:

```
$ pacman -Ss accountsservice
world/accountsservice 0.6.55-3
    D-Bus interface for user account query and manipulation
extra/accountsservice 0.6.55-3
    D-Bus interface for user account query and manipulation
```

I installed the package: 

```console
$ doas pacman -Sy accountsservice
```

then reboot and the warning (error) log had gone ☺
# Create a Tags UI Component in React With Styled Components
Published: 2021-01-26 21:27:13

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

[Try it here](https://bef94.csb.app/)

I need to make a React component that enables users to create tags on their profile.

So I went looking to see if anyone had already created such a component. I did find this component on CodePen by Fabio here is a link to his pen
 [Codepen](https://lnkd.in/gE-rDmT) 

I decided instead of Willy Nilly cutting and pasting into my project, I would instead refactor to use Functional Components managing state with Hooks and styling with Styled Components.

I have found that refactoring other people’s code really forces you to understand how the code actually works instead of just following along.

Here is a Code Sandbox of my refactor have a look let me know what you think or if you have any optimization suggestions.

 [My Code Sandbox](https://lnkd.in/g4swwEg) 


[#UI](https://dev.to/t/UI)
[#ReactComponents](https://dev.to/t/ReactComponents)
[#ReactComponents](https://det.to/t/React)
[#StyledComponents](https://det.to/t/StyledComponents)
Nullish Coalescing Operator
Tags: javascript, node, codenewbie, tutorial
Published: 2021-01-26 21:26:32

{% youtube AWuHpaMTtsM %}

---
The nullish coalescing operator is the two question marks `??`. It provides a default value.

Syntax:
```
result = a ?? b
```

The syntax above means:

- if `a` is defined, then `a`;
- if `a` isn't defined, then `b`;

The syntax above can be rewritten as shown below:

```
result = (a !== null && a !== undefined) ? a : b;
```

See the examples below:

if `a` is defined, then `a`;
```js
const a = "breakfast"; // a is defined
const b = "lunch";

const result = a ?? b;
console.log(result); // breakfast
```

if `a` isn't defined, then `b`;
```js
let a; // a is undefined => const a = undefined;
const b = "lunch";

const result = a ?? b; 
console.log(result); // lunch
```

If you are getting an error, the browser JavaScript engine does not understand the `??` operator. 

```
SyntaxError: Unexpected token '?'
```

In such a case, you need to upgrade the browser.

---
<a href="https://www.whogohost.com/host/aff.php?aff=7390&page=hosting" target="_blank"><img src="https://www.whogohost.com/images/affiliates/unlimited-hosting-728-x-90.png" /></a>

---

### Nullish operator with other Operators
For a nullish operator used with other operators, it's advisable to use parentheses to specify the order of operations.

With parentheses `()` grouping:
```js
let length, width;
const area = (length ?? 100) * (width ?? 50);

console.log(area) // 5000
```

Without parentheses `()` grouping:
```js
let length, width;
const area = length ?? 100 * width ?? 50;

console.log(area) // NaN
```

---
### Nullish operator with Logical Operators
```js
const x = (5 && 10) ?? 15; // (5 && 10) = 10 => 10 ?? 15

console.log(x); // 10
```

Nullish Operator Precedence
Nullish operator has the least precedence as compared to other logical operators.

|   Operators   |   Precedence |
|---------------|--------------|
|     `()`      |      21      |
|      `**`     |      16      |
|      `*`      |      15      |
|      `/`      |      15      |
|      `%`      |      15      |
|      `+`      |      14      |
|      `-`      |      14      |
|      `&&`     |       7      |
|         OR    |       6      |
|      `??`     |       5      |
|       `?`     |       4      |


Check out [the full list of operators precedence at MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence).

The highest operator precedence is `()` in any math operation. It specifies the order of operations.

**Happy Coding!!!**

---
[![Buy me a Coffee](https://res.cloudinary.com/bizstak/image/upload/v1610317510/ko-fi-trans_fr3su4.png)](https://www.buymeacoffee.com/techstackmedia)

---
### TechStack Media | Bluehost
- Get a website with a free domain name for 1st year and a free **SSL** certificate.
- 1-click WordPress install and 24/7 support.
- Starting at $3.95/month.

<a href="https://www.bluehost.com/track/belloosagienoah/" target="_blank"> <img border="0" src="https://bluehost-cdn.com/media/partner/images/belloosagienoah/430x288/430x288PW.png"> </a>
How do we make tech safer?
Published: 2021-01-26 21:25:11

##What do I think is wrong with tech?
Recently, like many people, I watched 'The Social Dilemma' on Netflix, and I was struck by how candid and seemingly honest they were in the interviews (I say seemingly because I'm sure they were required to hold some information back).

If you haven't yet seen this documentary, I implore you to watch it - it explains the problems in the industry, particularly with social media, very well.
Was I very surprised by what I learned from watching it? No - however it did bring a lot of thoughts into my mind. 

**Why was mental health not taken more seriously?**

**Why are we not talking about it more now that we are starting to see the addictive qualities of social media and other tech?**

**What can we do about it?**

**What will be the long term dangers for people who are already feeling the affect of their social media use?**

**What happens to the 7 year old child who has grown up on instagram and already has deep set anxieties about themselves, caused by the content that they are viewing online? What will happen to their mental state when they are adults?**

For the first time, we are raising a generation of people who have had access to this technology for their entire lives. I'm 27, I remember playing outside with friends when I was younger, riding on our bikes and splashing through mud. I remember getting my first mobile phone (a Nokia 3310, obvs) and being so excited because it meant that I would be able to go to the corner shop on my own. I was 10. All I could do on that phone was call and text my mum, and play Snake.

Now, you see 5 and 6 year olds glued to their iPhones and iPads, screaming if their parent takes the game away. At that age, I'd hope that they don't have social media, but they are still experiencing some sort of addiction to the games on the phone. Is it the bright lights, the haptics, the addictive nature of the game itself?
_The thing is; we don't know._
This generation of children are going to be the first in history to have this technology for their whole lives.

Maybe as they grow older they'll grow out of it. Maybe they'll be able to moderate their tech and media use. Maybe there'll be better awareness of problems that tech addiction can cause and there'll be help available.
Or maybe it'll cause no problem at all.

_The point is that we just don't know_

Relative to the history of humanity, tech is incredibly young and I wonder what will happen in the next 5, 10 or 15 years.


Tech moves quickly, the rate of progression is incredible and great - I am well aware of the advancements in medicine, amongst other things - that have been made thanks to technology.

**Let's not let it get away from us...**
Upgrading postgreSQL with Homebrew
Tags: postgressql, homebrew
Published: 2021-01-26 21:01:11

---
title: Upgrading postgreSQL with Homebrew
published: true
description: 
tags: postgressql, homebrew
canonical_url: https://geoffroybaumier.hashnode.dev/upgrading-postgresql-with-homebrew
---

After upgrading a few programs including postgres when starting a new project, I ran into an issue. I already had some postgres databases from older projects and I couldn't start postgres (and create my new database).

To install postgres with brew I used:
```
$ brew install postgres
```

To see if postgres is running I can type: 
```
$ brew services 
Name       Status  User Plist
postgresql stopped 
```

Then the funny thing was when I tried to start the service:
```
$ brew services start postgres
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)
```

Great! So it's running! But no..
```
$ brew services
Name       Status  User             Plist
postgresql error   geoffroy_baumier /Users/geoffroy_baumier/Library/LaunchAgents/homebrew.mxcl.postgresql.plist               
```

To see what is the issue, let's look at the logs:
```
$ tail /usr/local/var/log/postgres.log
2021-01-26 21:12:47.678 CET [8757] FATAL:  database files are incompatible with server
2021-01-26 21:12:47.678 CET [8757] DETAIL:  The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.1.
```

And there was the issue.<br/>
All I had to do to fix this was to run this command:
```
$ brew postgresql-upgrade-database
```

Then let's start it postgres:
```
$ brew services start postgres
==> Successfully started `postgresql` (label: homebrew.mxcl.postgresql)

$ brew services
Name          Status  User             Plist
postgresql    started geoffroy_baumier /Users/geoffroy_baumier/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
postgresql@12 stopped      
``` 

No I can see that I have two postgres services with the two different versions. I can create my new updated database. Also the good thing is that I didn't lose any data from previous project and I can run the service with version 12 if I ever need it.
Installing Redis on Windows 10
Tags: redis, windows, cache, database
Published: 2021-01-26 20:37:54

---
title: Installing Redis on Windows 10
published: true
description: I show you how to install the latest version of Redis on Windows 10 using the Windows Subsystem for Linux (WSL).
tags: #redis #windows #cache #database 
---

I recorded a video showing how to install Redis on Windows. This is a *really* common question and—since half of developers out there are using Windows—I thought it was important to share.

So, here ya go! Lemme know what ya think!

{% youtube 1psWME8UH_0 %}
Lessons Learned From Singing Opera
Tags: programming, music, javascript, fullstack
Published: 2021-01-26 20:35:41

You learn a lot being a high-performance oriented classical musician. Here are some lessons I learned along the way, especially in how I needed to practice so methodically to have any hope of making progress, which may be helpful to people as they learn to code. 

1) Isolate small, difficult sections

- If you are having difficulty in a section of music, you don't go back and practice the entire piece over and over again. you isolate the measure (which is a very tiny segment!) of music you are most struggling with and practice that. You work smaller and smaller even until you can play it without getting it wrong. The same goes for coding. If you're struggling with a leetcode exercise, are you struggling with arrays? Objects? Maybe control flow? Go back and practice some *short* exercises focused on that one thing you are struggling with until you absolutely cannot get them wrong. 

2) Practice until you can't get it wrong. 

- Don't practice a section of music until you get it right. Practice it until you can't get it wrong. The same goes for difficult concepts in code. Don't just do an array exercise until you're like "oh, ok I got one right, I guess I understand arrays now." Do array exercises until you literally can do them in your sleep. That's not to say you need to memorize every array method ever, but you should understand in-depth how arrays work. 

3) Simple and good is better than complex and a trainwreck. 

- When singers audition, there is a lot of temptation to do a big, showy, frilly piece; however, those pieces can be exceptionally difficult and not necessarily showcase the singer in the best light. It's better to do a simple piece in the audition, but executed flawlessly, than a showy piece with lots of mistakes. Same with code, I think, is that its better to have solid, amazing basics and stretch from there in your work (of course, balancing this with pushing yourself forward is important), rather than biting off huge chunks of very complex projects that are way beyond your skillset and will ultimately lead you to get discouraged.

4) At the end of the day, you're telling a story.

- I think this one is the most ethereal tip, but in classical music, as obsessive as it is on technical perfection (and I'm not kidding when I say perfection),  your job is to tell a story through the sound of your voice and your technical chops serve that end. I think the same thing in code is important; keeping in mind that working code is better than perfect and that if you can't serve the end-user with your work, then something is off.

And yes, you can hear me sing; in a live performance of [Poulenc's Gloria] (https://www.youtube.com/watch?v=Oi_o3rdtXXI):)
Python Zero to Hero - Ep.33 - Python ABC (Abstract Base Classes)
Tags: python, internal, tutorial, video
Published: 2021-01-26 20:34:59

---
title: Python Zero to Hero - Ep.33 - Python ABC (Abstract Base Classes)
published: true
description: I have come across Python ABC a few times and I always wonder what magic power do they processed and what are they used for. Today, we will have a look together.
tags: python, internal, tutorial, video
---
I have come across Python ABC a few times and I always wonder what magic power do they processed and what are they used for. Today, we will have a look together. If you have any questions or any suggestions about which Python topics to cover, please leave your comment at my [Twitch channel](https://www.twitch.tv/cheukting_ho)

You can get the slide deck [here](https://slides.com/cheukting_ho) and the example code and homework form [GitHub here](https://github.com/Cheukting/python02hero). Ask questions at my [Twitch channel](https://www.twitch.tv/cheukting_ho)
DeepDreaming
Tags: ai, machinelearning, 66daysofdata, datascience
Published: 2021-01-26 20:23:53

# What is Google's Deep Dream?

## So in my journey of machine learning i recently stumbled upon a bunch of really cool looking images generated by something called a "deep dream".

## Deep Dream is a computer vision program created by google's engineer "Alexander Mordvintsev" that uses Convolutional neural networks to find and enhance image features to make them look creepy and phenomenal.

**It basically makes image have "more" of a certain feature.**

### With the research I've done and I'm no machine learning face with tongue, What i was able to understand is that this program focuses on finding certain features in an image and "multiply" it ...i guess.. rather than focusing on the networks "Cost Function" like most neural networks do.

More resources can be found here:
[deepdreaming development website](https://deepai.org/machine-learning-model/deepdream)

[DeepDream on the wiki](https://en.wikipedia.org/wiki/DeepDream)

[COmputerPhile video on Deep dreaming.](https://youtube.com/watch?v=BsSmBPmPeYQ)
Connecting a Raspberry Pi/DHT11, Node Red, and Power BI with IoT Ensemble

Tags: iot, raspberrypi, nodered, azure
Published: 2021-01-26 20:22:58

For many, the Internet of Things (IoT) can seem like a difficult challenge, especially thinking through getting an end-to-end IoT Solution out the door (or stood up for the first time). In this post, we'll take you step-by-step through the process of setting up your own personal temperature sensor with Fathym IoT Ensemble. Here's a look at what we'll do:

- Configure and set up a Raspberry Pi
- Connect a temperature sensor
- Read the data with Node-Red
- Use IoT Ensemble to stream sensor data
- Leverage helpful data tools from your dashboard
- Visualize your data with PowerBI

This may seem like a lot, and can take some teams weeks or even months. So grab your gear, and we'll have you up and running in the next 30 - 60 minutes.

Read more here: https://www.iot-ensemble.com/blog/raspberry-pi-dht11-node-red-iot-ensemble-power-bi
How do you approach adding new npm dependencies to a project?
Tags: discuss, npm, javascript, security
Published: 2021-01-26 20:15:25

Do you review a dependency before adding it? Base it on what criteria? Discuss it with others, open a pull request or is it a total free-for-all where everything is allowed?

My question comes from a [previous post](https://dev.to/sumstrm/npm-security-issues-to-know-of-in-2021-43l5) and the need to adopt (or at least discuss) a strategy for how new dependencies are added securely and efficiently.

I found this [AskJS reddit thread](https://www.reddit.com/r/javascript/comments/ff1zp0/askjs_how_strict_should_js_teams_be_about_adding/) on the same subject, but not many responses unfortunately.

I am keen to hear of other experiences on this topic.

*Context: Secure management of dependencies is one of the issues our package management tool [bytesafe](https://bytesafe.dev/) addresses. As such I would like to get a better understanding of the workflow and concerns of the community on this issue.*
AWS newbie's overview
Tags: aws, newbie, iis, serverless
Published: 2021-01-26 20:04:41

  Modern programming differs from programming five to ten years ago. Application architectures changed too much, as well as their ways of deployment. My previous experience was connected with old styled monolith ASP.NET web applications. I had one web app and I had to deploy it on a premises’ server, where the IIS web server was installed. Sometimes my small and cozy team had problems with strange issues. For example, our web server froze each time we deployed every new version of our app. We did not have solid DevOps knowledge, so we learned some basic IIS functionality, and from time to time tried to make some devops work.

  Last month, I changed my job. We use interesting microservice architecture and store our services in the AWS cloud. It is interesting to discover new ways to create API routing using API Gateway. To make a long story short, this service allows you to create endpoints for the backend app, connect small (or even big) services with endpoints, protect your endpoints with authorization, or check necessary headers in requests.

  Last week, I had a pretty tricky moment with sending images to my backend. I could not accept multipart/form-data requests from my frontend. The backend returned a cors error, while the application/json header was accepted.

  AWS has a great tool to create microservices with lambda functions: everyone can create APIs using different programming languages like C#, Javascript, Java, Go, Python.

Lambda functions represent well-known serverless architecture where you do not have to worry about your server troubles. 

  Everyone can use it for small units of work, such as receiving something from a database, or inserting some amount of data to a database, or somewhere else.  Lambda is not a great option for long tasks, because it has an execution time limit of 15 minutes.
Another service I learned was S3 storage, where Amazon allows everyone to store different files, like images (to create your own storage, and make it public or private ), or even you can use it to host static frontend applications.

  For people who want to deploy their applications and not use lambda functions, they can easily deploy them using Elastic Beanstalk, where you upload a zip file with your app and in some minutes it is deployed. During its deployment Elastic Beanstalk creates a virtual machine that is needed for your application. Don’t forget about if you are using the free tier period, because after that period they will start charging you.

  Finally, you can connect your existing domain (or buy a new one) with the Route 53 service, just add a hosted zone for the domain you have chosen. AWS takes 50 US cents per month for adding each hosted zone to your account. 

  In conclusion, AWS has a big variety of services that could be interesting for developers and helpful as well.

_______________________
(the image was taken from aws.amazon.com)
To Cloud or not to Cloud
Tags: cloud, cloudskills, devops
Published: 2021-01-26 19:36:22

Hi fan of *Shakespeare*   !
Thank you for your support on my last blog post:
https://dev.to/simerca/why-i-moved-my-front-with-nuxtjs-to-wordpress-50p2

Last year, I work with the Cloud a major parts of my time.
Aws, Digital Ocean, Azure etc...

Each time, I realize that the cloud should only be used in one situation, if you need a temporary machine to perform certain tasks. But are overall less economical than its physical competitors, that's for me asking the question:

# To Cloud or not to Cloud?

**Benefits of the cloud**
- Not to be engaged with an instance
- The cost of use (which is also a weak point, we see that later)
- Variable power at will
- The speed of provisioning
- The number of suitable CLI tools

**The Benefits of Physics**
- Low cost
???

Oh wait!
I have no other argument in favor of the physical 

**Disadvantage of the cloud**
- At some suppliers, cost surprises
- Technical skills inevitable

**Disadvantage from the physical**
- Commitment (often monthly)
- Provisioning time
- Redundancy not always "native"
- Instance not really flexible

So ! 

This does not necessarily mean that the physical is a bad option, moreover in most cases I will advise to go for the physical for your companies. Or if you don't have any linux server skills, you can use SAAS services (Vercel, Heroku, Netlify ... etc)

If you have arguments to reinforce or counter what I'm saying, don't hesitate to tell me about it in the comments!
Learning JavaScript is HARD!
Tags: beginners, codenewbie, javascript, selflearning
Published: 2021-01-26 18:59:37

 _When I first started to teach myself JavaScript, it was truly a breaking point for me. I cried, I whined and gave up a thousand times. Only to pick it back up every time._ 

## JavaScript is tough

I used/ currently reviewing the entire course of JavaScript on FreeCodeCamp and I think that it is one of the toughest self-learning course out there. The challenges are just that... challenging and very intimidating. I stopped following FCC's course because I thought that it was too hard so I switched to other platforms (CodeCademy, W3 Schools, YouTube, etc.) to find something that was... easier. 

## Switching learning platforms was a NO-GO

But by switching from one platform to another only confused the crap out of me. And I found myself going back to FCC over and over again until I finally finished the certification. 

**Here is where I (bleeped) up.** Whenever I found myself in a pickle on the challenges, I would just get the answer from the forum and apply it to the problem and move on to the next. *I didn't learn a damn thing.*

## This is what worked for me

### Here are my personal tips on learning JavaScript:
**1) Take your time.** Don't rush the learning process.
**2) Always jot down notes.** Don't you ever in your precious life copy and paste your notes. Trust me. 
**3) Always check what you are doing by testing everything out.** Utilize console.log() to make sure that you are always on the right track.
**4) Play around with different inputs to see the outputs.** This is what I like to call: Cause and Effect Game. Change the values around to see what the outcome will be. Change the increments into decrements and see what happens. 
**5) Don't be afraid to mess up.** It's gonna happen. You can't be perfect all of the damn time. LOL. Learn from it and keep it moving. 

####I think that these steps can be applied to any language that you are learning. Just remember, YOU GOT THIS!!! :)