teleren/devto huggingface dataset:
Confusion Matrix use cases in Cyber Crime
Published: 2021-06-06 02:59:27

What is the Confusion Matrix?

The confusion matrix is a useful tool used for classification tasks in machine learning with the primary objective of visualizing the performance of a machine learning model.

In a binary classification setting where the negative class is 0 and the positive class is 1, the confusion matrix is constructed with a 2x2 grid table where the rows are the actual outputs of the data, and the columns are the predicted values from the model.

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

How to interpret a Confusion Matrix?

I will start by first describing some terminology, if you are able to work out where they would go then you are halfway there:

True Positive: The model predicted positive and the label was actually positive.

True Negative: The model predicted negative and the label was actually negative.

False Positive: The model predicted positive and the label was actually negative — I like to think of this as falsely classified as positive.

False Negative: The model predicted negative and the label was actually positive— I like to think of this as falsely classified as negative.

Our confusion matrix has two red patches on our grid, which infer to us the type of errors that our model is making.
Type-1 => False positive
Type-2 => False negative

How we use the confusion matrix in cyber crime?

Let's take a case study of this:
We are tasked with building a classifier that predicts fraudulent or non fraudulent for different transactions. The data was handed to us by a major bank in the UK with very tight security – the personal details of all customers were encrypted for privacy concerns – so fraudulent transactions do not happen very often. In fact, the data that they had given us had 10,000 Negative  cases (non-fraudulent) and 1000 positive cases(fraud). The below Figure shows the results of our classifier.

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

In the above image there are 11000 cases of fraud and non-fraudulent among them  our ML model find the 10000 cases are not-Fraudulent  i.e  negative .But actually 9900 cases  among them are True Negative(TN) and the rest 100 cases are False Negative(FN).here our model will predict the wrong output.so our model will not alert the Bank and The bank also don't the fraud  cases. Because the model predict 10000 cases are not-fraudulent.so this type of error FN(Type-2) is very dangerous in this case. The rest 1000 cases are fraud  cases but among them 800 cases are not fraud but the model gives us this is as a fraud cases i.e
False Negative(Type-1).in this case the Type-1 error are not so dangerous. but the Type-2 error are so dangerous.
What are javascript engines
Tags: javascript, engine, webdev
Published: 2021-06-06 02:33:02

JavaScript engines is a complex topic, and knowing about these engines you will code even better, and to code optimized for web.

["Virtual Machines"]

A JavaScript engine has a type of "virtual machine" and this high-level language was designed for web-development. There are many "virtual machines" I explain later on this topic.

[What is JavaScript engine] 

The basic job of JavaScript engine is to take a piece of code, and convert it so fast, optimizing code and it can be interpreted by the browser.

In each JavaScript engine has your own particular version followed by ECMAScript. There are many different engines world-wide, each one is designed to work. 
i.e.: Node.js is one of the awesome and known engines. Node otherwise, is good for runtime environment. And so on...

Those engines and a huge variety are available to analyze, parse, and execute client-side code or server-side (Node.js) in every browser version.

I hope you all enjoyed,
thanks for reading!
How to Write Good Alt Text for your Images
Tags: webdev, beginners, javascript, tutorial
Published: 2021-06-06 02:30:10

Hello, welcome to this tutorial! 
Today, I'm going to be explaining how to use alt text for your images.

```
<img src="https://image_link" alt="image_attributes"/>
```

First of all, what is "Alt Text"? 

> Alt Text which is also known as Alt Attributes, are used within an HTML code to describe the appearance and function of an image on a page. 

They describe the image to screen readers and other users. Also, when the user is experiencing a poor network that prevents the images from showing, alt attributes are shown instead to the users.

That was just a little introduction to Alt Text.

Back to **How To Write Good Alt Text for your Images**

### 1. Always use an Alt Text.
The Number 1 rule for every image on a website is to always have an alt attributes.

### 2. Use CAPS for abbreviations.
When writing Alt text that includes abbreviation, always use uppercase. For example : MIT, WHO, etc. They are pronounced letter by letter by screen readers.

### 3. Leave it blank, if the image is not relevant
If you don't want your image to be read by screen readers, that is the image is not relevant, you may use an empty string as the alt attribute.
```
<img src="https://image_link" alt=""/>
```

### 4. Don't use "image of" or "graphic of"
When writing an alt text for an image, avoid the use of "image of" or "graphic of", it will just be a repetition.
Let me explain better,
```
<img src="https://dog.jpg" alt="Image of a German Shepherd dog"/>
```
Screen readers read this code as, *"Image of a German Shepherd dog image"*, but if written as:
```
<img src="https://dog.jpg" alt="German Shepherd dog"/>
```
It is read as *"German Shepherd dog, image"*

### 5. Be Accurate
Make sure your alt texts describes the image clearly or creates a picture of the image in the mind of your readers.

### 6. Be Succinct
Be brief and concise when describing your images.

> Did you enjoy this blog post?

Follow me not to miss any, we can also hangout on [Twitter](https://twitter.com/Arshadayvid) my DM is widely open.
Inheritance Concept
Tags: oop, tutorial, programming, javascript
Published: 2021-06-06 02:03:02

- Like a child inherit many properties and behaviors from parents, the same can be done in programming called Inheritance.

- Parent class
<code>
Parent{
// owns a house
}
</code>

- Child class inherited from the parent class
<code>
Child Inherits From Parent{
// automatically get the house as he is a child
// can add own properties and behavior - play basketball, change hair color
}
</code>
LeetCode 1470. Shuffle the Array (javascript solution)

Tags: algorithms, javascript
Published: 2021-06-06 00:49:52

###Description:
Given the array nums consisting of 2n elements in the form [x1,x2,...,xn,y1,y2,...,yn].

Return the array in the form [x1,y1,x2,y2,...,xn,yn].

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
var shuffle = function(nums, n) {
    let res = []
    for(let i = 0; i < n; i++){
        res.push(nums[i], nums[i+n])
    }
    return res
};
```
Reason why a company website need a blog page
Published: 2021-06-06 00:46:19

<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qfrf64enxivws958og6j.png">

What is a blog?
From Wikipedia
A blog (a truncation of "weblog") is a discussion or informational website published on the World Wide Web consisting of discrete, often informal diary-style text entries (posts). Posts are typically displayed in reverse chronological order, so that the most recent post appears first, at the top of the web page.
<br>

A blog is a portion of your website that give user(customer) more information about your services or subject relating to your services.
<br>

<h3>Reason for brand website to have a blog page</h3>
<br>
<h4>Enhance users interest</h4>
<p> having a blog on your website it'll help your brand create a platform that will grab your user interest, there by enable user to be engage and committed to your website.
Imagine you visit a blog website and it meet what you want, whenever you need such thing again the first that come to your mind is the blog that grab  your interest.
</p>
<h4>SEO</h4>
<p> having a blog post on your website increase your search engine rank,
When people search for anything related to your post the search engine will search through your posts.
This we drive many users to your website.

<h4>It help to meet customer needs</h4>
<p>
When users get engage with your blog post they'll leave comment maybe for suggestions, support, enquiry,etc. 
This'll help you to know how to satisfy your customers needs
</p>
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/07j584qufov2qu8e6ye7.png">
<h4>It enable user to share your website link</h4>
<p>
When your user find your post interesting and informative there is high tendency of them to share your post with others.
</p>


<h3>How to add blog post page to your website</h3>

Once you have already have a main website for your brand you may not necessarily need to buy another domain name (depending on your choice).

What you need to do is to create a sub-domain name on your website hosting platform

Under DOMAIN on your cpanel dashboard click on Sub-domain 
It take you to a page where you will create your blog page.

 Fill the create form and click on create
 <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4u1zs3s4onm3b68l1x2.png">

 Is advisable to use blog.domain-name.com has your Sub-domain for your blog page.

Once the blog Sub-domain is create successful, a folder 📂 will be created named blog, that is where all you'll upload all your blog script code.

<center> Thanks for reading, I hope you find this post helpful</center>
AWS Where Did My Pin Go?
Tags: aws, beginners, ux
Published: 2021-06-06 00:41:51

AWS Console interface has changed over the years. One of the features I loved when I started as a newbie using AWS was the capability to pin AWS services that I use regularly. 

One of the challenges as a newbie to AWS is remembering service names. AWS has over 200 fully-featured services. You can search for a service using the search bar or via the services drop-down box. However, that is hardly efficient if you plan on using multiple services regularly.

When I first started using the AWS console, the main services I was regularly using were EC2, Cloudwatch, S3, API Gateway, and CloudFront. In the beginning, before I found out about the pin option, I would search for each of these services and then navigate to the appropriate dashboard. This process was time-consuming. It become bit more annoying when I had to navigate to other services too.

To help improve usability, AWS provided the capability to drag, drop and pin the most used service in the navigation bar. This meant when I logged in next time, the services were already available in the navigation bar and I didn't have to search for them. That made my life easy. I would pin the services I plan on using regularly and the ones I didn't need, I would unpin them.

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

As of recent, I don't see that capability anymore. It has been replaced with a favorite option. Favorite perform the same functionality. Once you add the service to the favorite list, next time when you log into the console, you don't have to search for the service. It will show up in your favorite list. 

Here is how to add the service to your favorite list.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5246i85uatk4h7m0010o.png)


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

So if you are new to AWS console and trying to learn your way around it, I highly recommend that you leverage the favorite option. This will help you in the short term access your most regularly used service quickly. Once you become comfortable then you can start using other options to navigate to different services. 

**Note:** I have to say my personal preference is the pin over the favorite option. From a usability view, it was much simpler to access the service.


------------------------------------------------------------------

Thanks for reading!

If you enjoyed this article feel free to share on social media 🙂

Say Hello on: [Linkedin](https://www.linkedin.com/in/harinderseera/) | [Twitter](https://twitter.com/harinderseera) | [Polywork](https://www.polywork.com/harinderseera)

Github repo: [hseera](https://github.com/hseera)
Tailwind CSS - my favourite way to style a site
Tags: javascript, tailwindcss, css, styling
Published: 2021-06-09 20:10:27

---
title: Tailwind CSS - my favourite way to style a site
published: true
date: 2021-06-06 00:00:00 UTC
tags: javascript,tailwind,css,styling
canonical_url: 
---

I've recently stumbled across [Tailwind CSS](https://tailwindcss.com/).

Initially I thought this was a similar framework to [Bootstrap](https://getbootstrap.com/) which I found to be centred around component based classes (`btn` and `btn-warning`) and not helpful in making a site look _unique_.

Tailwind instead is a _utility-based framework_ which makes it highly flexible for **any** site. Each class they provide maps to a specific CSS style.

For example `flex` becomes `display: flex;` and `text-left` becomes `text-align: left;`

These classes can be applied to any component on your site.

Tailwind can cover every style you can think of, giving you little reason to have CSS directly in your code anymore.

My favourite reasons to use Tailwind:

- **There are no magic numbers, everything is part of a design system.** You don't need to remember that the header had a font size of 18px, but rather that all components with `text-lg` will have the same size. Having a predefined design system makes it a lot easier to build visually consistant UIs.
- **Never needing to come up with class names.** No more `header-btn` or `header-nav-dropdown`. Simply think up the styles you want and add the Tailwind classes directly. The context switch between the markup and the CSS file is enough of a pain point for me.
- **The CSS styles are tied to each component.** If you remove a component, the styles go with it. Not only does that remove dead code, but could also reduce the bundle size as Tailwind purges unused utility classes.

I think Tailwind is worth trying out. It's pretty fun to use even if it looks a little ugly at first. Here are a couple tips to help you get going:

- If you find yourself repeating classes across multiple parts of your site, you likely need to build smaller components - a good practice in general.
- Use the [Tailwind VS Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) to have an auto suggestion feature for Tailwind classes.
Why I spent more than 400 EUR on software I didn't want
Tags: tooling, productivity
Published: 2021-06-14 13:11:35

---
title: Why I spent more than 400 EUR on software I didn't want
published: true
date: 2021-06-06 00:00:00 UTC
tags: tooling,productivity
canonical_url: https://jhall.io/archive/2021/06/06/why-i-spent-more-than-400-eur-on-software-i-didnt-want/
---

I’m working with a client right now that requires me to use a company-owned MacBook Pro to access their corporate network.

I’m not a Mac user (and not for lack of trying), so I put their MacBook in the corner, and connect to it using remote desktop software when I need to access one of their corporate resources.

There are many free remote desktop tools. I tried a fiew of them, but none of them worked quite right for my needs. I eventually settled on the free version of TeamViewer.

Then about a month in, TeamViewer started exiting after 1 minute. I searched forums, and found complaints about this, and many claims that it’s a bug. I tried updating to the latest version of TeamViewer on both the server and the client, to no avail.

After a couple hours of this, I finally just bought a license for a more than €400. Holy crap!

A part of me was cringing, for two reasons:

1. I _know_ there are free solutions that should work. So why should I pay this much?
2. Even this commercial product _should_ work for me, with the trial version, so why should I pay this company to fix their own buggy software?

On principle, both of those reasons might make sense.

But at the end of the day, I have a job to do. And spending €400 would allow me to complete the job more effectively.

Investing the time necessary to get a free solution working would have cost me _much more_ than €400. In fact, it already had! I had already lost more than a full day fiddling with free software solutions. And that day I had lost 2 hours or more trying to debug the preview version of TeamViewer.

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
How to check if a string is a valid latitude and longitude combination in JavaScript?
Tags: javascript
Published: 2021-06-06 00:00:00

---
  title: How to check if a string is a valid latitude and longitude combination in JavaScript?
  published: true
  tags: JavaScript
  date: Sun Jun 06 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/check-if-string-valid-latitude-longitude-javascript
  cover_image: https://melvingeorge.me/_next/static/images/main-037dd7a8435c1b82b566c4048e258138.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/check-if-string-valid-latitude-longitude-javascript)
  
To check if a string is a valid latitude and longitude combination, we can use a regex expression in JavaScript.

### TL;DR

```js
// Regular expression to check if string is a latitude and longitude
const regexExp = /^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/gi;

// String with latitude and longitude separated by comma
const str = "9.9824245,76.5703886";

regexExp.test(str); // true
```

This is the regex expression for matching almost all the test cases for a valid latitude and longitude combination in JavaScript.

```js
// Regular expression to check if string is a latitude and longitude
const regexExp = /^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/gi;
```

Now let's write a string with latitude and longitude like this,

```js
// Regular expression to check if string is a latitude and longitude
const regexExp = /^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/gi;

// String with latitude and longitude separated by comma
const str = "9.9824245,76.5703886";
```

Now to test the string, we can use the `test()` method available in the regular expression we defined. It can be done like this,

```js
// Regular expression to check if string is a latitude and longitude
const regexExp = /^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/gi;

// String with latitude and longitude separated by comma
const str = "9.9824245,76.5703886";

regexExp.test(str); // true
```

- The `test()` method will accept a `string` type as an argument to test for a match.
- The method will return boolean `true` if there is a match using the regular expression and `false` if not.

See the above example live in [JSBin](https://jsbin.com/xizowufusa/3/edit?js,console).

If you want this as a utility function which you can reuse, here it is,

```js
/* Check if string is a valid latitude and longitude  */
function checkIfValidlatitudeAndlongitude(str) {
  // Regular expression to check if string is a latitude and longitude
  const regexExp = /^((\-?|\+?)?\d+(\.\d+)?),\s*((\-?|\+?)?\d+(\.\d+)?)$/gi;

  return regexExp.test(str);
}

// Use the function
checkIfValidlatitudeAndlongitude("9.9824245,76.5703886"); // true
checkIfValidlatitudeAndlongitude("9.2323,1212notValid"); // false
```

That's all! 😃

### Feel free to share if you found this useful 😃.

---
Award-winning courses from the joint number 1 English language school in the Turkey
Published: 2021-06-05 23:47:34

<p><a href="https://www.tadmecidiyekoy.com/genel-ingilizce-egitimi">şişli ingilizce kursu</a></p>
Türk American Association from 1951 to the present day, the training staff specializing in foreign languages, educational solutions that produce educational solutions for their students will talk to the English-Oriented Education Method in very short time with a student-oriented training method. The purpose of the <strong> General English Course  is to enable students to learn quick, understandable and effectively without being compressed in a specific fixed course system. Our most important goal is to take the quality of education to the highest point, to provide our students training in an environment that experiences overseas experience. 

Mecidiyeköy English courses Communicative Approach Method in our education is used. This training is mainly similar to Methodu. Our trainees will find the opportunity to speak with more in classes in contrast to the customary methots with this training system.

<p> <strong> Mecidiyeköy & Nbsp; English Course. In our education, each student has a free private language right to pass the training of our trainees in our education. This fee can get free private lessons if you have missed the topics you have missed on the days you have missed with the component of compensation or if there are issues you don't understand in the course.
A Gift Wrap
Tags: vscode, beginners, convenience, psa
Published: 2021-06-05 23:39:44

Hey friends! This is a super quick post that I wanted to write as a little PSA for any of you beginners out there who use VSCode. If you are like me, you may not have gone through all of the settings in VSCode yet and, perhaps you have not realized yet that a text wrapping setting exists to keep your code from overflowing horizontally. I just wanted to bring it to your attention and tell you how to turn it on.

From the menu bar, open the dropdown menu for **Code** and select **Preferences**. From there, open up your **Settings**.

*You can jump straight to this point by using the shortcut:
`⌘` + `,` (Mac) or `Ctrl`+`,` (PC).*

Within **Settings**, go into the section for **Text Editor** and scroll all the way down until you get to **Word Wrap**. Turn that **on**.

Boom. Check that out. Much easier to read and you don't have to create your own line breaks!

I hope that's helpful. Now go be productive!
Deploying Azure Data Factory using Bicep
Tags: azure, devops, tutorial, database
Published: 2021-06-05 23:27:14

---
title: Deploying Azure Data Factory using Bicep
published: true
description: 
tags: azure,devops,tutorial,database
//cover_image: https://direct_url_to_image.jpg
---

So after a long break (caused by a combination of laziness and actually being busy), I'm attempting to get back into creating more video content.

In this video, I'm using Bicep to deploy Azure Data Factory! Bicep is Domain Specific Language for deploying resources to Azure and is a HUGE improvement over ARM templates.

{% youtube mtn58qKwJxc %}

I've been trying to learn [Bicep](https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbmJ2TkVJb08zWU9vdnViUWJLd3Jrb1BQSmxCUXxBQ3Jtc0trUklnVjdEQlc3ZENfMnA5N1c2UVZWMWNfOGtYeDV0eG1lUGxMdmhIcTZmdmI5N3Frb080R1ZJU05SMHBXNldsU255WHJkUHBKaTdMZlNMQVNmbHQzYmxZdC1qZkFZU3dOY09YR0c2dnlUZWtKQmhLdw&q=https%3A%2F%2Fgithub.com%2FAzure%2Fbicep) for my new job. Usually when it comes to Infrastructure code, I'd opt for Terraform since that's the first IaC tool I learnt. In my new role, I'm using ARM a lot more.

To be honest, I never really liked ARM. Messing about with JSON files wasn't my idea of fun, so when I first saw Bicep I was keen to give it a go.

I'm also planning to do more content with [Azure Data Factory](https://azure.microsoft.com/en-us/services/data-factory/), so I'd thought it be good to make a video combining the two.

If you have any questions about the video, feel free to comment here or on YouTube.