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 on Trending Technologies
Technical articles with clear explanations and examples
Regex in Python to put spaces between words starting with capital letters
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 module.For example, for the input string −AReallyLongVariableNameInJavaWe should get the output −A Really Long Variable Name In JavaWe can use "[A-Z]" regex to find all uppercase letters, then replace them with space and that letter again. We can implement it using the re package as follows −Exampleimport re # ...
Read MoreUsage of Bootstrap .btn-group-* class
To learn the usage of .btn-group-* class, you can try to run the following code:Example Bootstrap Example One Two Three Four Five Six
Read MoreBootstrap progress-bar class
Use the progress-bar class in Bootstrap to create a progress bar.You can try to run the following code to implement progress-bar class in Bootstrap −Example Bootstrap Example 70% Complete
Read MoreComparison of autoboxed integer object in Java
When we assigned an int to Integer object, it is first converted to an Integer Object and then assigned. This process is termed as autoboxing. But there are certain things which you should consider while comparison of such objects using == operator. See the below example first.Examplepublic class Tester { public static void main(String[] args) { Integer i1 = new Integer(100); Integer i2 = 100; //Scenario 1: System.out.println("Scenario 1: " + (i1 == i2)); Integer i3 = 100; ...
Read MoreVertical Buttongroup with Bootstrap
The btn-group-vertical class makes a set of buttons appear vertically stacked rather than horizontally.You can try to run the following code to work with a vertical button groupExample Bootstrap Example BCA B.Tech Masters span class = "caret"> MCA MBA M.Tech M.COM
Read MoreCreate an extra small button group with Bootstrap
To create a large button group in Bootstrap, use the .btn-group-xs class.You can try to run the following code to implement the .btn-group-xs class −Example Bootstrap Example The following are the car brands: BMW Audi Jeep Datsun Toyota The following are FMCG: ITC Limited Colgate-Palmolive Nestle Britannia Industries Limited
Read MoreComparison of double and float primitive types in Java
If we compare a float and a double value with .5 or .0 or .1235 (ending with 5 or 0), then == operator returns true, otherwise it will return false. See the below example.Examplepublic class Tester { public static void main(String[] args) { double d1 = 2.5; float f1 = 2.5f; System.out.println(d1 == f1); double d2 = 2.4; float f2 = 2.4f; double margin = 0.0000001; System.out.println(compareNumbers(d2, f2, margin)); } private static boolean compareNumbers(double d, float f, double margin) { if(Math.abs(d - f) < margin) { return true; } return false; } }Outputtrue true
Read MoreCompilation and execution of Java Program
Let us look at a simple code first that will print the words Hello World.Examplepublic class MyFirstJavaProgram { /* This is my first java program. * This will print 'Hello World' as the output */ public static void main(String []args) { System.out.println("Hello World"); // prints Hello World } }Let's look at how to save the file, compile, and run the program. Please follow the subsequent steps −Open notepad and add the code as above.Save the file as: MyFirstJavaProgram.java.Open a command prompt window and go to the ...
Read MoreAdd dropdown menu to buttons using Bootstrap
To add a dropdown to a button, simply wrap the button and dropdown menu in a .btn-group.You can try to run the following code to add dropdown menu to buttons −Example Bootstrap Example Default Action Another action Something else here Separated link Primary Action Another action Something else here Separated link
Read MoreBootstrap 4 .card-img-top class
Use the card-img-top class in Bootstrap to set the image at the top inside a card −After that add the card and card body − Swift 4 Learn Swift 4 Begin You can try to run the following code to implement the card-img-top class in Bootstrap 4 −Example Bootstrap Example SWIFT 4 Tutorial Video Tutorial on Switft 4 Swift 4 Learn Swift 4 Begin
Read More