Stream never modifies the source data, it processes it and gives us the result without modifying the original data.
Java: Beginner Guide to Stream API
a thread...
Stream never modifies the source data, it processes it and gives us the result without modifying the original data.
1. Collection. stream()
2. Stream.of(T... values)
3. Arrays. stream()
4. Stream.builder()
Eg:️
1. Intermediate Operations(IO)
2. Terminal Operations(TO)
Here's what the stream pipeline looks like:
Source -> Intermediate Operations -> Terminal Operations
It returns another stream object, after this, we can either call another IO or TO.
Few methods in Stream API for Intermediate operations:
1. filter()
2. map()
3. sorted()
and many more...
filter() - filters out the data based on any boolean condition - below we're filtering elements starting with the letter a.
map() - performs some given operation on the whole data set - below we're converting every element to upper case.
It's the last operation done on stream that's why it's called terminal.
This operation returns the final result.
Few methods in Stream API for Terminal operations:
1. collect()
2. count()
3. forEach()
and many more...
collect() - collects the elements in the given collection as shown below in the first case it is returning data in the form of a list.
count() - counts the no of the element in the stream and returns in the form of long.
More from Vikas Rajput
a roadmap...
Core Java can be Overwhelming, in the beginning!
Let's see what are those topics you should cover and what you can skip in Core Java.
1. Theoretical Concepts (2 days)
- Features of Java
- JVM, JRE & JDK
- Memory areas in Java
- Basics of how Garbage Collection Works.
2. OOP Concepts (3 days)
- Objects and Classes
- Inheritance
- Polymorphism
- Encapsulation
This topic forms the basis of your Java learning. Spent enough time on this topic and understanding it using real-world examples and some
OOPs Concept in Java
— Vikas Rajput (@vikasrajputin) April 4, 2022
a thread...
3. Primitives data types, Operators & Arrays (3 days)
- Various primitives/non-primitives data types, operators
- What is their use, How to use them
- Various sizes of data types
- Arrays, practice a few of its problems
- 2D/3D arrays and their use cases, practice a few problems
You May Also Like
Decoded his way of analysis/logics for everyone to easily understand.
Have covered:
1. Analysis of volatility, how to foresee/signs.
2. Workbook
3. When to sell options
4. Diff category of days
5. How movement of option prices tell us what will happen
1. Keeps following volatility super closely.
Makes 7-8 different strategies to give him a sense of what's going on.
Whichever gives highest profit he trades in.
I am quite different from your style. I follow the market's volatility very closely. I have mock positions in 7-8 different strategies which allows me to stay connected. Whichever gives best profit is usually the one i trade in.
— Sarang Sood (@SarangSood) August 13, 2019
2. Theta falls when market moves.
Falls where market is headed towards not on our original position.
Anilji most of the time these days Theta only falls when market moves. So the Theta actually falls where market has moved to, not where our position was in the first place. By shifting we can come close to capturing the Theta fall but not always.
— Sarang Sood (@SarangSood) June 24, 2019
3. If you're an options seller then sell only when volatility is dropping, there is a high probability of you making the right trade and getting profit as a result
He believes in a market operator, if market mover sells volatility Sarang Sir joins him.
This week has been great so far. The main aim is to be in the right side of the volatility, rest the market will reward.
— Sarang Sood (@SarangSood) July 3, 2019
4. Theta decay vs Fall in vega
Sell when Vega is falling rather than for theta decay. You won't be trapped and higher probability of making profit.
There is a difference between theta decay & fall in vega. Decay is certain but there is no guaranteed profit as delta moves can increase cost. Fall in vega on the other hand is backed by a powerful force that sells options and gives handsome returns. Our job is to identify them.
— Sarang Sood (@SarangSood) February 12, 2020
Why is this the most powerful question you can ask when attempting to reach an agreement with another human being or organization?
A thread, co-written by @deanmbrody:
Next level tactic when closing a sale, candidate, or investment:
— Erik Torenberg (@eriktorenberg) February 27, 2018
Ask: \u201cWhat needs to be true for you to be all in?\u201d
You'll usually get an explicit answer that you might not get otherwise. It also holds them accountable once the thing they need becomes true.
2/ First, “X” could be lots of things. Examples: What would need to be true for you to
- “Feel it's in our best interest for me to be CMO"
- “Feel that we’re in a good place as a company”
- “Feel that we’re on the same page”
- “Feel that we both got what we wanted from this deal
3/ Normally, we aren’t that direct. Example from startup/VC land:
Founders leave VC meetings thinking that every VC will invest, but they rarely do.
Worse over, the founders don’t know what they need to do in order to be fundable.
4/ So why should you ask the magic Q?
To get clarity.
You want to know where you stand, and what it takes to get what you want in a way that also gets them what they want.
It also holds them (mentally) accountable once the thing they need becomes true.
5/ Staying in the context of soliciting investors, the question is “what would need to be true for you to want to invest (or partner with us on this journey, etc)?”
Multiple responses to this question are likely to deliver a positive result.