Your peers will thank you later

blank computer screen and a keyboard sitting on a desk
Photo by Sora Sagano on Unsplash

Coding conventions are the style guidelines for programming. Programming best practices and principles are included in this. Here we will discuss some coding conventions.

Benefits of Following Conventions

  • Clean code
  • Quality of code
  • Readability of code
  • Makes code maintenance easier

“Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.” — Robert C. Martin

1. Magic Numbers

A magic number means we are assigning a number with no clear meaning. Sometimes we use a value for a specific purpose, and we don't assign the value in…


Prepare yourself for that desired job

Man coding on laptop
Photo by Danial Igdery on Unsplash.

Job interviews are not entirely predictable, but we often still see commonly asked tricky questions. Let’s take a look at ten of them.

1. Shallow Copy

Javascript copy

Output

original: { 
father: ‘MD’,
age: 26,
email: ‘shoaib.mehedi@gmail.com
}
copy: {
father: ‘MD’,
age: 26,
email: ‘shoaib.mehedi@gmail.com
}

Why?

Object.assign and the spread operator both do a shallow copy. That means we copied the first-level object.

Reference

The code we used before can be written like this with Object.assign:

Javascript copy

2. JavaScript Hoisting

Predict the output of the code below:

Javascript Hoisting

Output

undefined
26

Why?

The output of the code snippets is not shoaib and 20.


Introduce your system to automation.

The fundamental of cronjob

Cron is a kind of scheduler program for UNIX-based operating systems. Cron is used to executing a program/script after a certain period. Suppose we have a program that we want to execute every night at 12 AM, or we need to back up necessary files every week once. These things can be done perfectly by a script that is executed by a cronjob.

cronjob
Photo by insung yoon on Unsplash

Concept of cronjob

Cron is a daemon. Now the question is, what is a daemon? Daemon is a program that always runs in the background, and users don't have direct access over daemon. Cron checks the crontab (crontab is the…


WORK SMARTER NOT HARDER

Every day we do some technical things that we can fully handover to these websites

As a technical person, I fetch some regular basis tasks. There are tasks that we can solve in several ways. Many tools, open-source programs, coding, or anything can be helpful in these cases.

Work smarter, Not harder

Photo by Campaign Creators on Unsplash

But one thing I believe in that I mentioned above. If there is a way to do it easily then I am not going to do it by myself in another way. Here I will mention some websites like these that I use in my everyday life and skip my hassles.

Website Safety & Security Check

Security checking tools used to scan and check the safety of websites…


Essential javascript code snippets

Code that you need always

Javascript code snippets
Javascript Code Snippets

Programmers always do something new, but some basic and regular things exist that every project must include. Here I mentioned some code snippets from where you will find something new. I swear you are going to bookmark this. Hope this will be helpful.

1. Loop through an object

Loop over an object is a regular basis need of every programming language. Sometimes it can be a complex object with multiple keys and values. Going through this kind of pair is a little confusing. Here I am going to describe two possible ways.

2. Find in an array of objects.

Finding into an array is the most needed task of everyday development…


Create a 3D Face Landmark in Realtime

Face Mesh

In this article, we will see how Face Mesh Detection can be done using Python OpenCV directly via an Image file, webcam, or video file.

First of all, you need to install OpenCV and Numpy. We will do this tutorial using the completed Python programming language, so let’s get started.

MediaPipe works with research and developers’ solutions and applications for machine learning in mobile, web applications, edge computing, etc.

We need to import CV2, mediapipe, and time for the project base setup.

To install mediapipe, run the following command to install via pip.

pip install mediapipe

OpenCV Python

OpenCV is an image…


Social Distance Confirming using OpenCV Python
Image: Author

Social distancing is now a hot topic from the covid pandemic. Many large-scale companies and shopping malls are trying to confirm social distancing. Many exciting projects are there to ensure social distancing. Here we will build our system to demonstrate social distancing.

Here we need OpenCV and Numpy for the basic setup. So let's do the basic setup for the project start.

OpenCV Python

OpenCV is an image processing library. It is designed to solve computer vision problems. OpenCV is a C/C++ library that is extended in Python.

To install OpenCV, Here.

NumPy

The NumPy library is used to support multi-dimensional arrays, matrices…


Image Source: Author

In this article, we will see how Vehicle Detection can be done using Python OpenCV via an Image file, webcam, or video file.

First of all, you need to install OpenCV. We will do this tutorial using the completed Python programming language, so let’s get started.

OpenCV Python

OpenCV is an image processing library. It is designed to solve computer vision problems. OpenCV is a C/C++ library that is extended in Python.

To install OpenCV, Here.

NumPy

The NumPy library is used to support multi-dimensional arrays, matrices, etc., in the Python programming language. It is an open-source numerical Python library.

Numpy provides:

  1. Tools for integrating…


Caching and most popular cache eviction policies

Cache overview
Photo by Vladimir Mokry on Unsplash

Caching means keep frequent data closer to access it. This helps the process to access those data faster. Everywhere cache is used widely. You will find almost no big company that is not using cache. Knowing these will help you a lot.

Let's have an idea

Suppose you are doing research with a specific idea and for this, you are taking help from many books. All the books are in a library in your house. Every time you need a book, you need to go to the library then bring it. This is time-consuming also a hassle.


Image Source: Wiki

Here, we will see how object detection can be done using Python OpenCV directly via an image, webcam, or video file.

Let’s find out what object detection is

Object detection is a technique of computer vision that identifies an object from an image or video file.

It refers to the potential of computer and software systems to locate objects in an image/scene and identify each object. Object detection has been widely used for face detection, vehicle detection, pedestrian counting, web images, security systems, and driverless cars. There are some ways object detection is often used also in many fields of practice. …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store