teleren/devto huggingface dataset:
Ultimate Python Tutorial For Beginners
Published: 2022-04-22 20:06:45


**INTRODUCTION TO PYTHON**
Python is one of the high level programming languages just like Java. A high level programming language means it is closer to the human language e.g., `print('hello world!')`.

So as to understand what python is with less time wastage, I have outlined various key concepts to read about such include;
    

- Variables

- Operators

- Data Types

- Conditions

- Loops

- Exception Handling

- Lists

- Dictionary

- String Operations

- File Operations

**VARIABLES**
-This are whole numbers `[0,1,2,3,4,5,6,7,8,9]`.

**DATA TYPES**
-Data types are the classification or categorization of knowledge items. This represents the type useful to be performed for a specific data. 
There are 4 data types. This includes:   

1. string - This are alphabetic letters  `str('a', 'b', 'c', 'd')`.

2. Boolean(bool) - This are `True` or `False` statements. They can even be represented using `0 ` to mean `False` and `1` to mean `True`.

3.Float - This are decimal numbers. e.g., `0.12` .

4.Complex - This is a building function in python which is rarely used . `Complex number(real number + the imaginary number)` .

**LOOPS**
Loop is iterable object such as a list, tuple, set etc.

**CONDITIONS**
They are statements that are used to show if a statement is true  or not true . e.g., `if... else ` .

**STRING OPERATIONS**
They are special string operators .
   example 
`*` its used to concatenate multiple copies of the same string .
`[]` they give a character of the same index .
`[:]` it gives character from a given range .

**LISTS**
They are used to store multiple items in a single variable. e.g., `grocery = ['kales', 'tomatoes', 'onions']`.

**FILE OPERATIONS**
They are inbuilt functions  
e.g.,
 `r` used to open a file for reading .
How to create a list of suggestions for your HTML Input field
Tags: html, input, webdev, tutorial
Published: 2022-04-22 20:02:02

If you want to have a predefined list of suggestions for your input field by using just simple HTML then `<datalist>` HTML element is for you.

We will create a list of cities that will be offered as a suggestion for our input field. To create a list we will use the HTML element `<datalist>` that will have a list of items and `id` which will be used as a reference to our list.

```html
<datalist id="listOfCities">
        <option value="Bugojno"></option>
        <option value="New York"></option>
        <option value="London"></option>
        <option value="Peking"></option>
</datalist>
```

Now, we will create an `input` field and connect it to our list with `list` attribute.

```html
<input type="text" id="city" list="listOfCities" />
```

Now when we start typing in our input field suggestions will be loaded.

![Suggestions for the input box](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1v1gtff6eus8b8tdvp8r.png)

## CODEPEN
{% codepen https://codepen.io/TriLLi/pen/zYpXpdB %}
Open Source Adventures: Episode 43: SolidJS
Tags: solidjs, javascript
Published: 2022-04-22 19:50:34

Let's take a look at some of the new frameworks. SolidJS looks very much like Hooks-style React, but apparently it abandons virtual DOM.

I never used it before, so let's start with a hello world app, and over the next few episodes I'll try to build something a bit more substantive.

### Getting started

We can start it with `degit`, which seems to be the most popular tool for a lot of frameworks these days:

```
$ npx degit solidjs/templates/js episode-43
```

Then we do the usual steps to start the app:

```
$ npm i
$ npm run dev
```

### `index.html`

We can start with cleaned up `index.html`, it's pretty much what you'd expect:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Solid App</title>
  </head>
  <body>
    <div id="root"></div>
    <script src="/src/index.jsx" type="module"></script>
  </body>
</html>
```

### `index.jsx`

This comes from the template as well. I'm not sure what `/* @refresh reload */` is for, most likely something related to HMR.

```javascript
/* @refresh reload */
import { render } from "solid-js/web"

import "./index.css"
import App from "./App"

render(() => <App />, document.getElementById("root"))
```

### `index.css`

SolidJS has both global and (awkward coming from Svelte) module-scoped CSS. For this app I'll just use global CSS:

```css
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  text-align: center;
  justify-content: center;
  align-items: center;
}
```

### `App.jsx`

It looks very close to React with `useState`. It's not quite the same, as semantics are very different, and you access current value of `count` with `count()` not just `count`. But for simple cases, it should be easy transition for React developers.

```javascript
import { createSignal } from "solid-js"

function App() {
  let [count, setCount] = createSignal(0)

  return (
    <div>
      <div>{ count() }</div>
      <button onClick={() => setCount(count() + 1)}>Click me!</button>
    </div>
  )
}

export default App
```

### Building the app

To build the app, use `npm run build`, and it will be created in `dist`... And once again it will not work for GitHub Pages as it uses absolute paths. I have no idea why so many frameworks have this awful default.

We need to modify `vite.config.js` to use relative paths. Fortunately that's just one line change `base: "./"`:

```javascript
import { defineConfig } from "vite"
import solidPlugin from "vite-plugin-solid"

export default defineConfig({
  base: "./",
  plugins: [solidPlugin()],
  build: {
    target: "esnext",
    polyfillDynamicImport: false,
  },
})
```

### Story so far

And here's the result:

![Episode 43 screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bjxg5c3mn9av5pr00zyk.png)

I deployed this on GitHub Pages, [you can see it here](https://taw.github.io/open-source-adventures/episode-43/).

### Coming next

In the next few episodes, we'll try to build some less trivial things with SolidJS.
What was your win this week?
Tags: discuss, weeklyretro
Published: 2022-04-22 19:33:09

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey there! 


Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Meeting someone new on DEV or [CodeNewbie Community](https://community.codenewbie.org)... or whatever else might spark joy ❤️ 

---

Happy Friday

![Earth hugging a heart](https://media.giphy.com/media/2heDcW85P4f2602qDG/giphy.gif)
Tagging with terraform
Published: 2022-05-08 12:11:02

---
title: Tagging with terraform
published: true
date: 2022-04-22 19:25:33 UTC
tags: 
canonical_url: https://blog.sgrilux.com/tagging-with-terraform
---

We all know that when we share a resource in AWS with a different account, tags are not shared alongside the resource. Tags are account based so you need to assign tags to the other account as well.

Terraform comes to help with aws\_ec2\_tag which allows us to tag indivvidual resources that are created outside Terraform.

So lets jump directly to an example.

You have a networking account with a VPC that you are sharing with your production account. You want to Name your VPC with the same name that has been given in the networking account.

first you need to collect VPC data (using a provider that connects to the networking account)

```
data "aws_vpc" "selected" {
  filter {
    name = "tag:Environment"
    values = ["production"]
  }

  provider = aws.central-networking
}

```

then, with a production provider, you can tag your VPC

```
resource "aws_ec2_tag" "my_prod_vpc" {
  resource_id = data.aws_vpc.selected.id
  key = "Name"
  value = data.aws_vpc.selected.tags.Name

  provider = aws.production
}

```

You can also use for\_each to assign multiple tags to the same resource:

```
resource "aws_ec2_tag" "my_prod_vpc" {
  for_each = local.tags

  resource_id = data.aws_vpc.selected.id
  key = each.key
  value = each.value
}

```

Thats it, easy peasy!

I hope you have enjoyed itsee you on the next post.

CIAO!

[Here](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_tag) for more information about aws\_ec2\_tag
Use Inflint to follow files and folders convention
Tags: javascript, typescript, filesystem, lint
Published: 2022-04-22 19:22:52

## INTRO
In the last months I worked with some juniors on the same project. Usually in order to overcome some bad practices and bad code, I add some linters: `ESLint`, `Stylint`, `commitlint` and also `prettier`.

It usually helps a lot and I avoid redundant code reviews for dummy things.

However, there was 1 thing I couldn't avoid. **Files and folders names.**
Although I had some clear convention with my file structure, other people kept on creating files and folders that did not follow the repository convention.

First thing I thought of was applying some file structure linter.
But I couldn't find any proper linter for this.
I found one which could not be applied with `lint-staged` and has very low maintenance and features. **So.. I created my own package!**

## INFLINT

### WHO??
It is a file system linter. This tool will scan your file structure in the repository, and validates, according to provided configuration, that the files and folders match the provided convention.

### WHERE??
You can check it out here:
https://www.npmjs.com/package/inflint

Or look at the source code here:
https://github.com/Vinyl-Depository/Inflint

#### demo
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a3pwr9ywhiklm9ur3pcc.gif)

Not only you get a lot of configurations options with the main features: "Rules" and "Aliases" but this tool can also be applied together with `lint-staged`:
```json
"**/*": "inflint"
```
Reaching the final stage
Tags: osd700, opensource, telescope
Published: 2022-04-22 19:20:36

_This post should have been posted three weeks ago, but I didn't write it, so let's imagine that I wrote it three weeks ago :)_

We start to enter the final set of releases: `3.0`, this time, starting with its `alpha` version. Telescope has come a long way, and there will be some major changes that are still pending before Telescope 3.0 actually reaches.

A few things that I have to start working on are related to the Postgres backups that I promised a long time ago. Since now are going to use a **real** database ("real", as in persistent, sorry `redis`), we have to worry about the data we are storing, and the way we can take care of the data is by making backups and storing those backups in another place.

Well, we decided to break that issue in two steps: Figure out how to make the backups at all, and then figure out how to store those backups. At least, when we finish the first one, we will at least have some backups (although they are not going to be store in a separate location yet).

Also, I started to prepare writing the tests for the `dependency-discovery` service. More specifically, the tests for the routes `/project` and `/github`. To prepare for it, I went over the `jest` documentation, since my experience on writing tests is almost zero...

Either way, look forward to the new release!
eDriving anuncia una colaboración internacional con Bosch y Sfara
Published: 2022-04-22 19:08:12

La tecnología de detección de colisiones de Sfara en el dispositivo reconoce las colisiones y suprime los falsos positivos. Los centros de servicio de llamadas de emergencia internacionales de Bosch facilitan un proceso de respuesta de emergencia altamente eficiente para enviar asistencia y/o apoyar a los conductores en casos de emergencia. A través de la función Personal SOS, impulsada por Sfara y Servicio de Soluciones de Bosch, esta misma asistencia global está ahora disponible para las personas siempre que se sientan mal o les preocupe que su seguridad esté en peligro. La solución integrada de Mentor incorpora un enfoque holístico que, en última instancia, se ampliará más allá de la seguridad personal para incluir la asistencia al conductor y al vehículo en carretera, así como la gestión de accidentes y siniestros.

Según la Organización Mundial de la Salud, cada año se producen en el mundo entre 20 y 50 millones de lesiones relacionadas con accidentes. A menudo, las lesiones relacionadas con los accidentes dejan a los conductores varados, o peor aún, inconscientes, e incapaces de pedir ayuda cuando cada segundo cuenta.

"Como resultado de la colaboración entre eDriving, Bosch y Sfara, las organizaciones pueden proteger a sus empleados y contratistas las 24 horas del día de tales circunstancias en caso de que se produzca un accidente mientras conducen por motivos de trabajo", dijo Ed Dubens, director general y fundador de eDriving. "Por supuesto, el objetivo principal de la gestión de riesgos de los conductores es evitar que se produzcan colisiones en primer lugar, pero esta tecnología significa que, si se produce una colisión, las organizaciones pueden sentirse seguras de que la respuesta de emergencia rápida está a unos momentos de distancia, y que su compromiso con la seguridad personal de los empleados queda claramente demostrado".

Con 25 años de experiencia en la gestión de riesgos de los conductores, eDriving es el socio de confianza elegido por muchas de las flotas de ventas, servicios y entregas más grandes del mundo, apoyando a más de 1,2 millones de conductores en 125 países con las galardonadas soluciones digitales de gestión de riesgos de los conductores. Sfara proporciona su tecnología patentada de IA con una precisión y velocidad líderes en la industria para conectar a los usuarios de Mentor con los servicios de despacho de llamadas de emergencia de Bosch.

[PMM](https://plazamayormadrid4c.es/) [BTTMAP](https://bottomapp.org/) [AM](https://alejandromorales.es/) [SA](https://saludabit.es/) [RA](https://rafaelalberti.es/)
BingX aprovecha la profunda liquidez de WOO Network para mejorar la ejecución de precios y agilizar las transacciones
Published: 2022-04-22 19:07:59

Esta asociación con Woo Network permite a los usuarios de BingX acceder libremente a la solución de liquidez institucional de WOO Network, Wootrade. Wootrade cuenta con una lista de activos en rápido crecimiento, con un volumen de negociación diario máximo de más de 600 millones de dólares.

La integración de BingX en la liquidez profunda de Wootrade permitirá a los operadores "conectarse" a los grupos de liquidez profunda de Wootrade en los principales pares, permitiendo que la red Wootrade actúe como un soporte de liquidez clave.

"WOO Network se complace en explorar la posibilidad de proporcionar liquidez a BingX, una plataforma que desempeña un papel muy innovador en la introducción del comercio de criptoactivos en el escenario mundial. El enfoque de BingX en el cumplimiento y la seguridad los convierte en un socio ideal para desarrollar nuevos mercados y aportar más volumen a nuestra red", Ran Yi, Jefe de Desarrollo del Ecosistema de WOO Network

Una de las principales ventajas de contar con una gran liquidez en BingX es que sirve de reclamo, lo que refuerza la confianza de los inversores y mejora la experiencia general de negociación de sus usuarios. Un acceso adecuado a la liquidez también conducirá a un aumento de los libros de órdenes para los inversores. Esto no sólo mejora la transparencia del mercado, sino que también ofrece a los usuarios una mejor ejecución de los precios, lo que reduce en gran medida el coste de la negociación. En definitiva, los usuarios pueden esperar transacciones a la velocidad del rayo cuando realicen operaciones en BingX.

"Recientemente, hemos añadido varias monedas a nuestra plataforma, lo que nos complace decir que ha provocado un aumento de nuestro volumen medio diario de operaciones. Dicho esto, es fundamental que la liquidez se convierta en una de las principales en esta coyuntura. BingX trabaja continuamente para crear un entorno de negociación que minimice la volatilidad del mercado en la medida de lo posible. Al asociarnos con Woo Network, estamos seguros de que podemos alcanzar mejor este objetivo", Director de Comunicación Global de BingX, Elvisco Carrington

[PMM](https://plazamayormadrid4c.es/) [BTTMAP](https://bottomapp.org/) [AM](https://alejandromorales.es/) [SA](https://saludabit.es/) [RA](https://rafaelalberti.es/)
Install PHP and Composer in MontereyOS
Tags: php, laravel, symfony, webdev
Published: 2022-04-22 19:06:36

## Install PHP with brew

It would install the most recent PHP version, just open your terminal and type this command:

```
brew install php
```

If you does not have installed Brew, you can check the previous article from this series.

## Install composer

You can go to the official page and get the installation commands always updated [here](https://getcomposer.org/download/), but I will add it in this article updated at the current date.

Open your terminal and paste this commands (all at once):

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '906a84df04cea2aa72f40b5f787e49f22d4c2f19492ac310e8cba5b96ac8b64115ac402c8cd292b8a03482574915d1a8') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

Then you can verify that the composer.phar file is working by typing in your terminal:

```
php composer.phar
```

and you should be able to see that there is an output with the list of composer commands and flags.

## Add composer globally

You must need to move the composer path to `/usr/local/bin` directory, in MontereyOS or any other MacOS newer than HighSierraOS you need to create this directory manually:

```
sudo mkdir -p /usr/local/bin
```

If it throws an error like `/usr/local/bin is not a directory`, just remove the bin file and try again:

```
sudo rm -rf /usr/local/bin
sudo mkdir -p /usr/local/bin
```

Now you are able to move the `composer.phar` file to that directory with this command:

```
sudo mv composer.phar /usr/local/bin/composer
```

### Set the composer path

Write this command:

```
PATH=$PATH:~/.composer/vendor/bin
```

### Test your composer installation

Now you can test that everything works fine and just type in your terminal:

```
composer
```

and you should be able to see that there is an output with the list of composer commands and flags.
How the TypeScript Pick Type works
Tags: typescript, javascript, tutorial, webdev
Published: 2022-04-22 19:05:04

The TypeScript `Pick` type is a utility type which is used to create a new custom Type, based off an already existing one. It is the opposite of the [Omit Type](https://fjolt.com/article/typescript-omit-type). Let's look at how it works.

### Custom Types
We are using custom types in this guide. If you're new to custom types, [check out my guide on custom types here](https://fjolt.com/article/typescript-creating-custom-types).
})

## TypeScript Pick Utility Type
TypeScript has a number of utility types which are essentially custom types that solve a particular problem. The problem which `Pick` solves is when we have an already existing type, and want to create a new type using only a couple of fields from that type. For example, suppose we had a `User` type that looks like this:
```javascript
type User = {
    firstName: string,
    lastName: string,
    age: number
}
```

In another part of the code, we want to refer to a user, but we know that the data only gives the first and last name. As such, we can't actually use the `User` type as all fields are required. If we want to create a new type based off `User`, we can use `Pick`.

`Pick` has two arguments, the first is `Type` which is the type we want to use, and the second is a **union type** or list of fields we want to select from the type we are using. We write it like this: `Type<User, "fields" | "to" | "include">`. For example, let's make a new type which only has `firstName` and `lastName`:
```javascript
type User = {
    firstName: string,
    lastName: string,
    age: number
}
type UserName = Pick<User, "firstName" | "lastName">
```

Now, using our new type, `UserName`, we can define a variable consisting only of `firstName` and `lastName`:
```javascript
let user:UserName = {
    firstName: "John",
    lastName: "Doe"
}
```

If we wanted to create a new type, which only contained the user's age, we could also use `Pick`. Here is the example:
```javascript
type User = {
    firstName: string,
    lastName: string,
    age: number
}

type UserAge = Pick<User, "age">

let age:UserAge = {
    age: 1534
}
```

As you can see, the `Pick` type is very useful in creating custom types based on already existing ones. Now that you've mastered it, you can simplify your type declarations.
Nuevo Launchpad de BH Network - BHero - De Cero a Héroe
Published: 2022-04-22 19:01:13

Estos hechos han aumentado los problemas a los que se enfrentan millones de personas y hacen que la toma de decisiones sea más problemática de lo que fueron los mercados de criptomonedas.

Además, la inherente falta de confianza supone un problema para los legítimos proyectos de criptomonedas que están surgiendo. A los auténticos creadores de proyectos les resulta más difícil adquirir el capital que necesitan para evolucionar, lo que deja sobre la mesa muchos casos de uso y desarrolladores únicos sin margen de evolución.

El amplio espectro de inversores busca ahora proyectos de baja capitalización para sus emprendimientos. Sin embargo, al mirar a la próxima generación de emprendimientos es tan fácil quedarse con las manos vacías como siempre.

El BHero Launchpad está diseñado, operado y supervisado por un equipo que ha demostrado su valía en el sector. Utilizarán su experiencia y sus conexiones para extraer los principales grupos con casos de uso de primer nivel y garantizarán la plena adopción de todas las normativas actuales y futuras, incluidas las comprobaciones KYC y AML de las licencias.

Como primer proyecto de mainnet de BH Network (https://bh.network), el equipo está emocionado de lanzar su propio token en el launchpad de BHero. El primer listado será un mercado de autónomos con una huella completa en blockchain, que ofrecerá beneficios de baja latencia, bajas tarifas y alta seguridad que los actuales mercados fiat no pueden ofrecer.

La visión del mercado de BH Network es liderar la innovación de los mercados de autónomos y ampliar las posibilidades para los individuos, las empresas y los clientes a través de la tecnología blockchain, cambiando la forma en que los autónomos y las empresas compran y venden servicios digitales con una visión no sesgada, sin tiempos de espera para el pago, sin manipulación y con una seguridad blockchain de alta gama.

[PMM](https://plazamayormadrid4c.es/) [BTTMAP](https://bottomapp.org/) [AM](https://alejandromorales.es/) [SA](https://saludabit.es/) [RA](https://rafaelalberti.es/)