- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Get the minimum value from a sequence using the Min() method in C#.The following is our list.List list = new List { 1, 2, 3, 4, 5, 6 };Now, use Queryable Min() method to get minimum element.list.AsQueryable().Min();Exampleusing System; using System.Collections.Generic; using System.Linq; class Demo { static void Main() { List list = new List { 1, 2, 3, 4, 5, 6 }; foreach(long ele in list) { Console.WriteLine(ele); } // getting lowest element long min_num = list.AsQueryable().Min(); Console.WriteLine("Smallest number = {0}", mix_num); } }
The ondragover event triggers when the dragged element is over the drop target.ExampleYou can try to run the following code to learn how to implement ondragover event in JavaScript −Live Demo .drag { float: left; width: 100px; height: 35px; border: 2px dashed #876587; margin: 15px; padding: 10px; } ... Read More
The following is our Hashtable −Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris");To remove an item, use the Remove() method. Here, we are removing the 3rd element.h.Remove(3);Let us see the complete example.Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris"); Console.WriteLine("Initial list:"); foreach (var key in h.Keys ) { Console.WriteLine("Key = ... Read More
JavaScript date getUTCDay() method returns the day of the week in the specified date according to universal time. The value returned by getUTCDay() is an integer corresponding to the day of the week: 0 for Sunday, 1 for Monday, 2 for Tuesday, and so on.ExampleYou can try to run the following code to return the day of the week in the specified date − JavaScript getUTCDay Method var dt = new Date( "January 15, 2018 20:15:20" ); document.write("getUTCDay() : " + dt.getUTCDay() );
JavaScript date getTimezoneOffset() method returns the time-zone offset in minutes for the current locale. The time-zone offset is the minutes in difference; the Greenwich Mean Time (GMT) is relative to your local time.ExampleYou can try to run the following code to return the time-one offset in minutes − JavaScript getTimezoneOffset Method var dt = new Date(); var tz = dt.getTimezoneOffset(); document.write("getTimezoneOffset() : " + tz );
Set Hashtable collection with elements.Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris");Let’s say now you need to find any key, then use the Contains() method. We are finding key 3 here −h.Contains(3);The following is the complete example.Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris"); Console.WriteLine("Keys and Values list:"); foreach (var key in h.Keys ) ... Read More
Set Hahtable collection with elements.Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris");Let’s say now you need to find a value, then use the ContainsValue() method.We are finding value “Chris” here −h.ContainsValue(“Chris”);Example Live Demousing System; using System.Collections; public class Demo { public static void Main() { Hashtable h = new Hashtable(); h.Add(1, "Jack"); h.Add(2, "Henry"); h.Add(3, "Ben"); h.Add(4, "Chris"); Console.WriteLine("Keys and Values list:"); foreach (var key in h.Keys ) { Console.WriteLine("Key ... Read More
The following are the method supported by W3C DOM −Sr.NoProperty & Description1createAttribute( name)Returns a newly-created Attr node with the specified name.Ex − document.createAttribute( name)2createComment( text)Creates and returns a new Comment node containing the specified text.Ex − document.createComment( text)3createDocumentFragment( )Creates and returns an empty DocumentFragment node.Ex − document.createDocumentFragment( )4createElement( tagName)Creates and returns a new Element node with the specified tag name.Ex − document.createElement( tagName)5createTextNode( text)Creates and returns a new Text node that contains the specified text.Ex − document.createTextNode( text)6getElementById( id)Returns the Element of this document that has the specified value for its id attribute, or null if no such Element exists ... Read More
To convert a specified value to a double-precision floating-point number, use Convert.ToDouble() method.The following is our long value −long[] val = { 340, -200};Now convert it to Double.double result; result = Convert.ToDouble(val);Example Live Demousing System; public class Demo { public static void Main() { long[] val = { 340, -200}; double result; // long to double foreach (long number in val) { result = Convert.ToDouble(number); Console.WriteLine("Converted {0} value to {1}",number, result); } } }OutputConverted 340 value to 340 Converted -200 value to -200
To return the number of images in a document, use the images property in JavaScript.ExampleYou can try to run the following code to get the count of images −Live Demo var val = document.images.length; document.write("Number of images in the document: "+val);