teleren/devto huggingface dataset:
What are hooks in React
Tags: react, hooks
Published: 2022-01-19 20:53:39


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ru4o9fv9cx5v0iyhu2bw.png)
Before React 16.8, when hooks in React were not introduced, managing state and using lifecycle methods were only possible by the Class Components that tend to complicate things as we move with our App in React.

But after the introduction of hooks in version 16.8, managing state and using lifecycles methods became the easiest things to do in a React App, and it is only that which keeps our code clean and readable, without that ‘this’ keyword which was there in almost every other line.

In this blog, we will discuss everything related to hooks. Let’s begin

## Index
1. What are hooks?
2. Why were hooks introduced?
3. Common types of hooks
4. Rules for hooks
5. Conclusion

## What are hooks?
As already told, hooks are an addition to the Functional Components through which we can work with states and other React features without first converting them into classes as it was the general condition in Class Components.

One point to note is that we don’t have to make any other change in our component except for one thing, we have to write our Apps in functional components as hooks can’t be used in Class Components.

Introduction of Hooks in functional components does not mean the end of Class Components, developers of React gave us an option that we can do everything including managing state and lifecycle methods using both the Components, and it is up to us which one we prefer to use.

## Why were hooks introduced?

There were many problems that developers were facing while using the Class Components. They vary depending upon the user and the type of App they are making.

You can continue reading this blog on our [official website](https://tekolio.com/what-are-hooks-in-react/)
Las ventajas del curso de Perito Informático 5.0, por ANTPJI

Published: 2022-01-19 20:27:33

en este contexto, la Asociación Nacional de Tasadores y Peritos Judiciales Informáticos (ANTPJI) destaca por ofrecer una de las formaciones en peritajes más actualizadas y completas, mediante el curso de Perito Informático Forense 5.0 de la mano con la Universidad de Nebrija, que le permite a los alumnos obtener doble titulación al culminar sus horas de estudio. 

Curso de perito informático forense en ANTPJI
Desde hace más de una década, el ejercicio del peritaje informático ha pasado a formar una pieza fundamental en el entorno judicial, ya que del desempeño de estos profesionales dependerá el alegato de un abogado para defender o acusar a una persona.

Ante este escenario, centros formativos como la ANTPJI se han enfocado en dotar a los cursantes de esta profesión con conocimientos sólidos y habilidades específicas que les permitan desempeñar una labor adecuada a las necesidades judiciales en cualquier rama del derecho y también dentro de cualquier entorno empresarial.

A través de las modalidades online o semipresencial, los interesados podrán realizar el curso de Perito Informático Forense 5.0, cuya duración es de 4 meses con un total de 400 horas de formación, divididas en 220 teóricas y 180 de práctica.

Además, este programa formativo permite a los alumnos obtener el título universitario de Perito Informático 5.0 de la Universidad de Nebrija y también el diploma como Perito Judicial de la Asociación Nacional de Tasadores y Peritos Judiciales Informáticos.

¿Por qué son importantes los peritos informáticos?
A lo largo del tiempo, el peritaje informático ha sido un oficio únicamente asociado al área judicial. Sin embargo, los peritos informáticos profesionales en la actualidad se forman para desempeñarse en diferentes sectores como, por ejemplo, el ámbito empresarial.

Dentro de una compañía, un perito informático pasaría a convertirse en un aliado estratégico para adecuar a la empresa al cumplimiento de las leyes penales y evitar delitos asociados al entorno digital.

Asimismo, este profesional figura como un apoyo en el desarrollo de políticas de seguridad en una empresa, así como también al momento de identificar ataques cibernéticos, generar planes formativos de ciberseguridad dirigidos a los empleados y directivos de una compañía.

Adicionalmente, por sus conocimientos en materia legal, este profesional se mantiene constantemente a la vanguardia ayudando a la empresa en su adecuado funcionamiento.

La informática forense es un factor multidisciplinar, capaz de adaptarse a las necesidades de cualquier tipo de negocio que, además, proporciona herramientas clave para que las empresas se manejen correctamente en el entorno empresarial. 
[ver mas...](https://bogotaindependiente.com/)
CD Mantenimiento Integral, la opción alternativa para la reparación de robots aspiradores

Published: 2022-01-19 20:26:44

La receptividad hacia los robots aspiradores se debe a las ventajas de su uso. Ahorran tiempo de limpieza, trabajan con autonomía, son energéticamente eficientes, fáciles de configurar para cualquier tipo de espacio y son compactos. Otro factor que ha favorecido su uso es que se han vuelto más accesibles.

La dificultad de encontrar personal especializado en reparación de robots aspiradores
Cuando un nuevo producto tiene un avance tan disruptivo en el mercado, el reto para los consumidores es conseguir el servicio técnico especializado de reparación. Hallar personal especializado que pueda manejar con criterio una reparación es siempre una tarea desafiante, sobre todo cuando se trata de equipos con tecnología importada.

Aunque marcas como Roomba, Dyson, Samsung y LG tienen excelentes servicios por garantía, el mayor problema para las personas comienza cuando esta condición se vence. Les toca procurarse por sí mismos una asistencia técnica que tenga el personal cualificado para enfrentar cualquier tipo de reparación o mantenimiento.

Las averías más frecuentes que suelen presentar algunas marcas es que no se encienden, se apagan solos o devuelven el polvo al aire. Algunas veces comienzan solo a girar sobre sí mismos, dejan de cargar la batería, se recalientan o no se mueven. En otras situaciones su configuración arroja un código de error.

[ver mas...](https://bogotaindependiente.com/)
Paracetamol.js💊| #19: ¿Qué imprime este código JavaScript?
Tags: javascript, beginners, spanish, webdev
Published: 2022-01-19 20:22:42

## **¿Qué imprime este código JavaScript?**

```js
const foo = () => console.log("First");
const bar = () => setTimeout(() => console.log("Second"));
const baz = () => console.log("Third");

bar();
foo();
baz();
```

-     A: `First` `Second` `Third`
-     B: `First` `Third` `Second`
-     C: `Second` `First` `Third`
-     D: `Second` `Third` `First`

Respuesta en el primer comentario.

---
Interval Overlaps
Tags: 100daysofcode, algorithms, java, programming
Published: 2022-01-19 20:20:11

# Description

You are given a list of closed intervals `l0` and another list of intervals `l1`. Individually, each list is non-overlapping and are sorted in ascending order.

Return the overlap of the two intervals sorted in ascending order.

**Constraints:** 

- `n ≤ 100,000` where `n` is the length of `l0`
- `m ≤ 100,000` where `m` is the length of `l1`

## Example 1

### Input

```
l0 = [
    [1, 3],
    [5, 6],
    [7, 9]
]
l1 = [
    [1, 4],
    [5, 7]
]
```

### Output

```
[
    [1, 3],
    [5, 6],
    [7, 7]
]
```

---

## Example 2

### Input

```
l0 = [
    [1, 3],
    [5, 6],
    [7, 9]
]
l1 = [
    [100, 200]
]
```

### Output

```
[]
```

---

# Intuition

# Implementation

```java
import java.util.*;

class Solution {
    public int[][] solve(int[][] l0, int[][] l1) {
        ArrayList<int[]> list = new ArrayList<>();
        int i0 = 0, i1 = 0, n0 = l0.length, n1 = l1.length;
        while (i0 < n0 && i1 < n1) {
            int low = Math.max(l0[i0][0], l1[i1][0]);
            int high = Math.min(l0[i0][1], l1[i1][1]);
            if (low <= high) {
                list.add(new int[] {low, high});
            }
            if (l0[i0][1] < l1[i1][1]) {
                i0++;
            } else {
                i1++;
            }
        }
        int[][] ans = new int[list.size()][2];
        for (int i = 0; i < ans.length; i++) {
            ans[i] = list.get(i);
        }
        return ans;
    }
}
```

## Time Complexity

- Time: O(n+m)
- Space:O(n)
How to do a delete request in react
Tags: react
Published: 2022-01-19 20:17:19

Before check to make sure your backend is set up correctly before starting. Meaning your routes has a destroy route and the controller has the method.

Make a function that every single time it's run fetches and deletes the object you want delete. So in my case I call it deletePost with the parameters of postId. That way it will match whatever route that is has the corresponding postId.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhtcw7g6553c4n74ddic.png)

Make a button that has an onClick with an anonymous function that takes in the function you just made and past through the data needed for the function. So in my situation it was a post.Id.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zlkqwwgi0lcbd1awsvsu.png)
Wednesday Links - Edition 2022-01-19
Tags: jvm, spring, security, microservices
Published: 2022-01-19 19:57:20

Log4Shell rides again (8 min) 🙈
https://nakedsecurity.sophos.com/2022/01/07/log4shell-like-security-hole-found-in-popular-java-sql-database-engine-h2/

Make Buffer Channels great again (8 min) 🤯
https://blogs.oracle.com/javamagazine/post/java-nio-nio2-buffers-channels-async-future-callback

What's new in Spring Boot 2.6? webinar 🌱
https://twitter.com/springcentral/status/1481988517538381826

Java 17 deep dive (3h to watch) 🥸
https://inside.java/2022/01/11/java-17-deep-dive/

Don't catch stackoverflow (6 min) 👻
https://jaokim.github.io/2022/01/11/stackoverflow.html

Security Manager case again (8 min) 💩
https://blog.frankel.ch/running-untrusted-code/

Truth about microservices (16 min) 🤔
https://arnoldgalovics.com/truth-about-microservices/

Gif deep dive (20 min) 🧪
https://blog.darrien.dev/posts/you-dont-know-gif/

Good enough error message (10 min) ❤️
https://www.morling.dev/blog/whats-in-a-good-error-message/

Fastest way of serialization (9 min) 💨
http://minborgsjavapot.blogspot.com/2022/01/did-you-know-fastest-way-of-serializing.html

Cost of Attrition (3 min) 🔬
https://benjiweber.co.uk/blog/2022/01/12/cost-of-attrition/
Stands de diseño de hasta 3000 m² con Standecor

Published: 2022-01-19 19:47:23

El stand es el espacio de la empresa para sus clientes en el evento que participará
El stand es un espacio que debe entenderse como una ‘sucursal’ de la compañía que le patrocina. Por lo tanto, debe reflejar todo lo que la empresa desea proyectar. Es con ese objetivo que se utilizan los stands de diseño. Estas estructuras se salen de lo meramente modular y un equipo despliega toda su creatividad para hacerlo más llamativo.

El grupo de trabajo está formado por diseñadores, técnicos, carpinteros, electricistas, pintores entre otros muchos profesionales y quienes se encargan de hacer el montaje definitivo. No tienen ningún tipo de limitante sobre lo que se puede crear, únicamente lo referente a la superficie que ocupa dentro del complejo ferial. Los stands de diseño sobresalen del resto porque son impactantes y quedan registrados en la mente del visitante.

Estos stands generalmente están asociados a marcas muy grandes y poderosas dentro de un sector productivo determinado, aunque no es exclusivo de ellas. Hay muchas empresas que lo que buscan más allá de la venta es posicionamiento dentro del sector, añadiéndole así un valor diferencial a su espacio. Siempre hay un stand de diseño para cualquier compañía que quiera exponer, no importa su tamaño o antigüedad.

[ver mas...](https://bogotaindependiente.com/)
Agile metodologiyasi
Tags: agile, app, tutorial, uzbek
Published: 2022-01-19 09:56:54

Ushbu maqolada biz Agile metodologiyasi haqida qisqacha tanishib chiqamiz.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ipapigjf5fh9qhro3aj7.png)


## Agile metodologiyasi
 — bu loyihani bir necha bosqichlarga bo’lish orqali boshqarish usuli. Bunga manfaatdor tomonlar bilan doimiy hamkorlik va har bir bosqichda doimiy takomillashtirish kiradi. Ish boshlangandan so’ng, jamoalar rejalashtirish, amalga oshirish va baholash jarayonidan o’tadilar.


## Agile metodologiyasini umumiy ko’rinishi
Dasturiy ta’minotni ishlab chiqish bo’yicha “ The Manufesto of Software Development ”2001 yilda yaratilganidan so’ng, mijozlar bilan hamkorlik qilish va mijozlar bilan hamkorlik qilish bo’yicha ilg’or fikrlashni o’z ichiga oladi. Agilening to’rtta asosiy qadriyati:

- Individuallar va jarayonlar va vositalar bo’yicha o’zaro ta’sirlar
- Keng qamrovli hujjatlar ustida ishlaydigan dasturiy ta’minot
- Shartnoma bo’yicha mijozlarning hamkorligi yoki muzokaralari
- Reja bo’yicha o’zgarishlarga javob berish



## Agile metodologiyasining frameworklari
Xo’sh, loyihani boshqarishda Agile metodologiyasi nima? Bu doimiy hamkorlik va iteratsiyalarda ishlashni o’z ichiga olgan loyihani boshqarish jarayoni. Bugungi kunda Agile so’zi ushbu qadriyatlarga va ularni amalga oshirish uchun asoslarga, jumladan Scrum, Kanban, Extreme Programming (XP) va Adaptive Project Framework (APF) ga murojaat qilishi mumkin.
El coworking como complemento a la nueva Ley de Emprendedores y Startups

Published: 2022-01-19 19:46:53

Como aspecto positivo, el nuevo decreto podría promover el desarrollo de espacios pensados para el impulso de nuevos autónomos, startups y pymes. Espacios como Coworking Bernabéu, que son el lugar idóneo para que freelancers y emprendedores puedan trabajar con los medios de una gran empresa, en un entorno versátil, pensado para adaptarse a sus requerimientos y necesidades.

¿Cuáles son los beneficios de la Ley de Emprendedores de España?
Hasta diciembre de 2021, la ley que estaba en vigor databa del año 2013 y no ofrecía toda la flexibilidad y oportunidades que requieren los nuevos emprendedores. Este nuevo proyecto presenta medidas adicionales de protección, una mayor flexibilidad de pagos en impuestos, así como salvedades en caso de un revés empresarial imprevisto. Hay cuatro puntos a destacar. En primer lugar, las bonificaciones especiales en el pago de la Seguridad Social para nuevos autónomos, con una tarifa plana inicial de 50 €. Por otro lado, la flexibilidad con respecto al pago del IVA, que se podrá esperar a cobrarlo antes de tener que ingresarlo en Hacienda. También una mayor limitación de la responsabilidad que impide al emprendedor responder con sus bienes personales ante cualquier deuda. Por último, nuevas oportunidades para negociar pagos con acreedores; en el caso de un primer traspiés.

Coworking Bernabéu: el espacio ideal para emprender
Además de estos pequeños alivios legales que proporciona la nueva ley para el emprendedor interesado en desarrollar un nuevo proyecto, en España, se ha visto que espacios exclusivos como el coworking también contribuyen profundamente en el crecimiento de un nuevo negocio, puesto que funcionan como punto de partida y criadero de empresas para nuevos emprendedores. Espacios que, como Coworking Bernabéu, se caracterizan por su versatilidad.

[ver mas...](https://bogotaindependiente.com/)
Projects as a new Developer
Tags: discuss, beginners
Published: 2022-01-19 19:41:59

As a relatively new coder, I have noticed something problematic: 

**It's increasingly hard to find a time-worthy project to work on.**

Let me elaborate a little bit:

Projects are usually what developers learn the most from, not having restrictions for coding and being able to make whatever their knowledge and mind allows them to.

This usually isn't a problem for frontend devs, seeming as websites are usually original and unique.

But for some software developers, this becomes a big problem, since there are barely any programs/ideas that haven't been created before. Of course you can choose to recreate that program, but that usually contributes to imposter syndrome, which affects a huge portion of the programming scene. 

This isn't a problem for some software devs that have great imagination, but that sadly isn't everyone. 

I've been struggling with this ever since I got into software development, and it hasn't gotten better.
Presentation as Code
Tags: emacs, revealjs, presentation, org
Published: 2022-01-23 15:34:58

---
title: Presentation as Code
published: true
date: 2022-01-19 19:28:00 UTC
tags: emacs,revealjs,presentation,org
canonical_url: https://blog.dornea.nu/2022/01/19/presentation-as-code/
---

Last year I’ve done some experiments with the [Beamer LaTex class](https://ctan.org/pkg/beamer?lang=en) which you can use whenever you want to export an ORG document to a [Beamer presentation](https://orgmode.org/worg/exporters/beamer/tutorial.html). I’ve done some customizations and I’ve thought I have a quite decent presentation template. Till I’ve found [this](https://zenika.github.io/adoc-presentation-model/reveal/reveal-my-asciidoc.html).

That [reveal.js](https://revealjs.com/) presentation completely my mind and I’ve started digging into [asciidoc](https://asciidoctor.org/). And then there is also [org-asciidoc](https://github.com/yashi/org-asciidoc) which will export your ORG buffer into `asciidoc`. However there were some[issues](https://github.com/yashi/org-asciidoc/issues/14) and quickly after Christmas I decided I’ll go on my own and setup my own revealjs theme.


{% twitter 1481908662251704320 %}

Here are some links:

- [slides.dornea.nu](https://slides.dornea.nu)
  - here I’d like to host my slides
  - yes, I plan to do more
- [github.com/dorneanu/slides](https://github.com/dorneanu/slides)
  - check out the `content` folder and inspect the revealjs setup file
  - for theming I use some of [Zenika’s themes](https://github.com/Zenika/adoc-presentation-model/tree/master/docs/themes) with small customizations

And here some GIF I’ve put on Twitter:

{% twitter 1482694904547586051 %}
A quick start to using or context (global state) in react
Tags: react, javascript
Published: 2022-01-19 19:26:16

Before even using global state make sure it's a state that majority of your app is gonna use. If it's just for 2 components for example, you'd just want to use state at the parent level. Then pass it down to the child component as a prop.

If you find yourself making redundant states, that's a good sign that you should use global state. First Thing to do is make a file and call it whatever you want it to be. I had mine in a folder called context because I had more than one global state and I named it "globalPost.js".

![Make and name the file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sk5bpp1skxcvzhpc4ng0.png)

Next import React, useState, and if you are fetching from another place useEffect.

![Import the hooks you need](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2n1075vvaqh39mghcqj.png)

After that create and name the context of your context. Outside of your provider function. Then create your provider function and pass down children as a prop.

![create the context and provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqo2lry7b9kesa6fak0p.png)

Then inside the provider function name the state whatever you it to be. In my case I am calling it posts and setting it equal to an empty area. Then using useEffect open first mounting to fetch my post data and setting my posts state to the data I just fetched.

![Make and set the state](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrfoy3oc87689lep6v66.png)

Now in the return of the provider function render .provider on your context that you just made and set the value equal to the state that you want to use in other components. Also in between the context provider in curly brackets call children. Then export your context and your provider.


![Render and export context and provider](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cx72rvgr2wn509ko84iw.png)

Import your provider to the highest level component you need it at. So if you need it throughout the entire app render it in the index.js file.


![Import provider to highest level component](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sv29qtesg9i4e1t2rq08.png)

Lastly you can use it on any component throughout the entire app by importing useContext, and then import your context. Then calling it inside your function component.

![Import context in component that needs ir](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tiawc77bknubhk21keek.png)
Discoveries in Ruby(and Rails): Array#*
Tags: ruby
Published: 2022-01-19 19:19:50

Sometimes when you need to join the elements of an array you would end up calling Array#join and pass the argument to the method.

```ruby
["one", "two", "three"].join "-"
```

If we run the code above in an irb session. You effectively get `one-two-three` returned.

Ruby provides various sets of syntactical sugar. Another example in Ruby's elegancy is that you can also do the same operation as join by calling Array#* method.

```ruby
["one", "two", "three"] * "-"
```

The result from running this snippet is the same as the first code. To confirm this, run the following code in an irb session. The result returned to you should be true.

```ruby
["one", "two", "three"].join("-") == ["one", "two", "three"] * "-"
```

Thank you for reading. Happy Coding!.

## References
- [Array#*](https://ruby-doc.org/core-3.1.0/Array.html#method-i-2A)
- [Array#join](https://ruby-doc.org/core-3.1.0/Array.html#method-i-join)
Testing many repos/issues
Tags: opensource
Published: 2022-01-19 19:18:22

This is a test post to see how [Telescope](https://github.com/Seneca-CDOT/telescope) shows many issues on mobile. It will be removed once the testing is over.

A list of different repos:
https://github.com/yogurtkun/SysCall
https://github.com/SumunComunicacionGlobal/wppromosmv
https://github.com/KarolinaMrozek/TowerDefense-game
https://github.com/503yogeico/dragino
https://github.com/equaLize-dev/UnityHomework-repo
https://github.com/go-git/go-git
https://github.com/nucstack/k8s
https://github.com/jpratik15/OS-Lab
https://github.com/HuaLiMao-Code/android_kernel_xiaomi_atom
https://github.com/RobertCNelson/linux-stable-rcn-ee
https://github.com/phennaux/ankoku_kernel_sm6150_samsung
https://github.com/cnuber/k3s-airgap-bb

Issues:
https://github.com/HFOSSedu/kwurst-kit-review/issues/8
https://github.com/iron-fish/ironfish/issues/912
https://github.com/virtio-win/kvm-guest-drivers-windows/issues/721
https://github.com/HFOSSedu/kwurst-kit-review/issues/6
https://github.com/HFOSSedu/kwurst-kit-review/issues/5
https://github.com/abhi-kr-2100/sentence-collector/issues/2
https://github.com/HFOSSedu/kwurst-kit-review/issues/23
https://github.com/HFOSSedu/kwurst-kit-review/issues/26
https://github.com/bcgov/performance/issues/382
https://github.com/lodash/lodash/issues/5360
https://github.com/sanctuarycomputer/sanctu-dot-com/issues/138
⚡Var, Let, and Const in JavaScript
Tags: javascript, programming, webdev
Published: 2022-01-19 19:18:09


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jc913eegcex2lyswghqk.png)Let’s briefly discuss the concept of Var, let, and Const in JavaScript.They are mostly asked In programming interviews, and we may somehow be confused about their differences and use them Viceversa.

♦var

This is the default: it creates a global scoped(can be accessed anywhere in the program) variable which can be reassigned or redeclared later on.

♦let

This was introduced in ES6 and it is the preferred way over using var. It creates a block-scoped(only accessed in a particular block in which it is declared) variable which can be reassigned but can’t be redeclared.

♦const

It was introduced in ES6 along with let. It also creates a block-scoped variable but this can’t be reassigned nor redeclared. const should be used when you don’t want to reassign a value later on.