Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Nishtha Thakur
Page 17 of 40
match max_size() function in C++ STL
The match max_size() function in C++ STL returns the maximum number of elements in the match_results object that can be held by the match container.This function does not accept a parameter.Example Code#include #include using namespace std; int main() { match_results m; cout
Read MoreHow to convert a std::string to const char* or char* in C++?
In this section, we will see how to convert C++ string (std::string) to const char* or char*. These formats are C style strings. We have a function called c_str(). This will help us to do the task. It returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object.Following is the declaration for std::string::c_str.const char* c_str() const;This function returns a pointer to an array that contains a null-terminated sequence of characters (i.e., a C-string) representing the current value of the string object. If an exception is thrown, ...
Read MoreWhich one is better in between pass by value or pass by reference in C++?
In C++ we can pass arguments into a function in different ways. These different ways are −Call by ValueCall by ReferenceCall by AddressSometimes the call by address is referred to as call by reference, but they are different in C++. Incall by address, we use pointer variables to send the exact memory address, but in call by reference we pass the reference variable (alias of that variable). This feature is not present in C, there we have to pass the pointer to get that effect.In this section, we will see what are the advantages of call by reference over call ...
Read MoreCollectors counting() method in Java 8
The counting() method of the Java 8 Collectors class returns a Collector accepting elements of type T that counts the number of input elements.The syntax is as follows −static Collector counting()Here, the parameter −T − type of input elementsLong − This class value of the primitive type long in an objectTo work with Collectors class in Java, import the following package −import java.util.stream.Collectors;The following is an example to implement counting() method in Java 8 −Exampleimport java.util.stream.Collectors; import java.util.stream.Stream; public class Demo { public static void main(String[] args) { Stream stream = Stream.of("25", "50", "75", ...
Read MoreRestrictions applied to Java static methods
If the static keyword is applied to any method, it becomes a static method.If a method is declared as static, it is a member of a class rather than belonging to the object of the class. It can be called without creating an object of the class. A static method also has the power to access static data members of the class.There are a few restrictions imposed on a static methodThe static method cannot use non-static data member or invoke non-static method directly.The this and super cannot be used in static context.The static method can access only static type data ...
Read MoreSet all list items on a single line with Bootstrap
To set all list items on a single line, use the .list-inline class.You can try to run the following code to implement the .list-inline class −Example Bootstrap Example Technologies Home PHP Java jQuery JavaScript Ruby
Read MoreCreate Default Bootstrap Navbar
Follow the below given steps in Bootstrap to create default navbar −Add the classes .navbar, .navbar-default to the tag.Add role = "navigation" to the above element, to help with accessibility.Add a header class .navbar-header to the element. Include an element with class navbar-brand. This will give the text a slightly larger size.To add links to the navbar, simply add an unordered list with the classes of .nav, .navbar-nav.You can try to run the following code to create default navbar −Example Bootstrap Example Cars BMW Audi SUV Creta Scorpio
Read MoreBootstrap danger Contextual class
The Bootstrap danger contextual class indicates a danger action.You can try to run the following code to implement the .danger class −Example Bootstrap Table Subject Marks Student Programming 90 Amit Web Dev 92 Yuvraj Science 95 Sachin Economics 80 Tony
Read MoreCreate a progress bar with Bootstrap
To create a basic progress bar in Bootstrap, use the .progress and .progress-bar class.You can try to run the following code to form a progress bar −Example Bootstrap Example 60% Complete
Read MoreFilter table with Bootstrap
To filter a table in Bootstrap, you can try to run the following code −Example Bootstrap Example Students Rank Name Marks Rank Amit 94 1 Tom 90 2 Steve 88 3 Chris 80 4 Corey 79 5 Glenn 75 6 $(document).ready(function(){ $("#demo").on("keyup", function() { var value = $(this).val().toLowerCase(); $("#test tr").filter(function() { $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1) }); }); });
Read More