teleren/devto huggingface dataset:
Map a Local Folder to a Virtual Drive - Windows 10
Tags: windows, map, subst
Published: 2021-05-17 08:24:34

#### The Problem

I ran into a licencing issue with an old ASP.NET Web Forms project. The developer license links to the initial install location. Due to the age of the project, I can no longer update the licence key for the new location. 

> <figure>
<pre>    d:\projects\{client}\src </pre>
<figcaption> The path linked to the license. </figcaption>
</figure>

So how do I create a location on a drive that my current machine does not have?

Option 1: Make a new partition on my machine (Not ideal)

Option 2: Google a different solution.


Found the following article from 2014: <a href="https://www.computerworld.com/article/2694895/how-to-map-a-local-folder-to-a-drive-letter-in-windows.html" target="_blank">How to map a local folder to a drive letter in Windows</a>. It looked simple to implement and not a permanent change. 


### The SUBST command
<figure>
<pre>
   subst /?
   Associates a path with a drive letter.

   SUBST [drive1: [drive2:]path]
   SUBST drive1: /D

     drive1:        Specifies a virtual drive to which you want to assign a path.
     [drive2:]path  Specifies a physical drive and path you want to assign to
                 a virtual drive.
     /D             Deletes a substituted (virtual) drive.

   Type SUBST with no parameters to display a list of current virtual drives.
</pre>
<figcaption>The subst help output.</figcaption>
</figure>


---
#### 1. So first things first I needed a root folder to map to.

> <figure>
<pre> mkdir c:\files\fakeddrive </pre>
<figcaption> The fake root folder </figcaption>
</figure>

---

#### 2. Next up duplicate the folder structure:

> <figure>
<pre> 
    mkdir c:\files\fakeddrive\projects
    mkdir c:\files\fakeddrive\projects\{client}
    mkdir c:\files\fakeddrive\projects\{client}\src
 </pre>
<figcaption> Create the path </figcaption>
</figure>

---

#### 3. Next up run `subst` 

> <figure>
<pre> 
   subst d: c:\files\fakeddrive
 </pre>
<figcaption>Run The Command </figcaption>
</figure>

----

## The results

<figure>
<pre>
   > subst
   D:\: => C:\files\fakeddrive
</pre>
<figcaption>
List of current virtual drives.
</figcaption>


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

There are a couple of things to keep in mind:

* Don't run as an elevated user.
* The drive does not survive a reboot.
* remove the mapping `subst d: /D`
Nginx
Published: 2021-05-17 08:23:45

Nginx, stylized as NGINX, Nginx, or NginX, is a web server that can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. The software was created by Igor Sysoev and publicly released in 2004. Nginx is free and open-source software, released under the terms of the 2-clause BSD license.

It is also called reverse proxy..
[Nginx](http://avinash-sharma.com)
Cron Job Tutorials - How to set up cron job for Booking Calendar?
Published: 2021-05-17 08:23:03


I installed Booking Calendar on my server, and I want to set up a cron job to trigger Booking Calendar's cron job script. What should I do to set up the cron job?

https://www.easycron.com/cron-job-tutorials/how-to-set-up-cron-job-for-booking-calendar

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gwha09x5l88rr67nh07e.png)
In the pursuit of AWS Cloud Practitioner Certification
Tags: aws, cloudskills
Published: 2021-05-17 08:17:57

# Goal

I have set myself a goal at the start of 2021: 

**Get my AWS Cloud Practitioner Certification**.

First half of the year went past, still no progress. I am doing something about this. I am making it public here at dev.to

## Exam Guide

* You can download the [exam guide](https://aws.amazon.com/certification/certification-prep/).

From the guide, you should be able to pass the certification exam if you are able to demonstrate knowledge in these areas:

1. Cloud Concepts
1.1 Define the AWS Cloud and its value proposition
1.2 Identify aspects of AWS Cloud economics
1.3 List the different cloud architecture design principles

2. Security and Compliance
2.1 Define the AWS shared responsibility model
2.2 Define AWS Cloud security and compliance concepts
2.3 Identify AWS access management capabilities
2.4 Identify resources for security support

3. Technology
3.1 Define methods of deploying and operating in the AWS Cloud
3.2 Define the AWS global infrastructure
3.3 Identify the core AWS services
3.4 Identify resources for technology support

4. Billing and Pricing
4.1 Compare and contrast the various pricing models for AWS
4.2 Recognize the various account structures in relation to AWS billing and pricing
4.3 Identify resources available for billing support

## The Process

I have signed up at ACloudGuru's course of the same name: 

[AWS Certified Cloud Practitioner by Ryan Kroonenburg](https://acloudguru.com/course/aws-certified-cloud-practitioner) 

Everyday, I will login to this course and consume at least one video.

Once I get to the end of the course, I have consumed 80+ videos from the course.

A good tip I received from a colleague, once I have finished the course, get a udemy practice exam course. 

Once I get consistent passing marks, I am ready to book my aws cloud practitioner exam.

## Progress

I made good progress today and finished the introduction bit. A total of four videos.
Defsys Solutions says Rafale supplied 50 replicas to the aircraft maker 
Tags: defsyssolutions, sushantguptadefsys, defsys
Published: 2021-05-17 08:07:15

Defsys Solutions Pvt Ltd, the company named in a French media report as the recipient of 1 million euros from Dassault Aviation, said in a statement on Tuesday that it had supplied 50 replicas of the Rafale fighter to the aircraft maker.

“This is in response to wholly unsubstantiated, baseless and misleading claims appearing in certain sections of the media, insinuating that Defsys never supplied 50 replica models of Rafale aircraft,” Defsys said. “Delivery challans, E-way bills and GST returns related to such delivery have been duly filed with the relevant authorities.”

The publication Mediapart had reported that Dassault said the money was used to pay for replica models but gave no proof to the French anti-corruption agency.

“Dassault group was unable to provide the AFA (Agence Française Anticorruption) with a single document showing that these models existed and were delivered, and not even a photograph. The inspectors thus suspected that this was a bogus purchase designed to hide hidden financial transactions,” it said.

Read more here : https://www.telegraphindia.com/india/rafale-supplied-50-replicas-to-the-aircraft-maker-says-defsys/cid/1811793
What is logical deletion and physical deletion?
Tags: database
Published: 2021-05-17 07:47:57


[What is logical deletion and physical deletion? | off.tokyo]
(https://off.tokyo/blog/what-is-logical-deletion-and-physical-deletion/)
<h2>What is logical deletion?</h2>
&nbsp;

Logical deletion is the process of not actually deleting the data,

&nbsp;

but setting a column called "flag" to make it appear as if the data has been deleted to the user.

&nbsp;

For example, if you have a tweets table

For example, if you have a tweets table, you can add a boolean column called deleted_flag to the table.

In this state, the default value of the deleted_flag column is null.

In this way, when a user presses the delete button of a tweet,

&nbsp;

the deleted_flag will be set to 1, and the tweet will be treated as deleted.

&nbsp;
<h2>Physical Deletion</h2>
&nbsp;

A physical deletion is an actual deletion in SQL,

&nbsp;

and is also deleted from the database.

&nbsp;

Therefore, you can't restore or refer to the deleted data.

&nbsp;
<h2>Advantages of Logical Deletion</h2>
&nbsp;

As mentioned in the previous example,

&nbsp;

it only acts as if the data has been deleted, so it is possible to restore the data immediately.

&nbsp;

Another advantage of logical deletion is that it is faster than physical deletion.

&nbsp;
<h2>Disadvantages of logical deletion</h2>
&nbsp;

You don't want to create NUll data in the database.

&nbsp;

(I think this can be solved somehow, though.)

It is necessary to add a flag condition when

&nbsp;

performing a narrowed search with a where clause.
Beauty of Encapsulation, but in Redux, everything is global and we shout
Tags: react, redux, discuss
Published: 2021-05-17 07:41:25

I thought programming was becoming really beautiful: local variables, encapsulation first into a structure, and then we have Object-oriented programming, so we encapsulate both the values and the methods into a structure, and it was really beautiful.

And then now we have Redux, where everything is global. Everybody can read it if they want to, but to prevent anybody from modifying it, we "SHOUT".  Just like my coworkers, "Shout out to Peter", "Shout out to Susan". Now they "Shout out to global variables (state). Change it this way and that way."

I actually did some JavaScript framework where everything was an object, and we communicate to the object through methods, the usual way... and it worked quite well.

But... a big pool of global variables, a lot of shouting. Tons of selectors, tons of reducers, tons of middleware or other libraries, saga, rematch, etc, etc.  Let's see where this is going.  In 20 or 100 years, I wonder if people'd say, "our software engineering has improved a lot. It all started with a big pool of global variables and a lot of shouting."
webpack 5 - what can we achieve without using it
Tags: webpack, javascript
Published: 2021-05-17 07:40:57

If you are new to js, you can get confused with all the tooling people are using. Before you decide on including webpack, or any other js bundler let's take a look first at what modern browsers allow us to achieve without any additional dependencies.

# Short summary

1. Native js modules allow us to import files from js, without any bundlers. More on modules - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
2. If you make sure `node_modules` are with your application on the production deployment - you can import npm modules from your code as well.

# Links
* [webpack video course](https://bit.ly/WebpackCourse)
* [respitory](https://github.com/marcin-wosinek/no-webpack)

# Full discussion

{% youtube rpf0wIhOhd8 %}

In the [next article](https://dev.to/marcinwosinek/webpack-5-benefits-of-using-js-bundler-4h10), I'll show the actual benefits of using a bundler, such as webpack 5.
How can I become a data scientist when I know nothing about machine learning
Tags: datascience, machinelearning, algorithms, database
Published: 2021-05-17 07:21:26

AI is just one of the approaches to get into Data Science. Above all else, you need to really have the enthusiasm for this space to prevail in it as it requires difficult work and a great deal of training. You will as of now be most of the way there. Other than Machine Learning, you could begin seeking after Data Science with any of the accompanying referenced abilities 

Programming in Python

R programming

Statistics

Big Data Hadoop

SQL Database/Coding

Apache Spark

Multivariable Calculus & Linear Algebra

Unstructured Data 

Data Visualization & Communication

On the off chance that you have no related knowledge at all, you can begin with Python as it is a simple language to learn. There are a few assets that you can go to effectively seek after Data Science. 

Postgraduate education - Data Science, Statistics, Mathematics, and Computer Science programs 

Web based Learning Platforms – Intellipaat, Coursera, Udacity, codeacademy, and so on 

Certificates – Intellipaat, Simplilearn, Coursera, and so on 

Bootcamps 

Networks like Kaggle – Kaggle is a Data Science people group that has rivalries where you can work with true data and give genuine business answers for issues. It is viewed as significant, hands-on project work. 

LinkedIn Groups – Join important gatherings to associate with the data science local area individuals on LinkedIn. 

Confirmations are an extraordinary method to begin your Data Science profession. Intellipaat's [Best Online Data Science Courses](https://intellipaat.com/data-scientist-course-training/) has been intended for applicants in a joint effort with IBM. It incorporates a few continuous ventures also the chance to get situation help to apply to top MNCs all throughout the planet
Face detection using openCV python.
Tags: showdev, watercooler, discuss, machinelearning
Published: 2021-05-17 07:17:57

## Face detection is really fun, attractive and it has its own use.
**Without going in much definition let's jump to our implementation.**

## What is openCV?
openCV stands for **Open source computer vision.** it is a library of programming functions mainly aimed at real-time computer vision.

*For making task easier they have pretrained model name [haarcascade](https://github.com/opencv/opencv/tree/master/data/haarcascades)
which provides good accuracy.*

## Approach.
* install opencv at first.
```
pip install opencv-python
```
* Import libraries
```
import cv2
```
* Attach [frontal-face](https://github.com/opencv/opencv/blob/master/data/haarcascades/haarcascade_frontalface_default.xml) and apply basic logic.
```
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
# Read the input image
img = cv2.imread('your-image')
# convert it into gray code from BGR
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
# apply a scale of 1.1 and 4
faces = face_cascade.detectMultiScale(gray, 1.1, 4)

# Make rectangle around face of green colour and thickness of 3.
for (x, y , w ,h) in faces:
  cv2.rectangle(img, (x,y), (x+w, y+h), (0, 255 , 0), 3)

# Display the output
cv2.imshow('img', img)
cv2.waitKey()
```
* And here you are done.... Output image
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x76xdnhmp1oxm0scbioa.jpeg)

### This code will detect multiple faces on any image with great accuracy.

*It is also possible to detect multiple faces in realtime in videos.*
**That will be a part of my next blog.**
(You can ask doubt in comment section.)

**Thanks for reading.**
**Rishabh Dwivedi.**
Increase Productivity with Commands and Shortcuts
Tags: productivity, linux, git
Published: 2021-05-17 07:12:40

Commands and shortcuts can boost your productivity :fire: 

If you are a developer, commands and shortcuts are everywhere. Knowing the commands and shortcuts saves you a lot of time.

As a programmer, you most likely use [git](https://git-scm.com/) or will have to use git. Git is a version control system that is often used to work with code. 

[Vim](https://www.vim.org/), a programmers editor, heavily uses commands/shortcuts. The `w` to jump to the next word, `b` to jump backwards, `/` to search, `d2w` to delete two words and so on.

You probably have to learn SQL if you use databases. Nearly all web apps use a database and SQL is the language that interacts with databases.

Linux commands are the most important part for the study of Linux. Without the knowledge of these commands, a normal Linux user cannot compete with an advance or an expert! 

You can [practice git](https://shortcut.so/overview/git), [practice linux](https://shortcut.so/overview/linux) and [others](https://shortcut.so/home) online instead of going through hundreds of manuals or blogs :smile:

## Show me commands 

Some Linux commands are shown below. The ls command lists the contents of directories

```
$ ls
```

The tree command lists the contents of directories in a tree-like format.

```
$ tree
```

The du command shows disk usage for a directory and its subdirectories.

```
$ du
```

The find command find files.

```
$ find . -name "*.mkv"
```

The tail command just prints the last 10 lines of a file.

```
$ tail ~/.bash_history
```

The head command prints the first 10 lines of a file.

```
$ head ~/.bash_history
```
Frontend boilerplate with React, Next.js & TailwindCSS
Tags: react, nextjs, tailwindcss, frontend
Published: 2021-05-17 07:03:32

Introducing the one-in-all boilerplate for your next project!

I've spent the entire week structuring this repo to make it super-insanely-easy to deal with modals, forms (ugh), and tons of other small breakpoints!

**Live demo** 
http://align-items.center/

Modal as seen on the page
![Modal](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/03aujl9z1jf0unzr131m.png)

Code for the modal above
![Modal on image above](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/69903hl22m6mhbndhksr.png)

Forms
![Forms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/46aj8as6md7noe260uw7.png)

Code for the image above
![Code for forms](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/arrzj2cz49d9ivdrdm1j.png)

**GitHub Repo**
https://github.com/audn/frontend-boilerplate

**If you're using it, I'd appreciate if you left a Star for your followers to see it in their feed!**

What you can expect:
- Framer motion
- Google Analytics setup
- Responsive at all sizes + hamburger 
- Typescript interfaces
- Regex for regular stuff such as url/emails
- Modal component
- Premade Button components `<Button.Primary title={..}/`
- Premade <Input> for normal inputs, textarea & checkboxes
- SEO optimization built into the `<Layout>` component
- Cookies!
How to Convert an Image to PDF Using Java
Tags: java, pdf, image
Published: 2021-05-17 06:59:45

File format conversion is the most commonly used function when we are dealing with Word, Excel, PowerPoint or PDF documents. This article will introduce how to convert an image to PDF programatically with Free Spire.PDF for JAVA. This free Java library supports converting multiple image formats such as BMP, JPEG, GIF, PNG, TIFF and ICO to PDF.

**Import jar dependency (2 Methods)**
● Download the [Free Spire.PDF for Java](https://www.e-iceblue.com/Download/pdf-for-java-free.html) and unzip it.Then add the Spire.Pdf.jar file to your project as dependency.

● Directly add the jar dependency to maven project by adding the following configurations to the pom.xml.
```xml
<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.pdf.free</artifactId>
        <version>4.3.0</version>
    </dependency>
</dependencies>
```

**Convert Image to PDF:**
```java
import com.spire.pdf.PdfDocument;
import com.spire.pdf.PdfPageBase;
import com.spire.pdf.graphics.PdfImage;

import java.awt.geom.Rectangle2D;

public class ImageToPDF {
    public static void main(String[] args){
        //Create a PdfDocument instance
        PdfDocument pdf = new PdfDocument();
        //Add a page
        PdfPageBase page = pdf.getPages().add();

        //Load the image
        PdfImage image = PdfImage.fromFile("C:\\Users\\Administrator\\Desktop\\source.jpg");

        //Draw the image to the specific rectangular area of the page 
        double widthFitRate = image.getPhysicalDimension().getWidth() / page.getCanvas().getClientSize().getWidth();
        double heightFitRate = image.getPhysicalDimension().getHeight() / page.getCanvas().getClientSize().getHeight();
        double fitRate = Math.max(widthFitRate, heightFitRate);
        double fitWidth = image.getPhysicalDimension().getWidth() / fitRate;
        double fitHeight = image.getPhysicalDimension().getHeight() / fitRate;
        page.getCanvas().drawImage(image, new Rectangle2D.Double(0, 0, fitWidth, fitHeight));

        //Save the resultant document
        pdf.saveToFile("ImageToPDF.pdf");
    }
}
```

**A screenshot of the output PDF file:**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apk2r1agbrayd0z7d8tj.jpg)
Setting Visual Studio code up for Python
Tags: python
Published: 2021-05-17 06:58:08

I found this super cool feature when you open a Python file in Visual Studio Code. It will help you and suggest the Python plugin.

![Visual Studio Code Python plugin](https://cdn.hashnode.com/res/hashnode/image/upload/v1620886312244/nJgGt3GHB.png)

And for beginners in Python like me, this plugin is super helpful.
Out of the box, it has some outstanding features.

You can [download the Python Visual Studio Code plugin here](https://marketplace.visualstudio.com/items?itemName=ms-python.python).

## Running Python files in Visual Studio Code

The plugin will bring this cool run button to run your Python scripts inside Visual Studio automatically.

It will automatically start your environment and execute the command from there, which is incredible!

![Running Python inside Visual Studio Code](https://cdn.hashnode.com/res/hashnode/image/upload/v1620886496761/A_NtJ4sO4.png)

It also introduces more run functions to execute a test and many more options for Python files.

## IntelliSense and documentation

These are super handy for anyone.
The plugin will provide IntelliSense auto-complete functionality, as you can see in the screenshot below.

![VSC Python IntelliSense](https://cdn.hashnode.com/res/hashnode/image/upload/v1620886723334/-utdqavzs.png)

Furthermore, it can even state documentation when we hover on certain blocks of code.

![Python documentation in Visual Studio Code](https://cdn.hashnode.com/res/hashnode/image/upload/v1620886806068/bZv2BnDm5.png)

## Debugging Python files

We can easily set breakpoints in our code, then visit the Run & Debug tab and execute the run.

This will, in return, stop the code at that breakpoint and tell us what's going on till that point.

![Debugging Python in Visual Studio Code](https://cdn.hashnode.com/res/hashnode/image/upload/v1620887146568/eHON7BW7T.png)

There are even more cool features to this plugin, but I found these to be super useful for people starting Python.

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
8 Best Practices for REST API Design
Tags: javascript, react, webdev
Published: 2021-05-17 06:25:49

**1. Automate Caching**

Repeated request and responding to those request consumes resources and this becomes a sign of flawed design. To solve this problem you must store data fetched from the API on the server and serve later from there.
However, there are times when the data becomes outdated and needs to be updated, in this case, we have some industry caching solutions (Redis and Amazon ElasticCache) that can cache data even after making changes.

**2. API Documentation**

Always provide clear and concise documentation is necessary for any API, it becomes harder to use that API later without good documentation. So make sure that your API has good documentation using simple languages with updates and new releases.
Your API Documentation should include the following:

*Simple and easy to read language.*
*Implementation of API in different programming languages.*

**3. Don't Return Plain Text**

It is not necessary to go above JSON in REST architecture, as most REST APIs use JSON as a data format. But there are times when returning a body that contains a JSON-formated string isn't enough.

*Such as you can specify the Content-Type header set to the value application/json.*

**4. 401 VS 403**

Both the status codes have different meanings and it is very easy to get confused whether it related to authentication or authorization. In order to resolve issues faster, you need to know the difference.
If the user hasn't provided authentication details or they were invalid, then it is 401 Unauthorized.
And if the user successfully authenticated but didn't provide the permissions to access the resource, then it is 403 Forbidden.

Read More at: https://javascript.plainenglish.io/8-best-practices-for-rest-api-design-3fd1b837b283