JavaScript Code Examples

The following section provides several JavaScript Code Examples. addEventListener() Sometimes we want to attach an event listener to an HTML element dynamically. For this purpose, we can use the addEventListener() method. Even, it is possible to attach an event listener to a paragraph or div element. See Example. appendChild() Basically, this method helps us to append a child …

Edge Detection Using OpenCV

In this post on Edge Detection Using OpenCV, I will explain an important image processing function known as edge detection. Basically, edge detection results in a new image that contains the outlines or edges of the given image. Canny Edge Detection Method Basically, Canny Edge Detection is a step-by-step procedure that requires the image to …

Adding Images Using Image Control

In this post on Adding Images Using Image Control, I will demonstrate the use of Image Control for creating a Web Page in ASP.NET. Basically, the Image Control available in ASP.NET allows us to display an image on the web page. Hence, it displays the image as the data. Therefore, we can display images within any container element of HTML …

Using MD5 Hash Algorithm

In this post on Using MD5 Hash Algorithm, I will explain the MD5 algorithm for computing hash code, the MD5 abstract class in .NET, and its implementation for computing hash code. Basically, the Message Digest algorithm named MD5 generates a 16-byte (128-bit) hash code. This algorithm is available with the MD5 class in ASP.NET. Further, the namespace System.Security.Cryptography defines this …

Measuring Performance of Classification using Confusion Matrix

In this post on Measuring Performance of Classification using Confusion Matrix, I will explain what is a confusion matrix and how to use it with a Machine Learning classifier. Machine Learning offers a number of algorithms for classification and prediction. However, each algorithm performs differently. Hence, we must have some kind of performance measures to evaluate the …