This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jshell> listOfFoos.stream().forEach(foo -> foo.setFoo(stringValues.iterator().next())); | |
jshell> listOfFoos.stream().forEach(x -> System.out.println(x.getFoo())); | |
one | |
one | |
one | |
----------------------------------------------------------------------------------------- | |
jshell> Iterator<String> strValsIterator = stringValues.iterator(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Quicksort in Haskell | |
quicksort :: (Ord a) => [a] -> [a] | |
quicksort [] = [] | |
quicksort [x] = [x] | |
quicksort (x:xs) = | |
let lessThanOrEqualToXSorted = quicksort [y | y <- xs, y <= x] | |
greaterThanXSorted = quicksort [z | z <- xs, z > x] | |
in lessThanOrEqualToXSorted ++ [x] ++ greaterThanXSorted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create empty branch. | |
git checkout --orphan review | |
git rm -rf . | |
git commit --allow-empty -m "Create empty branch" | |
git push --set-upstream origin review | |
# Create `project` branch from `master` current state. | |
git checkout -b project | |
git merge master --allow-unrelated-histories | |
git push --set-upstream origin project |