teleren/devto huggingface dataset:
Objects
Tags: javascript
Published: 2020-04-25 00:48:12

<h2>What is an object?</h2> – An entity within the browser or web page.

<h2>What is a property?</h2> – Defining characteristics of an object.

<h2>What is a method?</h2> – An action that can be performed on an object.

<h2>Which are the different ways of referencing objects?</h2>
<h2>Tag name</h2> – document.getElementsByTagName(tag)
<h2>Class name</h2> – document.getElementsByClassName(class)
<h2>Name</h2> – document.getElementsByName(name)
<h2>ID</h2> - document.getElementById(id)
The Rise of Functional Programming - TerminusDB Discussion #7
Tags: programming, rust, python, java
Published: 2020-04-25 00:31:21

---
title: The Rise of Functional Programming - TerminusDB Discussion #7
published: true
description: Every week the TerminusDB core team get together to hear a talk led by one of our members. The discussions are always very interesting, so we thought we'd share. This week we have our software engineer talking The Rise of Functional Programming.
tags: programming, rust, python, java
---
Every week the TerminusDB core team get together to hear a talk led by one of our members. The discussions are always very interesting, so we thought we'd share. This week we have our software engineer talking The Rise of Functional Programming.

As we are a FOSS community, it is an open and free discussion.
StackExchange - The 8 best resources every developer must follow
Tags: programmer, skills
Published: 2020-10-05 10:50:15

---
title: StackExchange - The 8 best resources every developer must follow
published: true
date: 2020-04-25 00:00:00 UTC
tags: Programmer,Skills
canonical_url: 
---

As a developer, you should be familiar with StackExchange. There are tons of resources available on there about software development and programming. Out of everything, I have compiled a list of the top 8 resources that I find helpful. These resources cover a wide range of topics…

   
[Read On](https://www.loginradius.com/engineering/blog/stackexchange-8-best-resources-every-developer-must-follow/)
Attribute Selectors
Tags: css
Published: 2020-04-29 18:11:17

---
title: Attribute Selectors
published: true
date: 2020-04-25 00:00:00 UTC
tags: css
canonical_url: https://www.cgweb.co.uk/content/posts/2020-04-24-attribute-selectors/
---
Just a quick post on attribute selectors in CSS.

#### What is an attribute selector?

Attributes are part of HTML markup giving elements further details e.g href on a tags using CSS you can target these attributes and their values. Attribute selectors are shown by square brackets `[]` e.g.

```css 
a[title]{ 
color: #000000;
}

a[href="https://"] { 
color: #CC0000;
}

div[lang|="en"] { 
font-style: italic;
}
```

The first example will match a tags with a title attribute, the second will target any a tags with mailto links and the final will match any divs with the exact lang value of en \_or\_ en followed by a hyphen. 

#### Substring matching selectors

-`[att^="val"]` = begins with
-`[att$="val"]` = ends with
-`[att*="val"]` = contains

```css
a[href^="https://"]{ 
background: green; 
color: white;
}

a[href$=".pdf"] { 
background: yellow;
}

img[src*="thumb"] {
 border: 2px solid #CC0000;
}
```

I've created some examples are on codepen shown below:
{% codepen https://codepen.io/cgweb/pen/gOamEEz default-tab=css,result %}
Install .NET Core on Ubuntu 20.04 LTS Focal Fossa
Tags: dotnet, dotnetcore, ubuntu, linux
Published: 2020-04-25 13:58:41

---
title: Install .NET Core on Ubuntu 20.04 LTS Focal Fossa
published: true
date: 2020-04-25 00:00:00 UTC
tags: dotnet, dotnetcore, ubuntu, linux
canonical_url: https://solrevdev.com/2020/04/25/install-dotnetcore-on-ubuntu-focal-fossa.html
---

A couple of days ago Canonical the custodians of the Ubuntu Linux distribution released the latest long term support version of their desktop Linux operating system.

Codenamed _Focal Fossa_ the 20.04 LTS release is the latest and greatest version. For more information about its new features head over to their [blog](https://ubuntu.com/blog/ubuntu-20-04-lts-arrives).

![](https://i.imgur.com/862L8Gb.gif)

For us .NET Core developers each new release of Ubuntu generally means that whenever we need to update the .NET Core version we need to alter our package manager location so that we get the correct version.

Microsoft has now updated the dedicated page titled [“Ubuntu 20.04 Package Manager - Install .NET Core”](https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-manager-ubuntu-2004) which has instructions on how to use a package manager to install .NET Core on Ubuntu 20.04.

For those looking for a TLDR; here is the info copied from that page.

**Microsoft repository key and feed needed.**

```powershell
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
```

**Install the .NET Core SDK**

```powershell
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
```

**Install the ASP.NET Core runtime**

```powershell
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install aspnetcore-runtime-3.1
```

**Install the .NET Core runtime**

```powershell
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-runtime-3.1
```

I have not pulled the trigger yet. I am waiting for things to settle down and for my 19.10 distribution to tell me its time to upgrade.

However, for those who want to upgrade now and cannot wait you can force the issue by the following.

Press <kbd>ALT</kbd> + <kbd>F2</kbd> followed by

```powershell
update-manager -cd
```

The following dialog will then appear allowing you to then upgrade now.

![](https://i.imgur.com/GPOkbZb.png)

Success 🎉
Add Fade In and Fade Out Effects With ffmpeg!
Tags: ffmpeg, productivity, linux, video
Published: 2020-04-24 23:46:29

{% youtube iD4IxEKzr88 %}

I figured out that you don't need to use a full fledge video editor to apply some basic transition effects to video and audio.

Using ffmpeg, you can apply basic fade in and fade out to video using the *fade* filter. For audio, the *afade* filter can be used to achieve a similar effect.

```sh
ffmpeg -i video.mp4 -vf "fade=t=in:st=0:d=3" -c:a copy out.mp4
```
This will start the video with a black screen and fade in to full view over 3 seconds.

```sh
ffmpeg -i video.mp4 -vf "fade=t=out:st=10:d=5" -c:a copy out.mp4
```
This will make the video start fading to black over 5 seconds at the 10 second mark.

```sh
ffmpeg -i music.mp3 -af "afade=t=in:st=0:d=5" out.mp3
```
The audio file will start at a low volume and fade in to full over 5 seconds.

```sh
ffmpeg -i music.mp3 -af "afade=t=out:st=5:d=5" out.mp3
```
The audio file will start fading to zero volume over 5 seconds starting at the 5 second mark.

```sh
ffmpeg -i video.mp4 -vf "fade=t=in:st=0:d=10,fade=t=out:st=10:d=5" -c:a copy out.mp4
```
You can apply both fade in and out effects at the same time, to avoid having to re-encode twice.

Enjoy
Day 124 : Check to Check
Tags: hiphop, code, coding, lifelongdev
Published: 2020-04-24 23:39:45

_liner notes_:
- Professional : Had a couple of meetings. Worked on a demo for another team. Pretty relaxed day.

- Personal : Reworked some of the code for https://TicReactToe.com so that it can be played with just the keyboard. Also, went through some tracks for the radio show. Went to bed relatively early.

![Beach and mountains of Crete, Greece](https://dev-to-uploads.s3.amazonaws.com/i/6z1fq6rpnvvhj516cyvm.png)

I've been hearing all these stories of people waiting on their economic stimulus payment. I remember living pay check to check. Hope we can come back better and stronger than before the pandemic. For the rest of the night, going to work on tomorrow's radio show and maybe some coding or research.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube i2wFsaaYDvE %}
How to hide Ruby 2.7 deprecation warnings system-wide
Tags: ruby, rails, rbenv, tutorial
Published: 2020-04-24 23:36:24

Are you using `rbenv`? Want to hide Ruby 2.7 deprecation warnings system-wide and not to deal with it on a per-project basis? This small tutorial is for you!

All you have to do is create file `~/.rbenv/rbenv.d/exec/hide-deprecations-for-2.7.bash` with the following content:

```bash
# ~/.rbenv/rbenv.d/exec/hide-deprecations-for-2.7.bash

if [[ ${RBENV_VERSION%.*} == '2.7' ]]; then
  export RUBYOPT="-W:no-deprecated -W:no-experimental"
else
  unset RUBYOPT
fi
```

Done.

How exactly does it work can be found [here](https://github.com/rbenv/rbenv/wiki/Authoring-plugins#rbenv-hooks).

I've tested it in Zsh. It should work in Bash, but I can't guarantee it.
3 ways to use boolean in a bad way
Tags: cleancode
Published: 2020-04-24 15:41:37

# 1. Carry checkbox up to your high-level code

Every application is a sort of data processing. As such, in order to provide output, it requires some input. More often than not it’s a so-called “user input” and among user interfaces there happen to be checkboxes.

A checkbox indicate that some option is enabled or disabled and, as such, is a valuable way of controlling application flow. But a developer’s job is to put code into layers and split the ugly low-level code from the pure object-oriented (or functional) high-level code.

Unfortunately, we often fail and as we receive the checkbox value in a form of **isPremium**, **isValid** or **isAuthorized**, we tend to pass this argument deep into the application.

It should never be like this, because the more objects or functions know about **isPremium** or similar, the more conditional statements will appear to handle this information.

And the solution is to convert the raw input data as soon as possible into a high-level domain code with objects, higher-order functions and so on.

# 2. Use boolean to indicate objects interaction

Dealing with object-to-object interactions within a video game is an incredibly difficult process. So we have a character which is able co crunch when there’s not enough space to walk. How would you introduce such a feature?

Do you think that the character can check for **isSomethingAbove** and depending on that flag switch to crunching? Of course not, the character should be responsible for its actions, there should be some communication between character and its environment!

Such a model appears mostly when the developer does not expect much behavior from some minor thing. Here for example we may have a low ceiling that makes our character crunch. As the sole responsibility of the ceiling is to change the way the character moves, one may avoid to introduce a separate entity for it. But it's wrong! Even a single behavior is enough to delegate this responsibility for a separate entity!

# 3. Expose boolean in an API

Let’s assume you have a code where you need to compare two objects by their nature. For example, your application deals with door-to-door deliveries, you have to compare addresses for equality and expose **areEqual** to some sort of API.

Looks good, but remember that a boolean can only provide true or false! So there comes a business request to change the conditions for equality, but you still can expose only true or false. Can you see the problem?

The problem is that as you have exposed a boolean you cannot tell everyone that it is no longer valid! Maybe someone depends on it and will never know that a "new false" is a different "false".

If you need to expose raw data in such a form, always use some sort of nullable or enum to make sure you can easily make the field obsolete to tell everyone they can no longer count on it as they did before.
Reheating of Brownie - A/B Testing
Tags: datascience, testing
Published: 2020-04-24 23:19:53

Yesterday, for our weekly flat dinner, I made my first brownie dessert. It was great, but impossible to finish, thus layering chocolate aroma in the fridge for the next few days.  

![Brownie Tray](https://user-images.githubusercontent.com/17522078/80263865-1a4bd980-86e6-11ea-9111-c63a28d613e4.jpg)


Hot piping brownie taste best with decadent ice-cream, and I found two ways to reheat:

- Oven
- Microwave
Starting with a hypothesis “Oven reheating of brownie taste better then Microwave”, I sliced two cubes off the brownie tray:

- Reheating one in the oven for 10 mins
- And the other in the Microwave for 15 seconds

Ensuring a fair competition, oven reheated brownie was prepared earlier so that both brownies would be ready at the same time.

Hearing a detectable crack through the crust as I chomped through the brownie (oven reheated), I tasted the dense brownie but found it a bit dry. I went to rinse my mouth after the first chomp and got ready for my next.
![Oven Heated Brownie](https://user-images.githubusercontent.com/17522078/80263862-18821600-86e6-11ea-8150-c797a1778cd1.jpg)

Burnt wet smell greeted me as I bite my way through the other.

![Microwave Heated Brownie](https://user-images.githubusercontent.com/17522078/80263860-17e97f80-86e6-11ea-8f44-379411ae863b.jpg)

Scooping the Apricot ice-cream on the brownie, I stared into the horizon ready to tuck in. 

![Brownie with a View](https://user-images.githubusercontent.com/17522078/80263859-16b85280-86e6-11ea-96f3-8d62dda3e1a1.jpg)

#Brownie-Saga
React Bootcamp e a jornada de mulheres na tecnologia
Tags: react, javascript, shedotech, elasfazemtecnologia
Published: 2020-04-24 22:58:57

---
title: React Bootcamp e a jornada de mulheres na tecnologia
published: true
description: React Bootcamp é um projeto de capacitação da comunidade WoMakersCode para ensinar programação para mulheres
cover_image: https://wallpapercave.com/wp/wp4923981.jpg
tags: react, javascript, shedotech, elasfazemtecnologia 
---

Em janeiro, anunciamos o [React Bootcamp](https://dev.to/womakerscode/womakerscode-oferece-curso-de-programacao-gratuito-para-mulheres-2b0l), um curso de capacitação para mulheres em São Paulo, que foi liderado com maestria pela [Lais Lima](https://twitter.com/laislima_dev) e que teve apoio das empresas Fundação 1Bi, Stone e LivUp.

Foram 2 meses de imersão técnica, muitos exercícios e uma super adaptação ao trabalho remoto. A medida que o mundo todo enfrenta uma nova realidade com o COVID-19, a Lais e todas as mentoras prestaram suporte para alunas, não só tecnicamente, mas também mostrando que mesmo em meio aos maiores desafios, a **união faz a força.**

🏁E FOI DADA A LARGADA!

Nas últimas semanas, nossas alunas tiveram o desafio de criar projetos do zero e com isso, vivenciar uma rotina igual ao trabalho de uma desenvolvedora, com gerenciamento de tarefas, explorar e testar novas soluções, desenho de arquitetura, interfaces, GitHub (alô CONFLITO NO MERGE!). Tenho muito orgulho de dizer o quanto admiro o trabalho da Lais para fazer tudo isso acontecer e de todas as nossas alunas, que se reinventaram nesse período!

Quer saber o resultado de tudo isso? A nossa formatura será online e todas as pessoas estão convidadas para participar!

😎 Dia 1 - [28/04 às 20:00: React Bootcamp - DIA 1](https://www.meetup.com/WoMakersCode/events/270206786/): 
- Amo brindes - solução para sortear brindes nos eventos
- Sharing talks - solução para gerenciar eventos e propostas de palestras

🤩 Dia 2 - [29/04 às 20:00: React Bootcamp - DIA 1](https://www.meetup.com/WoMakersCode/events/270206799/)
- Collective Hiring - Solução para contratação de pessoas da comunidade e eventos
- Certificates for everyone - Solução para emissão de certificados em eventos
Workshops Online: Elastic Stack e Power BI
Tags: online, elastic
Published: 2020-04-24 22:07:55

---
title: Workshops Online: Elastic Stack e Power BI
published: true
description: No mês de maio, estamos trazendo uma série de webinars para compartilhar conteúdos técnicos e inspirações de carreira com a comunidade.
tags: online, elastic
cover_image: https://mixmag.com.br/assets/uploads/images/_fullX2/algorave-2.jpg
---

No mês de maio, estamos trazendo uma série de webinars para compartilhar conteúdos técnicos e inspirações de carreira com a comunidade.

**CONFIRA NOSSA AGENDA**

[05/05: Observabilidade com o Elastic Stack](https://www.meetup.com/WoMakersCode/events/269995878/)

📣 Vamos conhecer um pouquinho sobre observabilidade?

Nessa live, vamos falar sobre como é possível construir uma boa base de observabilidade utilizando o Elastic Stack, de modo com que você consiga ter visāo da sua aplicaçāo de ponta a ponta, utilizando uma ferramenta opensource.


[07/05: A Importância do BI nos Negócios com Power BI 📊](https://www.meetup.com/WoMakersCode/events/269136582/)

Neste workshop, Fabiane Ravanêda e Fernanda Alves, irão falar sobre a importância do BI para os negócios e mostrar, na prática, a ferramenta Power BI. Você terá acesso a um hands-on com o passo a passo, para criar o seu primeiro dashboard, coletando e limpando dados de diferentes fontes, além de modelar relatórios personalizados.

Eai, partiu?!
IP Camera NVR for Home surveillance with [Docker 🐋️ + Raspberry 🍓️ + S3] in just 5min🚀️! 
Tags: docker, raspberrypi, aws, s3
Published: 2020-04-24 22:35:47

In this article we're going to configure a NVR server for saving home IP Camera video on Raspberry PI 4 and keep a copy of them on AWS S3 Storage.

### 1. Install Docker on RaspberryPi
```
sudo su -
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
usermod -aG docker pi
systemctl status docker
● docker.service - Docker Application Container Engine
```
### 2. Download Kerberos.io container and run them
```
docker pull kerberos/kerberos
docker run --name camera1 -p 80:80 -p 8889:8889 -d kerberos/kerberos
```
Double check, container is running correctly?
```
docker ps

CONTAINER ID        IMAGE                 COMMAND             CREATED             STATUS              PORTS                                            NAMES
aef03c9d804a        kerberos/kerberos     "sh /run.sh"        10 days ago         Up 10 days          0.0.0.0:80->80/tcp, 0.0.0.0:8889->8889/tcp       camera1
```
### 3. Kerberos.io configuration
- Go to http://your_raspberry_ip/ follow the configuration step and set admin user/password. (Currentrly this app support only 1 user)
- Login
- Go to **Configuration**
- Set the RTSP camera URL, resolution and frame rate. ([Most common camera rstp URL](https://www.ispyconnect.com/man.aspx?n=Generic))
- Open the Dashboard and see the Live Stream from your camera and the lastest records activities
- Go to Configuration > Advanced > S3 and set Bucket, folder, publicKey and privateKey

![Dashboard Image](https://dev-to-uploads.s3.amazonaws.com/i/jd33h5zefoe9mqm0oxoi.png)

**Do you like Kubernetes?**
You can deploy [Kerberos on Kubernetes](http://doc.kerberos.io/architectures#kerberos-enterprise--5-kerberos-agents)

[See Other...](https://andreapavone.com/2020/04/home-ip-cam-docker-raspberry-pi-4/)
Orientação a objetos e o "Principio da Objetificação"
Published: 2020-04-24 22:24:36

Muitas pessoas erroneamente atribuem ao JavaScript o paradigma de orientação a objetos e nesse artigo eu quero tentar elucidar essa questão.

A orientação a objetos é um paradigma de programação — classificação de uma linguagem baseado em suas funcionalidades, seu modelo de execução ou organização do código — criado na década de 1950 que utiliza dois conceitos basilares:

- Classes: Representação abstrata de um objeto real ou não contendo o conjunto de estados (dados) e as possíveis ações (métodos) disponíveis do objeto.
- Objetos: alocação na memória durante a execução do programa que pode ter seus estados modificados e/ou utilizados dentro do escopo de criação.

Numa linguagem de programação orientada a objetos, há a criação das classes primariamente e, após isso, a criação dos objetos e para isso dá-se o nome de _linguagem baseada em classes_. Quando não há classes e os objetos já existem, chamamos de _linguagem baseada em protótipos_, pois todos os objetos serão baseados em objetos pré-existentes (os chamados protótipos).

Na especificação ECMAScript 2015, mais conhecida como ECMAScript 6, houve a adição de sintaxe para a criação classes, porém as classes no JavaScript são apenas funções que usam o modelo de herança de protótipos que já era usada antes da especificação, ou seja, não é a adição de orientação a objetos na linguagem, mas sim de uma facilidade para leitura por outros desenvolvedores(as).

Falar que o JavaScript é baseado em protótipo não representa a realidade, pois o protótipo é, em suma, um objeto que serve de base para a criação de outro objeto. Para que uma coisa seja base para outra, a primeira precisa existir de antemão, o que não é o caso no JavaScript.

No JavaScript, não existe uma base existente, mas sim um princípio de ação que é a ação de transformar qualquer dado num objeto — um conceito abstrato generalista de representação dos dados — para que se possa manipular seus estados. Desse modo, qualquer dado só poderá ser "entendido" pelo JavaScript se transformado em um objeto.

Porém, esse princípio não possui ainda um nome e, desse modo, não há uma forma acertada o suficiente de classificar o JavaScript. 

Portanto, eu gostaria de propor o nome _Princípio da Objetificação_, pois, dessa forma, se garante o entendimento de que o JavaScript têm todos os dados, em primeiro lugar, como objetos.
Memory Fragmentation and Pointers
Published: 2020-04-24 21:56:44

## Fragmentation and Pointer Relocation

When I first started making the memory manager, I was aware that when I allocated and deallocated memory, there would be gaps in the memory from the deallocation. When memory was deallocated, I would move any allocated memory that had a higher memory address than the deallocated memory down to a lower memory address to remove any gaps that the deallocated memory left behind. As I moved allocated memory down to lower addresses, I realized that the pointer that was pointing at the relocated memory no longer pointed at the correct data. If the pointer tried to reference that data, then the wrong data would be referenced or perhaps the memory being referenced would be null.

## Handles

Handles in this implementation are basically an index into an array of pointers to memory. I originally got the idea of using handles from Game Engine Architecture by Jason Gregory, in the Defragmentation and Relocation section. Gregory described three different ways to combat the relocation of pointers, carefully tracking the raw pointers, smart pointers, and handles.

Handles are much more flexible than raw pointers in regard to relocation. When memory is moved raw pointers would have to be manually adjusted but with handles when memory is moved, the indexes into the array stay the same but the pointer at said index will be moved to a lower memory address. When the handle tries to reference what it is pointing to it will go into the array and find the new or same memory address.

By Taylor Addington