teleren/devto huggingface dataset:
The Difference between JavaScript “==” and “===” Comparison Operators
Tags: javascript
Published: 2020-12-26 17:40:12


There are many comparison operators in javascript but we are going to discuss double equal `==`  and triple equal `===`  operators. It is important to know the difference between these two operators and also the difference between `!=` and `!==` in javascript. Lets begin with the double equal operator:

**Double equal “==”**
	It is known as equality. The double equal operator checks for equality of value. It doesn’t care about data types. Before it checks for equality JavaScript converts both values to the same type and then compares them, which can lead to some unexpected results. Like:
```javaScript
5 == ‘5’	// true
0 == ‘ ‘	// true
0 == false	// true
null == undefined 	// true
```
As seen above, the `==` operator is returning true for comparing an integer and a string in the first case, then 0 equals empty string true in the second case, 0 equals false in the third case and null equals undefined is also returning true which is not true in the last case. It is just checking the value but not the type, which is why all of the above comparisons return true. Similarly, the `!=` operator is used to check inequality. If you use `!=` in the above examples everything will return false. It can definitely lead to some nasty bugs in an application, so it's not recommended to use the `==`  and/or `!=` operators for comparison in JavaScript. 

**Note:** If you are not sure about types you can go to the console and simply type “typeof <foo>” and check its type. You can take a look at the image below to see what is returned in the console when you check the typeof. Make sure you use all lowercase letters when writing typeof and not the camelCase version of typeOf.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/k0onk1fjxzvt6skiz5kw.png)
 
**Triple equal “===”**
	Known as strict equality, it not only checks for equality of value but also datatype. It cares about value and types both which is why it's recommended to use strict equality for comparison, it's more precise. The above examples will return false when `===` is used :

```javaScript
5 === ‘5’ 	// false
0 === ‘ ‘	// false
0 === false	// false
null === undefined 	// false
 ```
Similarly the `!==` operator is strict inequality. Beside these operators there are few more comparison operators we need to know. Here is the screen shot from the MDN documentation:

var var1 = 3;
var var2 = 4;
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/m54dm39u0keczyc7aaiu.png)
 
That's all for comparison operators. I hope it helps. 
Happy Holidays everyone!
Digital Hackathon initial
Tags: dohackathon
Published: 2020-12-26 18:28:06

---
title: Digital Hackathon initial
published: true
description: My submission to the DigitalOcean App Platform Hackathon!
tags: dohackathon
series: dohackathon
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/t38j2flseg57pnholvnt.png
---

## What I plan to build

I would like to build a WhatsApp chatbot that responds to all your messages with a quote from a movie or Shakespeare. 

## What I would like to learn by the end of the hackathon

I would like to learn the following things:

- Tailwind Css
- [Venom](https://github.com/orkestral/venom): An npm library to create WhatsApp chatbots.


This will be in the random roulette category.
Soft Deletion in Database
Tags: database, webdev, java, csharp
Published: 2020-12-26 18:15:21

One of the common problems you may face when you design your database is that you want to delete a row from some table in the database without actually deleting it.

The name of this concept is called *Soft Deletion*. You can apply soft deletion by creating a column called `IS_DELETED` in the table you want. This column is of the type `Boolean`. If its value is `True`, then the row has been deleted or invisible to be accurate.

It's a straightforward concept to apply, but it comes with costs. You may face problems where you are building complex queries on this table; then later, you discover by coincidence that you forgot to consider this column in your queries from the wrong data they produce. At this moment, you discover that you have to include `IS_DELETED` in nearly every single query you build which has this table.

That's why some people try to avoid this method to apply soft deletion by creating an archive table. When you delete some row from the original table, just insert it into the archive table. Hence, no query mistakes on the original table and no `IS_DELETED` overhead.

Try to avoid soft deletion as much as you can, and try not to use it unless there is a real need to do so. Notice that soft deletion has nothing to do with backups. Backups have to be done regardless you're applying soft deletion or not. They have to be applied periodically, and the period itself depends on your application.
5 VSCode Extensions All JavaScript Developers Should Be Using
Tags: vscode, webdev, javascript
Published: 2020-12-26 18:14:54

1. Snippet Extensions
VS Code comes with many built-in code snippets, these snippets help you write code faster in the most productive way, you can easily create functions with references of a few keywords used in snippets. Here are some of the top JS code snippets.


.JavaScrip (ES6) code snippets, (Charalampos Karypidis): Currently the most popular javascript snippet extension with over 3+ million downloads.

.JavaScript Snippets, (Nathan Chapman): snippets for javascript for over 33K+ installs, provides the extension support for Node.js, BDD Testing frameworks such as Mocha and Jasmine

2. NPM Extensions
Every JS project needs npm packages unless you want to do things the hard way, are some VS Code extensions for package management

.npm (egamma): With over 2.3M+ installs this extension uses package.json to validate installed packages, this extension will make sure if anything is missing and will provide the fix for the issue, you can also run npm scripts defined in the pakcage.json inside the editor.

.Search node_modules (Jason Nutter): With over 470k+ installs this extension allows you to quickly open files in node_modules.

3. Formatting Extensions

.Prettier (Esben Peterson): The most popular extension out there that supports javascript, typescript, and CSS, it has over 5.7 million installs.

.JavaScript Booster (Stephen Burguchev): This is one of the amazing tools for refactoring, several coding actions such as converting var to const or let, also removing extra if-else statements, and merging declaration.

4. Auto-Complete Plugins

.Kite: Kite is an AI-powered autocomplete plugin where it learns you code pattern and the suggestions are made using that data that it stores on your machine, there are many autocomplete plugin in VSCode but kite turns out to be the most productive for me till now.

5. Bracket Pair Colorizer

This extension is most loved by developers for making the hassle of identifying the brackets with identifying colors, every pair of brackets get different colors as you code along with it it even becomes way too easy to determine which part you are working with.
#Javascriptmas Solutions
Tags: javascript, javascriptmas, scrimba, challenge
Published: 2020-12-26 17:36:39

My Javascriptmas Solutions! [Javascriptmas](https://scrimba.com/learn/adventcalendar)

Day 1 - [Candies](https://scrimba.com/scrim/co37a448583f31fa9b3308b35)
Day 2 - [Deposit Profit](https://scrimba.com/scrim/coc9448559252314d8be16d6f)
Day 3 - [Chunky Monkey](https://scrimba.com/scrim/co2d44abf9644130840fdf600)
Day 4 - [Century From Year](https://scrimba.com/scrim/co46846178130448b8ccdf4c4)
Day 5 - [Reverse a String](https://scrimba.com/scrim/coc974e188552eae71a2e5701)
Day 6 - [Sort By Length](https://scrimba.com/scrim/co3d443019c21ae771c800ea9)
Day 7 - [Count Vowel Consonant](https://scrimba.com/scrim/co474452c84d306a1480f2d35)
Day 8 - [The Rolling Dice](https://scrimba.com/scrim/coec64451b16e85be4e24e089)
Day 9 - [Sum Odd Fibonacci Numbers](https://scrimba.com/scrim/co56840a7bf2cdcf0cd838fdd)
Day 10 - [Adjacent Elements Product](https://scrimba.com/scrim/co6b8402d9549cf8184eb5c9b)
Day 11 - [Avoid Obstacles](https://scrimba.com/scrim/co5c74b318545552d7d64dab9)
Day 12 - [Valid Time](https://scrimba.com/scrim/co2dd49649d96ded865d7969d)
Day 13 - [Extract Each Kth](https://scrimba.com/scrim/co59e41f4a083d7909c4ed187)
Day 14 - [Maximal Adjacent Difference](https://scrimba.com/scrim/coa114341b243318e91ffe15d)
Day 15 - [Carousel](https://scrimba.com/scrim/cof894c5488b33f5217907602)
Day 16 - [Insert Dashes](https://scrimba.com/scrim/co78642c1994d8bdb92a6fee9)
Day 17 - [Different Symbols Naive](https://scrimba.com/scrim/co4f446928c6b00d559159639)
Day 18 - [Array Previous Less](https://scrimba.com/scrim/co4ce4127aafde47d2c034746)
Day 19 - [Alphabet Subsequesnce](https://scrimba.com/scrim/co7b341afa975b02456042364)
Day 20 - [Domain Type](https://scrimba.com/scrim/co73b4179a376a980b66c153e)
Day 21 - [Sum of Two](https://scrimba.com/scrim/co9fa44a7b3411cff0ea9161e)
Day 22 - [Extract Matrix Column](https://scrimba.com/scrim/coa144f329b93f37af27dad54)
Day 23 - [Social Media Input](https://scrimba.com/scrim/co68648ac91c5b13e85cfc3df)
Day 24 - [Test Your Agility](https://scrimba.com/scrim/cof0640e6b6c87339b1c608d4)
Understanding Message in Spring Integration
Tags: systems, architecture, integration, systemdesign
Published: 2020-12-26 17:35:55

In order to loose coupling between components in a system, we typically apply the messaging system to achieve that aim. That requires a solid understanding of what is a message and some type of message for effective use for specific scenarios. So in this article, I would like to share the definition of the message, the structure of a message, and common types of messages in a messaging system. 

Remaining part of this article we already published at Medium [Full article](https://medium.com/programming-sharing/understanding-message-in-spring-integration-5270ae2787f3)
Workaround for "rails g scaffold" hangs
Tags: rails
Published: 2020-12-26 17:35:46

If you are running a "rails g scaffold ..." and have the command hanging with no visible sign of activity, Spring is likely playing havoc.

Rails Spring is a preloader for the Rails framework. If you execute a "spring stop" and re-run the scaffold command, it should work. However, having to stop Spring after every command is going to get aggravating so there's an environment variable you can set - DISABLE_SPRING.

Run "spring stop" (if it is already running) and then define the DISABLE_SPRING variable like this on a bash prompt:
export DISABLE_SPRING=true
Listen for Changes Between Dark and Light Mode with Javascript
Tags: javascript, css, webdev
Published: 2020-12-26 17:27:41

You can use `javascript` to listen for changes between `light mode` and `dark mode.`

Color preferences mostly effect style, and so are the realm of `css`. But some changes need to be made using `javascript`, like loading external resources.

Here's how:

```
const darkModeMediaQuery = window.matchMedia('(prefers-color-scheme: dark)');

darkModeMediaQuery.addListener((event) => {
  console.log(event.matches) // True if Dark Mode is on
});
    
```


## When to use this?

I first came accross this while making [green quarantine](https://greenquanratine.org). The site has two versions of the same [mapbox](https://www.mapbox.com/) map, one for `dark mode` and one for `light mode`. 

When user preferences changed while on the site, the map would stay the same. I discovered this while trying to solve that issue.

You may think this is overkill, or an edge case. How likely is it that a user changes their color preferences while on your site?

But, **many devices automatically change color schemes based on the time of day.** If you're making a site, or web extension that stays open for a long time, it's very likely to happen.

Also, while developing it's nice to not have to refresh the page.
#Day 16: Web Development Journey Begins
Tags: 100daysofcode
Published: 2020-12-26 17:20:00

Hi! 
Today I finally decided to learn web development along with DSA practice. Hence, with the help of YouTube tutorials and w3school website I have started learning Html. Today I covered the topics of Elements and Attributes in Html.
Also, I solved the questions of Equal Stack and Bracket Balance on HacerRank. Now I'm going to solve few questions from DSA workshop on GFG. 
Lastly, I read the second Chapter on "Selection Sort" from Grokking Algorithm. This day balanced yesterday's sadness.
FrontEnd VSCode extensions
Tags: productivity, webdev, vscode
Published: 2020-12-26 17:19:28

#Hi Devs,

In this post I'll be covering the most useful front-end related VSCode extensions.

1 [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)
* This extension gives us a dev server on which we can run any web application. It supports auto-reload.

2 [Live Sass Compiler](https://marketplace.visualstudio.com/items?itemName=ritwickdey.live-sass)
* Used to compile the css pre-processer sass.

3 [HTML CSS Support](https://marketplace.visualstudio.com/items?itemName=ecmel.vscode-html-css)
* This extension helps in ID and Class attribute completion.

4 [Auto Rename tag](https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag)
* It helps in editing the HTML tag names. When we make any modifications to the opening tag, it updates the closing tag as well and vice-versa.

5 [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
* It's a code formatter which works seamlessly with HTML, CSS and JS. It helps in organising the lines, brackets, quotes, semi-colons, spacing, functions and etc every time we save the file.

6 [JavaScript ES6 Code Snippets](https://marketplace.visualstudio.com/items?itemName=xabikos.JavaScriptSnippets)
* Useful templates for destructing, arrow functions and many other JS features

7 [Bracket Pair colorizer](https://marketplace.visualstudio.com/items?itemName=CoenraadS.bracket-pair-colorizer)
* Colors the brackets, arrows. Helps in visualising the code blocks.

8 [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
* Very useful extension which helps in catching the spell errors in the code.

9 [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)
* This extension is similar to postman and helps in making a request to REST endpoints from the VSCode itself.

10 [GitLens](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
* Gives a lens into the git repository, displays the branches, contributors, git stats.
Responsive Personal Portfolio Website using HTML CSS & JavaScript
Tags: website, portfolio, personalwebsite, onepagewebsite
Published: 2020-12-26 16:53:55

Hello readers, Today in this blog you'll learn how to create a Fully Responsive Personal Portfolio Website using HTML CSS & JavaScript. I already shared many blogs on web design stuff like [<a href="https://www.codingnepalweb.com/search/label/Navigation%20Bar">Navigation Bar</a>, <a href="https://www.codingnepalweb.com/search/label/Card%20Design">Cards</a>, <a href="https://www.codingnepalweb.com/search/label/Image%20Slider">Image Slider</a>, <a href="https://www.codingnepalweb.com/search?q=owl%20carousel">Owl Carousel</a>, <a href="https://www.codingnepalweb.com/search/label/CSS%20Buttons">Buttons</a>, and <a href="https://www.codingnepalweb.com/">many more</a>] but still I' haven't created a full website and now it's time to create a portfolio website.

Personal portfolio sites are consistent that need to be taken care of throughout your work. It gives a convenient way for potential clients to view your work while also letting you expand on your skills/experiences and services.

In this site [Personal Portfolio], there are six sections on one page - Home, About, Services, Skills, Teams, and Contact, and each section is attractive and eye-catching. On the home page of this site, on the top, there is a sticky navigation bar with a logo on the left side and some navigation links are on the right side. On the left side of the home page, there are texts which are about the author's name, profession, and a button labeled as "Hire me" as you can see in the image.

You can copy the codes from the given boxes or download the code files from the given link but I recommend you to download the source code files instead of copying codes. <a href="https://www.codingnepalweb.com/2020/09/responsive-personal-portfolio-website.html">Click here to download code files.</a>

####You might like this:
<a href="https://www.codingnepalweb.com/2020/04/responsive-footer-section-design-html-css.html" target="_blank">Responsive Footer Section</a>
<a href="https://www.codingnepalweb.com/2020/10/responsive-testimonials-section.html" target="_blank">Responsive Testimonials Section</a>
<a href="https://www.codingnepalweb.com/2020/10/responsive-sticky-navbar.html" target="_blank">Responsive Sticky Navigation Bar</a>
<a href="https://www.codingnepalweb.com/2020/10/responsive-mega-menu-and-dropdown-menu.html" target="_blank">Fully Responsive Mega Menu Design</a>

Please download the code files from the above-given link. Thanks!
MySQL cheatsheet for search operation
Tags: mysql, database
Published: 2020-12-26 16:49:19

In this blog I am going to explain three different problems while working with MySql data operation. 

These three problems can help you to solve issues if came across same situation. I called this cheatsheet because this is something that has magic which helps do it in an easy way without knowing the bigger picture.

![tenor (1).gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1608996774364/LgBNgZnTn.gif)
Let's get started with questions : 

1. Search and Replace column name in table : 
```
UPDATE
   table 
SET
   column_name = REPLACE(column_name, 'value2', 'value1') 
WHERE
   column_name like '%value1%';
```
2. Finding column names across all tables when you are known to the skeleton and you have to find out which table belongs to this column. This is like a bottom to top approach by using wild card search `*`. what is bottom to top approach will explain the end of this article for new readers. 
```
SELECT
   COLUMN_NAME AS 'ColumnName',
   TABLE_NAME AS 'TableName' 
FROM
   INFORMATION_SCHEMA.COLUMNS 
WHERE
   COLUMN_NAME LIKE '%MyName%' 
ORDER BY
   TableName,
   ColumnName;
```
3. How to find duplicate records based on keys or column groups in the same table ? 

Let's take example tables for reference. 

**Table 1** : 
![Table1.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1608994626956/hl2_8wNbA.png)
```
select * from
(select callTime,callType,employee,phoneNumber,count(*) as n from table2 group by callTime,callType,employee,phoneNumber) x
where x.n > 1;
```

These are three questions till now came across. I will come with more hacks whenever I will get my next questions. As I promise above let me explain. 

**What is the bottom to top approach ? **

When you are new to any application or projects, sometimes it is difficult to find exact things. This kind of case generally came in the developer's timespan. How to tackle this and get the right information. Let's first understand what the **Top to bottom** approach is when you know where to start project exploration like documentation, tutorials and application entry points etc. 

Now exactly reverse to this is the **Bottom to top** approach. Start from wild card search by finding known words or known keys inside the project and find occurrences. Once you get this can go from the file which last execution does go from it top level by find function reference or definition like wise.   In the above example I explain the same approach to find exact question answers by using the search operation method in MySQL. There you are!

![tenor.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1608996457967/r6OUyxhLc.gif)

Hope you like my blog. Thanks for reading my blog. If you have any questions you can reach out to me at my twitter handle - @aviboy2006
Year in review – work
Tags: 100daystooffload
Published: 2020-12-26 16:48:16

There are many things to say about this year. In terms of my job and work, however, there are two main themes I can reflect on:

1. We made a substantial change to how we worked
2. The work kept going in much the same way as ever

## Changing how we work

We started the year working in the office for the majority of the time, and I would also travel to customer meetings a couple of times a month. By the end of March we found ourselves working from home. Although there were a few teething problems for us, it seems like we adapted remarkably well. Because our business had been predominantly office-based, we had no widely available video chat tools available for the majority of the year, so all of our communication was by phone and email. Some of our more network intensive applications were slow to access through a VPN, but the company adapted the network infrastructure to suit the change and we have had a perfectly usable setup throughout the year. Slow at times, yes, but not often a problem.

Later in the year we had a video chat tool accredited for our use and, to many of us, this was a significant improvement. Although the phone-based communication we had been using was adequate for our needs, adding video made me appreciate the face-to-face element of communication so much more. I would actually feel positive after a video call, just from seeing other people.

## The same as it ever was

Despite the changes to how we worked, we spent the year doing the same work and delivered the same amount as we usually do. This had been a concern at first, but I think everyone was surprised at how well we adapted as a company and delivered as well as before.

Delivering in the same way as before was good for the business, but was not without frustration for me at times. When faced with some of the more challenging problems for our customers, I like to explore different, and sometimes novel, ways to provide a useful solution. Unfortunately, there are some people in our team who would rather turn away such work because it's too difficult, or even just too _different_ to normal.

## The future

I do not expect there to be any changes to the way we work when I return next year. But continuing in the way we have been doing for the past 9 months is not as daunting for me as I originally thought it might have been. As far as any changes I would like to make, I have not yet decided. Ordinarily I do not commit to resolutions, preferring to make small changes throughout the year instead. But I think a time to reflect on my recent working practice is due, so will give that some thought soon.

_I'm publishing this as part of 100 Days to Offload. You can join in yourself by visiting [https://100daystooffload.com.](https://100daystooffload.com)_
Adding auth to the app
Tags: dohackathon
Published: 2020-12-26 16:31:57

I was busy adding auth functionality to my Blogfinder app the last few days. It is an essential, though not main, part of the app. Adding auth is quite routine, but, by no means, a trivial task. I had to code the views, forms and templates. Took some code from the [Flask mega tutorial](https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world). Flask-login and flask-mail play nicely with the framework I have chosen - quart.

I struggled with the password reset email functionality. Sending async emails with quart and flask-mail is not straight-forward. I was constantly getting a `coroutine not awaited` warning when trying to run a sync function from a thread started by the async route. I had to take help from a forum post by quart's creator to solve the issue.

I completed the login, register and password-reset parts of the application. Then I started working on the profile page. I add the routes and forms for the profile add and edit pages. Tomorrow I will start with showing the profile page and then move onto the "user follow" functionality which, I suppose, will take quite a bit of time.