Samual Sam has Published 2492 Articles

Classes vs Structures in C#

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:26:22

575 Views

In C#, a structure is a value type data type. It helps you to make a single variable hold related data of various data types. The struct keyword is used for creating a structure.When you define a class, you define a blueprint for a data type.The following are the differences ... Read More

Comments in C#

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:13:35

151 Views

Comments are used for explaining the code. Compilers ignore the comment entries. The multiline comments in C# programs start with /* and terminate with the characters */ as shown below.Multi-line comments/* The following is a multi-line comment In C# /*The /*...*/ is ignored by the compiler and it is put ... Read More

Write a C# program to check if a number is Palindrome or not

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:11:43

846 Views

First, find the reverse of the string to check if a string is a palindrome or not −Array.reverse()Now use the equals() method to match the original string with the reversed. If the result is true, that would mean the string is Palindrome.Let us try the complete example. Here, our string ... Read More

Remove all duplicates from a given string in Python

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:10:40

453 Views

To remove all duplicates from a string in python, we need to first split the string by spaces so that we have each word in an array. Then there are multiple ways to remove duplicates.We can remove duplicates by first converting all words to lowercase, then sorting them and finally ... Read More

What happens with the output of MySQL EXPORT_SET() function if I will skip the value of the fifth argument i.e. a number of bits?

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:08:37

51 Views

Actually, the default value of the fifth argument i.e. number of bits is 64, hence if we will not specify any value on fifth argument them MySQL will check the bits up to 64 bits and produce the result. It can be understood from the following example −Examplemysql> SELECT EXPORT_SET(5, ... Read More

Map function and Lambda expression in Python to replace characters

Samual Sam

Samual Sam

Updated on 20-Jun-2020 09:08:20

446 Views

We want to replace a character a1 with a character a2 and a2 with a1. For example, For the input string, "puporials toinp"and characters p and t, we want the end string to look like −"tutorials point"For this we can use map function and lambdas to make the replacement. The ... Read More

Regex in Python to put spaces between words starting with capital letters

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:43:36

655 Views

The problem we are trying to solve here is to convert CamelCase to separate out words. We can solve this directly using regexes by finding all occurrences of a capital letter in the given string and put a space before it. We can use the sub method from the re ... Read More

Sort the words in lexicographical order in Python

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:30:41

3K+ Views

Sorting words in lexicographical order mean that we want to arrange them first by the first letter of the word. Then for the words whose first letter is the same, we arrange them within that group by the second letter and so on just like in a language's dictionary(not the ... Read More

How MySQL CONCAT() function, applied to the column/s of a table, can be combined with the column/s of other tables?

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:29:24

71 Views

We can use the output of CONCAT() function which is applied to the column/s of a MySQL with the column/s of another MySQL table. It can be done with the help of MySQL join.ExampleFor example, we have two table ‘Student’, having the details like id, Name, Last_name, Address and Subjects ... Read More

Removing stop words with NLTK in Python

Samual Sam

Samual Sam

Updated on 20-Jun-2020 08:26:09

521 Views

When computers process natural language, some extremely common words which would appear to be of little value in helping select documents matching a user need are excluded from the vocabulary entirely. These words are called stop words.For example, if you give the input sentence as −John is a person who ... Read More

Advertisements