-
Git How to remove files from staging (Changes to be committed)
In Git, we can use git reset HEAD -- 'files/folders/patterns' to remove files or folders from the staging area (Changes to be committed).
Date: 2019-08-11 View: 1712
-
Git How to undo the last commit?
In Git, we can use git reset --soft HEAD~1 to undo the last commit in local. (The committed files haven’t pushed to the remote git server)
Date: 2019-08-11 View: 1482
-
Java 8 Stream.iterate examples
In Java 8, we can use Stream.iterate to create stream values on demand, so called infinite stream.
Date: 2019-08-11 View: 1160
-
Java Fibonacci examples
Fibonacci number – Every number after the first two is the sum of the two preceding.
Date: 2019-08-11 View: 1522
-
Java Fork/Join Framework examples
The fork/join framework is available since Java 7, to make it easier to write parallel programs. We can implement the fork/join framework by extending either RecursiveTask or RecursiveAction
Date: 2019-08-11 View: 1126
-
Java ScheduledExecutorService examples
In Java, we can use ScheduledExecutorService to run a task periodically or once time after a predefined delay by TimeUnit.
Date: 2019-08-11 View: 1096
-
Intellij IDEA How to show method signature?
In IDEA, clicks on the method name, press CTRL + Q to show the method signature on a pop up.
Date: 2019-08-11 View: 1228
-
Java ExecutorService examples
In Java, we can use ExecutorService to create a thread pool, and tracks the progress of the asynchronous tasks with Future.
Date: 2019-08-11 View: 1188
-
Java Sequence Generator examples
An example to show you how to create a thread safe sequence generator.
Date: 2019-08-11 View: 1312
-
Java Semaphore examples
In Java, we can use Semaphore to limit the number of threads to access a certain resource.
Date: 2019-08-11 View: 1347
-
Java – Check if a String contains a substring
In Java, we can use String.contains() to check if a String contains a substring.
Date: 2019-08-11 View: 1101
-
Java BlockingQueue examples
In Java, we can use BlockingQueue to create a queue which shared by both producer and the consumer.
Date: 2019-08-11 View: 1099
-
Git pull refusing to merge unrelated histories
Add --allow-unrelated-histories to solve the Git fatal error – “refusing to merge unrelated histories”
Date: 2019-08-11 View: 1057
-
Python How to read a file into a list?
Python example to read a log file, line by line into a list.
Date: 2019-08-11 View: 999
-
Java How to read a file into a list?
In Java, there are few ways to read a file line by line into a List
Date: 2019-08-11 View: 1260