Samual Sam has Published 2310 Articles

visited pseudo class in CSS

Samual Sam

Samual Sam

Updated on 23-Jun-2020 15:45:52

107 Views

Pseudo class is to show different state of an element or a css selector. visited pseudo class is to show that the link is already visited.This pseudo class is mostly being associated with link.Syntaxa:visited { color:green;}Let's check the actual usage of :visited pseudo class with different scenarios, as follows -Example Live ... Read More

Get emotions of images using Microsoft emotion API in Python?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 15:44:05

178 Views

Every human being have emotions just like happy, sad, neutral, surprise, sorrow etc., if we create the emotions of images like happy, sad, neutral, surprise, etc. in Python. We can use Microsoft emotion API for any development purpose.We can easily elaborate all these emotions using Microsoft emotion API's.Example Codeimport http.client, ... Read More

Extension Methods in C#

Samual Sam

Samual Sam

Updated on 23-Jun-2020 15:07:24

855 Views

Extension methods are static methods, which are called as if they were instance methods on the extended type. With Extension methods, you can add methods to existing types without even creating a new derived type, recompiling, or modifying the original type.The following is the extension method we have created.public static ... Read More

C# program to find Intersection of two lists

Samual Sam

Samual Sam

Updated on 23-Jun-2020 15:06:18

2K+ Views

To find intersection of two lists in C#, use the Intersect() method.The following is our list 1.List list1 = new List(); list1.Add(2); list1.Add(3); list1.Add(5); list1.Add(7);The following is our list 2.List list2 = new List(); list2.Add(5); list2.Add(4); list2.Add(6); list2.Add(8);The following is the code to find the intersection of two lists in ... Read More

How do you use a ‘for loop’ for accessing array elements in C#?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:35:45

303 Views

The ‘for loop’ executes a sequence of statements multiple times and abbreviates the code that manages the loop variable.The following is our for loop.Example Live Demousing System; namespace ArrayApplication {    class MyArray {       static void Main(string[] args) {          int [] n = new ... Read More

How do we use continue statement in a while loop in C#?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:31:50

241 Views

The continue statement causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.The continue statement in C# works somewhat like the break statement. Instead of forcing termination, however, continue forces the next iteration of the loop to take place, skipping any code ... Read More

How do we use foreach statement to loop through the elements of an array in C#?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:28:39

347 Views

A foreach loop is used to execute a statement or a group of statements for each element in an array or collection.It is similar to for Loop; however, the loop is executed for each element in an array or group. Therefoe, the index does not exist in it.Let us see ... Read More

How to sort a list of dictionaries by values of dictionaries in C#?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:26:29

473 Views

Set the list of dictionaries with keys and values.var d = new Dictionary(); d.Add("Zack", 0); d.Add("Akon", 3); d.Add("Jack", 2); d.Add("Tom", 1);Get and sort the keys.var val = d.Keys.ToList(); val.Sort();You can try to run the following code to sort a list of dictionaries by values.Example Live Demousing System; using System.Collections.Generic; using System.Linq; ... Read More

How to split a string with a string delimiter in C#?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:24:32

861 Views

Delimiters are the commas that you can see in the below string.string str = "Welcome, to, New York";Now set the delimiter separately.char[] newDelimiter = new char[] { ', ' };Use theSplit() method to split the string considering the delimiter as the parameter.str.Split(newDelimiter, StringSplitOptions.None);To split a string with a string deli ... Read More

How do we call a C# method recursively?

Samual Sam

Samual Sam

Updated on 23-Jun-2020 14:21:46

302 Views

To call a C# method recursively, you can try to run the following code. Here, Factorial of a number is what we are finding using a recursive function display().If the value is 1, it returns 1 since Factorial is 1.if (n == 1) return 1;If not, then the recursive function ... Read More

Advertisements