You are here |
www.morling.dev | ||
| | | |
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 someone who learned Haskell in his freshman year I cannot but love the simplicity. Also, because it is a very common way to express this statement in Ruby. The code above the return statement could not be more imperative and I was wondering whether there is a way to express this in a functional way, too. In Ruby we could possible implement it like this: | |
| | | |
brutalism.rs
|
|
| | | | BRU-12 is a research project for performing realtime processing on volumetric 3D models and presenting them as meshes ready for rendering. The toolchain consists of Cinder and OpenVDB.OpenVDB is an industrial-grade data structure used for parallel processing of very large amounts of volumetric ("voxel") data. It's not really intended to be used for real-time rendering, but its design (and performance!) was interesting to me so I decided to try to implement a simple data pipeline on top of it. | |
| | | |
winterbe.com
|
|
| | | | Learn Java 8 streams by example: functional programming with filter, map, flatMap, reduce, collect, lambdas, sequential and parallel streams are covered in-depth in this tutorial. | |
| | | |
michaelsalim.co.uk
|
|
| | Learn Rust to 80% in 5 minutes by leveraging your existing JavaScript knowledge. In this article, I list a number of differences Rust has compared to JS that is crucial to understanding it. |