teleren/devto huggingface dataset:
Confusion Matrix | Cyber Crime
Published: 2021-06-06 17:40:50

<h2>What is Confusion Matrix</h2>
<p>In the field of machine learning and specifically the problem of statistical classification, a confusion matrix, also known as an error matrix, is a specific table layout that allows visualization of the performance of an algorithm, typically a supervised learning one.</p>
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4m4g817cbabsl23ktbm6.png)

<h2>What is TP / TN / FP / FN ? </h2>
True Positive (TP) :
The predicted value matches the actual value
The actual value was positive and the model predicted a positive value

True Negative (TN) :
The predicted value matches the actual value
The actual value was negative and the model predicted a negative value

False Positive (FP) – Type 1 error:
The predicted value was falsely predicted
The actual value was negative but the model predicted a positive value
Also known as the Type 1 error

False Negative (FN) – Type 2 error:
The predicted value was falsely predicted
The actual value was positive but the model predicted a negative value
Also known as the Type 2 error

<h2>Now let us Discuss what is Cyber Crime ?</h2>

<p>Cybercrime, or computer crime, is a crime that involves a computer and a network. The computer may have been used in the commission of a crime, or it may be the target. Cybercrime may harm someone's security and financial health.</p>

<h2>How Confusion Matrix has an Important take in Cyber Crimes ? </h2>
<p>False Postivies :<br>
False positives are mislabeled security alerts, indicating there is a threat when in actuality, there isn’t. These false/non-malicious alerts (SIEM events) increase noise for already over-worked security teams and can include software bugs, poorly written software, or unrecognized network traffic.</p>
<br>
<p>False Negativies : <br>
False negatives are uncaught cyber threats — overlooked by security tooling because they’re dormant, highly sophisticated (i.e. file-less or capable of lateral movement) or the security infrastructure in place lacks the technological ability to detect these attacks.
</p>
AWS DynamoDB: Single or Multitable
Tags: aws, nosql, dynamodb
Published: 2021-06-07 14:45:11

---
title: AWS DynamoDB: Single or Multitable
published: true
date: 2021-06-06 17:38:11 UTC
tags: aws,nosql,dynamodb
canonical_url: https://wparad.medium.com/aws-dynamodb-single-or-multitable-5d32a95af746
series: AWS Advanced
---

Always, always, always use a single table, if possible.

Only use multiple tables if:

- Each of the tables have different numbers of GSI
- Tables have local secondary indices
- You want to manually control scaling
- You have DDB Cognito/federate permission integration
- Different tables have different permissions/owned by different services
- Some of the data should be replicated between regions but other data not

Otherwise, you should merge tables without thinking about it.
The Git tutorial
Tags: opensource, git, tutorial
Published: 2021-06-06 17:34:58

# Git tutorial

## What is Git?
**Git** is a **free and open source** software for version control, that is designed to handle all kinds of projects. 

## Advantages of Git
For example, let's consider people A and B working on the same project. Let's assume they are editing the same file. 

If A adds some text, and B replaces some text, a problem arises. The same file is being edited by 2 people, and there arrives a clash. The text replaced by B could be one of the dependencies of A's text. 

Git was introduced into this world, to solve this problem. One can edit the file, the other can also do the same, but these kinds of errors won't occur. 

## Installing Git
You can install git via checking out this URL: https://git-scm.com/downloads, and then selecting your operating system. Alternatively, 
* If your're using Chocolatey in Windows, open Powershell as admin and run this: `choco install git -y`
* If you're using Linux, run this (according to your distro):
  ```
  sudo apt install git -y (Debian based)
  sudo pacman -Sy git (Arch based)
  sudo yum install git -y (RedHat/Fedora based)
  ```
* If you're using macOS with HomeBrew installed, use this command: `brew install git`  

And now, you're ready to use Git.

## Using Git

Using Git via the GUI offered by GitHub seems easier, but learning the command line is even more easier and it helps you a lot.

Here's how you can use Git with the command line:

1. `git clone url_of_repo`
(To clone the repository into your system)
2. `git checkout branch_name`
(to change to a separate branch)
    `git checkout -b branch_name` (to create a new branch and switch to it)

3. You can create a file after changing the branch, or make any changes to already existing files.

4. After editing/modifying the files, you have to push the changes to GitHub. 

> Note: For the following commands to work, you must be inside that prticular folder. Else, it won't work :)

5. Use "`git add .`" ( Here, period is used to push all the files) or `git add -A` (same purpose)

6. `git commit -m your_message` (to )

7. `git push` (to push your changes to the repository)

    This might not work during a few situations, so you can use the command which is recommended by Git to use in the terminal. 

And, those are the basic methods to use Git. If you master these 5 commands, you won't be needing the GUI to manage files via GitHub. 

Good Luck!

## Credits:

**Authors**: [Yash Wankhade](https://twitter.com/CodingIsCoool) and [Abhay Anand](https://twitter.com/codo__sapien)

**Editors**: [Tushar Verma](https://twitter.com/tshrvrm), [Pranav](https://twitter.com/ppranav06) and [Rasheedah](https://twitter.com/STEMInstructor_)

**Publisher**: [Pranav P](https://twitter.com/ppranav06)
How to create a page load animated loader in React
Tags: react, html, css, javascript
Published: 2021-06-06 17:11:30

We’re gonna see how to create an animated loader that comes at the time of page load.
Basically, it’s equivalent to Javascript’s `load` event. The `load` event is fired when the whole page has loaded, including all dependent resources such as stylesheets and images.

```javascript
window.addEventListener('load', (event) => {
  console.log('page is fully loaded');
});
```

{% youtube HHmmOH5Ep3M %}

We need to add our **loaders** HTML and CSS inside the `index.html` file present inside the `public` directory.

```html
<div id="root">
  <div class="loader-wrapper">
    <div class="loader"></div>
  </div>
</div>
```

Since the react app is mounted in **root** div, so we need to add our loader HTML part inside the **root** div.
Then, we can add the CSS part inside the same file, inside the `<style>` tag.

```html
<head>
  <style>
    body {
      margin: 0;
      padding: 0;
      height: 100%;
    }

    .loader-wrapper {
      width: 100%;
      height: 100%;
      position: fixed;
      top: 0;
      left: 0;
      background-color: #0b0b0b;
      display: grid;
      place-items: center;
    }

    .loader {
      border: 16px solid #e3e3e3;
      border-top: 16px solid #3498db;
      border-radius: 50%;
      width: 140px;
      height: 140px;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      0% {
        transform: rotate(0deg);
      }

      100% {
        transform: rotate(360deg);
      }
    }
  </style>
</head>
```

And that’s it, it’ll create a page loader for your react application which will only come up whenever the website is first opened up.

It is quite different from the one which we use in the case of `React.lazy` and `Suspense` because in that, it uses the `fallback` property of `Suspense` which is visible every time the **route** of our page changes and it’s a new **route**.

Source code of the application - [react-page-loader](https://github.com/GermaVinsmoke/react-page-loader)
Coding suggestions for beginners
Published: 2021-06-06 16:52:56

When a beginner enters in programming from a non programming background ,he has to face a lot of difficulties from where to start ,what to do ,from where to practice coding.... ⁉️⁉️ and many more ...Now I am going to help the beginners through this blog--
1)Choose C language and take time to learn it completely.
2)Choose one subtopic of c language ,learn it through youtube channels name "easytuts4you" and mysirg(for better visualisation)
3)Then practice and solve the questions related to that particular topic by implementing your own logic in a piece of paper or in any notebook,as much as you can, from some useful websites ---
1)www.codeforwin.org
2)www.mysirg.com
3)www.include.com
4)www.tutorialsbookmarks.com
In this way,select each subtopic of c ,one by one,then practice questions of that subtopic one by one from the above mentioned website .
4)After writing the code,run it on any IDE .After getting correct output then compare your solution with the solution of the above mentioned website for that particular question.
5)If you will stuck in any place of coding after trying a particular question then ask from your peers .
#Don't give up if not able to solve the questions,keep doing ,keep practicing because expertise comes from practice ----Srishti Jaiswal
Creating a search function in React
Tags: codenewbie, javascript, react, vscode
Published: 2021-06-06 16:52:16

Things to think about when adding a 'Search bar' to your React app.

Proper planning will save you alot of time in the long run when it comes to building your react components.

So, you decide that you want a user to be able to search your app for certain words.  First off, where do you want the search bar to appear in your app? You want to put it inside a component that has access to State. Whether itself holds State OR State can be passed down to it (from Parent to Child).

Create an input value for your search field in the State Object.  Set that input value to an empty string inside the state where its located. For example: 

state = {
    items: [ ],
    item: { }
}

You will want to then create a method for the onChange event for the input into the search bar. I would use an arrow function so you bind the value of this.  Use setState to be able to update the state.

Pass down props for the input value and the handle the onChange function for the input field of the search bar as props to the the component holding the search bar. 

And finally create the search method using filter and includes!
Snake terminal game
Tags: computerscience, python, bash, git
Published: 2021-06-06 16:44:21

-My project is a terminal game called Snake.

-The main role of the project is just having fun playing an old game that reminds you of your childhood.

-The main idea of the project depends on: --Creating a Window which will represent the game's border, --then creating the character which will represent the snake, NoteThere will be 3 characters, one for the head and two for the body* --then creating the character which will represent the snake's food, --then creating the key events which will control the snake's moves, --then creating the function that will append the same character as the snake's character and creating the counter variable that will be increased by one --every time the first character of the snake which represents the head passes over the position of the the food's character, --then creating the function that will end the game if the snake's head passes over the border's position or one of it's body characters' postion

-Techniques used: 1-Python programming language : (Imperative structured procedual programming paradigm). 2-Python Modules(Libraries) : Curses & Random.

Code's link on github: https://github.com/AlSir-Ahmed/Snake
Importance of self-confidence 
Published: 2021-06-06 16:18:10

Self-confidence is an attitude about your skills and abilities. It means you accept and trust yourself and have a sense of control in your life. You know your strengths and weakness well, and have a positive view of yourself. You set realistic expectations and goals, communicate assertively, and can handle criticism.
Human's life is full of obstacles.Sometimes ,one can feel that no one is there to help,there is no way to come our from problem but always remember one thing when there is a will,there is a way .If one door will be closed then there will have some other doors to reach at the same place ,even better than that place . Sometimes one can  feel that I can't do a particular task or anything, because the task is very difficult or I am lacking in something,but always remember that with self confidence ,faith and hope ,one can make impossible things possible.One golden line ,keep doing ,never give up and don't stop or take rest  until you reach your goal.
              ----Srishti Jaiswal
Top 10 Websites for C++ learner
Tags: c, cpp, leadership, learning
Published: 2021-06-06 16:15:27

###1.[GeeksforGeeks](https://www.geeksforgeeks.com/)
It’s content is the best and there is a plenty of other Computer Science subjects too on their website like C,C++, python etc. DBMS, Operating Systems, Computer Networks etc.

###2.[freecodecamp](https://www.freecodecamp.com/)
This website and his youtube channel is awesome for any programming language and any development stuff, any technology you want to learn is available on his channel.

###3.[Coding Ninjas](https://www.codingninjas.com/)
This is a very renowned institute in the field of coding, they provide premium courses which you can purchase and learn from. They provide very useful content through their courses. Even I have taken their free trial of C++ programming which has taught me up to the best.

###4.[Educative](https://www.educative.com/)
Another good course on C++ is on educative website, it provide a really good user experience and covers the topics in detail, you can check the course here

###5.[HackerRank](https://www.hackerrank.com/)
For practicing you can go to hackerrank,C+ and can practice any topic related to C++ by selecting subdomain and difficulty levels, within few weeks you’ll notice a great change in your language proficiency.

###6. [HackerEarth](https://www.hackerearth.com/)
For taking part in contest in C+ and can practice any topic related to C++ by selecting subdomain and difficulty levels and upgrade your level.

###7.[W3 School](https://www.w3schools.com/cpp/)
This website also provide you with good content to learn language. So you can go with this also.

###8.[CPlusPlus](https://www.cplusplus.com/doc/tutorial/) 
CPlusplus is another excellent website for learning C++. Although this website also has some tutorials, its true potential shines as a reference.

###9.[Edabi]( https://edabit.com/challenges/cpp)
EDABIT is a useful website for testing your C++ knowledge. It will give you a series of challenges to solve using C++, ranging from simple addition and division tasks to very hard challenges.

###10.[LearnCpp]( https://www.learncpp.com/)
Learncpp is an excellent place for both beginners and experienced programmers to get started with C++.This website is practically an entire C++ course in itself.

######.................................................
A Clumsy Portmanteau
Tags: sql
Published: 2021-06-06 16:15:23

Sargability. 

I was watching a Youtube video about different methods of SQL query optimization, and the guy dropped this word- Sargability. What a word; lends itself quite well to a pirate accent! It’s a derivative of Sargable, which was coined in a paper from 1979 entitled "Access Path Selection in a Relational Database Management System". It’s primarily a mash-up of Search and Argument (SARG). Basically a query, or more accurately the predicate part of a query, is considered sargable if the predicate can be resolved by the storage engine by simply reading the information in the row without having to do extra calculations.

It sounds complicated but it’s fairly straightforward. Let’s consider a table representing users, that has columns for their names and ages. And let’s say AARP has contacted my company and wants to add people to their mailing list. I’m going to run a query along the lines of 
`SELECT * FROM Users WHERE age >= 65`. This is a simple query with a sargable predicate, because the storage engine can simply grab the age entry for each row and pop in the equation, no extra steps necessary.

Ok, now AARP has changed their mind, and decided that they actually want everyone who will be eligible in ten years. They want to get a jump on informing potential customers about what they have to offer. If I’m not thinking about sargability, I might write a query like this 
`SELECT * FROM Users WHERE (age - 10) >= 65`. Now the search engine has to perform an operation (albeit a simple one), on each age entry in the database. Obviously this is going to take more time than our first query. In this situation the same query can be made sargable by changing the predicate to `WHERE age >= 55`. It’ll get the same results, and allow the search engine to perform a simple comparison, taking place on the lowest level, with the least memory allocation.

This is just the tip of the query optimization iceberg. Once you ensure the predicate is sargable, there are all sorts of clever uses of indexes that will speed up your search times. But that's a story for another time.
HOW PEOPLES ACCESS WEB
Tags: webdev, web, wesite, developer
Published: 2021-06-06 15:53:58

Welcome to my blog, and as you may know, I am a complete novice when it comes to web development. I wanted to tell you about my experience. Let's get this party started.

![Image related about working of web](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/amua3qekvufm5at6j8hk.jpg)


Peoples are using a special type of software called "web browser" like Chrome, Firefox, Opera, etc. to access the web. For accessing any web page on the web, we need to enter the web address in a web browser of that particular web page. The "web address" is like the address of that web page. Then the request is sent to a "web server". They are a special type of computer that are connected to the internet continuously. Their job is to send web pages according to the user's request.  

But the web server doesn’t send the web pages as it is. The web server sends files to the web browser. These files are HTML, CSS, and JavaScript. 

At this point, web browsers play an important role. As it "converts these files into web pages". Therefore, with the help of a web browser, we see beautiful web pages. 

By this peoples access web. 

I hope you understand how peoples access the web. You can learn more about it by Googling it. If there is any query in your mind then feel free to write it down in the comments below. From the next blog, I will start HTML. So that's all for now, and I'll see you in the next blog. Thank You...
Day 84 of 100 Days Of SwiftUI
Tags: swift, 100daysofcode
Published: 2021-06-06 15:44:15

I just completed day 85 of 100 days of SwiftUI. Today I worked on integrating user defaults into the Hot Prospects app and I also integrated local notifications.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mz0tpiidzjclesy2uh5m.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwqb4bbxpim4v9m2z9kc.png)
Top 8 Mistakes Junior (and some Senior) Developers Make
Tags: tutorial, webdev, programming, productivity
Published: 2021-06-06 15:36:30


## Disclaimer
I am guilty of each one of those 8 mistakes 😁

### Let's get to know them 👇

*** 
## 1 "***Software development is all about coding***" 👨‍💻

- It's like saying a mechanic uses a wrench instead of saying he fixes cars using a wrench. 

- The same way, a developer solves real life problems using code.

- Great developers understand the problem at hand and solve it using the least amount of code possible.

*** 

## 2 "***if only the business people would get the requirements right***"😤
- The problem with this statement is that it assumes that the developer's job is to only write code and other's job to tell them what code to write.

- if business people could write a correct detailed description of the problem they wouldn't need developers, they can just use a tool to translate the description to code.
***

## 3 "***Speed is all that matters***"🏃
- Examples of it are typing code very fast or finishing the task as early as possible.
- Remember that the aim is to solve the problem using the least amount of code.

***

## 4 "***My job is to code, not to understand the business domain***"🤷
- it helps you writing simple code, you can also spot domain problems/opportunities domain experts might miss

***

## 5 "I can't ask for help, it shows I don't know enough"😕
The more you know, the more you know you know less

***

## 6 "***Software architecture is for the experts***"👩‍💼
- Designing a good architecture does require experience, but architecture  is more than just creating it.
- Architecture is about the ability to describe what the system do and how it does it to a non technical person, regardless of the tools and framework used. 

***

## 7 "***Testing is someone else's job***"🤭
- It's your job to test your code.

***
## 8 "***I would do a better job but my boss won't let me***"👨
- You don't permissions to clean code/write tests.
- Refactoring and testing are part of your job, just like it's the chief's responsibility to keep the kitchen clean.

***
## Final words
You might not be in a position to enforce good practices on the team, but you can apply them where you can.

This post is heavily inspired by Dave Farley's YouTube video 🙏 [Avoid These Common Mistakes Junior Developers Make!](https://www.youtube.com/watch?v=5g3dK2DgW-k&ab_channel=ContinuousDeliveryContinuousDelivery)