teleren/devto huggingface dataset:
Figura ¿Quién quiere ser Millonario?
Tags: codepen
Published: 2020-05-23 05:49:42

<p>Botones de que «quién quiere ser millonario». Se hizo en respuesta a una pregunta surgida en Stack Overflow.</p>

<p>La pregunta la pueden ubicar en:
<a href="https://es.stackoverflow.com/questions/347748/transformaci%c3%b3n-de-button-o-input-de-forma-din%c3%a1mica?noredirect=1#comment628139_347748" target="_blank">https://es.stackoverflow.com/questions/347748/transformaci%c3%b3n-de-button-o-input-de-forma-din%c3%a1mica?noredirect=1#comment628139_347748</a></p>

{% codepen https://codepen.io/dlunamontilla/pen/QWjKxyx %}
Vanilla JavaScript Number toLocaleString
Tags: javascript
Published: 2020-05-23 05:26:29

Yesterday we saw [how to get a month's name](https://daily-dev-tips.com/posts/vanilla-javascript-get-month-name/) using the `toLocalString` function. This made me wonder what else it could be used for, and as it turns out, we can use it for `Numbers` as well!

## JavaScript Number toLocaleString function

The syntax for this method is the same as we saw yesterday in converting a date object.

```js
number.toLocaleString('locale', {options});
```

In the most default way, we don't have to pass any arguments, and we will get the browser's default.

```js
var number = 123456.789;

console.log(number.toLocaleString());
// 123,456.789
```

### Number.toLocaleString locales

To use different locales we can pass along the locale parameters as such:

```js
console.log(number.toLocaleString('nl-NL'));
// 123.456,789
console.log(number.toLocaleString('en-US'));
// 123,456.789
console.log(number.toLocaleString('en-IN'));
// 1,23,456.789
```

### Number.toLocaleString options

This method has a lot of available options, let's say we want to convert to a local currency format.

```js
console.log(number.toLocaleString('nl-NL', {style: 'currency', currency: 'EUR'}));
// € 123.456,79
console.log(number.toLocaleString('en-US', {style: 'currency', currency: 'USD'}));
// $123,456.79
console.log(number.toLocaleString('en-IN', {style: 'currency', currency: 'INR'}));
// ₹1,23,456.79
```

Awesome right!

Other styles we can use are:

- decimal
- percent
- unit (Find all [units here](https://github.com/unicode-org/cldr/blob/master/common/validity/unit.xml))

View this method on Codepen.

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="js,result" data-user="rebelchris" data-slug-hash="qBOgNKx" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Vanilla JavaScript Number toLocaleString">
  <span>See the Pen <a href="https://codepen.io/rebelchris/pen/qBOgNKx">
  Vanilla JavaScript Number toLocaleString</a> by Chris Bongers (<a href="https://codepen.io/rebelchris">@rebelchris</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

## Browser Support

This is a widely supported method, feel free to use it.

[View on CanIUse](https://caniuse.com/#feat=mdn-javascript_builtins_number_tolocalestring)

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
@Bean and @Component. What is the different? Which one should use be used?
Tags: java, spring, annotation
Published: 2020-05-23 05:24:06

The most benefit of using a framework like Spring is auto-configuration. By only introducing the library or the module to the classpath, Spring could automatically scan it and create the necessary object and `@Autowrired` it.

`@Component` is an annotation that annotates a *class*. It tells Spring to use this class to create a bean if there is somewhere else depend on this class. The creation of the class is totally controlled by Spring. And only one bean created per class. 

```java
@Component
class UserService {
	public void updateUser(User user) {
	…
	}
}

@Controller
class UserController {
	private final UserService userService;
	
	@Autowired
	public UserController(UserService userService) {
		this.userService = userService;
	}
}
```

In this example, Spring will recognize the appearance of the `UserSerivc`e class because it was marked with `@Component` annotation. So when it tries to initiate the `UserController` object, it knows that it needs a `UserService` to put to `UserController` constructor. And the creation of the `UserService` will be controlled totally by Spring. It is a pretty declarative way to define dependency.

With `@Component` our life is so good. So why do we even need something like `@Bean` annotation? When should we use it? First, `@Bean` is an annotation that used for annotating the function (not a class) that will return an object of a class that will be registered as a bean object by Spring. 

You could use it in case you are using a third-party library when you don’t have access to the source code of the library. So you can’t just put `@Component` annotation of the class that you to create a bean.
You can combine with the `@Configuration` annotated the class that contains the method return the beans or otherwise Spring won’t catch and register it as a bean for your dependency resolution.
Let’s consider this example.

```java
class UserService {
	private final PasswordEncoder encoder;

	@Autowired
	public UserService(PasswordEncoder encoder) { 	
            this.encoder = encoder;
	}

	public String createUser(UserCreateReq req) {
		UserEntity user = UserEntity.builder()
							.setPassword(this.encoder.encode(req.getPassword()))
							…
							.build();
		repo.save(user);
	}
} 

@Configuration
class PasswordEncoderConfiguration {
	@Bean
	public PasswordEncoder bCryptPasswordEncoder() {
		return new BCryptPasswordEncoder();
	}
}
```

In this example, I couldn’t change the code base of the bcrypt library so to create the encoder object. I have to use a `@Configuration` class to create the bean that I need in a method inside that `@Configuration` class. In this way, we could create as many as you want bean objects. And you have to explicitly configure those bean by yourself when the conflict happens. One way to resolve that conflict is by using the `@Qualifier` annotation in the constructor of the dependent class.

That's all. Happy coding.
ExpressJS for Deno
Tags: deno, javascript, typescript, express
Published: 2020-05-23 04:36:49

Excited to say that I've been working on a fast, minimalist web framework for [Deno](https://deno.land/) ported from [ExpressJS](https://github.com/expressjs/express) called [Opine](https://github.com/asos-craigmorten/opine)!

```ts
import opine from "https://deno.land/x/opine@0.21.2/mod.ts";

const app = opine();

app.use((req, res) => {
  res.send("Hello World");
});

app.listen(3000);
```

There are quite a few web frameworks out there already for Deno, such as [Oak](https://github.com/oakserver/oak/) which is based on [koa](https://koajs.com/), but none that attempt to mirror the internals and API of ExpressJS that we know and love.

Opine attempts to solve this by completely porting ExpressJS over to TypeScript in Deno, making changes only where the Deno APIs dramatically differ from Node.

## Installation

Opine is a [Deno](https://deno.land/) module available to import direct from this repo and via the [Deno Registry](https://deno.land/x).

Before importing, [download and install Deno](https://deno.land/#installation).

You can then import Opine straight into your project:

```ts
import opine from "https://deno.land/x/opine@0.21.2/mod.ts";
```

## Features

- Robust routing
- Focus on high performance
- HTTP helpers

And more to come as we achieve feature parity with [ExpressJS](https://github.com/expressjs/express).

## Philosophy

The Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.

Opine will aim to achieve these same great goals, focusing first on developing robust tooling and features before moving onto accelerating performance and becoming super lightweight.

## Examples

Opine comes with a few useful examples to get you started. To view the examples, clone the Opine repo:

```bash
git clone git://github.com/asos-craigmorten/opine.git --depth 1
cd opine
```

Then just run whichever example you want:

```bash
deno --allow-net --allow-read ./example/hello-world/index.ts
```

## More!

Want to know more? Head over to the [Opine GitHub](https://github.com/asos-craigmorten/opine) page for full details, or check out one of the available doc resources:

- [Opine Documentation](https://github.com/asos-craigmorten/opine/blob/master/.github/API/api.md)

Just a quick read today - stay tuned for further updates and some more posts on how you can use Opine and guides on how to convert your existing ExpressJS apps from Node to Opine apps on Deno!

Want to help, found a bug, or have a suggestion? Please reach out by commenting below or raising issues / PR on the repo!

_See also:_ [Opine Tutorial Part 1: Express For Deno](https://dev.to/craigmorten/opine-tutorial-part-1-express-for-deno-5nb)
First look at C++
Tags: cpp, python
Published: 2020-05-23 04:25:22

Hello people! 
I want to tell you about my beginnings in C ++.
Attention spoiler (I really liked this programming language) I'll start with the fact that two days ago I started practicing C ++.
From my past blog you can understand that I used to work only on python, but to learn I need skills in plus plus.
I liked that the programming language does not allow errors and the syntax is not very clear to me, but I hope that I have everything ahead.
In my blogs I will talk about my success in programming.

I had to download: Visual Studio
Visual Studio 2019, working with it is very simple and clear.
But I'm still a beginner :)

If you are interested in where I get the material in the program 'Stepiс'
And on the video on YouTube.


                                                        by Chorrny Inc
Linux Capacity Planning Part -1 
Tags: linux, capacity
Published: 2020-05-23 03:16:04

---
title: Linux Capacity Planning Part -1 
published: true
description: This is a series of post which will increase the knowledge base to analyze historical data and plan for increased resources to meet your future need.
tags: Linux, capacity.
series: Linux Capacity Planning
---


This is going to be a series of blog post which will in introduce you with knowledge and tools necessary to analyze the historical data and plan for the increased resource to meet your future need as well as able to identify the resource bottleneck in your host machine. 

We would be considering the **Amazon Linux 2** as Linux operating system. 

In this part, we will first look at a few important considerations which we should look during the planning. 

- when you discuss the capacity, in reality, you are initiating a discussion about the performance. Capacity and Performance always go hand in hand.
- When we discuss performance we are trying to discuss the performance of an application on the system. 
- You have to measure and monitor performance to do any sort of capacity planning.

Below are the few important parameters which determine the capacity of your system and impact performance of your application. 

- CPU 
- RAM 
- IOPS (disk read and write)
- list of open files 
- Network transfer rate

One of the tools which can help us in measuring these parameters in present in package name as sysstat.
The above package come by default installed on **Amazon Linux 2** AMI. 
The distro on which it is not installed you can install it by running below commands. 

Command to install on different Distros:

**On RedHat / CentOS / Fedora**
```yum install sysstat```
**On Debian / Ubuntu / Linux Mint**
```apt-get install sysstat```
Once you have started the EC2 instance you can go and check if the sysstat service is active.
```
[root@ip-10-25-57-107 ec2-user]# service sysstat status
Redirecting to /bin/systemctl status sysstat.service
● sysstat.service - Resets System Activity Logs
   Loaded: loaded (/usr/lib/systemd/system/sysstat.service; enabled; vendor preset: enabled)
   Active: active (exited) since Sat 2020-05-23 02:21:42 UTC; 3min 34s ago
  Process: 2690 ExecStart=/usr/lib64/sa/sa1 --boot (code=exited, status=0/SUCCESS)
 Main PID: 2690 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/sysstat.service

May 23 02:21:41 localhost systemd[1]: Starting Resets System Activity Logs...
May 23 02:21:42 localhost systemd[1]: Started Resets System Activity Logs.
```
In next post, we will look into various utilities provided under sysstat package.
Coronavirus Probability Checker
Tags: octograd2020, githubsdp, github
Published: 2020-05-23 03:14:53

# Coronavirus Probability Checker

# Short Brief

* It is a Probability Checker for COVID-19 , people can input values and symptoms and according to the data , patient will get the probability of +ve COVID-19.

* Currently , I trained this on Random data.

* If we execute this idea with official Data , it can be very helpful for Peoples.


## Problem Statement


* India has a high population country and hence it is not possible to check everyone for the SARS-CoV-2 virus which is the cause of the corona virus outbreak.
* Everyone who is living in this country is affected due to the high population as there not enough facilities for each person
* The spread of false news is causing the people to worry. By the use of self evaluation for themselves and their family members they can take the decision to inform the authorities and ask for help.
* If someone enters false details then that would result in a small error in the assessment of the outbreak.

## The Technology/Product Concept

The developed hack is End user input based Web application. It takes the input from the user for their details and shows a list of symptoms which they may be experiencing and can confuse with Covid-19. On the basis of their entered choices the received input will be processed and their probability will be shown to them. If the probably is severe or high than the person is prompted to consult a doctor. His input will be stored in the system for Machine Learning. On the basis of this the priority of the tests can be done so as to reduce the transmission of the disease and also to make the most of limited testing capacity in such highly populated country such as India.
A Machine Learning Model is then trained on the data to find out the probability of a person  having the infection.
The Model is then used to find out whom to test for the infection first under a limited testing capacity.
The Same Model can be used to find potential candidates for conducting random tests.

## Benefits From this


There is a situation of fear among the people and spread of fake news is further making the situation worse. This Hack can be used to control this fear by self assessment of the user and their family. Also, if the prediction comes severe the authorities will be informed and this will be used to control the COVID-19 Pandemic up to a very large extent.

## Instructions to run this model on your local machine : 
* first run myTraining.py 
* run main.py , through main.py you will get a localhost link and get redirected to your browser.






![idea](https://i.pinimg.com/originals/41/ec/16/41ec16d5d73ea5be85807ebf7b4fe66d.png)

 

## Link to Code : https://github.com/Siddhant-K-code/Coronavirus-Probability-Checker
Recoil, A new state Management library from Facebook for React
Published: 2020-05-23 03:08:07


![Recoil, A new state Management library from Facebook for React](https://i0.wp.com/blogreact.com/wp-content/uploads/2020/05/image-6.png?fit=750%2C150&ssl=1)

State management is always the biggest concern for any developer specially in case of global state management. Recently, our beloved Facebook have launched a new state management library called Recoil. In this article we gonna see what features this new Library is offering.

## What is Recoil ?

Recoil is a new state management library recently released by Facebook. Recoil is created by the same Creator who created the React. So, internally Recoil works as the same way as React works. Its fast and flexible shared state.

This new library specially designed to work with Pure functions. It also have few features similar to Redux like undo operation, time-travel debugging, routing etc.

## How to use Recoil ?

First of all we need to install Recoil like any other package.

```
npm install recoil --save
```

Our Recoil library uses 5 different functions to perform state managment.

**RecoilRoot**

To use the Recoil state in the project first of all we need to wrap our app using this RecoilRoot Component.

```
import React from 'react';
import {
  RecoilRoot,
} from 'recoil';

function App() {
  return (
    <RecoilRoot>
      <CharacterCounter />
    </RecoilRoot>
  );
}
```

**Atom**

The term atom represents a piece of state. Any component can read atom and also can update them. Once the value of an atom changes subscribed components will re render.

```
import {
 atom
} from 'recoil';

const textState = atom({
  key: 'textState', // unique ID (with respect to other atoms/selectors)
  default: '', // default value (aka initial value)
});
```

**useRecoilState**

As the name suggest to use Recoil state we need to use useRecoilState function similar to useState.

```
import {
 useRecoilState
} from 'recoil';

function TextInput() {
  const [text, setText] = useRecoilState(textState);

  const onChange = (event) => {
    setText(event.target.value);
  };

  return (
    <div>
      <input type="text" value={text} onChange={onChange} />
      <br />
      Echo: {text}
    </div>
  );
}
```

**Selector**

A selector represents a piece of derived state. Here derived state means modification of a state by a normal function.

```
import {
 selector
} from 'recoil';

const charCountState = selector({
  key: 'charCountState', // unique ID (with respect to other atoms/selectors)
  get: ({get}) => {
    const text = get(textState);

    return text.length;
  },
});
```

**useRecoilValue**

To read the value of a selector we need to use useRecoilValue.

```
function CharacterCount() {
  const count = useRecoilValue(charCountState);

  return <>Character Count: {count}</>;
}
```

**[Demo](https://recoiljs.org/docs/introduction/getting-started#demo)**

[How to manage global state using React Tracked](https://blogreact.com/react-tracked/)
#1 - Hello World
Tags: javascript, html, css, react
Published: 2020-05-23 02:40:59

This is my first post on dev.to, how are you doing?

Well, I'm Ebraim Carvalho, from Brazil, 28 years old and Front-End Developer. I switch my career last year when I moved from Business Administration to Web Development.

In the past 14 months, HTML, CSS, Javascript, and more subjects around web development are part of my quotidian. Every day, I study between 5 and 7 hours, from Sunday to Sunday looking to my goals!

One of the goals is living and working as a Developer in Europe or remotely, and I will need to know English. So, to improve my English and share my knowledge about IT and to learn more effectively, I decided to write about Front-End development, what I am studying,  my questions and etc... in English!

You are welcome!
DEV + GitHub Graduation
Tags: devgrad2020, octograd2020
Published: 2020-05-23 02:04:24

## My Final Project
Webuy is an E-commerce site

## Demo Link
https://webuy-frontend.herokuapp.com/

## Link to Code
{% github https://github.com/jolouie7/webuy-frontend %}
{% github https://github.com/jolouie7/webuy-backend %}

[Note]: # (Our markdown editor supports pretty embeds. If you're sharing a GitHub repo, try this syntax: `{% github link_to_your_repo %}`)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
Stack: Ruby on Rails, PostgreSQL, React, Redux
- Building the shopping cart was pretty challenging because I had to temporarily store items somewhere. Perfecting authentication and authorization was hard as well.


## Additional Thoughts / Feelings / Stories
Thank you for reading my post!
BitTorrent
Tags: go, bittorrent
Published: 2020-05-23 01:54:44

[Comment]: This is a personal project I have been doing since March. The project is to use Go to implement a BitTorrent client that downloads and distributes files across the Internet. I followed a blog post to build the client from scratch and I have really liked the progress so far. I learned a lot about both Golang and the BitTorrent protocol, which is a very popular peer-to-peer protocol for file distribution over the Internet. 

[Note]: The original idea and implementation of this project is from another [post](https://blog.jse.li/posts/torrent/). I started this project for the purpose of learning Golang and BitTorrent. 

## My Final Project
(Since the project is still under development, I will post a sample demo here) 
[![asciicast](https://asciinema.org/a/xqRSB0Jec8RN91Zt89rbb9PcL.svg)](https://asciinema.org/a/xqRSB0Jec8RN91Zt89rbb9PcL)

## Link to Code
[Github Repo](https://github.com/syuan16/BitTorrent)

## How I built it (what's the stack? did I run into issues or discover something new along the way?)
I used Golang. The concurrency channel of Golang makes it really easy to manage different peers in a single BitTorrent client program. 

## Additional Thoughts / Feelings / Stories
The project is still under development and will see constant commits. Please let me know what you think about the project!
How do you improve ticket estimation?
Tags: discuss
Published: 2020-05-23 01:35:28

---
title: How do you improve ticket estimation?
published: true
description: About ticket estimation
tags: #discussion
---
Hello, as your role being a team lead or a tech lead, some of your tasks are to estimate the features, then its tickets. How do you do it reliably and confidently? what steps you follow?
Is programming an art?
Tags: discuss
Published: 2020-05-23 01:18:15

I asked this question a while ago on some forums out there in the internet, but no programmers answered. The only answers I got were from people who did not ever experience programming at all.

Some people told me that programming is merely the human response to the necessity of algorithms, and not an emotional or expressive thing.
Others said to me that it is not art because it does not stimulate our senses.
Other people even told me that programming does not give a sensitive POV of the world, and thus it is not an art.
On the other hand, there were people who defended that programming is an art as far as the programmer is an artist.

So, let us get to it. **DEV**elopers out there, do you think programming is an art? Why?
App web form
Published: 2020-05-23 01:10:58

Hello
  I am working in a personal project. It is consist in a form which people sign up with personals details, but I need help in validation of two points.
For mobile number and phone, I need implement a  structure. I am having problem to define it, and making a css style to print just name and DNI... it has work with javascript.  This is the link

https://codepen.io/juliana-gonzalez-the-encoder/pen/rNORxgK

Someone, could help me?