|
You are here |
initialcommit.com | ||
| | | | |
www.trickster.dev
|
|
| | | | | Code level discussion of web scraping, gray hat automation, growth hacking and bounty hunting | |
| | | | |
www.valentinog.com
|
|
| | | | | What's special about generator functions and asynchronous generators in JavaScript? Let's find out! | |
| | | | |
www.integralist.co.uk
|
|
| | | | | In this post I'm going to be talking about what a generator is and how it compares to a coroutine, but to understand these two concepts (generators and coroutines) we'll need to take a step back and understand the underlying concept of an Iterator. We ultimately we'll be discussing... Iterators Why use Iterators? Iterator Implementation Iterator Example Generators Why use Generators? Generator Implementation Generator Example Generator Expressions Nested Generators (i.e. yield from) Coroutines Why use Co... | |
| | | | |
konradreiche.com
|
|
| | | Since most of the Java code I wrote in the past was on Android I was not able to enjoy too many Java 8 features yet. Though recently I wrote a microservice in Java using Spring Boot where I could make full use of lambdas and functional interfaces. The following method, for instance, returns the sum of all transactions for a specified instance by traversing their children. @RequestMapping(value = "/transaction/sum/{id}", method = RequestMethod.GET) BigDecimal Sum sum(@PathVariable long id) { List transactions = new ArrayList<>(); Transaction current = repository.find(id); while (current != null) { transactions.add(current); current = current.getChild(); } return transactions.stream().map(t -> t.getAmount()) .reduce(BigDecimal.ZERO, BigDecimal::add); } As some... | ||