teleren/devto huggingface dataset:
LaTeX & Maths: Delimiters
Tags: codenewbie, latex
Published: 2021-08-05 02:23:28

Hello, how are you? :) 

In today's post I will talk about basic delimiters, like parentheses and its variations, and some operators for trigonometric functions.

Let's start!!!

## Delimiters

It is common in math to use delimiters like parentheses to denote a bunch of things, but how can i produce these in LaTeX, well, you have two ways to do it, 
- Type them direct from the keyboard 
- With commands

There is a difference between these two options, let's have a look 

![code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cnv1zpzez9gmw7njna36.png)
 
Produces 

![Screenshot from 2021-08-04 20-51-56](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zut1mran5lpp06vhzf6x.png)

Did you noticed? if we put the delimiters with the commands these adjust its size to the equation, but if we type them directly from the keyboard they have a standard size. The most common are
```LaTeX
\left( \right)
\left[ \right]
\left\{ \right\}
``` 

But what if we just need *one* delimiter, well we just need to use `.` in the other option, this is 

![code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5uik3ezowns6wznvr20e.png)

Produces

![Screenshot from 2021-08-04 20-56-57](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ptny0ajatkvod4lbqlp6.png)
  

## Operators

Some operators, like the trigonometric functions have a *proper name* sine, cosine, etc. These have their own commands, these are the name of the functions, let's see an example 

![code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6bpm06vmfxn4oskr1745.png)

Produces 

![Screenshot from 2021-08-04 21-17-35](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k8ysrtgsyww83co12exs.png)

Can you notice? The font type changes, that is the only change. The commands are `\sin`,`\cos`, `\tan`, `\cot`, `\sec`, `\csc`

There are commands for the inverse trigonometric functions but just for `\arcsin`, `\arccos`, `\arctan`

This is all for today. Do not forget to follow me on Twitter `@latexteada`

Greetings :)
How to use Neovim 0.5 on iSH on iPadOS
Tags: neovim, ipad, ios, ish
Published: 2021-08-05 02:19:01

I have an iPad. I love Neovim. Can I use it on my iPad? -- Let's try it.

## Use iSH as a terminal emulator

![iSH](https://camo.githubusercontent.com/9f65eca28081cc51e41ca56630cb9272c8ac8cdfe2216c3291febf6a87842319/68747470733a2f2f6973682e6170702f6173736574732f6769746875622d726561646d652e706e67)

https://ish.app/

iSH is a Linux shell built for iOS & iPadOS, using usermode x86 emulation and syscall translation. It's not a SSH client. You can actually have a terminal locally on your device.
It runs Alpine Linux, so you can install packages with `apk` command. Pretty neat!

## Couldn't build Neovim from source

Apparently, the official iSH package repository currently provides only Neovim 0.4.
Looks like you need to build the latest Neovim from its source.

* https://github.com/neovim/neovim/wiki/Building-Neovim

Install prerequisites:

```sh
apk update
apk add git build-base cmake automake autoconf libtool pkgconf coreutils curl unzip gettext-tiny-dev
```

Clone the reopsitory:

```sh
git clone https://github.com/neovim/neovim.git
cd neovim
```

Build it:

```sh
make -j4 CMAKE_BUILD_TYPE=Release
```

But got an error:

```
Install the project...
-- Install configuration: "Release"
-- Installing: /root/neovim/.deps/usr/lib/libluv_a.a
-- Installing: /root/neovim/.deps/usr/include/luv/luv.h
-- Installing: /root/neovim/.deps/usr/include/luv/util.h
-- Installing: /root/neovim/.deps/usr/include/luv/lhandle.h
-- Installing: /root/neovim/.deps/usr/include/luv/lreq.h
make[4]: Leaving directory '/root/neovim/.deps/build/src/luv-static-build'
[ 94%] Completed 'luv-static'
make[3]: Leaving directory '/root/neovim/.deps'
[ 94%] Built target luv-static
make[2]: Leaving directory '/root/neovim/.deps'
make[1]: *** [Makefile:104: all] Error 2
make[1]: Leaving directory '/root/neovim/.deps'
make: *** [Makefile:105: deps] Error 2
```

I don't understand what's going wrong from this error log.
iSH is quite unstable on doing those things.

I decided to go another way.

## Try Alpine's edge repository

The iSH's default package repository is kind of outdated.
So, I tried to use the Alpine's official edge repository.
Because neovim-0.5.0 is available there:

https://pkgs.alpinelinux.org/package/edge/community/x86/neovim

```sh
echo https://dl-cdn.alpinelinux.org/alpine/edge/main > /etc/apk/repositories
echo https://dl-cdn.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories
apk update
apk upgrade
apk add neovim
```

Boom. It worked!

![IMG_0341](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spkak4298c0cbz58dccl.PNG)

## You can't use all the edge packages

I found that git or nodejs won't work if I installed it from the edge repos due to "Bad system call".
So, you basically should be on the default package repos.

I hope iSH gets more stable. Kudos to [tbodt](https://github.com/tbodt) for the awesome work!

## Related

I've made a tutorial video on how to set up Neovim on macOS:

{% youtube FW2X1CXrU1w %}
Vite vue ts tailwind template: Install TailwindCSS
Tags: vite, vue, tailwindcss
Published: 2021-08-05 02:01:45

## Install and setup TailwindCSS

1. Start by following official [Install Tailwind CSS with Vue 3 and Vite](https://tailwindcss.com/docs/guides/vue-3-vite) instructions. Install `tailwindcss`.
    ```console
    $ npm install --save-dev tailwindcss@latest postcss@latest autoprefixer@latest
    ```
1. Create configuration files.
    ```console
    $ npx tailwindcss init -p
    ```
1. Configure tree-shaking (removal of unused styles). Update `tailwind.config.js`.
    ```diff
    -  purge: [],
    +  purge: ['./index.html', './src/**/*.{js,jsx,ts,tsx,vue}'],
    ```
1. Create `index.css`. `touch src/index.css`.
1. Update `src/index.css`.
    ```diff
    +@tailwind base;
    +@tailwind components;
    +@tailwind utilities;
    ```
1. Import `src/index.css` in `src/main.ts`.
    ```diff
     import App from '@/App.vue'
    +import '@/index.css'
    ```
1. `git add -u && git add tailwind.config.js postcss.config.js src/index.css`
1. `git commit -m 'install tailwindcss'`

## Links

-   https://tailwindcss.com/docs/guides/vue-3-vite
-   https://postcss.org

## Project

{% github https://github.com/imomaliev/vue-ts-tailwind no-readme %}
Triggering Jenkins Parameterized Builds Behind A Firewall
Tags: devops, jenkins, sre, cicd
Published: 2021-08-05 01:24:36

## Background

In this post I would like to share with you the process of how to trigger Jenkins parameterized builds behind a firewall. 

Imagine your Jenkins is behind a corporate firewall but still able to receive webhooks from Github, DockerHub and Microsoft Automate. 

I have seen many posts discussing related topics, but most webhook forwarding services cannot forward query parameters, which means they do not have the ability to trigger Jenkins builds with parameters.

## Prerequisites

- Webhook Relay account - register [here](https://my.webhookrelay.com/).
- Jenkins server

## Process

### Configuring Webhook Relay

Create a New Bucket [here](https://my.webhookrelay.com/buckets) . Buckets allow you to group inputs and outputs.

A newly created bucket will have a default input and you will need to create an output destination where webhooks will be sent.

Click on `OUTPUT DESTINATION`> Fill in your custom `Output name`  > Fill in your Jenkins server address  in `Output destination`  > click `create output` 

```yaml
# Output Destination Example
# If your Jenkins allows anonymous users can have build access.
http://192.168.0.200:8080
# If only authenticated users can have build access.
http://username:token@192.168.0.200:8080
```

Click `CONFIGURE` under your Output Destinations > Switch off `Lock destination path` > Click on `SAVE`.

It will allow us to send any extra path.
([xyz.hooks.webhookrelay.com/foo/bar](http://xyz.hooks.webhookrelay.com/foo/bar) -> 192.168.0.200:8080/foo/bar)

![webhooksettings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6dizae08pl36gi5urnsu.png)

### Configuring Webhookrelayd agent

Create an access token [here.](https://my.webhookrelay.com/tokens)  Access tokens are used to authenticate Webhook Relay agents.

On the Jenkins VM or  a VM that can talk on the Jenkins server, start a webhookrelayd agent.

Specify configuration through environment variables:

```bash
KEY=<your token key>
SECRET=<your token secret>
BUCKET=<bucket name>
```

Run the webhookrelayd container:

```bash
docker run -d \
           --name webhookrelayd \
           --restart=unless-stopped \
	       webhookrelay/webhookrelayd 
					
```

Now go back to your Bucket page, you should see the status has changed to `Client Connected`. If there are any problems, you should check your docker logs.

![clientstatus](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7p7uslz04g3ngxwlcoh.png)

## Testing Jenkins Builds

Open your Terminal, let us test your Jenkins build.

Here is an example when trigger the Jenkins build normally:

```bash
curl http://192.168.0.200:8080/job/demo/buildWithParameters?token=<buildToken>&env=dev&version=20210804&user=john.doe
```

When using Webhook Relay, it will be converted to the following url:

```bash
curl https://<unique domain>.hooks.webhookrelay.com/job/demo/buildWithParameters?token=<buildToken>&env=dev&version=20210804&user=john.doe
```

You can also find the Relay Logs [here](https://my.webhookrelay.com/logs).
Azure Fundamentals AZ-900 - Module 2
Tags: techtalks
Published: 2021-08-05 01:23:47

AZ-900 Azure Fundamentals Certification Part 1
6-August-2021 1 - 3 PM IST

{% youtube FuAfECKUTo4 %}

## For everything please join https://groups.google.com/g/techtalks-wriju
Azure Fundamentals AZ-900 Learning Paths
Tags: azure, cloudskills
Published: 2021-08-05 01:21:38

## Azure Fundamentals part 1: Describe core Azure concepts
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-cloud-concepts/

## Azure Fundamentals part 2: Describe core Azure services
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-core-azure-services/

## Azure Fundamentals part 3: Describe core solutions and management tools on Azure
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-core-solutions-management-tools-azure/

## Azure Fundamentals part 4: Describe general security and network security features
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-general-security-network-security-features/

## Azure Fundamentals part 5: Describe identity, governance, privacy, and compliance features
https://docs.microsoft.com/en-us/learn/paths/az-900-describe-identity-governance-privacy-compliance-features/
How to retrieve only one document from a MongoDB collection
Tags: mongodb
Published: 2021-08-05 01:12:31

---
title: How to retrieve only one document from a MongoDB collection
published: true
date: 2021-08-05 00:42:47 UTC
tags: MongoDB
canonical_url: https://donaldfeury.xyz/how-to-retrieve-only-one-document-from-a-mongodb-collection/
series: "Small Bytes of MongoDB"
---

For a full overview of MongoDB and all my posts on it, check out my [overview](donaldfeury.xyz/introduction-to-mongodb/).

MongoDB has a convenient method called `findOne` which is very similar to the `find` method, except it, returns the actual document instead of a cursor and it will only return the first document. [If you need to return multiple documents from a query](https://donaldfeury.xyz/ghost/#/editor/post/610938ba515f690a076f0a9f), you'll have to stick to the `find` or `findMany` methods for now.

If we have the documents shown here in a collection called `users`:

```
{
	"name": "John Doe",
	"email": "test@test.com",
	"admin": false
},
{
	"name": "Jane Doe",
	"email": "test2@test2.com",
	"admin": true
},
{
	"name": "Bob Doe",
	"email": "bob@bob.com",
	"admin": true
}
```

If we run the following command in MongoDB:

```
db.users.findOne()
```

It will return the first document in the `users` collection, since we're not specifying any filters.

```
{
	"name": "John Doe",
	"email": "test@test.com",
	"admin": false
}
```

If we specify that we want only the `admin` users:

```
db.users.findOne({admin: true})
```

Even though two users satisfy that filter, we will only get `Jane Doe` since she is the first document that matches the filter.

```
{
	"name": "Jane Doe",
	"email": "test2@test2.com",
	"admin": true
}
```
PLCnext Power BI Reports
Published: 2021-08-05 00:31:11

Once you have your Phoenix Contact PLCnext Control data flowing to the cloud, it's time to create some Power BI reports so that you can easily monitor everything. But first things first, let's get our PLCnext Control connected to Microsoft Azure.

![PCLnext Phoenix Contact](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjtqw3unst3bgbjofim7.png)

Phoenix Contact has a video at https://youtu.be/QST1RpTkdfA that shows how to connect your PLCnext controller to an Azure IoT Hub using a Node.js client. It's a great video and very informative. However, instead of going through all of the tedious steps outlined in the video of setting up an Azure resource group, the IoT Hub, storage containers, the storage endpoints, and everything else, I prefer to use Fathym's [IoT Ensemble](https://www.iot-ensemble.com/). With one click I can register my PLCnext device and immediately get access to the data for downstream use in alerts, dashboards, and visualizations. After I enroll my device in IoT Ensemble, it displays the IoT Hub connectionstring. I take the connectionstring into PLCnext Engineer to use as my Azure Key and I'm ready to rock. Here's a screenshot of my connected PLCnext Control.

![IoT Ensemble List Device](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntvirfmzrk7b0e6b0jj2.png)

The PLCnext data is immediately flowing to IoT Ensemble and I can view the data on screen. Reminder that behind the scenes in IoT Ensemble the PLCnext data is stored in Microsoft Azure in blob storage, as well as in CosmosDB.

>**HOW TO ACCESS DATA IN MICROSOFT AZURE**
>Behind the scenes in IoT Ensemble the PLCnext data is stored in Microsoft Azure in blob storage, as well as in CosmosDB. [Read This](https://www.iot-ensemble.com/docs/getting-started/connecting-downstream) to learn more about accessing your data.

Fathym's IoT Ensemble is providing an easy-to-use UI for interacting with the data instead of using the Azure portal - and it saves me a ton of time and money.

![Fathym IoT Ensemble](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lfimqchij4hugf2quusu.png)

**Real-time PLCnext Power BI Reports**
Now that my PLCnext data is flowing to IoT Ensemble, it's time to create some Power BI reports to monitor everything. This [IoT Ensemble doc](https://www.iot-ensemble.com/docs/devs/storage/power-bi) explains how to import data from IoT Ensemble into Power BI and setup reports and visualizations. Here's a screenshot.

![Power BI Reports](https://powerbicdn.azureedge.net/mediahandler/blog/legacymedia/5078.dashboard5.png)

[Sign up](https://www.iot-ensemble.com/dashboard) for IoT Ensemble and save your company thousands of dollars in Azure setup and management costs.

>[Enroll your first PLCnext Control](https://www.iot-ensemble.com/dashboard) with IoT Ensemble for free.
>No credit card required.
>No Azure account required.
Theming with CSS variables.
Tags: html, css, javascript, webdev
Published: 2021-08-05 00:30:56

In this article, I will talk about how to make theming with CSS variables. We will see again the importance of using variables with this example.

> Step 1: Define your variables.

```css
/* Define your variables to the root. */
:root {
  --black: #181818;
  --white: #f5f7f7;
  --fade:  150ms;
}

/*  
The variables of the tag with the data-theme="light" attribute.
We will then apply this property to the HTML tag with javascript,
but you can define it manually.
*/
[data-theme="light"]{
  --color-text: var(--black);
  --color-background: var(--white);
}

/* Change variables for dark theme. */
[data-theme="dark"]{
  --color-text: var(--white);
  --color-background: var(--black);
}

/* And apply styles to document root element. */
html {
  color: var(--color-text);
  background-color: var(--color-background);

  /* for smooth color transitions. */
  transition: var(--fade) color, var(--fade) background-color;
}

```

> Step 2: Add functionality with javascript.

```js
// Call theme value from browsers local storage.
var theme = localStorage.getItem("theme");
// Root element of the document.
const _root = document.documentElement;

// Check if local storage has no theme value, define the initial value.
!theme && localStorage.setItem("theme", "light");

// Update theme value.
theme = localStorage.getItem("theme");

// Apply theme value to document root element.
_root.setAttribute("data-theme", theme);

// Function for change theme.
// You can define this function to the a button or call this any way.
function changeTheme() {
  theme === "light"
    ? localStorage.setItem("theme", "dark")
    : localStorage.setItem("theme", "light");

  // Update theme value
  theme = localStorage.getItem("theme");

  // Apply theme to document root element
  _root.setAttribute("data-theme", theme);
}
```

> **Result**

{% codepen https://codepen.io/E-klc/pen/KKmxovv %}
La zona de confort del programador
Published: 2021-08-04 23:54:19

En todas las profesiones modernas existe un punto en el cual el crecimiento como profesional se verá estancado, cuando eres consciente de que estás estancado y no quieres crecer por miedo, por comodidad en ese momento entras a tu zona de confort.

Siempre que te mantengas bajo un paraguas empresarial debes saber que la forma más favorable de permanecer en el trabajo es demostrando que sabes lo que haces y que tienes conocimiento (muchas no significa traer nuevas formas de hacer las cosas).

No sabes cuántos programadores se quedan estancados en un solo lugar y cuando la realidad decide abrirle los ojos se dan cuenta que esa realidad a la que se adaptaron por muchos años de servicio a una empresa cambió totalmente (esto es muy riesgoso cuando estás en esta profesión).

La cosa es es que al estar en una empresa en la que te sientes muy cómodo generalmente tiene el patrón de no cambiar la forma en que hace las cosas y eso significa que ahora el conocimiento que estas adquiriendo es mucho menor al que adquiriste para llegar donde estás y dejas de ser competitivo, pregúntate:

¿Si salgo de aquí y voy al mercado nuevamente, soy alguién que una empresa contrataría y por qué?

Es por eso que en algún momento debes mejorar habilidades como comunicación, liderazgo, oratoria y empatía porque es bien sabido que aunque amemos lo que hacemos hoy en 20 años puede que ya no sea así y dejes de hacer algo que amas a pasar a hacer algo por lo que te pagan.

Nunca debes pensar a corto plazo, todas tus luchas de hoy deben significar algo en tu futuro lejano porque hoy resistimos todo pero en 20,30,40 años creeme que nuestra opinión será otra.

#desarrolloweb #programacion #programador #tecnologia #sistemas #emprender #motivacion #diseñoweb #disenoweb #disenoui
5 Input Events That You Will Use At Least One Of Them In Your Next Projects.
Tags: javascript, codenewbie, webdev, beginners
Published: 2021-08-05 00:30:31

Hello,
I'm [**Aya Bouchiha**](https://t.me/AyaBouchiha),
today, we'll discuss 5 input events that you will use at least one of them in your next projects. 

firstly, we need to know that handling events can be done with:
+ `onEventName`

example:
```javascript
showButton.onclick = handleClick;
```
+ `addEventListener('eventName', function)`

example:
```javascript
showButton.addEventListener('click', handleClick)
```

+ The event as a attribute (`onEventName="function()"`)
```html
<button onclick="doSomething()"></button>
```

## blur and focus

**focus**: This happens when the user focuses on the input field.
**blur**: happens when the user leaves the input field.

{% codepen https://codepen.io/Aya_Bouchiha/pen/qBmMxXV %}

## input

**input**: This happens immediately when the user changes the input's value.

{% codepen https://codepen.io/Aya_Bouchiha/pen/xxdaYyY %}

## reset

**reset**: This happens when a form is reset by clicking to a reset input or a reset button.

{% codepen https://codepen.io/Aya_Bouchiha/pen/vYmzjve %}

## submit

**submit**: This happens when a form is submitted, by clicking a submit button or a submit input.

{% codepen https://codepen.io/Aya_Bouchiha/pen/yLbxjWm %}

### Summary
+ focus happens when the user leaves the input field.
+ blur: happens when the user focuses on the input field.
+ input: happens immediately when the user changes the input's value.
+ reset: happens when a form is reset.
+ submit: This happens when a form is submitted.

### References

+ [www.developer.mozilla.org](https://developer.mozilla.org/)
+ [www.w3schools.com](https://www.w3schools.com/)

### Suggested Posts

+ [5 HTML Tags That Almost Nobody Knows](https://dev.to/ayabouchiha/part-2-5-html-tags-that-almost-nobody-knows-nj8)

+ [Youtube Courses, Projects To Learn Javascript](https://dev.to/ayabouchiha/youtube-courses-projects-to-master-javascript-3lhc)

+ [All JS String Methods In One Post!](https://dev.to/ayabouchiha/all-js-string-methods-in-one-post-4h23)

To Contact Me:

+ email: developer.aya.b@gmail.com
+ telegram: [Aya Bouchiha](https://t.me/AyaBouchiha)

Happy codding!
Participe da Python Brasil 2021, a maior conferência de Python da América Latina
Tags: python, braziliandevs, programming
Published: 2021-08-05 00:08:10

*Python Brasil 2021, a maior conferência de Python da América Latina, acontecerá entre os dias 11 e 17 de outubro, reunindo desenvolvedores, cientistas de dados e entusiastas da tecnologia.*

A [Python Brasil 2021](https://2021.pythonbrasil.org.br/), evento promovido pela comunidade brasileira de Python, traz nesta edição uma agenda imperdível para quem quer mergulhar no universo de uma das linguagens de programação mais utilizadas na atualidade.

Uma das principais novidades deste ano é a trilha de atividades em espanhol, que vai trazer ao evento palestras de toda a América Latina, criando um ambiente de muita diversidade onde as comunidades Python de língua espanhola vão poder se conectar e trocar experiências.

Em sua 17ª edição, o evento será realizado de forma **online, gratuito e aberto para qualquer pessoa** de 11 a 17 de outubro. É esperado um público de mais de 10 mil participantes de todas as partes do Brasil e do mundo.

Nos sete dias de imersão, os participantes poderão contribuir para projetos de software livre, participar de treinamentos e adquirir novos conhecimentos com outras pessoas da comunidade.

E que tal falar sobre aquele projeto inovador, dar dicas sobre carreira ou mostrar formas de usar a tecnologia para causar impacto social, tudo isso em um ambiente inclusivo, seguro e acolhedor?! Até o dia 12 de agosto você poderá [submeter sua proposta](https://docs.google.com/forms/d/e/1FAIpQLSfXA7KGJbmoE6BHRgWAtK8LlBTEULv8QTS8ffHLIKUgeiLkZA/viewform) para apresentação de palestras e tutoriais na maior conferência Python da América Latina.

Você poderá acompanhar a Python Brasil pelo YouTube em tempo real e também participar de atividades e interagir com toda a comunidade pelo servidor do Discord criado especialmente para o evento.

Não deixe de seguir o perfil do evento no [Instagram](https://instagram.com/pythonbrasil?utm_medium=copy_link) ou [Twitter](https://twitter.com/pythonbrasil) para ficar por dentro das últimas novidades!