Nick Samoylov's Blog, page 4

May 2, 2020

Java streams 24. Reduce

The reduce() operation accumulates stream elements into one resulting value, thus “reducing” the stream of values to one value of the same or a different type.


The post Java streams 24. Reduce appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 02, 2020 20:59

April 12, 2020

Java streams 23. ToArray

The toArray() operation collects the emitted stream values into an array no matter whether the stream is parallel or not. The only limitation is that the stream has to be finite. Otherwise, the processing never ends.


The post Java streams 23. ToArray appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on April 12, 2020 16:13

April 9, 2020

Java streams 22. FindAny, findFirst, max, min

The reason these operators return an Optional is that, generally, there may be not a single element emitted (the Stream object is empty). An Optional object allows checking for the presence of the value before committing to getting it, thus avoiding unexpected behavior.


The post Java streams 22. FindAny, findFirst, max, min appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on April 09, 2020 20:31

Java streams 22. FindAny(), findFirst(), max(), min()

The reason these operators return an Optional is that, generally, there may be not a single element emitted (the Stream object is empty). An Optional object allows checking for the presence of the value before committing to getting it, thus avoiding unexpected behavior.


The post Java streams 22. FindAny(), findFirst(), max(), min() appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on April 09, 2020 20:31

April 6, 2020

Wittgenstein 2. Inexpressible

If we try to talk about inexpressible – which goes beyond the language capacity – like philosophy does, in Wittgenstein’s view – we begin fighting non-existing problems and just waste time. That’s how Wittgenstein was able to claim that he solved all philosophical problems – by dismissing the alleged problems as nonsensical – made-up problems.


The post Wittgenstein 2. Inexpressible appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on April 06, 2020 18:22

March 29, 2020

Wittgenstein 1. Discovery

He was definitely an authentic and very unusual character. Bertrand Russell considered him a genius. And true to these characteristics, he challenged the philosophy and the way we understand human thinking to its core, on par with Kant, although not all professional philosophers share such praise.


The post Wittgenstein 1. Discovery appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on March 29, 2020 23:52

My library

While reviewing my attitude towards books, I discovered that I loved and still love paradoxes. Having observed so many unexpected turns during my lifetime made me probably better aligned with paradoxes than with deterministic predictions.


The post My library appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on March 29, 2020 19:24

The Truth

Truth is not the same for all people at all times. Your Truth may look like the Lie in the views of other peoples of different cultures or even different families. Even those who taught you, sometimes change the tune and completely abandon their seemingly firm position.


The post The Truth appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on March 29, 2020 16:08

The biggest life lesson

I think that we need to base our decision on rational considerations most of the time, and the successful execution of the well thought plans can bring a well-deserved solid feel of satisfaction. But we should not be frustrated that life turns out not the way we expected.


The post The biggest life lesson appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on March 29, 2020 15:53

What Romans ate

They did not have pasta or the Italian wines familiar to us. The wine they drank was white, very sweet, with honey, and a lot of alcohol. Well, they diluted it with water to more palatable taste—still very bad to the modern palate according to those who tasted it.


The post What Romans ate appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on March 29, 2020 15:35