-
Intellij IDEA default static void main shortcut
In IDEA, you can type psvm and press Tab to generate the public static void main(String[] args) automatically.
Date: 2019-08-11 View: 1165
-
Intellij IDEA System.out.println shortcut
In IDEA, you can type sout and press Tab to generate System.out.println automatically.
Date: 2019-08-11 View: 1443
-
Kotlin How to Loop a Map
In Kotlin, you can loop a Map via the following ways:
Date: 2019-08-11 View: 1124
-
Java Bubble sort example
Bubble sort is the simplest sorting algorithm, it compares the first two elements, if the first is greater than the second, swaps them, continues doing (compares and swaps) for the next pair of adjacent elements. It then starts again with the first two elements, compares, swaps until no more swaps are required.
Date: 2019-08-11 View: 1188
-
Java Selection sort example
Selection sort is an in-place comparison sort. It loops and find the first smallest value, swaps it with the first element; loop and find the second smallest value again, swaps it with the second element, repeats third, fourth, fifth smallest values and swaps it, until everything is in correct order.
Date: 2019-08-11 View: 1088
-
How to check MySQL version
In terminal, type mysql -V (uppercase V) to display the current MySQL version installed on the server.
Date: 2019-08-11 View: 1256
-
Python How to convert float to String
In Python, we can use str() to convert float to String.
Date: 2019-08-11 View: 1260
-
Java Count the number of items in a List
In Java, we can use List.size() to count the number of items in a List
Date: 2019-08-11 View: 1173
-
Python How to convert String to int
In Python, we can use int() to convert a String to int.
Date: 2019-08-11 View: 1155
-
Python How to check the variables type?
In Python, we can use type() to check the variable’s type.
Date: 2019-08-11 View: 1154
-
Python How to convert int to String
In Python, we can use str() to convert a int to String.
Date: 2019-08-11 View: 1185
-
Python How to convert String to float
In Python, we can use float() to convert String to float.
Date: 2019-08-11 View: 1114
-
Python How to use a global variable in a function
In Python, we can use a global keyword to referring a global variable.
Date: 2019-08-11 View: 1475
-
Java How to convert System.nanoTime to Seconds
We can just divide the nanoTime by 1_000_000_000, or use the TimeUnit.SECONDS.convert to convert it.
Date: 2019-08-11 View: 1839
-
Python How to check if a file exists
In Python, we can use os.path.isfile() or pathlib.Path.is_file() (Python 3.4) to check if a file exists.
Date: 2019-08-11 View: 1459