Tag: How to
C Program to display Prime Numbers between two numbers
Problem Write a program in C to display all the prime numbers between a range of 2 numbers. How to display prime numbers between a range of 2 numbers in C ? Output Abundantcode.com coding sample Enter Lower limit :5 Enter Upper limit :20 Prime numbers between 5 and 20 : 5 7 11 13 17 19
Java – How to convert String to Double in Java ?
Problem Statement You want to convert a string value to double in Java. Solution You can use one of the three approaches to convert a string to double in Java. 1. Assigning the string to the constructor of the Double class 2. Using Double.valueOf 3. Using Double.parseDouble The output of the above program is Abundantcode.com Java Tutorials 76.2 String to double using valueOf 76.2 string…
How to Notify Clients when there is a change using C# ?
There are times when you want the users who use the class wants some kind of indication or notification when there is a change in data inside it . One of the solutions for this is to make the class implement INotifyPropertyChanged interface which is located in the namespace System.ComponentModel. One of the primary use of the INotifyPropertyChanged is in the WPF / Silverlight /…
How to Catch an Exception in C# ?
Every time when the exception is thrown , it is necessary that it be handled . In this case , one needs to wrap the code with the try catch block as shown below. How to Catch an Exception in C# ?
Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
Below is a sample code snippet demonstrating the usage of the “B” to define a ASCII string in F# . This technique is somewhat similar to Encoding.ASCII.GetBytes in F#. Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
How to Validate an email address using Regular Expression in C# ?
You can validate an email address in C# using regular expressions which provides the developers to play around with different patterns. Below is a code snippet that shows how you can use regular expression to validate an email address in C# . How to Validate an email address using Regular Expression in C# ?
How to remove user from group using command line in Windows 10 ?
You can use the net localgroup command and specify the /delete parameter to remove the user from a group using command line in Windows 10. The format of the command is as shown below. net localgroup <groupname> <username> /delete How to remove user from group using command line in Windows 10 ? 1. Open command prompt from the elevated administrator mode. 2. Enter the command….
Json.NET & C# – How to Serialize a Collection?
Do you want to serialize an collection in your C# application?. Json.NET supports this functionality with ease. The Collection can be an Array , Dictionary or List. You need to simply pass collection to the JsonConvert.SerializeObject static method which would serialize the collection and return you the Json string. How to Serialize a Collection in C# using JSON.NET ? For example , assume that you…
Alias Names for Tables in SQL Query
There are times when you write query and end up qualifying the columns references by indicating the table name. For example , In the above query , the Department table is referred in the GroupName and Name column. Instead of mentioning the table table , we could provide a shortname or alias name for the table and use the alias name instead. The full use…
How to use Find method with Lambda Expressions in C#?
Below is a sample source code demonstrating how to use Find method with Lambda Expression in C# How to use Find method with Lambda Expressions in C#?
How to specify the Sort order for a Query in SQL Server ?
If you want the sort the records in descending order by more than one column instead of the default ascending order , you can use the DESC or DESCENDING to this. How to specify the Sort order for a Query in SQL Server ? Here’s the query which retrieves the Department records in Descending order by two columns – Name and GroupName.
C Program to convert decimal number to binary
Problem Write a program in C to convert a decimal number to binary number How to convert a decimal number to binary number in C ? Output Abundantcode.com Coding samples Enter a decimal number: 10 1010