Samual Sam has Published 2491 Articles

Zip function in Python to change to a new character set.

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

74 Views

Given a 26 letter character set, here we are using a new character set. And another character set just like alphabet set (a, b, c........z), then our task is to make a relation between new character set and that alphabet set. Example New character set: qwertyuiopasdfghjklzxcvbnm Input: "wwmm" Output: ... Read More

How to find a matching substring using regular expression in C#?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

1K+ Views

Our string is − string str = " My make "; Use the following regular expression to find the substring “make” @"\bmake\b" Here is the complete code − Example Live Demo using System; using System.Text.RegularExpressions; namespace RegExApplication { public class ... Read More

Database Operations in C#

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

2K+ Views

The most common databases used in C# are Microsoft SQL Server and Oracle. The following is done to work with databases. Connect Set the Database Name, Optional Parameters and Credentials. The username and password is needed to set a connection to the database. The connection string would look somewhat like ... Read More

SequenceMatcher in Python for Longest Common Substring.

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

812 Views

Given two strings, our task is to print the longest common sub-string. We will solve problem in python using SequenceMatcher.find_longest_match () method. Class difflib.SequenceMatcher is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are hashable. find_longest_match(a, x, b, y) Find ... Read More

Cohesion in C#

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

1K+ Views

Cohesion in C# shows the relationship within modules. It shows the functional strength of the modules. The greater the cohesion, the better will be the program design. It is the dependency between the modules internal elements like methods and internal modules. High cohesion will allow you to reuse classes and ... Read More

Python program to check if binary representation is palindrome?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

629 Views

Here we use different python inbuilt function. First we use bin() for converting number into it’s binary for, then reverse the binary form of string and compare with originals, if match then palindrome otherwise not. Example Input: 5 Output: palindrome Explanation Binary representation of 5 is 101 Reverse ... Read More

Python program to Display Hostname and IP address?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:23

1K+ Views

Python provides gethostname(), gethostbyname() two function. gethostname() retrives the standard host name for the local machine. gethostbyname() retrives host information corresponding to a host name from a host database. Socket. gethostname() Socket. gethostbyname() Algorithm Step 1: use module socket. Step 2: use gethostname() retrives the standard host ... Read More

How to optimize nested if...elif...else in Python?

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:22

1K+ Views

Here are some of the steps that you can follow to optimize a nested if...elif...else.1. Ensure that the path that'll be taken most is near the top. This ensures that not multiple conditions are needed to be checked on the most executed path.2. Similarly, sort the paths by most use ... Read More

CSS media types

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:22

128 Views

The following are the media types in CSS:S.noValue & Description1.AllSuitable for all devices.2.AuralIntended for speech synthesizers.3.BrailleIntended for braille tactile feedback devices.4.EmbossedIntended for paged braille printers.5.HandheldIntended for handheld devices (typically small screen, monochrome, limited bandwidth).6.PrintIntended for paged, opaque material and for documents viewed on screen in print preview mode. Please consult ... Read More

Unicode Byte Order Mark (BOM) character in HTML5 document.

Samual Sam

Samual Sam

Updated on 30-Jul-2019 22:30:22

553 Views

A byte order mark (BOM) consists of the character code U+FEFF at the beginning of a data stream, where it can be used as a signature defining the byte order and encoding form, primarily of unmarked plaintext files.Many Windows programs (including Windows Notepad) add the bytes 0xEF, 0xBB, 0xBF at ... Read More

Advertisements