Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 1637 of 3366
1K+ Views
In c#, the throw is a keyword and it is useful to throw an exception manually during the execution of the program and we can handle those thrown exceptions using try−catch blocks based on our requirements.By using throw keyword in the catch block, we can re-throw an exception that is handled in the catch block. The re-throwing an exception is useful when we want to pass an exception to the caller to handle it in a way they want.Following is the example of re−throwing an exception to the caller using throw keyword with try-catch blocks in c#.Exampleclass Program{ static ... Read More
598 Views
Lambda expression is a better way to represent an anonymous method. Both anonymous methods and Lambda expressions allow you define the method implementation inline, however, an anonymous method explicitly requires you to define the parameter types and the return type for a method.Expression lambda that has an expression as its body: (input−parameters) => expressionStatement lambda that has a statement block as its body: (input−parameters) => { }Any lambda expression can be converted to a delegate type. The delegate type to which a lambda expression can be converted is defined by the types of its parameters and return value. If ... Read More
34K+ Views
In C#, String.Contains() is a string method. This method is used to check whether the substring occurs within a given string or not. It returns the boolean value. If substring exists in string or value is the empty string (""), then it returns True, otherwise returns False. Exception − This method can give ArgumentNullException if str is null. This method performs the case-sensitive checking. The search will always begin from the first character position of the string and continues until the last character position. Example 1 Contains is case sensitive if the string is found it return true else false ... Read More
2K+ Views
| OperatorThe | operator computes the logical OR of its operands. The result of x | y is true if either x or y evaluates to true. Otherwise, the result is false.The | operator evaluates both operands even if the left-hand operand evaluates to true, so that the operation result is true regardless of the value of the right-hand operand.|| OperatorThe conditional logical OR operator ||, also known as the "short−circuiting" logical OR operator, computes the logical OR of its operands.The result of x || y is true if either x or y evaluates to true. Otherwise, the result is ... Read More
1K+ Views
IP (Internet Protocol) Address is an address of your network hardware. It helps in connecting your computer to other devices on your network and all over the world. An IP Address is made up of numbers or characters.All devices that are connected to an internet connection have a unique IP address which means there’s a need of billions of IP addresses. This requirement is fulfilled by the new IP version IPv6.Private IP AddressA private IP address is the address of your device connected on the home or business network. If you have a few different devices connected to one ISP ... Read More
589 Views
The WebClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI.The WebClient class uses the WebRequest class to provide access to resources. WebClient instances can access data with any WebRequest descendant registered with the WebRequest.RegisterPrefix method.DownloadString Downloads a String from a resource and returns a String.If your request requires an optional header, you must add the header to the Headers collectionExampleIn the below example we are calling the url "https://jsonplaceholder.typicode.com/posts"The example is then deserialized to User arrayFrom the user array we are printing the first array valueExampleclass ... Read More
340 Views
The [] operator is called an indexer.An indexer allows an object to be indexed such as an array. When you define an indexer for a class, this class behaves similar to a virtual array. You can then access the instance of this class using the array access operator ([ ]).Indexers can be overloaded. Indexers can also be declared with multiple parameters and each parameter may be a different type. It is not necessary that the indexes have to be integers.Example 1static void Main(string[] args){ IndexerClass Team = new IndexerClass(); Team[0] = "A"; Team[1] = "B"; Team[2] ... Read More
1K+ Views
There are many ways to check whether internet is connected to a machine in C# or not. Make use of System.Net namespace which provides common methods for sending data to and receiving data from a resource identified by a URI. The WebClient or HttpClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI. Here in the below example we have used (OpenRead)Returns the data from a resource as a Stream.Checks by hitting the url "http://google.com/generate_204" if success return true else false.The below example runs in the loop ... Read More
327 Views
IntroductionPandas have a dual selection capability to select the subset of data using the Index position or by using the Index labels. Inthis post, I will show you how to "Select a Subset Of Data Using lexicographical slicing".Google is full of datasets. Search for movies dataset in kaggle.com. This post uses the movies data set from kaggle.How to do it1. Import the movies dataset with only the columns required for this example.import pandas as pd import numpy as np movies = pd.read_csv("https://raw.githubusercontent.com/sasankac/TestDataSet/master/movies_data.csv", index_col="title", usecols=["title", "budget", "vote_average", "vote_count"]) movies.sample(n=5)titlebudgetvote_averagevote_countLittle Voice06.661Grown Ups 2800000005.81155The Best Years of Our Lives21000007.6143Tusk28000005.1366Operation Chromite05.8292. I always recommend ... Read More