This article explains how to use the MATLAB abs() function to obtain the absolute value or modulus of each element of a matrix.

We also explain the individual calling methods of this function and describe in detail its input and output arguments, as well as the accepted data types.

In addition, we explain various ways to obtain the absolute value of complex magnitudes using the various tools and functions that MATLAB provides us to solve this mathematical operation.

This article includes practical examples and images that explain each of the ways to use this function, which is one of the most used functions in the library of mathematical functions of this powerful programming language.

Syntax of the MATLAB abs() Function

Description and Examples

Matlab’s abs() function returns in “a” the absolute value of each value of the array sent in “x”.

The input arguments to this function can be the following:

For Auténtico Values:

In cases where abs() is called with vivo values in “x”, this function returns the absolute value in “a”, the unsigned value of “x”. The type of input array for abs() can be vectors, scalars, matrices, or multidimensional arrays.

The data types accepted by input and output arrays are: single, double, int8, int16, int32, int64, uint8, uint16, uint32, uint64, or duration.

For Complex Values:

This function accepts complex numbers. In this case, the data type of the array must be single or double.

For complex numbers, abs() returns the complex magnitude or modulus of “x”. The complex magnitude can be calculated by taking the square root of the absolute value of the vivo part squared plus the absolute value of the imaginary part squared.

Next, we will see how to calculate the complex amount.

How to Get the Absolute Value of a Scalar with the abs() Function

In the following example, we see how to obtain the absolute value of a scalar using the abs() function. Since the scalar in this case has a vivo value, abs() will return the unsigned vivo result of “x”.

As a result, abs() will return the absolute value of “x”. In this case, since it is a vivo number, the result in “a” will be the same magnitude as “x” but without a sign. In the following image, you can see this expression and its results applied in the MATLAB command console.

How to Get the Absolute Value of an Array

Now, we will see how to obtain the absolute values of the elements of an array. For this, we create an array “x” of 4×5 elements with values of positive and negative sign.

x = [ 12, 51, –84, 5, –6;

23, –9, –54, 21, 22;

25,-89, –74, 25, 2;

14, –7, –85, 66,-23];

a = abs(x)

a =

12 51 84 5 6

23 9 54 21 22

25 89 74 25 2

14 7 85 66 23

As a result, abs() returns an array containing the absolute values of each element of the array passed in its input arguments. As seen in the picture, the results in “a” are the unsigned values of “x”. In the following image, you can see this expression and its results applied in the MATLAB command console.

How to Get the Complex Magnitude of a Scalar Using MATLAB abs() Function

MATLAB abs() function supports complex numbers. The absolute value or modulus of a complex number is calculated by taking the square root of the vivo part squared plus the imaginary part squared. In this example, we will find the complex amount of 3.5653 + 14.2363i using the abs() function in MATLAB.

x = abs(3.5653 + 14.2363i)

x =

14.6760

% The calculation can also be done using the sqrt() function as follows:

x = sqrt( (3.5653.^2) + (14.2363.^2))

x =

14.6760

As seen in the following image, we have obtained the complex magnitude of 3.5653 + 14.2363i using two different ways, the first through the abs() function as shown below:

x = abs(3.5653 + 14.2363i);

The other way was to use the sqrt() function to get the square root of the sums of 3.5653 and 14.2363 squared.

x = sqrt((3.5653.^2) + (14.2363.^2))

In the following image, you can see this expression and its results applied in the MATLAB command console:

How to Get the Complex Magnitude of an Array with MATLAB’s abs() Function

In this example, we will see how to obtain the absolute values of an array of 5×5 elements containing vivo and complex magnitudes. To do this, we create the array “x” with these values and send it as an input argument in the call to the abs() function.

x= [ 12+54i, 523i, 16+64i, 88, –3;

8+21i, –57, –89+22i, –9, 240i;

5+54i, –99, 35+59i, 23, –124;

5723i, –59, 387i, 23, –124;

11, 35+6i, 21, 2717i, 9+95i];

a= abs(x)

a =

55.3173 23.5372 65.9697 88.0000 3.0000

22.4722 57.0000 91.6788 9.0000 40.0500

54.2310 99.0000 68.6003 23.0000 124.0000

61.4654 59.0000 87.0517 23.0000 124.0000

11.0000 35.5106 21.0000 31.9061 95.4254

As a result, abs() will return an array of the same size as “x” with the absolute values of each element. In the following image, you can see this expression and its results applied in the MATLAB command console:

Conclusion

In this article, we explained how to obtain absolute values using the MATLAB abs() function. We also show you several alternatives on how to solve this mathematical calculation using other functions in the MATLAB library. We have also included practical examples and images that use this function with different types of input, so you can better understand which methods to call in each case. We hope you found this MATLAB article useful. See other Linux Hint articles for more tips and information.



Source link

Hi guys, Nick is here from OKNetTV. 

Welcome to my channel.

WooCommerce has just released the new version of its own native payment system known as WooCommerce payments. It was available only in the US but has just been released in Australia, the UK, Canada, Ireland, New Zealand, France, Italy, Spain and Germany. The primary benefit of this payment system over others such as PayPal or Stripe is that you can now take payments directly on your platform, as well as instructor all transactions and resolve any issues in your backend.

This plugin was made by Automatic, which is the company that created WordPress and WooCommerce. You may use WooCommerce Payments to collect payments, track cash flow, and manage recurring revenue directly from your store’s dashboard — all without setup costs or monthly fees. However, this plugin works with Stripe, so you must have a Stripe account to use it. 

Download the WooCommerce Payments plugin from WooCommerce

Download my free eBook
Internet Sales Funnel User’s Guide
https://tinyurl.com/yh8nnfu6
Find more about WordPress, tips, hacks, tricks etc.
https://wpgopro.com/
Camera used for making our videos Sony ZV-1
https://amzn.to/3s16iSN



Language Integrated Query language (LINQ) is used to perform operations on the C# collections or Regular data structures. With LINQ, we can also perform database query operations. LINQ supports many methods and functions that are used for Data manipulation like Updating, deletion, Insertion, and etc.

LINQ ElementAtOrDefault

LINQ ElementAtOrDefault operator is used to search the element present in a data source. It searches the element based on the index value provided. If the element is found at a specified index, the element is returned. Otherwise, it returns empty by default.

Syntax:

input_source.ElementAtOrDefault(index_number);

Where input_source is the data source that can be an array or List or any collection.

We will understand this by seeing the following examples.

As we know, Indexing starts with 0.

Example 1:

Here, we will create a list that has 10 integers and get the elements based on index numbers provided inside ElementAtOrDefault().

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{

    static public  void Main(){
   
    //create List named input_numbers
    var input_numbers = new  List() {100,200,300,456,12,34,56,78,54,44};
   
    //return 6th value
    Console.WriteLine(«Element present at 6th position: «+input_numbers.ElementAtOrDefault (5));
   
    //return 9th value
    Console.WriteLine(«Element present at 9th position: «+input_numbers.ElementAtOrDefault (8));
   
    //return 1st value
    Console.WriteLine(«Element present at 1st position: «+input_numbers.ElementAtOrDefault (0));
   
    //return 4th value
    Console.WriteLine(«Element present at 4th position: «+input_numbers.ElementAtOrDefault (3));
   
    //return 10th value
    Console.WriteLine(«Element present at 10th position: «+input_numbers.ElementAtOrDefault (9));
   
    }
   
}

Output:

Explanation:

1. So first, we created a list named input_numbers that holds 10 integer elements.

2. After that, we searched and displayed the below values using their index positions.

Example 2:

Here, we will create a list that has 3 strings and get the elements based on index numbers provided inside ElementAtOrDefault().

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{

    static public  void Main(){
   
    //create List named input_strings
    var input_strings = new  List() {«Linuxhint»,«c#»,«vignan»};
   
    //return 1st value
    Console.WriteLine(«Element present at 1st  position: «+input_strings.ElementAtOrDefault(0));
   
        //return 3rd value
    Console.WriteLine(«Element present at 3rd position: «+input_strings.ElementAtOrDefault(2));
   
    //return 6th value
    Console.WriteLine(«Element present at 6th position: «+input_strings.ElementAtOrDefault(5));
   
    //return 9th value
    Console.WriteLine(«Element present at 9th position: «+input_strings.ElementAtOrDefault(8));
   
   
    }
   
}

Output:

Explanation:

1. So first, we created a list named input_strings that holds 3 string elements.

2. After that, we searched and displayed the below strings using their index positions.

The index positions 6 and 9 are not present. Hence, empty is returned.

This is how to return the element based on the index number using ElementAtOrDefault operator available in C# – LINQ. If the element is found at index, the element is returned. If it is not found, it returns empty by default. We demonstrated two different examples to understand the concept better and make sure to use the modules using System, using System.Linq, using System.Collections.Generic in your code.



Source link

🛑 GRATUIT : Les 17 ressources WordPress indispensables pour proporcionadamente débuter
👉 https://easywordpress.fr/ressources

Maitrisez WordPress et Woocommerce sur le bout des doigts pour créer votre boutique en ligne / site e-commerce pro de A à Z ! Ce tutoriel en français vous détail toutes les étapes pour créer une boutique en ligne rapidement et facilement avec WordPress et Woocommerce.
Dans ce tutorial, vous verrez comment installer votre site sur un hébergeur puis comment configurer votre boutique : ajouter des produits, gérer les livraisons et moyens de paiement, créer toutes les pages indispensables (panier, checkout) ou encore comment modifier le design de votre boutique en ligne sur WordPress et Woocommerce.

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

🛑 Woocommerce Elite™️ : Créez votre boutique Woocommerce professionnelle de A à Z :
👉 https://easywordpress.fr/woocommerce-elite/

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

🛑 FORMATIONS : Développez vos compétences sur WordPress et Woocommerce :
👉 https://easywordpress.fr/les-formations/

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

🛑 MES RECOMMANDATIONS WORDPRESS

👉 Ionos : Hébergement WordPress à 1€20 par mois

👉 Elementor : Créez les designs de vos rêves, sans code
https://easywordpress.fr/elementor
👉 OceanWP : Le thème avec les meilleures personnalisations
https://easywordpress.fr/oceanwp
👉 Alidropship : Le plugin WordPress de dropshipping par excellence
https://easywordpress.fr/alidropship
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

SOMMAIRE :
00:00 Installation de WordPress sur un hébergeur
04:00 Présentation du tableau de bord
05:33 Le meilleur thème ecommerce gratuit
06:20 Les plugins indispensables
12:09 Configuration de pulvínulo de Woocommerce
14:03 Comment créer un produit ?
26:08 Réglages de Woocommerce
27:21 Ajouter des moyens de paiement
31:21 Configuration de la TVA
32:24 Les méthodes de livraison
34:53 Créer des codes promo
35:57 Le déroulement d’une commande
38:55 Personnaliser les e-mails Woocommerce
41:40 Création d’un menu
42:45 Personnaliser le design de votre boutique en ligne
53:13 Aller plus loin sur Woocommerce

// Merci d’avoir visionné la vidéo //
Je vous invite à liker la vidéo si vous avez réussi à créer votre boutique en ligne.

On se retrouve bientôt pour un nouveau conseil WordPress,
Enzo



The LINQ Except() method in C#, it returns all the elements in the first dataset that are not present in the second data set. The data set can be an Array, List, ArrayList, SortedList, and etc.

Syntax:

input_source1.Except(input_source2);

Where input_source1 is the first data source and input_source2 is the second data source.

Example 1:

Here, we will create two Arrays that have string elements and apply the Except() method to return only elements from the first Array that are not present in the second Array.

using System;  
using System.Linq;  
using System.Collections;  
using System.Collections.Generic;  

class Linuxhint
    {  
        static void Main()  
        {  
//create array of strings with 5 strings
           string[] first_strings = {«Linuxhint»,«java»,«python»,«backbone.js»,«ember.js»};
//create array of strings with 3 strings
           string[] second_strings = {«Linuxhint»,«java»,«html»};

Console.WriteLine(«——–First Array——–«);
            foreach (var values1 in first_strings)  
            {  
Console.WriteLine(values1);  
            }  
Console.WriteLine(«——–Second Array——–«);
             foreach (var values1 in second_strings)  
            {  
Console.WriteLine(values1);  
            }

            //apply Except()
            var final=first_strings.Except(second_strings);

Console.WriteLine(«——–Final Result——–«);
             foreach (var values in final)  
            {  
Console.WriteLine(values);  
            }
        }  

}

Output:

Explanation:

1. So first, we created two String Arrays named first_strings,second_strings.

2. After that, we are displaying the flagrante values present in the two arrays using a foreach loop.

3. Use the Except() method and display the values using the foreach loop.

Example 2:

Here, we will create two Arrays that have integer elements and apply the Except() method to return only values from the first Array that are not present in the second Array.

using System;  
using System.Linq;  
using System.Collections;  
using System.Collections.Generic;  

class Linuxhint
    {  
        static void Main()  
        {  
//create array of integers
           int[] first_integers = {20,34,56,23,67,100};
//create array of integers
           int[] second_integers = {20,23,34,56,67};

Console.WriteLine(«——–First Array——–«);
            foreach (var values1 in first_integers)  
            {  
Console.WriteLine(values1);  
            }  
Console.WriteLine(«——–Second Array——–«);
             foreach (var values1 in second_integers)  
            {  
Console.WriteLine(values1);  
            }

            //apply Except()
            var final=first_integers.Except(second_integers);

Console.WriteLine(«——–Final Result——–«);
             foreach (var values in final)  
            {  
Console.WriteLine(values);  
            }
        }  

}

Output:

Explanation:

1. So first, we created two Integer Arrays named first_integers and second_integers.

2. After that, we are displaying the flagrante values present in the two arrays using a foreach loop.

3. Use the Except() method and display the values using the foreach loop.

Conclusion

The LINQ Except() method in C# returns all the elements in the first dataset that are not present in the second data set. Here, we used Array as a data source. Make sure you have to include using System, using System.Linq, using System.Collections, and using System.Collections.Generic.



Source link

WooCommerce is the webs favorite eCommerce plugin for WordPress. It gives both store owners and developers complete control. Sell anything. Beautifully. Get started for free.



In C#, if you want to group all the similar values at one place, LINQ in C# provides GroupBy() method.

The LINQ GroupBy method is used to group the similar values in a specified attribute and place with all the similar elements.

Method Syntax:

input_source.GroupBy(element => element.attribute);

Query Syntax:

from iterator in input_source group iterator by iterator.attribute

Where, input_source is the data source(List) and iterator is used to iterate the elements present in input_source.

Example 1:

We will create a List that stores Food details and Group the values in the list based on different attributes.

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{
    //define the data for Food
   class Food  
    {  
        public int food_price { get; set; }  
        public string name { get; set; }  
        public int quantity { get; set; }  
        public string city { get; set; }
    }
    static public  void Main(){

       //create data
       Listfirst_list = new List();
       //add values
first_list.Add(new Food { food_price=300,name=«vegtables»,quantity=1,city=«california» });
first_list.Add(new Food { food_price=34,name=«fruits»,quantity=4,city=«california»});
first_list.Add(new Food { food_price=100,name=«mushroom»,quantity=2,city=«nepal» });
first_list.Add(new Food { food_price=564,name=«vegtables»,quantity=10,city=«guntur» });
first_list.Add(new Food { food_price=500,name=«fruits»,quantity=8,city=«nepal» });
first_list.Add(new Food { food_price=764,name=«pulses»,quantity=10,city=«guntur» });
first_list.Add(new Food { food_price=400,name=«pulses»,quantity=8,city=«nepal» });

Console.WriteLine(«————————–Flagrante List————————–«);

       foreach (var value in first_list)  
            {  
                Console.WriteLine(value.food_price+«->»+value.name+«->»+value.quantity+«->»+value.city);  
            }  

Console.WriteLine(«————————–LINQ GroupBy city————————–«);

         //group the values in city attribute
         var result = first_list.GroupBy(element =>element.city);

         //display the grouped results using foreach loop
     foreach (var i in result)  
            {  
              foreach (var j in i)  
            {  
                Console.WriteLine(j.food_price+«->»+j.name+«->»+j.quantity+«->»+j.city);  
            }    
            }  

Console.WriteLine(«————————–LINQ GroupBy name————————–«);

         //group the values in name attribute
         var result2 = first_list.GroupBy(element => element.name);

         //display the grouped results using foreach loop
     foreach (var i in result2)  
            {  
              foreach (var j in i)  
            {  
                Console.WriteLine(j.food_price+«->»+j.name+«->»+j.quantity+«->»+j.city);  
            }    
            }  

}
}

Output:

Explanation:

1. So first, we created a list that had food details.

2. After that, we are grouping values in the city column. Finally, we are using for each loop to display the grouped values.

3. Lastly, we are grouping values in the name column then we are using for each loop to display the grouped values.

Example 2:

We will create a List that stores Food details and Group the values in the list based on different attributes using Query Syntax.

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{
    //define the data for Food
   class Food  
    {  
        public int food_price { get; set; }  
        public string name { get; set; }  
        public int quantity { get; set; }  
        public string city { get; set; }
    }
    static public  void Main(){

       //create data
       Listfirst_list = new List();
       //add values
first_list.Add(new Food { food_price=300,name=«vegtables»,quantity=1,city=«california» });
first_list.Add(new Food { food_price=34,name=«fruits»,quantity=4,city=«california»});
first_list.Add(new Food { food_price=100,name=«mushroom»,quantity=2,city=«nepal» });
first_list.Add(new Food { food_price=564,name=«vegtables»,quantity=10,city=«guntur» });
first_list.Add(new Food { food_price=500,name=«fruits»,quantity=8,city=«nepal» });
first_list.Add(new Food { food_price=764,name=«pulses»,quantity=10,city=«guntur» });
first_list.Add(new Food { food_price=400,name=«pulses»,quantity=8,city=«nepal» });

Console.WriteLine(«————————–Flagrante List————————–«);

       foreach (var value in first_list)  
            {  
                Console.WriteLine(value.food_price+«->»+value.name+«->»+value.quantity+«->»+value.city);  
            }  

Console.WriteLine(«————————–LINQ GroupBy city————————–«);

         //group the values in city attribute
         var result = from iterator1 in first_list group iterator1 by iterator1.city;

         //display the grouped results using foreach loop
     foreach (var i in result)  
            {  
              foreach (var j in i)  
            {  
                Console.WriteLine(j.food_price+«->»+j.name+«->»+j.quantity+«->»+j.city);  
            }    
            }  

Console.WriteLine(«————————–LINQ GroupBy name————————–«);

         //group the values in name attribute
         var result2 = from iterator2 in first_list group iterator2 by iterator2.name;

         //display the grouped results using foreach loop
     foreach (var i in result2)  
            {  
              foreach (var j in i)  
            {  
                Console.WriteLine(j.food_price+«->»+j.name+«->»+j.quantity+«->»+j.city);  
            }    
            }  

}
}

Output:

Explanation:

1. First, we created a list that had food details.

2. After that, we are grouping values in the city column then we are using for each loop to display the grouped values.

3. Lastly, we are grouping values in the name column then we are using for each loop to display the grouped values.

Conclusion

The LINQ GroupBy method is used to group the similar values in a specified attribute and place all the similar elements using Method and Query. It group all the similar values at one place and we can return the grouped values using foreach loop.



Source link

The top 10 Plugins for WordPress that everybody can use on their WordPress website.

Here are the names (so you can copy them and find them yourself):

Rank Math SEO
Duplicate Page
Post Types Order
ManageWP – Worker (my tutorial: https://youtu.be/IVJHCqq58MU)
Antispam Bee
iThemes Security
Elementor Custom Skin
Custom Post Type UI
Google Analytics Dashboard for WP
reSmush.it Image Optimizer

And of course Elementor:
My Basics video about the Free version: https://youtu.be/E15iQEm9KF8
My Basics video about the Pro version: https://youtu.be/hNP6HOC1c-0

→ Software that I recommend
Elementor: https://trk.elementor.com/livingwithpixels
Hosting provider premium: https://www.siteground.com/go/lwp-youtube
Hosting provider affordable: https://www.hostinger.com/livingwithpixels
Adobe Xd (design software): https://bit.ly/lwp-adobexd-yt
All software I recommend: https://livingwithpixels.com/links/

→ Gear that I use to create videos
Macbook Pro M1 14 inch: https://amzn.to/3oHBQNd
Camera: Lumix GH5: https://amzn.to/3pPpTVh
Microphone: Shure MV7: https://amzn.to/3s3nhFM
Chair & Sit/stand Desk: https://bit.ly/39fn6fs
Video editing software: https://bit.ly/lwp-premiere-yt

→ Helpful for beginner
How to Install Elementor and WordPress. Watch: https://youtu.be/SKyoKk9T4g4
Elementor Beginners Tutorial. Watch: https://youtu.be/E15iQEm9KF8
Elementor Pro Beginners Tutorial. Watch: https://youtu.be/hNP6HOC1c-0

→ My social media
Instagram Livingwithpixels: https://www.instagram.com/livingwithpix/
Personal Instagram: https://www.instagram.com/rinodeboer/

Some of the above links are affiliate links, which means that I earn a commission when you make a purchase via my link. Thanks a lot if you decide to do that! I couldn’t make all these videos without it.



In this article, we will discuss how to return the last element or default element using the LINQ LastOrDefault() function.

Language Integrated Query language (LINQ) is used to perform operations on the C# collections or Regular data structures.

LINQ LastOrDefault()

LastOrDefault() in LINQ returns the last element from the specified data structure. If there are no elements in the data structure, it will return a default value – 0.

There are two ways to use this method. Let’s look into it.

Approach 1: Using Method

We will use the ordinario LastOrDefault() method to return the last/default element.

Syntax:

Where list is the List object created.

Approach 2: Using Query

We will use the Query similar to SQL expression that returns the last/default element.

Syntax:

from i in list select i.LastOrDefault()

Where list is the List object created.

Example 1:

Here, we will create a list that holds integer elements and we will use LastOrDefault() to return only the last value.

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{

    static public  void Main(){
   
    //create list of integers
       Listfirst_list = new List() {100,200,300,456};
   
   
Console.WriteLine(«List: «);
    foreach (var values in first_list)
    {
Console.WriteLine(values);
    }
   
   
    //get the last element from the list
    var result = first_list.LastOrDefault();
   
Console.WriteLine(«Last element in the List: «+result);
   
   
}
}

Output:

Explanation:

1. So first, we created a list data structure with 4 integers.

2. After that, we applied LastOrDefault() to get the last element and display the result.

Example 2:

Here, we will create a list that holds no elements and we will use LastOrDefault() to return the default value.

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{

    static public  void Main(){
   
    //create list
       Listfirst_list = new List();

    //get the default element from the list
    var result = first_list.LastOrDefault();
   
Console.WriteLine(«Default element in the List: «+result);
   
   
}
}

Output:

Explanation:

1. So first, we created a list data structure with no values.

2. After that, we applied LastOrDefault() to get the default element and display it using the Console.Write() function.

Example 3:

Here, we will create two lists that hold integer and string elements separately. Get the last element from both the lists using Query.

using System;
using System.Linq;
using System.Collections.Generic;

 //create a class – Linuxhint
class Linuxhint
{

    static public  void Main(){
   
    //create list of integers
       Listfirst_list = new List() {100,200,300,456};
   
    //create list of strings
       Listsecond_list = new List() {«linuxhint»,«sravan»,«vignan»,«java»};
   
   
Console.WriteLine(«First List: «);
    foreach (var values in first_list)
    {
Console.WriteLine(values);
    }
   
   
    //get the last element from the list
    var result = (from i  in first_list select i).LastOrDefault();
   
Console.WriteLine(«Last element in the List: «+result);
   
Console.WriteLine(«Second List: «);
    foreach (var values2 in second_list)
    {
Console.WriteLine(values2);
    }
   
   
    //get the last element from the list
    var result2 = (from i  in second_list select i).LastOrDefault();
   
Console.WriteLine(«Last element in the List: «+result2);
   
   
}
}

Output:

Explanation:

1. Let’s create two Lists:

2. Now, return Last element from both the lists:

Conclusion

LastOrDefault() in LINQ returns only the last element or default element from the data structure. Here, we used List as a data structure. If the data structure has no elements, a default value 0 is returned. We implemented the LINQ LastOrDefault() method in two ways. Make sure that use has to include – using System.Linq and using System.Collections.Generic command lines in your code.



Source link

WORDPRESS TUTORIAL FOR BEGINNERS 2022
This how to make a WordPress website for beginners tutorial for 2022 covers all the steps needed to create your own WordPress website for free from start to finish with steps skipped. The course explains how to pick the best web host, how to get a free domain name, and how to get the best possible price. This WordPress video covers purchasing WordPress web hosting, installing WordPress for free, installing themes and plug-ins for your WordPress for free, and creating your own professional logo for free. It provides a very detailed and complete step-by-step walk-through of everything you’ll need to know how to create your own professional website from start to finish using the super easy (and free) Elementor page building plug-in. Below you will also discount options, free resources, and timestamps to access specific lessons within this tutorial.

YODA’S TIP JAR 🗑️

DISCOUNT HOSTING OFFERS*
Host Link: http://hostgator.com/webyoda
Coupon : webyoda (Up to 80% off)
* You save money, I get a commission :-)

WEBSITE MUST HAVES
Backup Website : https://youtube.com/watch?v=wGyZvNupHV8
Free Logo : http://designevo.com/webyoda (Coupon WEBYODA30OFF)
Elementor: https://go.elementor.com/webyoda

ROYALTY FREE IMAGES
https://webyoda.com/123RF (professional images)
http://unsplash.com (free)
http://pixabay.com (free)
http://pexels.com (free)

ROYALTY FREE VIDEO CLIPS
http://youtube.com (free)
http://coverr.co (free)
https://www.videvo.net (free)

TIMESTAMPS
00:00:00 Step 01 – Introduction
00:02:00 Step 02 – Website Project Overview
00:06:37 Step 03 – Unavoidable Costs
00:07:03 Step 04 – Please Ask Questions
00:07:20 Step 05 – Please Pay It Forward
00:07:33 Step 06 – Let’s Start Our Website
00:07:52 Step 07 – Choose Web Hosting
00:09:48 Step 08 – Purchase Web Hosting
00:15:26 Step 09 – Log In To Your Control Panel
00:15:55 Step 10 – Email Forward Setup
00:16:39 Step 11 – Find WordPress Installer
00:17:08 Step 12 – Fix WordPress Install Errors
00:18:13 Step 13 – Install WordPress
00:21:03 Step 14 – How To Login To WordPress
00:22:22 Step 15 – Display Your WordPress Website
00:23:05 Step 16 – WordPress Tutorial Timestamps
00:23:44 Step 17 – Install WordPress Theme
00:25:28 Step 18 – Install WordPress Plugins
00:20:56 Step 19 – How To Update Plugins
00:30:18 Step 20 – How To Update WordPress
00:31:46 Step 21 – Creating Empty Pages
00:36:05 Step 22 – Access Elementor Plugin
00:37:25 Step 23 – Create A Menu
00:39:07 Step 24 – Set Menu Colors
00:42:19 Step 25 – Make A Free Logo
00:42:34 Step 26 – Add Logo To Menu Bar
00:43:37 Step 27 – Add Favicon Icon
00:44:31 Step 28 – Choose A Homepage
00:45:28 Step 29 – Set Website Permalinks
00:46:21 Step 30 – Remove Search Icon
00:47:08 Step 31 – Remove Header Spacing
00:48:12 Step 32 – Set Footer Copyright
00:48:56 Step 33 – Build The Homepage
00:50:32 Step 34 – Collecting Website Content
00:51:28 Step 35 – Royalty Free Images And Videos
00:51:48 Step 36 – Add YouTube Background
00:57:00 Step 37 – Add Image Text Combo
01:01:22 Step 38 – Setting Default Fonts
01:12:24 Step 39 – Make Call To Action Areas
01:18:19 Step 40 – Add Accordion Widget
01:25:38 Step 41 – Add Image Carousel
01:30:05 Step 42 – Build Testimonials Section
01:35:54 Step 43 – Add Parallax Background
01:38:32 Step 44 – Using Contact Form 7
01:43:35 Step 45 – Insert Join Our Email Form
01:46:02 Step 46 – Create Website Footer
01:49:39 Step 47 – Set Footer Background Color
01:50:32 Step 48 – Create About Us Page
01:51:11 Step 49 – YouTube Segment Background
01:58:29 Step 50 – Create Destination Page
02:09:57 Step 51 – Create Numbered List
02:11:41 Step 52 – Using Elementor Templates
02:20:10 Step 53 – Create Photo Gallery
02:21:22 Step 54 – How To Set Color Defaults
02:21:52 Step 55 – Add Gallery Page
02:24:43 Step 56 – Create Travel Tips Page
02:25:15 Step 57 – Create Contact Us Page
02:28:02 Step 58 – Using Icon List Widget
02:30:59 Step 59 – Using Google Map Widget
02:32:20 Step 60 – Apply Content Animation
02:35:11 Step 61 – Headline Animation Widget
02:37:24 Step 62 – Mobile Friendly Adjustments
02:43:30 Step 63 – Website SEO Tips
02:46:25 Step 64 – You Finished, Well Done!

ABOUT THE AUTHOR
About me (Yoda) – http://webyoda.com/first-certified-webmaster
WebYoda – http://webyoda.com (Owner)
WOW Academy – http://wowacademy.com (Creator)
Web Design Training School – http://webdesigntrainingschool.com (Creator)

MUSIC CREDITS
Come On In & Sun’s Rise – Silent Partner

VIDEO COVER CREDITS
1. Girl Raft – SkyMediaPro
2. Egypt – Explore&Share
3. Havasu – Pavel Losevsky
4. Jamaica – Ron Lane
5. Mt Baker – coverr.co
6. Hawaii – InBoundHorizons
7. PC Beach – Pineapple Properties
8. Rome Italy – Tom Hoffman Jr
9. Bermuda – Purchased

DRAWING ARTIST CREDITS

WE LOVE QUESTIONS & COMMENTS
Please leave your comments and questions below.

#WordPress #WordpressTutorial #WordpressWebsite #WordPressForBeginners