teleren/devto huggingface dataset:
SQL: Inner Join
Tags: sql, programming, postgres, database
Published: 2019-11-18 13:26:19

---
title: SQL: Inner Join
published: true
description: 
tags: sql,programming,postgres,database
---
In SQL we have various powerful clauses that make managing databases possible, but one that usually brings confusion along with it's functionality, is the JOIN clause.

The JOIN clause is used in a relational database to select records from two or more tables that share at least one column in common. There are different ways of joining tables, and in this post we will be discussing, through the use of an example, the one corresponding to the INNER JOIN.

INNER JOIN will compare the specified tables and select those rows that have matching values. It could be considered the default JOIN type, since we would get the same result without specifying the keyword INNER.

It's syntax is the following:

![Inner Join syntax](https://thepracticaldev.s3.amazonaws.com/i/djw2ld9fjvp0pmjlrhv0.png)

In the SELECT clause, we specify the columns we want to select, by chaining them to the table they correspond. Pro-tip: we only do this for columns that are not specific to one table. If we want to select a column that is specific to just one table, we don't have to specify the table name.

Now let's explain how it works, based on an example. The following image shows the tables to be considered.
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/1vausock9nmpr5x2uagc.png)
In this example, we see that in the pets table we have a pet_id column that is common to the checkups table. The pet_id column in the pets table is referred to as [Primary Key](https://www.w3schools.com/sql/sql_primarykey.asp), and the one in the checkups table as [Foreign Key](https://www.w3schools.com/sql/sql_foreignkey.asp).

The next image graphically explains the result of joining these two tables with the INNER clause, referencing the Venn Diagram.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/krn2h7ux7dtbg8l17j27.png)

Now, considering the tables above, if we wanted to get our pets names, their species and the date they had a checkup, the query would look like this:

![Example query](https://thepracticaldev.s3.amazonaws.com/i/dqrfb0j7ulfovfdlgbsu.png)

Let's break it down: We select the columns we want, and since they are unique columns to each of the tables, we don't have to chain them to their tables. We select them from pets, and join the checkups table on the column both tables have in common (remember, the INNER keyword is optional). We could've selected from checkups and joined pets, as long as we join them on their common field, we would be getting the same result.

In a following post, we'll discuss the other ways available to join tables. See you there!

E.T.A.: The following post, where we discuss Outer Joins, can be found [here](https://dev.to/wendisha/sql-outer-joins-2cj7).
Daily Challenge #119 - Adding Big Numbers
Tags: challenge
Published: 2019-11-18 14:46:51

---
title: Daily Challenge #119 - Adding Big Numbers
published: true
series: Daily Challenge
description: We need to sum big numbers and we require your help.
tags: challenge
---

We need to sum big numbers and we require your help.

Write a function that returns the sum of two numbers. The input numbers are strings and the function must return a string.

*Example*:

`add("123", "321"); -> "444"`
`add("11", "99");   -> "110"`

*Notes*:

- The input numbers are big.
- The input is a string of only digits
- The numbers are positives


***

_This challenge comes from Becojo on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
TypeError: Assignment to read-only properties is not allowed in strict mode
Tags: javascript, readonly, didyouknow, ask
Published: 2019-11-18 14:46:40

---
title: TypeError: Assignment to read-only properties is not allowed in strict mode
published: true
description: 
tags: javascript, readonly, didyouknow, ask
---
By a show of hands, how many knew that [`HTMLElement.style`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) is **readonly**?

> Styles should not be set by assigning a string directly to the `style` property (as in `element.style = "color: blue;"`), since it is considered read-only, as the style attribute returns a CSSStyleDeclaration object which is also read-only.

Anyway, `element.style = "color: blue;"` will give you the following error in strict mode:
```
TypeError: Assignment to read-only properties is not allowed in strict mode

```
NYTimes warns of USB "juice jacking"
Tags: news, discuss
Published: 2019-11-18 14:24:02

---
title: NYTimes warns of USB "juice jacking"
published: true
cover_image: https://cl.ly/443339a743e4/Image%202019-11-18%20at%209.24.24%20AM.png
description: Discussing a NYTimes article about USB hackers and "juice jacking."
tags: news, discuss
---

Today's NYTimes features an article titled [Stop! Don’t Charge Your Phone This Way](https://www.nytimes.com/2019/11/18/technology/personaltech/usb-warning-juice-jacking.html).

It warns that hackers are setting up compromised USB "charging stations" in airports, hotels, etc.  Similar to "card skimmers" on ATM machines.

First time I have ever heard of the potential for this attack method.  Legitimate threat that people need to be aware of or more of a clickbait concern?  What do you think?

_[Photo via Unsplash](https://unsplash.com/photos/8JfiktHSpXI)_
Out of the burrow.
Published: 2019-11-18 14:22:08

So I've been more of a behind-the-scenes dev for quite a while, with almost zero online presence. This lonesome path has been rightly frowned at by close friends and colleagues. Truth is I just have not found the right time to 'go public', lol. (Yo man, that's just...super cheesy!)

    Oh well, since the universe seems to be on my side most of the time, that 'right moment' (whatever that means) surfaced. A couple weeks ago, I sent in a last minute application for the Bertelsmann/Udacity Technology Scholarship Program (a 3.5-month training after which top students would be enrolled into a Nano-degree program in either of the Cloud, Data or AI tracks). Got accepted, and it seemed like the best time to begin to document my tech journey.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/qgxmkppsdhxpa6kyr0jo.jpg)

Lots of stories and experiences in the past, but y'know, I kinda like 'new and shiny' so I guess this is the START marker on this one.
That said, I still do not know the point of this post; it would probably come to me after I hit the 'PUBLISH' button. I'll just try that out now. If you care to know the outcome, hit me up. (That pun was totally not my doing). Cheers!
New website for the developers.
Tags: webdev, html, css
Published: 2019-11-18 14:13:51

Hello everyone, I started my journey as a web developer just 2 weeks ago. And I tested my HTML, and CSS skills by making a live website.

If you want to insert an emoji in your website, just copy the CDN from my website and type the name of the class in the image tag.

However the JavaScript section is not added in my website, still you can use it by copy and paste method...

Website link: https://ishanbagchi.github.io/emojisthan/
AWS API Gateway and Lambda limitations workaround
Tags: aws, serverless
Published: 2019-11-18 14:10:48

When using AWS API Gateway and Lambda, you will probably reach a few limitations, in this article, I will explain how I created one workaround to overcome the 29 seconds of maximum API Gateway request and 6mb of maximum body payload size.

As an example, on our administrative dashboard, some data will be collected from MySQL and Elastic Search, that can be very slow in some cases.

On our front-end, an React app, the request can take up to 15 minutes (maximum lambda execution time), the usage will be simple as that:


![usage](https://miro.medium.com/max/1870/1*-2SkQb6ruQqt1KW5xvImYg.png)

The api.js file will contain:

![api example](https://i.imgur.com/myL3P32.png)


The resume of back-end architecture:
![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/b8riqztmxh8d34kaesmc.png)

First, start de workflow sending a POST request, passing any necessary parameters in body. This request needs a “type” parameter to define what function will be executed in the lambda worker. That request return the jobId for future use.
An item is created in the DynamoDB workers table, with jobId as hashkey and status as “pending”.

When worker promise function is done, with error or not, that DynamoDB item will be updated with the new status and S3 key of the result, that can be a JSON, XLSX or any useful type.

On front-end, using the received jobId, we fire another request, GET /api/worker/retrieve, passing jobId as query parameter. This request starts a Lambda function that verify if worker is done.

Case status is done, get the URL of S3 that have been saved later, sign that url with 1 hour to expires, then return to front-end.

Case status is pending, make a loop to verify every 100ms if status have changed, if elapsed time is more than 21 seconds, return a 303 redirect with the same URL, so front-end doesn’t need to fire the request again, browser will handle that for us.

After all that, front-end will receive a URL to a S3 file, if type is JSON, I make a new request to it and parse, if not, just return the URL.
Friday Night Deploys: Episode 3 - What Tech Stacks Should You Learn In 2020?
Tags: podcast, webdev, jokes
Published: 2019-11-18 14:08:58

This week the DevPlebs talk about: WatchMojo! Pumping out content! Yooka Laylee! Shoutouts! Dan Abramov! High school football dreams cut short by ACL injuries! React Suspense! Nu Metal! Carpool Karaoke With James Corden! Turing (the language)! Snapchat! The Rules of BINGO! Linkin Park! Windows Forms! Chester the Cheetah! Alan Kay, the father of Object-Oriented Programming! Dan Abramov again! Finding meaning in abstract art!

## Listen to The Full Episode!
{% spotify spotify:episode:6IPFjZs5C5FrmLpYd0u33j %}

**We're also on...**

**Apple:** https://apple.co/2NTqOCc
**Google:** https://bit.ly/32QFczj

## Get In Touch With Us!
If you would like to share your answers to the tech stack questions we went through such as...

- What was the first language/framework you were introduced to?
- What was the first language/framework you were first comfortable with?
- What is the language/framework you are currently most comfortable with?
- What is a language/framework you had a bad experience with?

@ or DM us on our [twitter](https://twitter.com/DevPlebs?s=20).

You can also ask questions or give us some feedback about the show!
Make A .APK And I'll tell you who wins!
Tags: challenge
Published: 2019-11-18 14:07:56

***
Hello I would like to challenge all the android Devs a contest. Enter your entry of making a game that has Adventure Arcade And Cute A hard mix indeed Submit the .APK in the comments with the download link. 
I wish you luck!

Sincerely Ibrahim From TGD Dev™





_Want to propose a challenge for a future post?  Email 

**yo+challenge@dev.to** with your suggestions!_
HTML: I have a problem with the canvas.
Tags: canvas, javascript
Published: 2019-11-18 14:06:57

Hi guys! I have a problem.
https://pastebin.com/68recZYa
In this code, when I click "Move" button, the image in "myDIV" div go ahead, and the viewport follow him. But I would like that this method would work in a canvas instead of a div. Can you tell me a how can I do it?
Want career growth? Make time for creativity, conquer impostor syndrome & develop management skills
Tags: todayilearned, career, beginners, programming
Published: 2019-11-18 13:00:19

*TL;DR style notes from articles I read today.*

### [Making time for the good stuff](http://bit.ly/37fshKY)

- When you’re really busy, it is easy to get into reactive mode. It makes you feel productive. But ensure a long term proactive focus on achieving significant goals too. 
- Realize that your biggest potential impact comes from doing creative work that sets up future success. 
- Creativity needs time and space in your schedule.
- Avoid interruptions & repeated context switching. Block 2-3 hour slots of time for deep work. 
- Make a note of any idea or inspiration that strikes you right when it does. If you can’t spend some time exploring it at right away, add enough context to be able to pick it up later. 

*[Full post here](http://bit.ly/37fshKY), 5 mins read* 

---

### [Conquering impostor syndrome](http://bit.ly/35gueoB)

- Little wins are by far the most effective way to gain momentum that can stave off impostor syndrome.
- Submit a code fix even if it's tiny. Tweak the refactor code. Do code reviews - they are a good way to think about how you would have completed a task without needing to complete it. 
- Bug filing also gets you thinking about ways a project can be improved, which may nudge your mind into other ways to make the project better.
- Commit to accomplishing a task in front of your team.  
- Talk to your manager & colleagues when you feel stuck or not good enough. They will help you find a starting point to dive into coding. 
- Do a pair programming session to help yourself find the motivation to start even if you are feeling like an impostor. 

*[Full post here](http://bit.ly/35gueoB), 6 mins read* 

---

### [Why all engineers must understand management: the view from both ladders ](http://bit.ly/2r68GvO)

- Growing in technical & management ladders require different skill sets. 
- You need to understand technical matters to manage a technical team well. Similarly, an effective engineer who wants to grow in a technical team needs to understand management too. 
- You need management skills for your career growth as an individual contributor (IC). 
- When you grow in an IC role, you need these management skills to help you effectively collaborate with people on and outside your team, influence others as well as coach and mentor other engineers. 
- Understand why & how some processes in your company designed, executed and evaluated - for ex: recruitment or performance management process - to get an idea of how management systems work.  

*[Full post here](http://bit.ly/2r68GvO), 9 mins read* 

---

*[Get these notes directly to your inbox every weekday by signing up for my newsletter, in.snippets(), here.](https://mailchi.mp/appsmith/insnippets?utm_source=devto&utm_medium=post08&utm_campaign=is)*
Performance vs. Trust, identifying toxic people
Tags: culture, toxicpeople, team, startup
Published: 2019-12-17 12:04:58

---
title: Performance vs. Trust, identifying toxic people
published: true
date: 2019-11-18 13:00:00 UTC
tags: culture, toxic people, team, startups
canonical_url: https://avelino.run/quote/performance-vs-trust-identifying-toxic-people/
---

There is one simple question to ask if you want to build a high performing team.

> “Who is the asshole?”

[Simon Sinek](https://www.youtube.com/channel/UC24N3jZCsNOKf94dfE9ms9w) explains a powerful and, ironically, very simple way to identify toxic people in your teams which might be successful short-term but harm a team long-term.

The majority of companies out there are run a system of incentives which fuels toxic cultures as the bonus structure is mainly based on performance.

{% youtube Y4dyADuYfbg %}
Why MS Excel is So Popular
Tags: database, productivity, excel
Published: 2019-11-18 12:59:17

This is a reflection and continuation of my previous post, about the business logic of an application. (https://dev.to/zoltanhalasz/business-logic-of-an-application-my-experience-as-newbie-programmer-1oh0)

I very much struggle to model the real world business processes to application business logic, and this resulted in my newest article:

https://mydev-journey.blogspot.com/2019/11/why-microsoft-excel-is-so-popular-my.html

The main idea is, to somehow extract from the realm of Microsoft Excel all processes that can be automated with an application. But this needs careful analysis of the underlying process.

My current endeavor is to automate another internal process, which collects, consolidates, corrects and checks internal VAT reporting data and can prepare statutory reports for VAT (Value-Added-Tax) in the local economy.

What do you think, do you have experience in reducing company bureaucracy by automating existing (obviously Excel-based) processes?
Kubernetes RBAC 101
Tags: kubernetes, devops, docker, rbac
Published: 2019-11-18 12:58:33

Role-Based Access Control (RBAC) Overview
RBAC is a security design that restricts access to valuable resources based on the role the user holds, hence the name role-based. To understand the importance and the need of having RBAC policies in place, let’s consider a system that doesn’t use it. Let’s say that you have an HR management solution, but the only security access measure used is that users must authenticate themselves through a username and a password. Having provided their credentials, users gain full access to every module in the system (recruitment, training, staff performance, salaries, etc.). A slightly more secure system will differentiate between regular user access and “admin” access, with the latter providing potentially destructive privileges. For example, ordinary users cannot delete a module from the system, whereas an administrator can. But still, users without admin access can read and modify the module’s data regardless of whether their current job entails doing this.

If you worked as a Linux administrator for any length of time, you appreciate the importance of having a security system that implements a security matrix of access and authority. In the old days of Linux and UNIX, you could either be a “normal” user with minimal access to the system resources, or you can have “root” access. Root access virtually gives you full control over the machine that you can accidentally bring the whole system down. Needless to say that if an intruder could gain access to this root account, your entire system is at high risk. Accordingly, RBAC systems were introduced.

In a system that uses RBAC, there is minimal mention of the “superuser” or the administrator who has access to everything. Instead, there’s more reference to the access level, the role, and the privilege. Even administrators can be categorized based on their job requirements. So, backup administrators should have full access to the tools that they use to do full, incremental, and differential backups. But they shouldn’t be able to stop the webserver or change the system’s date and time.
https://www.magalix.com/blog/kubernetes-rbac-101
9 Essential Software Management Interview Questions
Published: 2019-11-18 12:58:29

Software development is a non-physical new stream in business management and most of the products are customized as per client’s requirements. In today’s ever-changing, rapidly evolving Information technology market the prime importance is given to management skills of the Software manager as the techniques and development experience of one product can be absolutely opposite or irrelevant to one another.

In other words, we can say the findings of one product may not be useful to others at all and to survive the cut-throat competition in this ever-evolving software scenario, constant upgradations of skill-set, updating to the latest technology, modules are the only way out. It creates a constrained business environment for software developers and managers as the risk factor is higher in <a href="https://codersera.com/blog/complete-guide-on-sdlc/">software development</a> and they need to be very efficient, innovative and risk-taker with their planning and executions.

Organizations have become very selective in hiring the best talent pool for Software management of their organizations in order to deliver a quality product at a restrained budget, with profits, and on-time delivery. A Software engineering manager closely monitors the development process, and executes various plans, arranges necessary and adequate resources, maintains communication amongst all team members in order to address issues of cost, budget, resources, time, and quality and customer satisfaction.

Software project management is an art and discipline of planning and supervising software projects. Time, cost and quality are considered the basic parameters in Software management. A successful Software engineering manager is always tested on these three parameters of time, cost and quality delivered which get affected due to several internal and external factors.

You can see the <a href="https://codersera.com/blog/9-essential-software-management-interview-questions/">question and answer</a> here
filterMap - JavaScript filter and map in O(n)
Tags: javascript
Published: 2019-11-18 12:52:24


It's common that we need to get a subset of items from an array. For example, get only the users that are subscribed to the newsletter from the list of all users. This is commonly a job for Array.filter.

```javascript
/**
 * Get list of subscribed users
 * @param {User[]} users The list of all users
 * @retuns {User[]} Only users that are subscribed
 */
const getSubscribedUsers = users => {
  return users.filter(user => user.is_subscribed);
}
```

It's also common that we need to apply some transformation to a set of data. For example, get a list of full names from a list of users by concatenating each user's `first_name` and `last_name`.

```javascript
/**
 * Get list of users full names
 * @param {User[]} users The list of all users
 * @retuns {string[]} Users full names
 */
const getUsersFullNames = users => {
  return users.map(user => `${user.first_name} ${user.last_name}`);
}
```

**But what if we need the full names of the subscribed users only?*
Frequently we'll see:

```javascript
const subscribedUsers = getSubscribedUsers(users);
const subscribedUsersNames = getUsersFullNames(subscribedUsers);
```

The problem with this approach, which might not be too significant on a small set of users but is when dealing with large sets, is that it requires two loops: the first across every `user` and the second across every `subscribedUser`.

The method I'm sharing with you here accomplishes the same result but looping just once over the data set – O(n) – thus making it more performant:

```javascript
const isFn = f => typeof f === 'function';

/**
 * Filter and Map an Array in a single loop
 * @param {array} arr The list to process
 * @param {function} filterFn The filtering logic
 * @param {function} mapFn The transforming logic
 */
const filterMap = (arr, filterFn = null, mapFn = null) => {
  return arr.reduce((acc, item, i) => {
    if (isFn(filterFn) && filterFn(item, i) === false) return acc;
    const newItem = isFn(mapFn) ? mapFn(item, i) : item;
    return [...acc, newItem];
  }, []);
};

```

And an example usage would be:

```javascript
const isSubscribed = user => user.is_subscribed;
const getFullName = user => `${user.first_name} ${user.last_name}`;

const subscribedUsersNames = filterMap(users, isSubscribed, getFullName);
```

In the example above, `isSubscribed` is a utility function that will be used to evaluate if the item (each `user`) should be kept or excluded, and `getFullName` is a utility function that will determine the data we get back in the new list.

Check it out at CodeSandbox with tests:
https://codesandbox.io/embed/js-array-filtermap-mvi1q?fontsize=14&hidenavigation=1&module=%2Findex.ts&previewwindow=tests&theme=dark

**Spotted a mistake?** Let me know!