Nick Samoylov's Blog, page 3

June 27, 2020

Java streams 29. Collect 5. Method join() and Collectors.joining() collector

Sometimes we need to create a string that contains comma-separated values emitted by a stream. The collect() operation with the Collectors.joining() collector (with a parameter that describes a delimiter) is very convenient way to do it.


The post Java streams 29. Collect 5. Method join() and Collectors.joining() collector appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on June 27, 2020 17:06

June 19, 2020

Wittgenstein 7. Tragedy

A tragedy “helps” to look deeper. It is hard, but strips from stereotypes and preconceived patterns (expectations). Maybe that’s why it was the first theatric form developed by Ancient Greeks. We all experience problems, but very few of us get them as many and as deep as Wittgenstein.


The post Wittgenstein 7. Tragedy appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on June 19, 2020 00:38

May 27, 2020

Wittgenstein 6. Patterns

Pattern recognition and automatic decision making create a foundation for our third activity of explaining (rationalizing) our decisions and whatever we observe – all the time, never pausing. Most of this third activity is done automatically too. Yet some of it we do consciously, sometimes with great effort, trying to “understand” – to discover the […]


The post Wittgenstein 6. Patterns appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 27, 2020 17:08

Wittgenstein 5. Thinking

A human, even in doubt, finds a way to make a decision, may be based just on the liking the instructor or not. Or on using some kind of moral principles. Or just from sheer compassion. Such irrational decision making apparently was beneficial, since human species managed to survive so far. This means that our […]


The post Wittgenstein 5. Thinking appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 27, 2020 16:18

May 25, 2020

Java streams 26. Collect 2. The .maxBy() and .minBy() collectors

Collectors.maxBy() and Collectors.minBy() collectors calculate the max and the min element correspondingly according to a given Comparator


The post Java streams 26. Collect 2. The .maxBy() and .minBy() collectors appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 25, 2020 16:53

Java streams 26. Collect 2. Counting the stream elements

This is a very straightforward operation. It counts a number of emitted elements. But it does a bit more than the Stream operator count().


The post Java streams 26. Collect 2. Counting the stream elements appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 25, 2020 16:53

Java streams 25. Collect 1. Custom collector

The collect() operation is a specialization of reduce(). It allows implementing a vast variety of algorithms using the ready-to-use implementations of collectors located in the java.util.stream.Collectors class.


The post Java streams 25. Collect 1. Custom collector appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 25, 2020 16:08

Java streams 25. Collect 1. Custom collector and joining()

The collect() operation is a specialization of reduce(). It allows implementing a vast variety of algorithms using the ready-to-use implementations of collectors located in the java.util.stream.Collectors class.


The post Java streams 25. Collect 1. Custom collector and joining() appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 25, 2020 16:08

May 12, 2020

Wittgenstein 4. Language

The change of the view on the language – from modeling structure to reflecting usage – was the primary motivation for Wittgenstein to write his second book Philosophical Investigations, where he introduced the notion of “language games”. He now states that the meaning of a word or even a sentence comes from the context of […]


The post Wittgenstein 4. Language appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 12, 2020 16:57

May 5, 2020

Wittgenstein 3. Implementation

Abraham Kaplan made an observation in his book The Conduct of Inquiry (1964): “In addition to the social pressures from the scientific community there is also at work a very human trait of individual scientist. I call it the law of the instrument, and it may be formulated as follows: Give a small boy a […]


The post Wittgenstein 3. Implementation appeared first on Nick Samoylov, programmer and writer.

 •  0 comments  •  flag
Share on Twitter
Published on May 05, 2020 19:06