teleren/devto huggingface dataset:
6 very useful react component libraries
Tags: javascript, react
Published: 2020-04-04 04:18:30

React is arguably the most popular JavaScript framework now. Every day, a lot of new react component libraries are released. I have collected these useful components, each of them is very useful, I hope you will like it.

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

---

## 1. React Portal Tooltip
> Awesome React tooltip

![img](https://raw.githubusercontent.com/romainberger/react-portal-tooltip/master/react-portal-tooltip.gif)

#### github project url [https://github.com/romainberger/react-portal-tooltip](https://github.com/romainberger/react-portal-tooltip)

---

## 2. react-notifications-component
> A delightful, easy to use and highly configurable component to help you notify your users out of the box. No messy setup, just beautiful notifications!

![img](https://raw.githubusercontent.com/teodosii/react-notifications-component/master/github-preview.gif)

#### github project url [https://github.com/teodosii/react-notifications-component](https://github.com/teodosii/react-notifications-component)

---

## 3. react-native-keyboard-spacer
> Plug and play iOS react-native keyboard spacer view.

![img](https://camo.githubusercontent.com/ef132cecc200ab3a5eec2b24021f5c02c44c4de4/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f336f456a484a774c7959673775705479596f2f67697068792e676966)

#### github project url [https://github.com/Andr3wHur5t/react-native-keyboard-spacer](https://github.com/Andr3wHur5t/react-native-keyboard-spacer)

---

## 4. React Flip Move
> Effortless animation between DOM changes (eg. list reordering) using the FLIP technique.

![img](https://camo.githubusercontent.com/327ab3ca8958538e66c1bad251fcd60441b5093f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f676974687562646f63732f666d2d6d61696e2d64656d6f2e676966)

#### github project url [https://github.com/joshwcomeau/react-flip-move](https://github.com/joshwcomeau/react-flip-move)

---

## 5. React-Tags
> React-tags is a simple tagging component ready to drop in your React projects. The component is inspired by GMail's To field in the compose window.

![img](https://github.com/prakhar1989/react-tags/raw/master/demo.gif)

#### github project url [https://github.com/prakhar1989/react-tags](https://github.com/prakhar1989/react-tags)

---

## 6. React Simple Chatbot
> A simple chatbot component to create conversation chats.

![img](https://cloud.githubusercontent.com/assets/1014326/25716667/2d4bb4c4-30d6-11e7-996e-30c8fb316361.gif)

#### github project url [https://github.com/LucasBassetti/react-simple-chatbot](https://github.com/LucasBassetti/react-simple-chatbot)
Factory Method Pattern
Tags: patterns, computerscience, oop
Published: 2020-04-04 03:33:01

# What is the Factory Method Pattern? 
Using a method to create a new instance of an object rather than using the new keyword to call the constructor directly. 
## Why would you do that?
This decouples the two classes by allowing the higher level class to change from creating an instance to requesting an instance of the lower level class. The advantage of decoupling the two classes by changing the nature of the relationship between the two of them. The higher level class no longer creates an instance of the lower level class. Instead this pattern means that the higher level class requests an instance of an interface..
This presents a number of advantages; 

* It allows for object pooling of the lower level class. Some objects may be expensive to create, consume a lot of memory, or may require that there are a limited set of them in existence. In these cases a pool of objects can be created and they can be passed out to consumers.
* It allows for the higher level class class to not know about what implementation of an interface or abstract class is provided. This allows for the consuming class to adhere to the Open Closed Principle by having functionality provided by the implementation. Meaning that the higher level class can differ the the decision about what approach to take until certain information is available rather than being forced to decide during it's instantiation. 
* Encapsulating object creation within a package allows the the higher level class to be ignorant of the creation details of the lower level class, minimising the size of the interface presented by a module.

## Where would you use it?
* Abstracting functionality to be decided on at runtime. 
* Object pooling to minimise the creation of and maximise the reuse of objects that are expensive to create or consume a lot of memory. 
* Implementing the singleton pattern.
* Creating a connection pool for constrained resources.
* Simplifying repeated object creation for tests. 

## What could go wrong?
* Code that is too flexible by abstracting away all of it's functionality can stop being single responsibility and no longer have a single reason to change. 
* Object pooling with non read only objects can lead to race conditions around multi threading and asynchronous programming models.
* Applications may have unexpected side effects if the lower level classes do not adhere to the Liskov Substitution Principle and have unexpected behaviour for the methods they're implementing.
JavaScript - Global variable
Tags: javascript
Published: 2020-04-04 03:31:31

Hi, in this episode I will talk about Global variable in JavaScript.

Let's write the next code:
```javascript
function print(text) {
 var helloWorld = text;
 console.log(helloWorld);
}

print('hello my aliens') // => hello my aliens
console.log(helloWorld) // => error: Uncaught ReferenceError: helloWorld is not defined
```
The program is going to print the variable **helloWorld** inside the function but outside the function it will break the code

If we want to have access to the variable **hellowWorld** outside the function **print** we need to remove the reserved word **var** and our code will look like this:
```javascript
function print(text) {
 helloWorld = text;
 console.log(helloWorld);
}

print('hello my aliens') // => hello my aliens
console.log(helloWorld) // => hello my aliens
```

And we will see two identical messages.

**But the big question is, WHY THIS HAPPENS?**
When JavaScript are compiling, and he found the word **helloWorld** without the reserved word **var**, it will put the variable **helloWorld** on top of the file because it thinks that you are going to use it below.

Your compiled code will look like this:
```javascript
var helloWorld;

function print(text) {
 helloWorld = text;
 console.log(helloWorld);
}

print('hello my aliens') // => hello my aliens
console.log(helloWorld) // => hello my aliens
```

This method of using the global variable will work but is not recommended. There are multiple ways to have a global variable, but the complexity of the code will determine which one is the correct one. Some example of these are `use a session store`, `create a function that return the value`, `enums`, or use `a dictionary`
ما أصله ؟
Published: 2020-04-04 02:23:23

خلافاَ للإعتقاد السائد فإن لوريم إيبسوم ليس نصاَ عشوائياً، بل إن له جذور في الأدب اللاتيني الكلاسيكي منذ العام 45 قبل الميلاد، مما يجعله أكثر من 2000 عام في القدم. قام البروفيسور "ريتشارد ماك لينتوك" (Richard McClintock) وهو بروفيسور اللغة اللاتينية في جامعة هامبدن-سيدني في فيرجينيا بالبحث عن أصول كلمة لاتينية غامضة في نص لوريم إيبسوم وهي "consectetur"، وخلال تتبعه لهذه الكلمة في الأدب اللاتيني اكتشف المصدر الغير قابل للشك. فلقد اتضح أن كلمات نص لوريم إيبسوم تأتي من الأقسام 1.10.32 و 1.10.33 من كتاب "حول أقاصي الخير والشر" 

(de Finibus Bonorum et Malorum) للمفكر شيشيرون (Cicero) والذي كتبه في عام 45 قبل الميلاد. هذا الكتاب هو بمثابة مقالة علمية مطولة في نظرية الأخلاق، وكان له شعبية كبيرة في عصر النهضة. السطر الأول من لوريم إيبسوم "Lorem ipsum dolor sit amet.." يأتي من سطر في القسم 1.20.32 من هذا الكتاب.

للمهتمين قمنا بوضع نص لوريم إبسوم القياسي والمُستخدم منذ القرن الخامس عشر في الأسفل. وتم أيضاً توفير الأقسام 1.10.32 و 1.10.33 من "حول أقاصي الخير والشر" (de Finibus Bonorum et Malorum) لمؤلفه شيشيرون (Cicero) بصيغها الأصلية، مرفقة بالنسخ الإنكليزية لها والتي قام بترجمتها هـ.راكهام (H. Rackham) في عام 1914.
Why Flutter Uses Dart
Published: 2020-04-04 02:15:43

Many linguists believe that the natural language a person speaks affects how they think. Does the same concept apply to computer languages? 

Programmers working in different kinds of programming languages often come up with radically different solutions to problems. As a more extreme example, computer scientists eliminated the goto statement to encourage more structured programs (not quite the same as totalitarian leaders in the novel 1984 expunging heretical words from natural language to eliminate thoughtcrimes, but you get the idea).

                 .   .   .   .   .   .   .    .   .  .   .
What does this have to do with Flutter and Dart? Quite a bit actually. The early Flutter team evaluated more than a dozen languages , and picked Dart because it matched the way they were building user interfaces.
PRISONERS learning to code. I spoke to a room full of prisoners to motivate them. Here is how that went.
Tags: codenewbie, beginners, career, webdev
Published: 2020-04-04 02:02:11

The passion could tear down the walls, The enthusiasm could lift the roof and the eager eyes ready to learn lifted from their computer screens. All eyes fell on me. I was in a room filled with prisoners... learning to code.

"The deck is stacked against you and there isn't a person around that wants you to succeed! I believe this is your new beginning, IT DOESN'T HAVE TO BE YOUR END! But You need to be so da*n good that they HAVE to need you! You need to be so good, that they have to pay attention to you. You need to be so good, that they have to ask someone 'Who is that? What is their name?' YOU NEED TO BE SO GOOD THAT THEY LEARN how to pronounce your name correctly. Be so good, that you... are undeniable."

No internet, lessons and work pre-prepared. The prisoners have nothing on their side for success except the amazing people that put on this program, their heart, their stamina and their sheer will NOT TO be denied. They are working hard, putting in the hours to produce a better version of themselves.

![Danny Thompson with the people that work with the state to do this program](https://dev-to-uploads.s3.amazonaws.com/i/g88i0xpbwsnaafeai2eg.png)
(Danny Thompson with the people that work with the state to do this program.)

I supported this program right away for a BIG reason. This is the situation of not giving a man a fish but teaching him to fish. You are giving an actual tool to these humans, to change the outcome of their lives. They are landing decent jobs when they get out which will deter them from wanting to return. They can freelance, they can pay their bills and not be swayed back into their old lifestyles!

Positive Impact Creates Positive Impact!

The reason why this program exists is there is factual proof that shows the recidivism rate for inmates that learns to code drops close to ZERO. Working with these inmates, I was able to see their drive to create change in their lives.

Now if these people can push themselves to get to the point of creating the change they want with ALL OF THE ODDS against them. Then shouldn't you be able to hit the goals you are going for?

"Why is it so hard to learn to code? Why can't I pick up code easily? Why is it so painful to learn how to program?! Why is this happening to me!?!" 

WHY NOT YOU! It should happen to all of us! The greatest pains have hardened all of us into who we currently are. Embrace the circumstance to reach the level you want to achieve!

If a prisoner can see the light at the end of the tunnel. If they can say "I will not go quietly into the night! I will not give up!" Then you can too! You are phenomenal beyond measure! It is time to act like it. Recognize how valuable you are, shock your mind and SHOW YOURSELF how amazing you are!

I am Danny Thompson and I can't wait to see how amazing you become.
You can find me on twitter @DThompsonDev

This last photo is with our meetup community GDG Memphis. 
![GDG Memphis community](https://dev-to-uploads.s3.amazonaws.com/i/6n95emmq0o9p807eehaw.png)
The Coffee Project: Sinatra knows this ditty
Tags: sinatra, ruby
Published: 2020-04-04 01:25:58

The Coffee Project is the app that serves as the grand finale to Module 2 of my Flatiron School program: Sinatra.

Sprinkled throughout the app are a few nods to the late, great Frank Sinatra, and its name is derived from one of his songs, "The Coffee Song."

As a barista and coffee lover, I took inspiration for this project from what I know well - day to day life in a coffee shop. The prompt required that the app functions as a Content Management System (CMS), and I decided to build an app that would track inventory for The Cafe Sinatra, a fictional small chain of coffee shops.

![A checklist of the project requirements](https://dev-to-uploads.s3.amazonaws.com/i/xwtwhzzj36i44ikx3pkz.png)

### Application Structure

The Coffee Project is an MVC (Model-View-Controller) Sinatra application. [Sinatra] (https://github.com/sinatra/sinatra) is a Domain-specific language for creating web applications with Ruby. When paired with the [Shotgun] (https://github.com/rtomayko/shotgun) gem, it's incredibly easy to view your app in browser with real-time changes.
 
#### Models

The Cafe Sinatra has multiple cafe locations, and each of those locations (Store model) has its own inventory of supplies (Item model) and employees (User model). Put in terms of Ruby model relationships:

1. A Store has_many items and users
2. A User belongs_to a Store and has_many Items
3. An Item belongs_to a Store and to (many) Users through their Store


### User Validations and CRUD Actions

CRUD = Create, Read, Update, Delete

Before a user is able to complete the signup process, the form is checked for completeness and the username they entered is checked against the database to ensure that it hasn't already been taken by way of the [validates_uniqueness_of] (https://apidock.com/rails/ActiveRecord/Validations/ClassMethods/validates_uniqueness_of) macro.

Each store has two types of users - employees and admins. The full inventory of an individual store is available for all of its users to view (read) and update when they are logged in, but only admins are able to create and delete items.

![An example of the Store Inventory page](https://dev-to-uploads.s3.amazonaws.com/i/9hbwuphqhcha86lkzn5z.png)

Building this app was quite a learning experience, and after all of the debugging, researching, route building, and testing, I'm proud to say Sinatra KNOWS this ditty!

Check out the repo here:

{% github TheCodingBarista/the-coffee-project %}
Placeholder title
Tags: twiliohackathon
Published: 2020-04-04 01:12:52

[Comment]: # (All of this is placeholder text. Use this format or any other format of your choosing to best describe your project.)

[Reminder]: # (Make sure you've submitted the Twilio CodeExchange agreement: https://ahoy.twilio.com/code-exchange-community)

[Important]: # (By making a submission, you agree to the competition's terms: https://www.twilio.com/legal/twilio-dev-hackathon-terms)


## What I built
I would be building a chatbot that helps detect if a person is infected with covid19

## Demo Link
 
Coming soon
## Link to Code

Coming soon
Problemas y Programas
Tags: spanish, español, principiante, fundamentos
Published: 2020-04-04 00:30:42

---
title: Problemas y Programas 
published: true
description: Introducción a la programación
tags: #spanish #español #principiante #fundamentos 
---

El mundo de la ciencia de computación constantemente busca resolver *problemas*, pero no debemos delimitar este término como si fuera alguna ecuación matemática, puesto que en la computación un **problema** es toda tarea que deba ser resuelta, cualquier tarea y de cualquier naturaleza, ya sea imprimir elementos de una lista, buscar el elemento máximo y mínimo en un conjunto de números o incluso calcular la masa del sol, todas son tareas que deben ser resueltas y que por supuesto, están ligadas al contexto que se esta trabajando.

Un problema puede verse como una operación matemática, es decir, como una función entre las entradas (*dominio -> X*) y las salidas (*rango -> Y*) del problema. Su definición no debería incluir el *“el cómo debería estar resuelto”*.
>*f (x) -> Y*

En donde *f* es una función o una operación que se aplica sobre los valores de *X* o los utiliza para obtener un resultado *Y*, resolviendo así el problema.

La función *f* muchas veces puede estar compuesta por un conjunto de acciones o una secuencia de pasos que resuelven el problema, esto es lo que llamamos un **algoritmo**. 
Un *algoritmo*, sería la implementación de dicha función matemática ( *f(x)* ). 

![Algoritmo](https://dev-to-uploads.s3.amazonaws.com/i/sikv5axr3jlqn4mmqivo.png)

Un algoritmo debe cumplir las siguientes características para ser considerado como tal:

* Debe ser **preciso**: Tiene que indicar el orden de ejecución de cada paso.
* Debe estar **definido**: Si se ejecuta un algoritmo dos veces, se debe obtener el mismo resultado cada vez.
* Debe ser **finito**: El algoritmo se debe terminar en algún momento; o sea, debe tener un número finito de pasos.
* Debe ser **legible**: El texto que lo describe debe ser claro, tal que permita entenderlo y leerlo fácilmente.
+ Debe estar **completo**: Compuesto por tres partes: Entrada, Proceso y Salida.

Por último, un **programa** es una instancia de un algoritmo en algún lenguaje de programación, es un archivo ejecutable que recibe ciertos parámetros de entrada (*dominio -> x*), realiza alguna función sobre ellos (*ejecuta un algoritmo*) y se obtiene un resultado (*rango -> y*).

Para lograr resolver correctamente cualquier problema se recomienda seguir los siguientes pasos:
* Análisis del problema
* Diseño del programa/algoritmo
* Codificación del programa/algoritmo)

![Lista de Tareas](https://dev-to-uploads.s3.amazonaws.com/i/pqzf14op0gd62gmvos1n.jpg)

#### Referencias:
- Shaffer, Clifford A. (2010). *A Practical Introduction to Data Structures and Algorithm.  (3rd ed. Java Version).*
Never Inline Hack Java
Tags: java, performance
Published: 2020-04-03 23:50:59

As of occasion you may need to ensure some Java code is never inlined when debugging performance problems.

The following hack works around this by abusing a special exception for the Throwable constructor.

static <T> T dontinline(Supplier<T> supplier) {
    return (T) new Throwable() {
       Object sneak = supplier.get();
    }.sneak;
}
Exercism Ruby - Acronym
Tags: exercism, ruby
Published: 2020-04-03 23:21:58


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

Convert a phrase to its acronym.

Techies love their TLA (Three Letter Acronyms)!

Help generate some jargon by writing a program that converts a long name like Portable Network Graphics to its acronym (PNG).

Test suite

```ruby
require 'minitest/autorun'
require_relative 'acronym'

# Common test data version: 1.7.0 cacf1f1
class AcronymTest < Minitest::Test
  def test_basic
    assert_equal "PNG", Acronym.abbreviate('Portable Network Graphics')
  end

  def test_lowercase_words
    assert_equal "ROR", Acronym.abbreviate('Ruby on Rails')
  end

  def test_punctuation
    assert_equal "FIFO", Acronym.abbreviate('First In, First Out')
  end

  def test_all_caps_word
    assert_equal "GIMP", Acronym.abbreviate('GNU Image Manipulation Program')
  end

  def test_punctuation_without_whitespace
    assert_equal "CMOS", Acronym.abbreviate('Complementary metal-oxide semiconductor')
  end

  def test_very_long_abbreviation
    assert_equal "ROTFLSHTMDCOALM", Acronym.abbreviate('Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me')
  end

  def test_consecutive_delimiters
    assert_equal "SIMUFTA", Acronym.abbreviate('Something - I made up from thin air')
  end
end
```

My answer was:

```ruby
class Acronym
  def self.abbreviate(phrase)
    phrase.split("-").join(" ").split.map(&:chr).join.upcase
  end
end
```
**I saw other important answers like those:**
* I don't like the scan content because it is hard to understand but it's a short answer.
* I didn't know the `tr` method, it replace the first param with the secound param 🤘

```ruby
class Acronym
  def self.abbreviate(string)
    string.scan(/(\b\w)/).join.upcase
  end
end

class Acronym
  def self.abbreviate(name)
    name.tr('-', ' ')
        .split
        .map { |x| x.slice(0) }.join.upcase
  end
end
```

This was fun!
gistify
Published: 2020-04-03 23:08:47

i check for latest news and gist from http://afrigistbase.com/
https://afrigistbase.com/category/https-afrigistbase-com-entertainment-news/
https://afrigistbase.com/category/https-afrigistbase-com-entertainment-news/https-afrigistbase-com-celebrity-gist/
Debugging native library dependencies on Linux
Tags: csharp, dotnet, native, linux
Published: 2020-04-03 23:07:38

---
title: Debugging native library dependencies on Linux
published: true
description: .NET Core apps can run on a number of operating systems. When using purely .NET libraries, deployment is a breeze. However, if you're using a library that wraps a native (C/C++) library, then you might come across native library dependency problems.
tags: csharp, dotnet, native, linux
canonical_url: https://mazeez.dev/posts/debugging-native-library-dependencies-linux
---

.NET Core apps can run on a number of operating systems. When using purely .NET libraries, deployment is a breeze. However, if you're using a library that wraps a native (C/C++) library, then you might have come across this error message when trying to run your app on Linux:

```
System.TypeInitializationException: The type initializer for 'DlibDotNet.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'DlibDotNetNativeDnn' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libDlibDotNetNativeDnn: cannot open shared object file: No such file or directory
```

This tells us that either `libDlibDotNetNativeDnn.so` doesn't exist (which in my case it did), or it has some other native dependencies that are missing. 

To see which dependencies are missing, you use `ldd`:

```
ldd libDlibDotNetNativeDnn.so
```

And it would give you an output like this:

```
linux-vdso.so.1 (0x00007ffdb9fe1000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f06b2254000)
libopenblas.so.0 => not found
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f06b2072000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f06b1f24000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f06b1f0a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f06b1d1d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f06b490d000)
```

Now it's clear that `libopenblas` is missing from the system. Search for it on google and find the package that contains the library. In `libopenblas`'s case, it happens to be in the `libopenblas-base` . To install it on ubuntu, you can run:

```
sudo apt-get install libopenblas-base
```

Tada 🎉 and now your app (hopefully) works as expected!

This little error wasted several hours from me. I am grateful to the people who maintain these native library wrappers and hide (most of) the ugliness from us.