How to convert Promise to Observable in Angular?

How to convert Promise to Observable in Angular? Angular by default returns Obserable when you invoked HTTP client methods. But let’s assume that you have a function that returns a promise. In this case, you can easily change…

How to measure time taken by a function to execute

In this post, I will show you how to measure the execution time of any function in Javascript. Javascript console api have two functions console.time and console.timeEnd . console.time - start the timer console.timeEnd …

Create Compiler In C# Using ANTLR-Crash Course

Unless it is a hobby project, the vast majority of programmers should avoid writing their own compiler. You should write your own compiler or interpreter because you have a unique idea for a programming language that is not al…

RSA encryption/decryption C# example

There are two classes for asymmetric encryption in .net. RSACryptoServiceProvider and DSACryptoserviceProvider . With the default constructor, both classes automatically create the public and private keys necessary to encryption…

How to randomize (shuffle) a JavaScript array?

In this article, I will show you how to shuffle an array in javascript. We will use The modern version of the Fisher-Yates shuffle, designed for computer use, was introduced by Richard Durstenfeld in 1964 The algorithm for shu…

Everything you show know about ES6 `let` keyword.

Everything you show knows about ES6 let keyword. Both var and let are used to declare variables in javascript, but the difference is that var is function scoped and let is block scoped. In this article, we will see the diffe…

ES6 JavaScript: Understanding Let & Const

Variables can be declared using const in the same way that var or let declarations are. The const keyword turns a variable into a constant whose value cannot be changed. The scoping rules for const variables are the same as t…

How to extract number from string using Linq

Imagine you have an s tring("ABCDE99F-J74-12-89A") , and you want to extract the only number from the string. This snippet will show how to extract numbers from strings. using System ; using System . Collections . G…

C# Boyer-Moore String Search Example

In this article, I will show you the implementation of the ==Boyer-Moore == algorithm. Boyer Moore is a string searching algorithm. It avoids checking most positions in the source string. The implementation here uses constant ch…

Flood fill algorithm in javascript

Flood fill , also called seed fill , is an algorithm that determines and alters the area connected to a given node in a multi-dimensional array with some matching attribute. It is used in the “bucket” fill tool of paint programs…

Angular Custom Form Controls - Complete Guide

Angular is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations In this article, I will show you how to create a custom control in Angular…

Create Tabs In Angular Using Bootstrap

Angular is a TypeScript-based open-source web application framework led by the Angular Team at Google and by a community of individuals and corporations In this article, I will show you how to create a tab component using boot…

Delete node from linked list with specific value

In computer science, a linked list is a linear collection of data elements whose order is not given by their physical placement in memory. Instead, each element points to the next. It is a data structure consisting of a collecti…

Implement Trie Data Structure in Typescript/JavaScript

As per the Wikipedia In computer science, a trie, also called digital tree or prefix tree, is a type of search tree, a tree data structure used for locating specific keys from within a set. These keys are most often strings, w…

تحميل المزيد من المشاركات
لم يتم العثور على أي نتائج