teleren/devto huggingface dataset:
Database Normalization
Published: 2020-09-28 23:16:32

Now that we have an actual set of tables formulated, there is a need to be sure that the data in the tables are not scrambled. So for this week, I will be 'normalizing' my data.

Normalization is a technique for organizing data in a database.The organization of data is managed with the form of stages of organization are called normal forms. These are the forms applied in a database.

### First Normal Form (1NF):
* Data is stored in tables with rows **uniquely identified by a primary key**
* Data within each table is stored in individual columns in its most reduced form
* No repeating groups

### Second Normal Form (2NF):
* Everything from 1NF
* Only data that relates to a table’s primary key is stored in each table

### Third Normal Form (3NF):
* Everything from 2NF




Here's the alteration of one of my tables via normalization:
`Before`
![befo](https://dev-to-uploads.s3.amazonaws.com/i/70xfsx65tnx8zbwfll2i.png)
`After`
![Aft](https://dev-to-uploads.s3.amazonaws.com/i/zteovwqhxfuttdpkpad1.png)

As you can see, the column of 'Cities' was removed due to latent redundancy (zipcode can be used to find city name anyways). 

{% youtube kBrX-hGN75A%} 

`Before`
![1](https://dev-to-uploads.s3.amazonaws.com/i/9ls4m9n0fr4syt3clm2x.png)
`After`
![2](https://dev-to-uploads.s3.amazonaws.com/i/77gz50i81c30y7g5nase.png)

{% youtube drMiSuT_icQ%}
⚡⚡ a short guide to object destructuring in JS ⚡
Tags: beginners, webdev, tutorial, javascript
Published: 2020-09-28 23:01:00

Want to get better at Web Development 🚀🚀🚀? Subscribe to my weekly newsletter at **[https://codesnacks.net/subscribe/](https://codesnacks.net/subscribe/)**

---

Destructuring in JS is used to access object properties in an elegant way.

Let's have a look at a JS object:

```js
const pastry = {
  name: "waffle",
  sweetness: 80,
  ingredients: ["flour", "butter", "eggs"],
  origin: {
    country: "Greece",
    name: "obelios",
    year: 1200,
  }
};
```

To access its properties we could use the dot notation:

```js
const name = pastry.name;
const sweetness = pastry.sweetness;
const country = pastry.origin.country;
```

Or with less code, we could use destructuring by specifying the properties, that we want to get.

So instead of 

```js
const name = pastry.name;
```

we can also use 

```js
const { name } = pastry;
```

which looks for the property name inside of the pastry object. It's basically the same as accessing it via `pastry.name`.

The cool thing is, that you can access multiple properties at once. Let's use the example from above where we accessed `name` and `sweetness`.

```js
const { name, sweetness } = pastry;
console.log(name);
console.log(sweetness);
```

## destructuring nested objects

Let's have a look at how to destructure e.g. the `country` from the `origin` property.

```js
// const country = pastry.origin.country;
// or

const { origin: { country } } = pastry;
console.log(country); // Greece
```

You can of course also combine accessing nested and non-nested properties:

```js
const { name, sweetness, origin: { country } } = pastry;
console.log(name);
console.log(sweetness);
console.log(country);
```

---

Want to get better at Web Development?
[🚀🚀🚀subscribe to the Tutorial Tuesday ✉️newsletter](https://codesnacks.net/subscribe/)
How To Level Up As A Software Engineer
Tags: webdev, codenewbie, computerscience
Published: 2020-09-28 22:59:00

Greetings everyone(:

Today I want to share some of the knowledge I've acquired since I have begun to program.

I'm hoping this will help some juniors and even mid-level devs who are trying to level up.

Creating software is like culture, things come and go at a rapid pace. The library you begged your manager to let you use in production today could be old news tomorrow.

As a junior, I remember sitting at my computer wondering,
*well, how do I know what I should learn?*

After a lot of banging my head on the wall and talks with my mentors and other peers, what I figured out was, being a good Engineer has nothing to do with creating React apps, libraries, or a cli... **It's about being able to adapt to new unknowns while also finding and using the right tools to get the job done.** This is the trait of a good to great engineer. 

The question is not *what framework should I use?*, but *what framework is the best fit for this project?*

So if this is what it means to be an engineer, how do I practice this skill? Only one answer, build more.


Build things you have not built before. Earlier I said:
>being an Engineer is not about being the best at creating React apps, libraries, or a cli

And I stand on that, BUT to work the skill of being able to adapt to new unknowns you must create new things. New apps, cli, libraries.

Think of it like this. When you're a kid and your parents teach you chores, you start by taking the trash out, then you learn to do the dishes, then its the yard, and so on. Well, why is it important to add to that load? 
They aren't making you do it because they think:
>we're going to have the best cleaner in the world!

They do it because to be truly disciplined you have to constantly work that discipline muscle in your mind, in ways you haven't before.

Think of being an engineer in the same way. The projects you create are not teaching you anything, its the frustration and struggles you were able to work past during the process of creating that made you better. And the more you do it the better you get.

If you want to become a better engineer, I challenge you to do this. Take the top 3 apps you use daily and for however long it takes you to build them to perfection. Always think quality instead of quantity when you work.
If you do this I can promise you you'll be well on your way to Sr engineer.

Thank you for reading and I hope this has helped you. If you know of anyone struggling with their next step, please share this with them.

P.s. Remember pressure makes diamonds, todays uncomfortable can be tomorrows easy! Problems get difficult, reach out to friends and your network for help we all go through this process, you are not alone! The greatest engineers in the world know when to ask for help!
Keep a brag book
Published: 2020-09-28 22:55:28

---
title: Keep a brag book
published: true
description: We tend to focus on the negative, and rarely recall the positive things we have accomplished, or the impact we have on others. Here's my tip for helping to overcome this.
tags: 
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/v2nwylpwuo6ulq2hxgs3.png
---
It's pretty common to not feel like you're doing a great job at work (or in your projects, or whatever else). I know I tend to definitely remember negative things that folks say to me or times that I feel like I have messed up. 

We don't remember the positive things, generally speaking. I have a simple technique to help with this. Whenever someone shares (either privately or publicly) an accolade, I save it into a private notebook[1]. 

I first came up with this idea when I was a newly minted sales engineer at Chef. I was super nervous and felt like I wasn't accomplishing anything. Then, I got the following message from a coworker of mine that I really looked up to:

![Screenshot of comment from Chip Johnson](https://dev-to-uploads.s3.amazonaws.com/i/kmp09y32fa9972bwprca.png)

This made a massive difference to me in the moment, but the fact that whenever I am feeling like I am "not good enough", I can always go back to my "compliments" notebook. It's very telling that even today, over six years later, that one comment from Chip still has the power to make me re-center my self-belief. 

Any time that I am feeling "less than", or that I don't belong, or that I am not valuable, a simple review of my "compliments" notebook often helps.

This has an additional use as well - when it comes time for annual review, go back through this notebook! It will help you remember the things you did to help your colleagues and community members.

[1] - I used to use Evernote for this, but you can use whatever works for you! Even a simple Google Doc that you just paste things into is fine! Don't overthink it!
How to deal with bad code?
Tags: productivity, codenewbie
Published: 2020-09-28 22:43:52

## Most of us as developers have dealt at some point in our careers with a piece of code that caused us nightmares!

We have all the names and terms to describe it, bad code, garbage code, inconsistent patterns, and so on, let's say here we will stick with the term bad code which will be a general one describes them all. 

# What is Bad code?

Bad code is simply a piece of code that is hard to change; maybe because of bad abstraction, misleading naming, changed requirements, and responsibilities, or maybe you don't know how to code.
Sometimes we use the term "Readability" but in reality, this term consists of two factors Reader + Writer; this is why I don't consider it as a sign of "Bad Code".

# What about good code?
Good Code design is memorable and unambiguous. It encourages readable, correct, and performant code, and helps developers fall into the <a href="https://blog.codinghorror.com/falling-into-the-pit-of-success/">pit of success</a>.

> When you change the way you look at things, the things you look at change. Wayne dyer

## You have identified the piece of code you are working with as bad code then what?

The secret is simple:
> Don't look at it as this is bad code.

Instead, focus on figuring out what is the issue which is one of the listed above or more, if you find a pattern in it stick to the same design pattern and modify it over time, changing the entire methodology or design pattern especially in big projects takes a lot of time to tweak and handle which most of the times your manager won't accept to give you, and actually as long as you didn't have at least weeks working on this codebase you shouldn't judge it. Try to document the tricky parts you start to have the ability to handle, you will see yourself begin to understand parts of the system you are working on overtime, you can then change the design pattern, but at the same time, global changes take time to be stabilized.

This is my take about bad code.
What is yours?
Let me know in the comments section.
My #100DOC - Day 33
Tags: 100daysofcode, challenge, log
Published: 2020-09-28 22:36:03

#### **Today's Progress**: 
1. **[Redesign of my portfolio](https://github.com/pablohs1986/pablohs1986.github.io)** (2h):<br>I continued working on my portfolio. I tried to implement certain logic using JavaScript to handle the UI, although I finally ended up making use of the fullPage.js library.
    
#### **What I learned**: 
* Review of html basics.
* Review of Bootstrap basics.
* Review of JavaScript basics.
* Implement external libraries.
* Use of fullPage.js.

#### **Total time**:
2h.
Why to choose Cloud service providers like Azure or GCP or AWS Instead of InterServer or GoDaddy ...etc.
Tags: discuss, azure, aws, host
Published: 2020-09-28 22:13:19

Why to choose Cloud service providers like Azure or GCP or AWS Instead of InterServer or GoDaddy ...etc. Even they have better prices and Shared Host and also VPS, when we compare the prices for example for computing or Store they're very expansive comparing to the another alternatives, even though Azure and AWS and GCP are leading in cloud serveries.
I want to ask why they lead in this? Why to chose one of Azure or GCP or AWS verses InterServer or GoDaddy or Bluehost?
First day of school
Tags: bootcamp, flatiron, herewego, justthebeginning
Published: 2020-09-28 22:13:10

Today was the first day of school for me and let me tell you it was just as overwhelming as expected!  Everyone seems supportive and wonderful but I have heard from previous graduates as well as the teaching team and coaches that the program is harder than you think it's going to be... and I am already expecting it to be pretty hard!  So today I am keeping my focus, trying to build good habits and most importantly a positive attitude!
Mobile iOS, Android App with VueJS in 5 minutes ! Really ! #EN
Tags: ios, android, app, vue
Published: 2020-09-28 22:06:24

Hi **beginners** *or not* !
Today i will show you how to make an awesome mobile app from scratch with VueJS and Capacitor, directly compatible with iOS and Android mobile device.
    
The first question is 
# How it’s work ?

## Did you know CapacitorJS ?
CapacitorJS is full package to set Node app compatible with iOS and Android,

The first step is the requirement:

- Android Studio with the latest SDK
- XCode latest version

**and now you can start**.

### Create a basic VueJS app with @vue/cli packages
```
vue create app
```
set the configuration as you want, not very important at this step.

ok then, 
### install CapacitorJS on your project

```
npm install @capacitor/core @capacitor/cli
``` 

now you can type this command: 
```
npx cap init
```
*respond to the questions,*

**so now very important step,**
inside the capacitor.config.json file, change 
```
webDir: "www"
```

to

```
webDir: "dist"
```

ok you can **build your project** 
```
npm run build
```

and now, it's ready to do **the best thing** :

### Android
```
npx cap add android
```

### iOS
```
sudo gem install cocoapods
npx cap add ios
```

and now do the **magic thing**: 

```
npx cap copy
```
wow !

Now you can open XCode or Android Studio with this command :

```
// Android Studio
npx cap open android
// XCode
npx cap open ios
```

Android Studio 
![Build Android App](https://dev-to-uploads.s3.amazonaws.com/i/wyd0pzqhxzxbjren7zwx.png)

XCode
![Build iOS App](https://dev-to-uploads.s3.amazonaws.com/i/2s487nddp8xyho428eb5.png)

Very awesome no ?

#### Note
For iOs you need to install xcode dependency, follow XCode install instruction to perform this.

and for lazy people
https://gitlab.com/Simerca/vuejs-mobileapp-exemple

### Références

- VueJS https://vuejs.org/
- CapacitorJS https://capacitorjs.com/
- Android Studio https://developer.android.com/studio
- XCode https://apps.apple.com/us/app/xcode/id497799835?mt=12
How to create an excel sheet in android
Tags: android, java, github, opensource
Published: 2020-09-28 21:49:30

[Worksheet](https://github.com/elirehema/worksheet#worksheet) simply creation of an Excel Sheets in Android project. It is simple as explained.

- Add the dependency
```dependencies{
        .....................................
        ..........................................

       implementation 'com.github.elirehema:worksheet:0.0.1'
```
- In your activity class create excel


```
button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                try {
                    workSheet = new WorkSheet.Builder(getApplicationContext(), path)
                            .setSheet(List<Object>)
                            .writeSheet();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
});
```





- For more infomation checkout the [documentation](https://github.com/elirehema/worksheet#worksheet)
MMT Tech Meet-up September 2020 - Featuring Svelte
Tags: svelte, javascript
Published: 2020-09-28 21:40:22

---
title: MMT Tech Meet-up September 2020 - Featuring Svelte
published: true
description: This meet-up covers both Svelte and Sapper talks
tags: Svelte, SvelteJS, Javascript
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/t96e1vgitqzuv6ys9onq.png
---

## MMT Tech Meet-Up - September 2020 featuring Svelte

This meet-up featured Svelte and Sapper topics. 

We had the following speakers for this meet-up:
- Introduction to Svelte with Ilesh Mistry (@IleshMistry)
- Looking into the Svelte compiler with Tan Li Hau (@tanhauhau)
- How I built a Sapper blog with all the must-have features with Markus Hatvan (@MHatvan)
- Sapper JAMstack - Trello as a blog backend with Shriji Kondan (@Shriji)

This is the recording from the tech meet-up https://youtu.be/xfwEvHL8FlQ
[![MMT Tech Meet-up - Sept 2020 - Featuring Svelte](https://dev-to-uploads.s3.amazonaws.com/i/t96e1vgitqzuv6ys9onq.png)](https://youtu.be/xfwEvHL8FlQ)

This is the recording from the MMT Tech Meet-up where we have the following content in this video:
00:00:00 - Welcome to the MMT Tech Meet-ups by Ilesh Mistry
00:02:40 - Introduction to Svelte by Ilesh Mistry
00:20:00 - Looking into the Svelte compiler by Tan Li Hau
00:44:30 - How I built a Sapper blog with all the must-have features by Markus Hatvan
01:06:20 - Sapper JAMstack - Trello as a blog backend by Shriji Kondan
01:38:13 - End

### *** Bonus extended trial *** 
Kentico Kontent - 90 days extended trial - http://bit.ly/KontentMVP 

### Useful links
- Introduction to Svelte slides - https://www.slideshare.net/IleshMistry/introduction-to-svelte-mmt-tech-meetup-september-2020
- Looking into the Svelte compiler slides - https://lihautan.com/looking-into-the-svelte-compiler/
- How I built a Sapper blog with all the must-have features slides - https://www.beautiful.ai/player/-MI0JqYe0oPmQRIf08NQ
- Sapper JAMstack - Trello as a blog backend slides - https://docs.google.com/presentation/d/1abSuDWFVKXu2CSuJ1svApxQPPtag4QUnf7iR0QGdOPA/edit?usp=sharing
New .URL powered shortcuts to access the web quickly
Published: 2020-09-28 21:29:49

The .new domain was first noticed when google allowed people to quickly open a new doc by typing [doc.new](http://doc.new) after which they started the process of opening its .new-powered shortcuts to other companies.

You must have heard about these two cool URLs, [repo.new](http://repo.new), and [gist.new](http://gist.new) to quickly create a new GitHub repository and GitHub gist. It's a cool little trick to do in front of your friend and even helpful if you are the kind of person who creates repositories and gists left and right every day but it turns out that there a lot more of these which might actually be helpful at times and I have created a list of them

- [repo.new](http://repo.new): Create a new GitHub repository  
- [gist.new](http://gist.new): Create a new GitHub gist  
- [cal.new](http://cal.new): Create a new Calendar event  
- [link.new](http://link.new): Create a new Bitly link  
- [story.new](http://story.new): Create a new Medium story 
- [docs.new](http://docs.new): Create a new Google doc  
- [sheets.new](http://sheets.new): Create a new Goole spreadsheet  
- [slides.new](http://slides.new): Create a new Google slide presentation  
- [forms.new](http://forms.new): Create a new  Google form 
- [react.new](http://react.new): Create a new  React codesandbox  
- [vue.new](http://vue.new): Create a new  Vue codesandbox 
- [ng.new](http://ng.new): Create a new Angular codesandbox 

Hopefully, more of these will popup and I will try my best to keep this up to date :)

PS: Found some more even before putting this blog up, wow :p 

- [playlist.new](http://playlist.new): Create a new Spotify playlist 
- [canva.new](http://canva.new): Create a new Canva design

- [word.new](http://word.new): Open Online Microsoft office
- [webex.new](http://webex.new): Create a new Personal Meeting room 
- [api.new](http://api.new): Prototype your ideas for new Node.js API endpoints with RunKit
- [coda.new](http:coda.new): Create a doc that combines documents and spreadsheets into a single canvas

Some more,
- [invoice.new](http://invoice.new): Create Invoices with Stripe dashboard
- [sell.new](http://sell.new): Help people get exactly what they want through eBay.
- [Reservation.new](http://reservation.new): Make an OpenTable reservation at the best restaurant near you. (Might not work well for all countries)
SQL Injections
Published: 2020-09-28 21:22:57

I chose to do the second option for this lab, which takes a look at SQL injections. SQL injections are some of the most common web hacking techniques, and could lead to the destruction of your database or massive data leaks. It can work on webpages that use backend databases such as MySQL, Oracle, and MSSQL (pentest-tools.com). Here are some of examples of common SQL injections:

##Error-based SQL Injection
This is one of the most common types of SQL injections. It is often performed when there is user input into a database and the hacker will input commands or an invalid input that creates an error. This error could contain details about the structure, version, OS, or query results. For example, if someone is inputting an ID to retrieve information about a person, a hacker can input a number with a single quote attached to it to force an error in the system. This error could reveal information to the hacker about the type of server and the server version that you are using in order to aid the hacker into getting access to your database. 

To prevent this attack a coder should disable error messages for user input queries. These errors should be disabled at all times on a published site, or should be sent to a file with restricted access to allow for improvements, but not shown to anyone who visits the site. 

##Boolean-based Blind SQL Injection
This injection is used when there is a boolean query and can tell a hacker if a value is present in the database or not. Hackers use a boolean-based payload to check in the application is vulnerable. They inject a value with a single quote attached and 1=1;-- into the query. This will make the application return a different result depending on if the query returns a true or false result. Depending on the result, the content within the HTTP response will change or stay the same. 

To prevent this type of attack a coder should use parameterized queries (also known as prepared statements), which make sure that user input cannot interfere with the structure of the SQL. These statements should be used whenever untrusted input appears as data through user input to prevent the exploitation of the SQL. 

##Union-Based SQL Injection
This injection is leverages the UNION SQL operator to combine SELECT statements that will be returned as part of the HTTP response. This injection will work as long as the individual queries have the same number of columns and the data types in each column must be compatible between the individual queries. 

To prevent this type of attack a coder should also use parameterize queries. This will ensure that the UNION operator that the user inputs will not interfere with the rest of the SQL code. The coder could also perform whitelist validation to test the user input against an existing set of known, approved, and defined input. 

###Video
{% youtube Lz7uzvQG1BM %}
That awkward moment when you need to generate test data...
Tags: json, perl, sns
Published: 2020-09-28 20:46:21

## The Problem

I have a system which uses SNS to send mail messages to a Lambda for additional processing. The Lambda is written in JavaScript, and it has really good test coverage, but there are message shapes that aren't included.

All of the messages which go through the system get persisted into S3 in SMTP format, but the Lambda receives a JavaScript object in a known SNS shape as its input, not an SMTP message.

## The Solution

Write a quick-and-dirty script to generate JSON from the SMTP message which is close enough to what the Lambda's input would be, so that I can add additional messages to the Lambda's unit tests as needed.

## The Gist

Here's a gist of the script.

 {% gist https://gist.github.com/manchicken/cb96aa6da476f6f827287021e5f6acad %}

## Conclusion

As I'm sure you noticed, that data isn't super clean. It's missing some key fields, so it's not 100%. However, my additional processing only needs the `Message` content, the `Subject` and a few fields from the receipt.

Thanks for looking at my quick-and-dirty, I had fun writing it. May your quick-and-dirties bring you joy as well.

(Update: Made a couple code fixes to the Gist)