teleren/devto huggingface dataset:
Comparing values using Object.is() in Javascript
Tags: javascript, codenewbie, webdev, todayilearned
Published: 2020-06-10 08:35:43

In Javascript, using **Object.is()** you can determine if two values are equal or not. **Object.is()** helper function is introduced in **ES6**.

## Syntax

> **Object.is(val1, val2)**

### Parameters
Values to compare **val1** and **val2**.

### Return Value
**Object.is()** returns a Boolean which indicates if **val1** is having the same value as **val2** or not.

## Value Comparision
**val1** and **val2** are same in case of Object.is() in case of following conditions:

### val1 and val2 are both null
```javascript
let val1 = null;
let val2 = null;
Object.is(val1, val2)
// true
```
### val1 and val2 are both undefined.
```javascript
let val1 = undefined;
let val2 = undefined;
Object.is(val1, val2)
// true
```

### val1 and val2 are both NaN
```javascript
let val1 = NaN;
let val2 = NaN;
Object.is(val1, val2)
// true
```

### val1 and val2 are both of the same Boolean value i.e. true or false.

```javascript
let val1 = true;
let val2 = true;
Object.is(val1, val2)
// true

let val3 = false;
let val4 = false;
Object.is(val3, val4)
// true

let val5 = true;
let val6 = false;
Object.is(val5, val6)
// false
```

### val1 and val2 are referencing the same object.
```javascript
let val1 = { name: "Object comparison" };
let val2 = val1;
Object.is(val1, val2)
// true

let val3 = { name: "Object comparison" };
let val4 = { name: "Object comparison" };
Object.is(val3, val4)
// false

```

### val1 and val2 are both non-zero numbers and have the same value.
```javascript
let val1 = 42;
let val2 = 42;
Object.is(val1, val2)
// true

```
### val1 and val2 are both either +0 or -0.
```javascript
let val1 = +0;
let val2 = +0;
Object.is(val1, val2)
// true

let val3 = -0;
let val4 = -0;
Object.is(val3, val4)
// true

let val5 = +0;
let val6 = -0;
Object.is(val5, val6)
// false
```

## Note on Object.is(), "==" and "==="

- Object.is() works differently than "==" operator as it does not apply coercions before comparing the values.

```javascript
console.log(1 == [1]);
// true
console.log(1 == "1");
// true

console.log(Object.is(1, [1]));
// false
console.log(Object.is(1, "1"));
// false
```

- Object.is() also works differently than "===" operator as the "===" operator treats +0 and -0 as equals and NaN as not equal to itself.
```javascript
console.log(+0 === -0);
// true
console.log(Object.is(+0, -0));
// false

console.log(NaN === NaN);
// false
console.log(Object.is(NaN, NaN));
// true

```
---
**Cover Image**: Image by <a href="https://pixabay.com/users/MartinHarry-1411929/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=941625">Martin Pyško</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=941625">Pixabay</a>

---
***This article was first published on [hackinbits.com](https://hackinbits.com/articles)***
Insight #2 - Format code in Github comments with Prettier
Tags: javascript, typescript, node, github
Published: 2020-06-10 08:25:23

Aren't you tired of indenting manually Github issue code?

This [Chrome plugin](https://chrome.google.com/webstore/detail/prettier/fbcfnmplppajblbmdehballiekfgdkhp/related) will handle it for you, adding a `Prettier` button next to the regular Github buttons.


From:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8g16ohkp8ng1es2bqym8.png)


To:

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

In a single click :)

It should work with many languages (same as Prettier), and also on StackOverflow.

---

Part of my Insights serie (I try to write short/daily posts).
Follow me on [Twitter](https://twitter.com/sebastienlorber), [Dev](https://dev.to/sebastienlorber), or check my [website](http://sebastienlorber.com/)
Migrate React App To TypeScript
Tags: react, typescript, javascript, beginners
Published: 2020-06-10 08:06:53

For react projects created with [create-react-app](https://create-react-app.dev/docs/getting-started/), it is very easy to migrate to [Typescript](https://www.typescriptlang.org/). This will guarantee type checking and proper linting of the codebase.

## Steps


### 1. Install necessary dependencies

```shell
# yarn
yarn add -D typescript @types/node @types/react-dom @types/jest @types/react-router-dom

# npm
npm install --save-dev typescript @types/node @types/react-dom @types/jest @types/react-router-dom
```

**Note:** most react/npm packages will require an `@types/<package-name>` dependency to work with typescript. So add them accordingly

### 2. Change file extensions

- Change component files from `.js` or `.jsx` to `.tsx`
- Change other javascript files from `.js` to `.ts`
- Fix import statements
- Fix any other issues that may arise

Since react works with es6 syntax, switching to typescript should raise minimal to no issues

### 3. Start project

```shell
# yarn
yarn start

# npm
npm start
```

Starting the project will automatically create a `tsconfig.json` file with all the necessary settings

### 4. Add Type to variables and functions

Append the **type** for each variable, parameter and **return type** for each function or method.

For example, change the following javascript function:

```javascript
function add(a, b) {
  return a + b;
}
```

to the following typescript function:

```typescript
function add(a: number, b: number): number {
  return a + b;
}
```

Both parameters in the function have a type of `number` and the function also has a return type of `number`

### 5. Define Classes/Interfaces for Complex Data

This includes data from API's and redux state

Thanks 👍 for making it to the end 👨‍💻 and I really hope you found the content useful.

Leave a comment below or tweet me @ElishaChibueze if you have any questions or suggestions
ĐAM MÊ LÀM GAME? HÃY ĐẾN VÀ TÌM HIỂU LẬP TRÌNH UNITY LÀ GÌ?
Published: 2020-06-10 08:04:34

Bạn có niềm đam mê trở thành lập trình viên game chuyên nghiệp? Bạn đang băn khoăn không biết nên đến với nền tảng nào để bắt đầu hành trình của mình? Hãy đến với lập trình game trên Unity – Engine phổ biến nhất trong thế giới game và mang đến cơ hội nghề nghiệp ngoài sức tưởng tượng.
http://24htechtrend.com/index.php/lap-trinh-unity-la-gi/
Encrypt/ Decrypt PDF Files in Java Application
Tags: java, pdf, encrypt, decrypt
Published: 2020-06-10 08:01:10

In daily work, it is important for us to encrypt the confidential PDF files or contracts before transferring them, because this will greatly avoid the prying of confidential content by third parties. In this article, I will share a free Java PDF library named Free Spire.PDF for Java to help us encrypt and decrypt PDF files through simple code.

**Installation**
**Method 1:** 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.

**Method 2:** You can also add the jar dependency to maven project by adding the following configurations to the pom.xml.

```java
<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>2.6.3</version>
    </dependency>
</dependencies>
```

**Encrypt PDF:**

```java
import java.util.EnumSet;

import com.spire.pdf.PdfDocument;
import com.spire.pdf.security.PdfEncryptionKeySize;
import com.spire.pdf.security.PdfPermissionsFlags;

public class EncryptPDF {

    public static void main(String[] args) {

        //Create a PdfDocument instance
        PdfDocument doc = new PdfDocument();
        //Load a PDF file
        doc.loadFromFile("input.pdf");

        //Encrypt the file
        PdfEncryptionKeySize keySize = PdfEncryptionKeySize.Key_128_Bit;
        String openPassword = "123-abc";
        String permissionPassword = "test";
        EnumSet flags = EnumSet.of(PdfPermissionsFlags.Print, PdfPermissionsFlags.Fill_Fields);
        doc.getSecurity().encrypt(openPassword, permissionPassword, flags, keySize);

        //Save and close
        doc.saveToFile("EncryptPDF.pdf");
        doc.close();

    }
}
```

![](https://dev-to-uploads.s3.amazonaws.com/i/zetrmli7u7g2lhuq7nwg.png)

**Decrypt PDF:**

```java
import com.spire.pdf.PdfDocument;
import com.spire.pdf.security.PdfEncryptionKeySize;
import com.spire.pdf.security.PdfPermissionsFlags;

public class DecryptPDF {

    public static void main(String[] args) throws Exception {

        //Create a PdfDocument instance
        PdfDocument doc = new PdfDocument();
        //Load the PDF file
        doc.loadFromFile("EncryptPDF.pdf", "test");

        //Decrypt the file
        doc.getSecurity().encrypt("", "", PdfPermissionsFlags.getDefaultPermissions(), PdfEncryptionKeySize.Key_256_Bit, "test");

        //Save and close
        doc.saveToFile("DecryptPDF.pdf");
        doc.close();
    }
}
```
![](https://dev-to-uploads.s3.amazonaws.com/i/bcakqvb22ezc7pr73n78.png)
Programming Principles worth following
Tags: beginners
Published: 2020-06-10 07:29:29

So, today we are going to have a look into some well-known programming principles which always come handy while coding. 

# 1. KISS : Keep It Simple Stupid
The following quote has rightly explained it:

<blockquote>Any fool can write code that a computer can understand. Good programmers focus on writing the program in a humans understand.</blockquote>
<cite>Martin Fowler</cite>


# 2. DRY : Don't Repeat Yourself
Implement functions for the block of code commonly used in your program and call out the functions as needed rather rewriting the complete code.

![TYPING CODE GIF](https://media.giphy.com/media/RRerwvHrb0nxm/giphy.gif)

# 3. 4C's : Clean Code, Clever Code
The code we write is a way of our thinking to solve/create a given thing/scenario. It has to be different than the other. So, how do we grasp a thinking which is <strong>NOT</strong> as same as ours ? 
Here comes our third point into play. We must aim for the best readability of our code so that others can understand your way of thinking, your way of coding. 

<blockquote>Readability matters.</blockquote>
<cite>Tim Peters, (The Zen of Python)</cite>

# 4. YAGNI : You Aren't Gonna Need It
We usually comment the code from our code base thinking that we might need it in future. But, that's rarely going to happen. So, don't just let your code rot over there. You have the power of Git, USE IT !

![THINKING GIF](https://media.giphy.com/media/LR5S0IAxyu6hwtO0Ia/giphy.gif)

With that, these are some of the programming principles which can upgrade your coding & programming skills.
20+ Essential TYPO3 Blog Tools
Published: 2020-06-10 07:28:04

While there are other blogging platforms out there like WordPress and Blogger.com we TYPO3 lovers have always thought of TYPO3 as a blogging platform because of its creative freedom and flexibility.

Lesser known fact, but TYPO3 gives us greater control over the look and feel of our blog—more creative control than any other platform. And yes, TYPO3 itself is absolutely free!

Wondering what are the best blogging tools are for TYPO3 websites and blogs? You’ve come to the right place! In this article, we’ll give you the best blogging tools available to help you craft better blog posts, boost your traffic, rank on Google, and more.

Explore Essential TYPO3 Blogging Tools where you'd get,
- Free TYPO3 Blog Template - T3 Clean Blog
- Import Google Docs to TYPO3
- TYPO3 Blog Extension
- TYPO3 News Extension
- T3Blog
- Blogging
- Comment functionality for TYPO3 Pages
- TYPO3 Comment Extension for EXT:news
- Comments for TYPO3 CMS
- TYPO3 Disqus Comment Extension
- TYPO3 Facebook Comment
- TYPO3 Guestbook Extension
- TYPO3 Core SEO
- Yoast SEO TYPO3 Extension
- Clickstorm SEO
- All in One Feedback
- luxletter - TYPO3 Email Marketing Newsletter Tool
- Social Media Streams
- Scheduled Social
- Twitter TYPO3 Extension
- Instagram TYPO3 Extension
- Youtube TYPO3 Extension
- ShareThis TYPO3 Extension

Visit https://t3terminal.com/blog/typo3-blog-tools/ to read complete blog.
trendmicro.com/bestuypc
Published: 2020-06-10 07:18:26

<a href="https://tbestbuypc.com/">trendmicro.com/bestbuypc</a> Support specialists can lend their hand to download, introduce and update Trend Micro Spy Sweeper Antivirus on your framework. We can likewise fix all blunders that may manifest while introducing and arranging Trend Micro  Antivirus on your PC without the circle. We can enable you to distinguish and expel malignant dangers, malware and spyware by playing out a snappy sweep on all documents and organizers. With our strong innovation, we can demolish suspicious projects and tainted documents from your framework. Our antivirus specialists can clean all online dangers, including Trojan, root units, key lumberjacks, and worms in simply single scope. We can upgrade your PC’s speed and productivity and furthermore shield it from being drowsy. 

<a href="https://tbestbuypc.com/">www.trendmicro.com/bestbuypc</a> Security secures your connected world, supplying protection against malware, ransomware, and online banking threats. exploitation advanced computing, it conjointly helps guard you from fraud, coin-mining, and file-less malware, viruses, on-line technical support, and phishing scams, just go to trend micro activation login and shield yourself.
MontiMark - Watermark + Web Monetization
Tags: gftwhackathon, showdev, webdev
Published: 2020-06-10 07:02:35

[Instructions]: 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/sc0503iwxrtcuuwlxz4q.png)

made by <a href="https://dev.to/nokol"> Nokol </a>

## What I built
MontiMark is a very simple to use image watermarker.
You can watermark your images and gain a reward if people wants to use or download your pictures without a watermark.

Every image will be transformed into a base64 with the watermark on it. To provide good UX , while loading a ghostimage will be displayed (option : default gray)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/itrqldprmua2wq0rehh5.jpg)

If a buyer / supporter / fan oe wants a picture without a watermark he can demonetize it and the image is an normal path.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/oggzp6jplwu6nds31bep.jpg)

<b>Possible improvements</b>
- Secure downloadable image paths
- Possibility to remove the watermark without Web Moni.

<b>How to:</b>

Just do :

<pre>
new Montimark('.selector', 'watermarkpath.jpg');
</pre>

and you have a sweet watermark

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/crhedlrgu0pw5pdxec8j.jpg)

there are also options of the position and more

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u2cphhhnuvqmfkneo4hn.jpg)


### Submission Category: 

Foundational Technology


## Demo
 https://nokol.net/montimark/

## Link to Code

https://github.com/DomEscobar/montimark


## How I built it 

Javascript


## Additional Resources/Info 

Resources are already linked
Chocolatey and Gist
Tags: chocolatey, automation, gist, windows
Published: 2020-06-10 08:39:34

---
title: Chocolatey and Gist
published: true
date: 2020-06-10 07:00:00 UTC
tags: Chocolatey,Automation,Gist,windows
canonical_url: https://10xlearner.com/2020/06/10/chocolatey-and-gist/
---

Hello ! I’m Xavier Jouvenot and in this small post, we are going to see how to link a gist to a chocolatey package maintainer repository.

_Self promotion_: You can find other articles on my [website](www.10xlearner.com) 😉

## Introduction

I assume that if you click to see this post, you already know what [Chocolatey] and [Gist] are, but if this is not the case I encourage to go google about them.

In this post, we are going to focus on the [Chocolatey Automatic Package Updater Module](https://github.com/majkinetor/au), aka AU, and how to link it to a Gist document so you can have a public report expliciting the state of all the packages that you are maintaining. 🙂

## Setting it up

### Appveyor report upload

Once you have created you own fork of the [chocolatey-packages-template](https://github.com/chocolatey-community/chocolatey-packages-template) repository, let’s go in the [.appveyor.yml](https://github.com/chocolatey-community/chocolatey-packages-template/blob/master/.appveyor.yml) file and look to the two following lines

```
gist_id:

gist_id_test:
```

Those are the fields that are going to interest us.Indeed, by giving then the id of our Gist, it will link the result of your tests in appveyor to your Gist.

To identify the id of your Gist, all you have to do, is to create a new Gist, name it `Update-AUPackages.md` and take the id from the url of your gist.Know that your Gist url is form like `https://gist.github.com/name/id` so all you have to do is to get the last component of the url and paste it after each of the `gist` fields. 🙂
### Link your report to your README

You can also create a link in your `README.md` file to your Gist report by adding a badge.To do so, you can copy-paste the following line at the top of you read me (after replacing `<your/gist/url>` by your actual gist report url):

```
[![Update Status](https://img.shields.io/badge/Update-Status-blue.svg)](<your/gist/url>)
```

Moreover, if you want, you can go to [img.shields.io](https://img.shields.io/) to create your own custom badge 😉

* * *

Thank you all for reading this article,And until my next article, have a splendid day 😉

## Interesting links

- [Chocolatey Automatic Package Updater Module](https://github.com/majkinetor/au)
- [My Update AU Packages](https://gist.github.com/Xav83/c4eb33a8aa993629f3d047747322e809)
- [10xlearner website](www.10xlearner.com)
Build Todoist app with Vue.js and Parse Platform (Part 2 - Login)
Tags: vue, beginners, webdev, javascript
Published: 2020-06-10 06:50:21

---
title: Build Todoist app with Vue.js and Parse Platform (Part 2 - Login)
published: true
description: 
tags: vue, beginners, webdev, javascript
---

{% vimeo 427604478 %}

Hello! Do you want to learn how to build cool web apps with Vue.js? Do you want to do it in fun way with Parse platform? This tutorial is for you! In the 2nd part I will demonstrate you how to implement a login flow in Todoist-like apps.
React Tutorial - Part 01 - Full Shopping Cart By React & Redux 
Tags: react, tutorial, ecommerce, shoppingcart
Published: 2020-06-10 06:43:57

---
title: React Tutorial - Part 01 - Full Shopping Cart By React & Redux 
published: true
description: 
tags: react, tutorial, ecommerce, shoppingcart
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/hop6hgjonqk51v9la5ew.png
---
## Watch Video
{% youtube mZH59soDRfQ %}
## Resources
Code: https://github.com/basir/react-shopping-cart
Demo: https://react-shopping-cart-final.herokuapp.com

## Introduction
Welcome to my coding course to build an fully-functional shopping cart using react and redux. In this course, you will learn the essential tools and skills to design, develop and deploy a fully-function shopping cart using React, Redux, Node, Express, and MongoDB.

My name is Basir and I’ll be your instructor in this course. After 15 years of coding in international companies like ROI Vision in Montreal, I found my passion in teaching programming. For the last 5 years, I have been tutoring hundreds of successful students around the world.

I designed this course for anyone seeking to develop a fully-functional shopping cart using react and redux. By the end of this course you’ll be able to design a responsive shopping cart, implement a user-friendly frontend and develop a simple backend.

You need to open a code editor along with me and start coding throughout this course. I teach you creating products list, shopping cart and checkout components using React, adding animation using react-reveal, create modal by react modal, managing state by Redux, building backends using Node, and MongoDB.

I designed this course for non-coders or juniors who want to be a professional web developer to get a job in 22 million job opportunities around the world. This is no requirement necessary for this course and having a passion for coding is enough.

 
## What you’ll learn

- Design Shopping Cart Using HTML and CSS
- Implement React Components For Product List, Filter, Cart
- Managing Component State using Redux, React-Redux and - Redux-Thunk
- Creating Animations Using React-Reveal and Add Routes using React-Routers
- Build Backend using Node, Express, MongoDB and Mongoose
- Publish Project on the Heroku and MongoDB Atlas

## Prerequisites

- Basic HTML and CSS
- Basic JavaScript

## Who this course is for

- Javascript developers
- Web Developers
- Freelancers
- Programming Students

## Video Topics
1. Fully-Functional Shopping Cart
2. Instant Feedback
3. Animated and Intuitive Design
4. List Products
5. Sort Products By Price High or Low
6. Filter Products by Size
7. Open Modal By Click on Product
8. Add Product To Cart using Animation
9. Handle Multiple Click By Adding More Items
10. Remove Product
11. Show Checkout Form
12. Create Order with user friendly id
13. Admin Section to see list of products
14. Using postman to add or remove products and orders
One Week Into Lambda
Tags: webdev, design, school, learning
Published: 2020-06-10 06:39:27

After one week at Lambda School and I’m really impressed with both the school and my own abilities. I seem to really grasp the subjects and I'm having a blast immersing myself into the projects. I go above and beyond, pushing myself on each module, because I find the modules fun.

The projects are fun, interactive, and simulate real world problems making them all the more exciting. I find myself spending hours of overtime, losing myself in the projects.

The weeks are set up so there are 4 days of classes, 8 hours a day. The final day (Friday) is what they refer to as a sprint challenge in which they give you an objective centered around the previous 4 days of learning. This past week was centered around HTML and CSS. The material was run through pretty quickly, but HTML and CSS are pretty simple concepts to grasp. During the week I developed a portfolio site (which I hosted on netlist and provided a link to at the bottom of the page.

We covered basics and advanced HTML and CSS including responsive design, flexbox, and accessibility. I went from a basic understanding of web develop and design to design a complete basic, responsive portfolio site. It's not the most involved site, but I'm really happy with the outcome.

This week is javascript basics and just like last week I continue to excel in the modules. I'm excited for what the future holds and even more so after my first week here at Lambda. I have found my calling. Full stack web development is whereby belong. I'm home.

Link to netlify portfolio site one week in (warning there is no functionality yet):
https://coleman-wk1-mod4-project.netlify.app/contact.html