Aditya Chatterjee's Blog, page 143

November 22, 2021

Different ways to sort array in JavaScript

In this article, we have explained Different ways to sort array in JavaScript which includes sort() method, localeCompare(), orderBy() and much more.

Table Contents1. Introduction2. sort() Method2.1. Alphabetical order2.2. Ascending order2.3. Descending order2.4. Reverse order3. localeCompare() Method4. parseInt() Function5. Lodash _.orderBy() Method6. Lodash _.sortBy() Method7. Intl7.1. Intl.Collator()7.2. Intl.DateTimeFormat()7.3. Intl.NumberFormat()8. Final ConsiderationsRefer...
 •  0 comments  •  flag
Share on Twitter
Published on November 22, 2021 13:39

Augmented Random Search (ARS)

Augmented random search (ARS)is a model-free reinforcement learning, and a modified basic random search (BRS) algorithm, the algorithm was first published in 2018 by the trio - Horia Mania, Aurelia Guy, and Benjamin Recht from the University of California, Berkeley. When ARS is compared with other AI algorithms, it is 15 times faster and more efficiecnt, returning higher rewards when applied to a specific application, like the locomotion task in MuJoCo (Multi-Joint Dynamics with Contact) environ...

 •  0 comments  •  flag
Share on Twitter
Published on November 22, 2021 10:36

Orientation of three ordered points

In this article, we will discuss about algorithms to detect the orientation of three given ordered points. Orientation imply collinear, Clockwise or Anti-clockwise.

Table of contentsOrdered pointsOrientation of three ordered pointsComplexity analysis

Ordered Points

A set of two numbers that are written in a particular order is called an ordered pair. they are also called as 2-tuples. The numbers are always enclosed within brackets (parantheses) and denotes both x coordinate and y coordinat...

 •  0 comments  •  flag
Share on Twitter
Published on November 22, 2021 10:10

November 21, 2021

Simple closed path in a set of points

In this article, we have explored an insightful approach/ algorithm to find a simple closed path in a set of points. This is an important concept in the field of computational geometry.

Reading time: 25 minutes | Coding time: 20 minutes

TABLE OF CONTENTSProblem Statement DefinitionIntuitionSolution AnalysisOrientationIntersection of line segmentsOrdering of pointsImplementationComplexity analysisTime-ComplexitySpace-ComplexityApplicationsPROBLEM STATEMENT DEFINITION

To put t...

 •  0 comments  •  flag
Share on Twitter
Published on November 21, 2021 11:20

Rust for Beginners (variables, datatypes, loops, functions, array and more)

Let's go through some of the basic programming concepts in Rust, such as variables, functions, loops and the like. I realize that I have not covered them in any article before, assuming some small previous knowledge.. Let's fix that by covering them today!

Table of contents:

Variables & Data TypesLoops & Flow controlFunctionsCommentsArrays, Tuples and VectorsStringsType inference and castingVariables & Data Types

As we've seen before, variables are declared with the let keyword, and if ...

 •  0 comments  •  flag
Share on Twitter
Published on November 21, 2021 11:10

Meet In Middle Technique

In this post, we discuss the Meet in Middle problem solving technique and show through examples how we can use it to improve a naive brute force algorithm.

Table of contents:

Introduction to Meet In MiddleProblem 1: Pythagorean tripletProblem 2: Maximum sum subsetMore examples using Meet in Middle

ezgif.com-gif-maker

Introduction to Meet In Middle

The meet-in-middle algorithm is a search technique used for problem solving whereby the given input size of the problem is small but not small enough for a brute fo...

 •  0 comments  •  flag
Share on Twitter
Published on November 21, 2021 09:35

November 20, 2021

"50+ Linux Commands before joining a Company" book

A serious Developer uses Linux as his / her Development System. The book "50+ Linux Commands before joining a Company" cover the most important commands and tasks that you need to know to make a good impression at your workspace.

Following is the cover of the book "50+ Linux Commands before joining a Company":

Get the book on:

Amazon.in for IndiaAmazon.com for USA and worldwideSystem and Software Information table

This is a table which you should fill every time you move to a new machine.

...
 •  0 comments  •  flag
Share on Twitter
Published on November 20, 2021 18:02

November 19, 2021

Squeeze and Excitation (SE) Network

This article describes what are Convolutional Neural Network and What are Squeeze and Excitation blocks.

Table of Contents:

IntroductionWhat are Convolutional Neural Networks?What are Squeeze-and-Excitation Networks and it’s Architecture?
3.1 Squeeze: Global Information Embedding
3.2 Excitation: Adaptive RecalibrationImplementationSummaryIntroduction:

Squeeze-and-Excitation Networks, bring in a building block for Convolutional Neural Networks (CNN) that increase channel interdependencies ...

 •  0 comments  •  flag
Share on Twitter
Published on November 19, 2021 04:42

Reservoir Sampling Technique

In this article, we have explained the Reservoir Sampling Technique which is the basis of Randomized Algorithms. We have covered two methods Simple Reservoir and Variable Probability.

Table of ContentsIntroductionMethod 1: Simple ReservoirMethod 2: Variable ProbabilityInitial proofRevision of algorithmProof of new algorithmApplicationsOverview

Prerequisite: Randomized Algorithms

Introduction

Reservoir Sampling is a group of randomised algorithms which helps us choose random samples ...

 •  0 comments  •  flag
Share on Twitter
Published on November 19, 2021 03:44

November 18, 2021

Copy to clipboard in JavaScript

In this article, we have explored techniques in JavaScript to copy text to clipboard and use the data stored in clipboard. This involves using navigator.clipboard.

Table of contents:

Introduction to clipboardUse Cases of ClipboardThe old vs the new technique in JavaScriptUsing the clipboard with JavaScriptnavigator.clipboardnavigator.clipboard.writeTextnavigator.clipboard.readTextnavigator.clipboard.writenavigator.clipboard.readConclusion

Let us get started with Copy to clipboard i...

 •  0 comments  •  flag
Share on Twitter
Published on November 18, 2021 23:48