We're excited to announce a new livestream, brought to you by the Microsoft Community Team. Need updates on the latest and greatest Microsoft releases for Python? We got you. Each stream we start with a run down of the latest news in Microsoft Cloud, VS Code and Python tech ecosystem, then we deep dive into special segments with an esteemed…
#stream
5 posts
10 Jan 2023
30 Sept 2019
One of the Stream APIs greatest features is its laziness. The whole pipeline is constructed lazily, stored as a set of instructions, akin to a SQL execution plan. Only when we invoke a terminal operation, the pipeline is started. It is still lazy, meaning that some operations may be short circuited. Some third party libraries … Continue reading A Quick…
3 Jul 2017
Notice, this issue has been fixed in Java 8 (8u222), thanks for the comment Zheka Kozlov In a recent article, I’ve shown that programmers should always apply a filter first, map later strategy with streams. The example I made there was this one: In this case, the limit() operation implements the filtering, which should take … Continue reading Are Java…
29 Jun 2017
In recent days, I’ve seen a bit too much of this: Something is very wrong with the above example. Can you see it? No? Let me rename those variables for you. Better now? Exactly. The above algorithm is O(N) when it could be O(1): (Let’s assume the lack of explicit ordering is irrelevant) I’m working … Continue reading A Basic…
29 Mar 2016
An interesting question by Tagir Valeev on Stack Overflow has recently caught my attention. To keep things short (read the question for details), while the following code works: printing 1 2 3 4 5 The following, similar code won’t work: Causing a StackOverflowError. Sure, this kind of recursive iteration is not optimal. It wasn’t prior … Continue reading Watch Out…