Arjun Thakur

Arjun Thakur

749 Articles Published

Articles by Arjun Thakur

Page 49 of 75

How to find if a graph is Bipartite?

Arjun Thakur
Arjun Thakur
Updated on 16-Jun-2020 4K+ Views

A graph is said to be a bipartite graph, when vertices of that graph can be divided into two independent sets such that every edge in the graph is either start from the first set and ended in the second set, or starts from the second set, connected to the first set, in other words, we can say that no edge can found in the same set.Checking of a bipartite graph is possible by using the vertex coloring. When a vertex is in the same set, it has the same color, for another set, the color will change.Input and OutputInput: ...

Read More

How to include Bootstrap Plugins on a website

Arjun Thakur
Arjun Thakur
Updated on 15-Jun-2020 166 Views

To include Bootstrap plugins on a website, consider any of the below form −IndividuallyUsing Bootstrap's individual *.js files. Some plugins and CSS components depend on other plugins. If you include plugins individually, make sure to check for these dependencies in the docs.Compiled (all at once)Using bootstrap.js or the minified bootstrap.min.js. Do not attempt to include both, as both bootstrap.js and bootstrap.min.js contain all plugins in a single file.

Read More

Java overflow and underflow

Arjun Thakur
Arjun Thakur
Updated on 15-Jun-2020 4K+ Views

OverflowOverflow occurs when we assign such a value to a variable which is more than the maximum permissible value.UnderflowUnderflow occurs when we assign such a value to a variable which is less than the minimum permissible value.JVM does not throw any exception in case Overflow or underflow occurs, it simply changes the value. Its programmer responsibility to check the possibility of an overflow/underflow condition and act accordingly. Example (Overflow)Consider the case of int variable, it is of 32 bit and any value which is more than Integer.MAX_VALUE (2147483647) is rolled over. For example, Integer.MAX_VALUE + 1 returns -2147483648 (Integer.MIN_VALUE).As int ...

Read More

Bootstrap code tag styling

Arjun Thakur
Arjun Thakur
Updated on 12-Jun-2020 332 Views

Using Bootstrap, you can easily display code with and tag.The tag displays code wrapped as an inline element.To display code with the tag, you can try to run the following code −Example     is wrapped as an inline element.

Read More

Bootstrap Table Elements

Arjun Thakur
Arjun Thakur
Updated on 12-Jun-2020 221 Views

The following are the Bootstrap table elements −TagDescriptionWrapping element for displaying data in a tabular formatContainer element for table header rows () to label table columns.Container element for table rows () in the body of the table.Container element for a set of table cells ( or ) that appears on a single row.Default table cell.Special table cell for column (or row, depending on scope and placement) labels. Must be used within a Description or summary of what the table holds.

Read More

Benefits of using Bootstrap

Arjun Thakur
Arjun Thakur
Updated on 12-Jun-2020 905 Views

Bootstrap is an open source, sleek, intuitive, and powerful, mobile first front-end framework for faster and easier web development. The following are the benefits of using Bootstrap −Bootstrap 3, framework consists of Mobile first styles throughout the entire library instead them of in separate files.It is supported by all popular browsers.With just the knowledge of HTML and CSS, anyone can get started with Bootstrap.Bootstrap's responsive CSS adjusts to Desktops, Tablets, and Mobiles.

Read More

Wrap a page's content with Bootstrap

Arjun Thakur
Arjun Thakur
Updated on 12-Jun-2020 530 Views

To wrap a page's content, use the .container class,  ... The following is the .container class in bootstrap.css file: .container{     padding-right: 20px;     padding-left: 20px;     margin-right: auto;     margin-left: auto; }

Read More

Write an example to find whether a given string is palindrome using recursion

Arjun Thakur
Arjun Thakur
Updated on 13-Mar-2020 1K+ Views

Recursion is the process of repeating items in a self-similar way. In programming languages, if a program allows you to call a function inside the same function, then it is called a recursive call of the function.Following is an example to find palindrome of a given number using recursive function.Examplepublic class PalindromeRecursion {    public static boolean isPalindrome(String str){       if(str.length() == 0 ||str.length()==1){          return true;       }       if(str.charAt(0) == str.charAt(str.length()-1)){          return isPalindrome(str.substring(1, str.length()-1));       }       return false; ...

Read More

How can I eliminate numbers in a string in Python?

Arjun Thakur
Arjun Thakur
Updated on 05-Mar-2020 256 Views

You can create an array to keep track of all non digit characters in a string. Then finally join this array using "".join method. examplemy_str = 'qwerty123asdf32' non_digits = [] for c in my_str: if not c.isdigit(): non_digits.append(c) result = ''.join(non_digits) print(result)OutputThis will give the outputqwertyasdfexampleYou can also achieve this using a python list comprehension in a single line. my_str = 'qwerty123asdf32' result = ''.join([c for c in my_str if not c.isdigit()]) print(result)OutputThis will give the outputqwertyasdf

Read More

How do I serialize a Python dictionary into a string, and then back to a dictionary?

Arjun Thakur
Arjun Thakur
Updated on 05-Mar-2020 1K+ Views

The JSON module is a very reliable library to serialize a Python dictionary into a string, and then back to a dictionary. The dumps function converts the dict to a string. exampleimport json my_dict = { 'foo': 42, 'bar': { 'baz': "Hello", 'poo': 124.2 } } my_json = json.dumps(my_dict) print(my_json)OutputThis will give the output −'{"foo": 42, "bar": {"baz": "Hello", "poo": 124.2}}'The loads function converts the string back to a dict. exampleimport json my_str = '{"foo": 42, "bar": {"baz": "Hello", "poo": 124.2}}' my_dict = json.loads(my_str) print(my_dict['bar']['baz'])OutputThis will give the output −Hello

Read More
Showing 481–490 of 749 articles
« Prev 1 47 48 49 50 51 75 Next »
Advertisements