teleren/devto huggingface dataset:
Reinforcement Learning
Published: 2021-08-29 20:04:13

Reinforcement learning is an important type of Machine Learning where an agent learn how to behave in a environment by performing actions and seeing the results. Reinforcement learning is about taking suitable action to maximize reward in a particular situation. 

It is employed by various software and machines to find the best possible behavior or path it should take in a specific situation. Reinforcement learning differs from the supervised learning in a way that in supervised learning the training data has the answer key with it so the model is trained with the correct answer itself whereas in reinforcement learning, there is no answer but the reinforcement agent decides what to do to perform the given task. In the absence of training dataset, it is bound to learn from its experience.

Components:

Agent - the entity exhibiting certain behaviors (actions) based on its environment.

Actions - what the agent chooses to do at certain places in the environment. Actions can be discrete or continuous.

States - has to do with where in the environment the agent resides (at a specific location) or with what is going on in the environment (for a robotic vacuum, perhaps that its current location is also clean). By taking actions, the agent moves from one state to a new state. States can be partial or absolute.

Discount factor - determines the extent to which future rewards should contribute to the overall sum of expected rewards. At a factor of zero, this means agent would only care about the very next action and its reward. With a factor of one, it pays attention to future rewards as well.

Policy - this determines what action the agent takes given a particular state. Policies are split between stochastic and deterministic policies. Note that policy functions are often denoted by the symbol π.

   i) Stochastic - determines a probability for choosing a given action in a particular state (e.g. an 80% chance to go straight, 20% chance to turn left)
  ii) Deterministic - directly maps actions to states.

Value Function - Value functions indicate which actions you should take to maximize rewards over the long-term (the expected rewards when starting from some given state). These are often represented with the capital letter V.
Deleting duplicate value at the same column in table of sql
Tags: sql
Published: 2021-08-31 04:52:31

Sometime, the table has duplicate value as string, number or etc,... And we want to clean that data. But the data is dynamic so we can not hard code for all case of table.

> **fruits** table

| id  | name |
| --- | ---------- |
| 1   | Orange 🍊  |
| 2   | Apple 🍎    |
| 3   | Orange 🍊    |
| 4   | Pineapple🍍    |

In this case, we got have a simple sql like that:

```sql
DELETE
  FROM fruits a
 USING fruits b
 WHERE a.id > b.id
   AND a.name = b.name;
```

> Result after excute query

| id  | name |
| --- | ---------- |
| 1   | Orange 🍊  |
| 2   | Apple 🍎    |
| 4   | Pineapple🍍    |

> If several columns have the same names but the datatypes do not match, the NATURAL JOIN clause can be modified with the USING clause to specify the columns that should be used for an EQUIJOIN.

[Find out **USING** in this article](https://www.geeksforgeeks.org/sql-using-clause/)

Enjoy your time 🪴
Thanks for reading.

<a href="https://www.buymeacoffee.com/hte305" target="_blank">
![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ddtyyk0zuud3h7o0sjpq.png)
</a>
Some memes that only developers will relate to
Tags: codenewbie, memes, relatable
Published: 2021-08-31 04:13:55

Being a developer is a gift.
It teaches you how to think.
It teaches you to be resilient when searching for days to fix a bug or make things work.

>“Everybody should learn to program a computer, because it teaches you how to think” — Steve Jobs

#1- The Linux lovers:

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

#2- For observers:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ynpeya4ke1o06f0o61oe.png)
 
#3- For starting developers:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ohcf5aamkxxzf9e8yke2.png)
 
#4- For smart devs:

 ![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4omti722k0d8hj7qmp5.png)
 
#5- For developer teams:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lktlimu8el83pd363wgu.png)
 
#6- For developers life:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbta115hfmh4jpc2r75x.png)
 
  
#7- For the production team:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wtsnxz93t5noltb4zp5f.png)
 
#8- For developers & managers relationship:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v45ida6q9ofuga95z8kb.png)
 
#9- For developers experience:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ie80g8dfk979zbsigwvj.png)
 
#10- For developers experience:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdeqet52mjwqs1yncz0w.png)
 
#11- For beginner intern developers
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qcrhginkjug2x8lusrth.png)
 
#12- For HTML developers
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zp7vxtgnlczthk02e51o.png)
 
#13- For developers life with managers
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/95k6mhaejf8zebny9k1x.png)
 
#14- For developers life with Git
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mz3zy4ycafywhrmqv77s.png)
 
#15- For debugging
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4651abtly8p559civ5a.png)
 
#16- For pair programmers

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fv1ppo12yj23sla739z.png)
Making Decisions
Published: 2021-08-31 04:03:40

---
canonical_url: https://www.wilbertom.com/posts/making-decisions/
---
Making decisions can be difficult; here are my models for making them.

## Scorecards

Imagine you need to choose between different vendors for an Anti-Virus. 
Looking at alternative vendor websites makes it hard to compare solutions. It's easy to make a choice that doesn't satisfy all the requirements. Having
a scorecard that compares all the solutions makes it easier and reduces mistakes.

| Criteria         | AV X        | AV Y        |
| ---------------- | ----------- | ----------- |
| Windows 8        | ✓           | ✓           |
| Windows 10       | ✓           | ✓           |
| Patch Management | ✓           | ✗           |
| Monthly Cost     | 10          | 2           |


Scorecards are a tool I first learned about from a recruiting book and have repurposed for engineering.

## Radar charts

[Radar Charts](https://en.wikipedia.org/wiki/Radar_chart) are a great way to compare the
attributes of different solutions. As software engineers, we need to remind ourselves that there are no
silver bullets. Radar charts make this obvious.

For example, imagine you need to choose between different software architectures. Their "ilities" should be considered—scalability, observability, changeability, reversibility, and so on.

List the "ilities" that are important to you and graph them
for each alternative.

## Costs for being wrong

Keep in mind the cost (usually money and time), risk, long-term consequences, and reversibility of the decision.

If these aren't severe and you are OK with the consequences, **don't waste time making the decision**.
Just make it and move on.

I've seen too many people anguish over choices that they could have made in a few minutes.
Blue Ocean
Published: 2021-08-31 04:00:35

We're now deep into the Blue Ocean.

My assignment was the logo, and as I write over the last couple of posts, that's pretty much tied up now.

I joined our group today unsure of what was coming next for me. It was a little unsettling feeling so detached from the rest of the group. From my perspective, I was working on a pretty siloed part of the project (svgs and animations) while my teammates were working on parts of the project that were more inter-related.

I felt like I was floating. I spent some time asking around and getting a sense of what others were up to and where I could contribute. It's a tough question -- and kind of weird. I'm a big believe that sometimes there are just too many cooks in the kitchen. Two people doing the work of one can be less efficient than just the one. I've also come to appreciate that that's not always the case. But I want to avoid a situation where just getting up to speed on some part of the project impedes that work.

Well, I started think about the extras. I have a strong team of solid communicators. They're getting things squared away _ I trust that. So what are some of our stretch goals?

It was a good lead and it ultimately led me to my new assignment: displaying the search results in an embedded google map. It's one of our client's asks and our team has the bandwidth for it. And it's great practice for me - working out of a teammates code and integrating a third-party API.
useReducer and useContext 
Tags: react, javascript, functional, codenewbie
Published: 2021-08-31 03:40:18

They are cool tools in a way that you realize useState and useEffect are cool but not to the degree that useReducer and useContext simplify your codes in cleaner fashion. 
I guess cool things about React in general is that once you learn new topic, you don't have to go back much to basics because every new concept is designed such that you can make sense of it intuitively and you can start from the point you learned it, without going back too much to basics. 

useReducer and useContext are such tools that make me think 'Oh, I didn't have to use previous hooks (i.e. useState) that much if I could use useReducer!' but sort of appreciate learning useState at the same time because I can make analogies to useState when learning useReducer. Learning useState definitely helped me in understanding useReducer so I could learn useReducer faster.

### How it can be confusing and how I have dissected useReducer

First of all, useReducer consists of four words
```javascript
const [state, dispatch] = useReducer(reducer, initialState)
```

Now, notice the similarity to useState hook
```javascript
const [state, setState] = useState(initialState)
```

The only difference is it has weird things like 'dispatch' and 'reducer'

To simplify and help understand the concept intuitively, my way of devising their terms are as follows:

dispatch is almost same as setState
reducer is a function that describes action and takes setState as argument to change the state
Installing open-wc on MacOS
Published: 2021-08-31 03:16:42

Download Node.js (https://nodejs.org/en/) and when the download is done click through the agreements/ permissions.  To make sure that it is all installed correctly type the commands node -v and npm -v in the terminal to see if the version numbers are returned.

Yarn (https://yarnpkg.com/)
Since you just installed npm open a new terminal and type npm install –global yarn.  Because of permission and access errors on your device you may have to type sudo npm install –global yarn to override this.

Open-wc boilerplate
Create a folder where you want the project to be saved.  Open up the terminal and locate the folder with command cd <director>/<folder name>.  Next type npm init @open-wc and select “Scaffold a new project,” “Web Component,” “Linting,” “Testing,” and “Demoing.”  Select No for Typescript. Next name it hello-world in all lowercase, then select yes to write the files to your hard drive.  Then select yes with yarn.  It will display “You’re all set up” in the terminal if it is set up correctly.  In order to run it type the command cd hello-world and npm run start.
JavaScript for Dummies
Tags: javascript, beginners, whattolearnfirst, vscode
Published: 2021-08-31 03:13:07

Do you feel like you can’t get the hang of JavaScript?

Like you get it but you don’t get it, all at the same time. 

like if you see a piece of code you understand, but when its just you and your code editer, you have one of these feelings. 🤷‍♂️ 

I understand your pain! And we are here together. We will begin with some terminology and basic code to start getting the hang of JavaScript, or JS for short (we like to call our selfs lazy. . . FYI) and build out our skill little steps at a time.

 
##What is Javascript?

Lets start here! we arent going to talk about how some person started the language in 1995 or how in 2012 JS was supported by all the browsers.

       -- what is a browser? -- 
      A browser is the website page you are on now. Its the 
      users(You are the user) web pages he/she interacts with.

JS renders web browsers to you, the user, but in a cool and dynamic way so when you are pressing buttons to interact with the web pages it does exactly that when you are asking it to do so.

{% codepen https://codepen.io/danielcampo1/pen/LYLGmNz %}
JAVASCRIPT IN A NUTSHELL!

##What is to come?!

We will makes this a little series, to consume in short doses to keep you wanting more.


 Next time we will learn about:  
* values and variables
* something called, Data Types
* and, Basic operators
Getting Started with WPF Diagram Control
Tags: csharp, dotnet, diagram, wpf
Published: 2021-08-31 03:12:05

Learn how to create a [diagram](https://www.syncfusion.com/wpf-controls/diagram) builder app in WPF. This video explains how to add the Diagram Ribbon and add a Diagram control to a WPF project. It also explains how to add Stencil and add shapes to the Diagram. Finally, you will see how to change the theme for the Syncfusion controls.

[WPF Diagram](https://www.syncfusion.com/wpf-controls/diagram) - Powerful and Feature-rich Control

- Automatic layout algorithm for org chart, hierarchical trees, radial trees and flowcharts.
- A flowchart maker, BPMN editor, floor planner app, and visualization of a diagram with an external data source are easy.
- Seamless interaction and editing capabilities

{% youtube 6_nME39Gfm0 %}
Create, Insert, Retrieve Data in SQL
Tags: beginners, learning, sql, database
Published: 2021-08-31 02:37:13

## Create table

We often use table in relational database to make models and predictions, create dashboards, visualize data with other tools, extract data from other sources and store them in an organized way.

**Table Creation Syntax:**

```sql
CREATE TABLE table_name (
	Col_name_1 DATA_TYPE,
	Col_name_2 DATA_TYPE,
	…….
	Col_name_n DATA_TYPE
);
```

Example:

```sql
CREATE TABLE shoes (
	id              NUMBER           PRIMARY KEY,
	brand           VARCHAR(20)      NOT NULL,
	shoe_type       VARCHAR(20),
	color           VARCHAR(10),
	price           DECIMAL(2, 8)    NOT NULL,
	desc            VARCHAR(100)
);
```

## NULL and Primary Key

Every column can be NULL or NOT NULL.
An error will be returned if one tries to submit a column with no value when it is defined as a NOT NULL
Don’t confuse NULL values with empty strings that are different kind of data
Primary keys can be NOT NULL and MUST be have a unique value in a table


## ADD / INSERT Data to the Table

```sql
INSERT INTO shoes
VALUES (1, ‘Nike’, ‘Slipper’, ‘Black’, ‘9.2’, NULL);
```

OR add data using explicitly declared the column name:

```sql
INSERT INTO shoes (id, brand, shoe_type, color, price, desc)
VALUES (1, ‘Nike’, ‘Slipper’, ‘Black’, ‘9.2’, NULL);
```


## CREATE TEMPORARY TABLE

Temporary tables will be deleted when current session terminated
Faster than creating a real table
Useful for complex queries using subsets and joins


Syntax:

```sql
CREATE TEMPORARY TABLE temp_table_name AS (
	SELECT *
	FROM main_table_name
	WHERE param=’value’
);
```

Example:

```sql
CREATE TEMPORARY TABLE Sandals AS (
	SELECT *
	FROM shoes
	WHERE shoe_type=’sandal’
);
```


## ADD COMMENTS in SQL STATEMENTS

Comments help you remember what you were doing and why
Mute the expression of code (commenting out code)
Troubleshoot query issues systematically

**Single Line Comments**

```sql
SELECT shoe_id,
       - -  brand_id,
shoe_name,
shoe_type
FROM shoes;
```

**Multiline Comments / Section Comments**

```sql
SELECT *
/*	Shoe_id,
	Shoe_name,
Shoe_type,
Shoe_color
*/
FROM shoes;
```

COMMENTS GONE WRONG

```sql
SELECT
-- Getting the avg units for each materials
Material,
Avg_units,
FROM shoes
-- group it by each type
GROUP BY shoe_type
-- Order it by brand
ORDER BY brand;
```

## Credit
- Cover Photo by <a href="https://unsplash.com/@lazycreekimages?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Michael Dziedzic</a> on <a href="https://unsplash.com/s/photos/sql?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Số điện thoại SV388
Tags: sodienthoaisv388
Published: 2021-08-31 02:24:31

Hotline của nhà cái 094 8248 728 hoạt động 24/24 sẵn sàng hỗ trợ người chơi tận tình cũng như tư vấn các anh em còn thắc mắc, nghi ngại về sự uy tín - minh bạch của nhà cái SV388.
- https://ceret.us/lien-he-sv388/

Ngoài ra các anh em còn có thể liên hệ với nhà cái thông qua phần Chat trực tuyến trên website hoặc email để góp ý, đánh giá hoặc yêu cầu hướng dẫn đặt cược, giao dịch tiền cược tại SV388.
Create an Elastic Kubernetes Service (EKS) cluster on AWS
Tags: aws, kubernetes
Published: 2021-08-31 02:21:18

## Summary
Amazon Elastic Kubernetes Service (Amazon EKS) is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS and on-premise. This tutorial will guide you through creating an EKS cluster on AWS.

## Prerequisites
[Set Up AWS Command Line Interface (CLI)](https://dev.to/aakan/setting-up-aws-command-line-interface-cli-4j8f)
[Set Up Kubernetes Command Line Tool (kubectl)](https://dev.to/aakan/setting-up-kubernetes-command-line-tool-kubectl-163p)

## Steps
Create an Amazon VPC with public and private subnets.
```shell-session
$ aws cloudformation create-stack \
  --region us-east-1 \
  --stack-name my-eks-vpc-stack \
  --template-url https://amazon-eks.s3.us-west-2.amazonaws.com/cloudformation/2020-10-29/amazon-eks-vpc-private-subnets.yaml
```
Create a file named cluster-role-trust-policy.json with the following policy definition.

cluster-role-trust-policy.json
```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "eks.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

Create the AWS IAM role.
```shell-session
$ aws iam create-role \
  --role-name myAmazonEKSClusterRole \
  --assume-role-policy-document file://"cluster-role-trust-policy.json"
```

Attach the required Amazon EKS managed IAM policy to the role.

```shell-session
$ aws iam attach-role-policy \
  --policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy \
  --role-name myAmazonEKSClusterRole
```
Open the Amazon EKS console at https://console.aws.amazon.com/eks/home#/clusters.

Make sure that the Region selected in the top right of your console is N.Virginia (us-east-1).

Select create cluster.

On the Configure cluster page enter a name for your cluster, such as my-cluster and select myAmazonEKSClusterRole for Cluster Service Role. 

On the Specify networking page, select vpc-00x0000x000x0x000 | my-eks-vpc-stack-VPC from the VPC drop down list. Leave the remaining settings at their default values and select Next.

On the Configure logging page, select Next.

On the Review and create page, select Create.

To configure your computer to communicate with your cluster, Create or update a kubeconfig file for your cluster.

```shell-session
$ aws eks update-kubeconfig \
  --region us-east-1 \
  --name my-cluster
```

Test your configuration.
```shell-session
$ kubectl get svc
```
S1E1 - Instalando ZSH & ASDF en Ubuntu
Tags: wsl2, zsh, asdf, terminal
Published: 2021-08-31 01:58:31

Hola a todos a nuestro primer post comunitario, en formato video para su mayor comodidad. En esta ocasión comenzaremos con ZSH & ASDF en WSL2 con Ubuntu, ya que aprovechando de que estaremos trabajando con una Raspberry Pi 4, aprovecha,ps para hacer este video. Espero les guste y no olviden dejar su Like & compartir para seguir trayendo mas contenido.

{% youtube 760fprtwhAg %}
Revealing hidden elements when hovering a parent with Tailwind CSS
Tags: tailwindcss, hover, display, group
Published: 2021-08-31 01:48:02

**_This article was written for Tailwind 2.0. As of 3.0 variants are available by default thanks to the new JIT engine. Please refer to the Tailwind 3.0 docs for further inquiry. However, `group` should still be the solution to this particular CSS issue._**


Tailwind CSS makes it almost *too* easy these days. Add two classes: `text-blue-500 hover:text-blue-700` and you have a perfectly styled link.

But what if you want to hide elements until the user hovers the mouse over a parent element? That type of UI requirement is fairly common for dashboard tables when you want to provide quick access to things without overwhelming the user with a lot of visual clutter.

Tailwind is capable of doing that with [group hover](https://tailwindcss.com/docs/hover-focus-and-other-states#group-hover). For this example, we're going to reach for a lesser used css attribute: `visibility`. The difference between `visibility: hidden;` and `display: none;` is the browser treats elements with their visibility set to hidden as still being present, but simply...invisible. Their space and padding are still respected, though, as if they were still present. Elements with their display set to `none` are essentially ignored from the markup. None of their spacing or padding impacts the page until they are visible again. We don't want elements jumping around when the user hovers over our element, so we'll be using `visibility: hidden` instead of `display: none;` for this example.

Consider the following HTML:

```html
<div class="group">
   <p>Some content that is always visible.</p>
   <p class="invisible group-hover:visible">I am hidden until my parent is hovered!</p>
</div>
```
You would probably expect this to work - but it won't. That's because Tailwind's `group-hover` doesn't support `display` types out of the box. But, with one line of code, we can easily make it work!

You can add this to your `tailwind.config.js` file:

```js
...
variants: {
 extend: {
   visibility: ["group-hover"],
 },
},
...
```
Now, it will work!

One thing to note: the `visibility` attribute cannot have transitions applied to it since it is an "on" or "off" field. If transitions is something you're after, consider using Tailwind's [opacity](https://tailwindcss.com/docs/opacity).

###Check out this [Tailwind playground link](https://play.tailwindcss.com/M410phgTM3) to see group hover working with CSS's visibility class.
LFN-all open source communities are global
Tags: opensource
Published: 2021-08-31 01:47:09

While all open source communities are global as we know, this event, and our own community is being disproportionately affected by prolonged border closures, and we simply don’t think it makes sense to continue with the in-person portion this year with so many in our community unable to join in person.

-LF Networking Team
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmehse1txarxd36c15zz.png)