SlideShare a Scribd company logo
1 of 44
Download to read offline
Streams to
rule the world
Into the Box 2020
Gavin Pickin
CBStreams => Accelerate Your Functional Programming!
●
About Me?
Who am I?
● Software Consultant for Ortus Solutions
● Work with ColdBox, CommandBox, ContentBox every day
● Working with Coldfusion for 22 years
● Working with Javascript just as long
● Love learning and sharing the lessons learned
● From New Zealand, live in Bakersfield, Ca
● Loving wife, lots of kids, and countless critters
http://www.gpickin.com and @gpickin on twitter
http://www.ortussolutions.com
What are Java Streams
What is CBStreams
Imperative vs Functional Programming
Building Streams
Using Streams
Collecting Streams
What are Java Streams
• Introduced in JDK 8+
• Not I/O Streams
• A data abstraction layer
• Does not store any data, it wraps the data
• Designed to process streams of data elements
• map(), reduce(), filter(), collect()
• Enables functional-style operations on such elements
https://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html
Dr. Venkat Subramaniam
• Streams Changed My Life!
• Devnexus Presentations
• Streams
• Completeable Futures
• Watch these videos
Lambdas + Streams Streams
What is CBStreams
• Port of Java Streams to CFML Land!
• 90% of all Java functionality is there
• Plus some CFML Dynamic Goodness
• Box Module (ColdBox, CommandBox,
etc)
https://forgebox.io/view/cbstreams
install cbstreams
Imperative
VS
Functional
Programming
Imperative Programming
• Major OO languages are imperative (C,++,C#, Java)
• Follow a top-down or procedural design to reach a goal
• Each statement changes the state (side-effect) of a program
• Each statement tells the computer what to change and in what order
• Always cons and pros
function isPrime( number ) {
for( var i = 2; i <= sqr( number ); i++) {
if(number % i == 0) return false;
}
return number > 1;
}
isPrime(9220000000000000039) // Output: true
Functional Programming
• Declarative programming
• We tell the computer what things, actions, etc are
• Runtime determines the best way how to do it
• Functions are first class citizens
• No side-effect or iterating state to worry about
• Always cons and pros
function isPrime(number) {
return number > 1 &&
stream
.rangeClosed( 2, sqr( number ) )
.noneMatch( index => number % index == 0 );
}
isPrime( 9220000000000000039 ) // Output: true
Functional Programming
Comparing Styles
Streams Functional Heaven!
• All about functional programming
• Heavy Lambda/Closure usage
• Must focus on the what and not on the how!
• Create a data processing pipeline
• Not for everything, choose wisely….
You have been warned!
Streams Functional Heaven!
var errors = [];
var errorCount = 0;
var oFile = fileOpen( filename );
var thisLine = fileReadLine( oFile );
while( errorCount < 40 && !isNull( thisLine ) ){
if( line.startsWith( "ERROR" ) ){
errors.append( line );
errorCount++;
}
line = fileReadLine( oFile );
}
var errors = streamBuilder.ofFile( filePath )
.filter( line => line.startsWith( "ERROR" ) )
.limit( 40 )
.collect();
What if I want
to multi-thread
this?
.parallel()
What about CFML Functions?
• They are limited in input, scope & operations
• No short-circuiting operations
• No lazyness, they all fire top to bottom
• Each operation blocks until it finishes processing ALL
elements
• Creates new arrays/queries/structs for each new
concatenated operation
• What about infinite input or biiiiig files?
• map(), reduce(), each(), filter()
Element Stream
Stream Processing Pipeline
Lazy!
Stream Lazyness!
Lazy Example
var empIds = [ 1, 2, 3, 4 ];
var employee = streamBuilder.new( empIds )
// Convert ID's to Employee Objects, passing function reference
.map( employeeService.findByID )
// only valid employees
.filter( (employee) => !isNull( employee ) )
// same as: .filter( function( employee ){ return !isNull (employee); } )
// only salaries > 10000
.filter( (employee) => employee.getSalary() > 100000 )
// Find the first one
.findFirst()
// Return null
.orElse( null );
expect( employee.getSalary() ).toBe( 200000 );
• Stream performs the map and two filter operations, one element at a time.
• Since the salary of id 1 is not greater than 100000, the processing moves on to the next
element.
• Id 2 satisfies both of the filter predicates and hence the stream evaluates the terminal
operation findFirst() and returns the result.
• No operations are performed on id 3 and 4.
Let’s Get Started!
install cbstreams
StreamBuilder@cbstreams
• The StreamBuilder is injected where needed
• Helps you build streams out of native CFML data types
• Strings, Files, Arrays, Structs, Queries, Nulls
• Helps you build infinite or closure based streams
• You can strong type elements for the stream if needed
• For mathematical operations
• int, long, or double
Empty Streams
emptyStream = streamBuilder.new();
emptyStream = streamBuilder.new().empty();
• Simple way to build streams with no elements
• Useful? Maybe…
Building Custom Streams
builder = streamBuilder.builder();
myData.each( function( item ){
builder.add( item );
} );
myStream = builder.build();
stream = streamBuilder.new()
.of( "a", "hello", "stream" );
stream = streamBuilder.new()
.of( argumentCollection=myData );
• Two approaches:
• builder() - Add your own data via the add() method
• Of( arguments ) - Via an array of arguments
Streams of Characters
stream = streamBuilder.new().ofChars( "Welcome to Streams" );
• Stream of string characters
• Great for parsing, lookups, etc.
File Streams
stream = streamBuilder.new().ofFile( absolutePath );
try{
//work on the stream
} finally{
stream.close();
}
• Non Blocking I/O Classes
• Stream of file lines
• Throw any file size to it, I dare ya!
Generate Infinite Streams
// Generate 100 random numbers
stream = streamBuilder.new().generate( function(){
return randRange( 1, 100 );
} ).limit( 100 );
// Seeded iteration
stream = streamBuilder.new().iterate( 40, function( x ){
return x + 2;
} ).limit( 20 );
• Infinite streams of data
• Start with a seed or no seeded results
• Make sure you limit them or wait forever….
Ranged Streams
stream = streamBuilder.new().range( 1, 200 );
stream = streamBuilder.new().rangeClosed( 1, 2030 );
stream = streamBuilder.new().rangeClosed( 1, qUsers.recordcount );
• Create open or closed ranges
• Similar to of() but a whole less typing
Intermediate Operations
• Remember, they are lazy, nothing gets done until a terminator is called.
• Result is always a stream
Operation Description
limit( maxSize ) Limit the stream processing
distinct() Return only distinct elements
skip( n ) Skip from the first element to n
sorted( comparator ) Sort a stream using a compactor closure
unordered() Return an unordered stream (default)
onClose( closeHandler ) Attach a listener to when the close operation is called
concat( stream1, stream2 ) Concatenates two streams together
peek( action ) Allows you to peek on the element in the order is called
Map( mapper ) Transform the elements into something else
filter( predicate ) Returns a new stream containing only the requested elements
parallel() Convert the stream to a parallel multi-threaded stream
Terminal Operations
• They kick off processing of elements sequentially or in parallel
Operation Description
iterator() Returns a java iterator
spliterator() Returns a java spliterator
close() Close the stream
toArray() Convert the stream back into an array
count() Count the elements in the stream
forEach( action ) Iterate through the elements calling the action closure
forEachOrdered( action ) Iterate through the elements calling the action closure in order, even in parallel
reduce( accumulator, identity ) Fold, reduces the stream to a single element.
max( comparator ) Returns the max value in the stream, if a comparator is passed its called for you
min( comparator ) Returns the min value in the stream, if a comparator is passed its called for you
average( comparator ) Returns the avg value in the stream, if a comparator is passed its called for you
summaryStatistics() Gives you a struct of stats containing: { min, max, count, sum, average }
Short-Circuit Operations
• Also terminal, but can short-circuit processing of the stream
Operation Description
findAny() Find any element in the stream
findFirst() Find the first element in the stream
anyMatch( predicate ) Returns a boolean that indicates if any of the elements match the predicate closure
allMatch( predicate ) Returns a boolean that indicates if ALL of the elements match the predicate closure
noneMatch( predicate ) Returns a boolean that indicates if none of the elements match the predicate closure
Collectors
• Finalizes the stream by converting it to concrete collections
• CBStreams auto-converts Java -> CFML Data Types
Operation Description
collect() Return an array of the final elements
collectGroupingBy( classifier )
Build a final collection according to the classifier lambda/closure that
will classify the keys in the group. End result is usually a struct of data
collectAverage( mapper, primitive=long )
Collect an average according to the mapper function/closure and data
type passed
collectSum( mapper, primitive=long )
Collect a sum according to the mapper function/closure and data type
passed
collectSummary( mapper, primitive=long )
Collect a statistics struct according to the mapper function and data type
passed
collectAsList( delimiter=“,”, prefix, suffix )
Collect results into a string list with a delimiter and attached prefix
and/or suffix.
collectAsStruct( keyId, valueID, overwrite=true )
Collect the elements into a struct by leveraging the key identifier and the
value identifier from the stream of elements to pass into the collection.
collectPartitioningBy( predicate )
partitions the input elements according to a Predicate closure/lambda,
and organizes them into a Struct of <Boolean, array >.
Lambda/Closure
References
• CBStreams converts CFML Closures -> Java Lambdas
• Let’s investigate them by Java name:
// BiFunction, BinaryOperator
function( previous, item ){
return item;
}
// Comparator
function compare( o1, o2 ){
return -,+ or 0 for equal
}
// Consumer
void function( item ){
}
// Function, ToDoubleFunction, ToIntFunction,
ToLongFunction, UnaryOperator
function( item ){
return something;
}
// Predicate
boolean function( item ){
return false;
}
// Supplier
function(){
return something;
}
// Runnable
void function(){
// execute something
}
CBStreams Optionals
• Most return values are not the actual values but a CFML Optional
• Wraps a Java Optional
• Simple functional value container instead of doing null checks, with some
cool functions
Operation Description
isPresent() Returns boolean if value is present
ifPresent( consumer ) If value is present call the consumer closure for you
filter( predicate )
If a value is present and the value matches the predicate then return another
Optional :)
map( mapper ) If a value is present, apply the mapping function and return another Optional
get() Get the value!
orElse( other ) Get the value or the `other` if the value is null
orElseGet( other ) Get the value or if not present call the other closure to return a value
hashCode() Unique hash code of the value
toString() Debugging
Examples
myArray = [
"ddd2", "aaa2", "bbb1", "aaa1",
"bbb3", "ccc", "bbb2", "ddd1"
];
// Filtering
streamBuilder.new( myArray )
.filter( function( item ){
return item.startsWith( "a" );
} )
.forEach( function( item ){
writedump( item );
} );
Examples
// Sorted Stream
streamBuilder.new( myArray )
.sorted()
.filter( function( item ){
return item.startsWith( "a" );
} )
.forEach( function( item ){
writedump( item );
} );
Examples
// Mapping
streamBuilder.new( myArray )
.map( function( item ){
return item.ucase();
})
.sorted( function( a, b ){
return a.compareNoCase( b );
}
.forEach( function( item ){
writedump( item );
} );
Examples
// Partition stream to a struct of arrays according to even/odd
var isEven = streamBuilder.new( 2,4,5,6,8 )
.collectPartitioningBy( function(i){
return i % 2 == 0;
} );
expect( isEven[ "true" ].size() ).toBe( 4 );
expect( isEven[ "false" ].size() ).toBe( 1 );
Examples
// Group employees into character groups
component{
var groupByAlphabet = streamBuilder.of( employeeArray )
.collectGroupingBy( function( employee ){
return listFirst( employee.getlastName(), “” );
} );
expect( groupByAlphabet.get( 'B' ).get( 0 ).getName() )
.toBe( "Bill Gates" );
expect( groupByAlphabet.get( 'J' ).get( 0 ).getName() )
.toBe( "Jeff Bezos" );
expect( groupByAlphabet.get( 'M' ).get( 0 ).getName() )
.toBe( "Mark Zuckerberg" );
}
Examples
// Matching
anyStartsWithA =
streamBuilder
.new( myArray )
.anyMatch( function( item ){
return item.startsWith( "a" );
} );
writeDump( anyStartsWithA ); // true
allStartsWithA =
streamBuilder
.new( myArray )
.allMatch( function( item ){
return item.startsWith( "a" );
} );
writeDump( anyStartsWithA ); // false
Examples
noneStartsWithZ =
streamBuilder
.new( myArray )
.noneMatch((s) -> s.startsWith("z"));
noneStartsWithZ =
streamBuilder
.new( myArray )
.noneMatch( function( item ){
return item.startsWith( "z" );
} );
writeDump( noneStartsWithZ ); // true
Examples
// Reduce
optional =
streamBuilder
.new( myArray )
.sorted()
.reduce( function( s1, s2 ){
return s1 & "#" & s2;
} );
writedump( optional.get() );
Examples
// Parallel Sorted Count
count =
streamBuilder
.new( myArray )
.parallel()
.sorted()
.count();
Implement JDK 9-10 features
Threading Intricacies to solve
cbORM, Quick Integration
qb Integration
ColdBox Integration
Reactive Streams
Roadmap
Questions??
● After the presentation in the Breakout Room
● On the Boxteam slack channel - boxteam.herokuapp.com
● On Twitter @lmajano @gpickin @ortussolutions

More Related Content

What's hot

A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...
A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...
A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...Spark Summit
 
Batch and Stream Graph Processing with Apache Flink
Batch and Stream Graph Processing with Apache FlinkBatch and Stream Graph Processing with Apache Flink
Batch and Stream Graph Processing with Apache FlinkVasia Kalavri
 
GPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionGPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionVaclav Pech
 
Finalize() method
Finalize() methodFinalize() method
Finalize() methodJadavsejal
 
Writing code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongWriting code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongVu Huy
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVMVaclav Pech
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"Gal Marder
 
Predictive Datacenter Analytics with Strymon
Predictive Datacenter Analytics with StrymonPredictive Datacenter Analytics with Strymon
Predictive Datacenter Analytics with StrymonVasia Kalavri
 
Parallel First-Order Operations
Parallel First-Order OperationsParallel First-Order Operations
Parallel First-Order OperationsSina Madani
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJSMattia Occhiuto
 
Kenneth Knowles - Apache Beam - A Unified Model for Batch and Streaming Data...
Kenneth Knowles -  Apache Beam - A Unified Model for Batch and Streaming Data...Kenneth Knowles -  Apache Beam - A Unified Model for Batch and Streaming Data...
Kenneth Knowles - Apache Beam - A Unified Model for Batch and Streaming Data...Flink Forward
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present FutureIndicThreads
 
Machine Learning with Apache Flink at Stockholm Machine Learning Group
Machine Learning with Apache Flink at Stockholm Machine Learning GroupMachine Learning with Apache Flink at Stockholm Machine Learning Group
Machine Learning with Apache Flink at Stockholm Machine Learning GroupTill Rohrmann
 
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...Martin Zapletal
 
Self-managed and automatically reconfigurable stream processing
Self-managed and automatically reconfigurable stream processingSelf-managed and automatically reconfigurable stream processing
Self-managed and automatically reconfigurable stream processingVasia Kalavri
 
Pick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruitPick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruitVaclav Pech
 
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...ucelebi
 

What's hot (20)

A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...
A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...
A Scalable Hierarchical Clustering Algorithm Using Spark: Spark Summit East t...
 
Batch and Stream Graph Processing with Apache Flink
Batch and Stream Graph Processing with Apache FlinkBatch and Stream Graph Processing with Apache Flink
Batch and Stream Graph Processing with Apache Flink
 
Gpars workshop
Gpars workshopGpars workshop
Gpars workshop
 
Intro to Akka Streams
Intro to Akka StreamsIntro to Akka Streams
Intro to Akka Streams
 
GPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstractionGPars howto - when to use which concurrency abstraction
GPars howto - when to use which concurrency abstraction
 
Finalize() method
Finalize() methodFinalize() method
Finalize() method
 
Writing code that writes code - Nguyen Luong
Writing code that writes code - Nguyen LuongWriting code that writes code - Nguyen Luong
Writing code that writes code - Nguyen Luong
 
Concurrency on the JVM
Concurrency on the JVMConcurrency on the JVM
Concurrency on the JVM
 
JVM languages "flame wars"
JVM languages "flame wars"JVM languages "flame wars"
JVM languages "flame wars"
 
Predictive Datacenter Analytics with Strymon
Predictive Datacenter Analytics with StrymonPredictive Datacenter Analytics with Strymon
Predictive Datacenter Analytics with Strymon
 
Parallel First-Order Operations
Parallel First-Order OperationsParallel First-Order Operations
Parallel First-Order Operations
 
My Gentle Introduction to RxJS
My Gentle Introduction to RxJSMy Gentle Introduction to RxJS
My Gentle Introduction to RxJS
 
Kenneth Knowles - Apache Beam - A Unified Model for Batch and Streaming Data...
Kenneth Knowles -  Apache Beam - A Unified Model for Batch and Streaming Data...Kenneth Knowles -  Apache Beam - A Unified Model for Batch and Streaming Data...
Kenneth Knowles - Apache Beam - A Unified Model for Batch and Streaming Data...
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present Future
 
Machine Learning with Apache Flink at Stockholm Machine Learning Group
Machine Learning with Apache Flink at Stockholm Machine Learning GroupMachine Learning with Apache Flink at Stockholm Machine Learning Group
Machine Learning with Apache Flink at Stockholm Machine Learning Group
 
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
 
Self-managed and automatically reconfigurable stream processing
Self-managed and automatically reconfigurable stream processingSelf-managed and automatically reconfigurable stream processing
Self-managed and automatically reconfigurable stream processing
 
Pick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruitPick up the low-hanging concurrency fruit
Pick up the low-hanging concurrency fruit
 
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...
Apache Flink Internals: Stream & Batch Processing in One System – Apache Flin...
 

Similar to Stream to rule the world

CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)Ortus Solutions, Corp
 
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...Ortus Solutions, Corp
 
AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)Paul Chao
 
SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsDatabricks
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrencyAlex Miller
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsKevin Webber
 
Hadoop and HBase experiences in perf log project
Hadoop and HBase experiences in perf log projectHadoop and HBase experiences in perf log project
Hadoop and HBase experiences in perf log projectMao Geng
 
C# as a System Language
C# as a System LanguageC# as a System Language
C# as a System LanguageScyllaDB
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actorslegendofklang
 
Stream processing - Apache flink
Stream processing - Apache flinkStream processing - Apache flink
Stream processing - Apache flinkRenato Guimaraes
 
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Data Con LA
 
Distributed real time stream processing- why and how
Distributed real time stream processing- why and howDistributed real time stream processing- why and how
Distributed real time stream processing- why and howPetr Zapletal
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Matthias Niehoff
 
Memory Management with Java and C++
Memory Management with Java and C++Memory Management with Java and C++
Memory Management with Java and C++Mohammad Shaker
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0Petr Zapletal
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012Chris Westin
 

Similar to Stream to rule the world (20)

CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)CBStreams - Java Streams for ColdFusion (CFML)
CBStreams - Java Streams for ColdFusion (CFML)
 
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
ITB2019 CBStreams : Accelerate your Functional Programming with the power of ...
 
AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)AI與大數據數據處理 Spark實戰(20171216)
AI與大數據數據處理 Spark實戰(20171216)
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
 
SparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDsSparkSQL: A Compiler from Queries to RDDs
SparkSQL: A Compiler from Queries to RDDs
 
Groovy concurrency
Groovy concurrencyGroovy concurrency
Groovy concurrency
 
Google cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache FlinkGoogle cloud Dataflow & Apache Flink
Google cloud Dataflow & Apache Flink
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka Streams
 
Hadoop and HBase experiences in perf log project
Hadoop and HBase experiences in perf log projectHadoop and HBase experiences in perf log project
Hadoop and HBase experiences in perf log project
 
C# as a System Language
C# as a System LanguageC# as a System Language
C# as a System Language
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actors
 
Stream processing - Apache flink
Stream processing - Apache flinkStream processing - Apache flink
Stream processing - Apache flink
 
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
 
Distributed real time stream processing- why and how
Distributed real time stream processing- why and howDistributed real time stream processing- why and how
Distributed real time stream processing- why and how
 
Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra Big data analytics with Spark & Cassandra
Big data analytics with Spark & Cassandra
 
Flink internals web
Flink internals web Flink internals web
Flink internals web
 
Memory Management with Java and C++
Memory Management with Java and C++Memory Management with Java and C++
Memory Management with Java and C++
 
Distributed Real-Time Stream Processing: Why and How 2.0
Distributed Real-Time Stream Processing:  Why and How 2.0Distributed Real-Time Stream Processing:  Why and How 2.0
Distributed Real-Time Stream Processing: Why and How 2.0
 
So you think you can stream.pptx
So you think you can stream.pptxSo you think you can stream.pptx
So you think you can stream.pptx
 
mongodb-aggregation-may-2012
mongodb-aggregation-may-2012mongodb-aggregation-may-2012
mongodb-aggregation-may-2012
 

More from Ortus Solutions, Corp

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionOrtus Solutions, Corp
 
Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Ortus Solutions, Corp
 
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdfITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdfOrtus Solutions, Corp
 
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfOrtus Solutions, Corp
 
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfOrtus Solutions, Corp
 
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdfITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdfOrtus Solutions, Corp
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfOrtus Solutions, Corp
 
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdfITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdfOrtus Solutions, Corp
 
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdfITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdfOrtus Solutions, Corp
 
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdfITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdfOrtus Solutions, Corp
 
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdfITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdfOrtus Solutions, Corp
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfOrtus Solutions, Corp
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfOrtus Solutions, Corp
 
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdfITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdfOrtus Solutions, Corp
 
ITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdfITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdfOrtus Solutions, Corp
 

More from Ortus Solutions, Corp (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Ortus Government.pdf
Ortus Government.pdfOrtus Government.pdf
Ortus Government.pdf
 
Luis Majano The Battlefield ORM
Luis Majano The Battlefield ORMLuis Majano The Battlefield ORM
Luis Majano The Battlefield ORM
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusion
 
Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023
 
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdfITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
 
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
 
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
 
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdfITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdfITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
 
ITB_2023_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdfITB_2023_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdf
 
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdfITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
 
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdfITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
 
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdfITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdfITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
 
ITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdfITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdf
 

Recently uploaded

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 

Recently uploaded (20)

Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 

Stream to rule the world

  • 1. Streams to rule the world Into the Box 2020 Gavin Pickin
  • 2. CBStreams => Accelerate Your Functional Programming!
  • 4. Who am I? ● Software Consultant for Ortus Solutions ● Work with ColdBox, CommandBox, ContentBox every day ● Working with Coldfusion for 22 years ● Working with Javascript just as long ● Love learning and sharing the lessons learned ● From New Zealand, live in Bakersfield, Ca ● Loving wife, lots of kids, and countless critters http://www.gpickin.com and @gpickin on twitter http://www.ortussolutions.com
  • 5. What are Java Streams What is CBStreams Imperative vs Functional Programming Building Streams Using Streams Collecting Streams
  • 6. What are Java Streams • Introduced in JDK 8+ • Not I/O Streams • A data abstraction layer • Does not store any data, it wraps the data • Designed to process streams of data elements • map(), reduce(), filter(), collect() • Enables functional-style operations on such elements https://www.oracle.com/technetwork/articles/java/ma14-java-se-8-streams-2177646.html
  • 7. Dr. Venkat Subramaniam • Streams Changed My Life! • Devnexus Presentations • Streams • Completeable Futures • Watch these videos Lambdas + Streams Streams
  • 8. What is CBStreams • Port of Java Streams to CFML Land! • 90% of all Java functionality is there • Plus some CFML Dynamic Goodness • Box Module (ColdBox, CommandBox, etc) https://forgebox.io/view/cbstreams install cbstreams
  • 10. Imperative Programming • Major OO languages are imperative (C,++,C#, Java) • Follow a top-down or procedural design to reach a goal • Each statement changes the state (side-effect) of a program • Each statement tells the computer what to change and in what order • Always cons and pros function isPrime( number ) { for( var i = 2; i <= sqr( number ); i++) { if(number % i == 0) return false; } return number > 1; } isPrime(9220000000000000039) // Output: true
  • 11. Functional Programming • Declarative programming • We tell the computer what things, actions, etc are • Runtime determines the best way how to do it • Functions are first class citizens • No side-effect or iterating state to worry about • Always cons and pros function isPrime(number) { return number > 1 && stream .rangeClosed( 2, sqr( number ) ) .noneMatch( index => number % index == 0 ); } isPrime( 9220000000000000039 ) // Output: true Functional Programming
  • 13. Streams Functional Heaven! • All about functional programming • Heavy Lambda/Closure usage • Must focus on the what and not on the how! • Create a data processing pipeline • Not for everything, choose wisely…. You have been warned!
  • 14. Streams Functional Heaven! var errors = []; var errorCount = 0; var oFile = fileOpen( filename ); var thisLine = fileReadLine( oFile ); while( errorCount < 40 && !isNull( thisLine ) ){ if( line.startsWith( "ERROR" ) ){ errors.append( line ); errorCount++; } line = fileReadLine( oFile ); } var errors = streamBuilder.ofFile( filePath ) .filter( line => line.startsWith( "ERROR" ) ) .limit( 40 ) .collect(); What if I want to multi-thread this? .parallel()
  • 15. What about CFML Functions? • They are limited in input, scope & operations • No short-circuiting operations • No lazyness, they all fire top to bottom • Each operation blocks until it finishes processing ALL elements • Creates new arrays/queries/structs for each new concatenated operation • What about infinite input or biiiiig files? • map(), reduce(), each(), filter()
  • 18. Lazy!
  • 20. Lazy Example var empIds = [ 1, 2, 3, 4 ]; var employee = streamBuilder.new( empIds ) // Convert ID's to Employee Objects, passing function reference .map( employeeService.findByID ) // only valid employees .filter( (employee) => !isNull( employee ) ) // same as: .filter( function( employee ){ return !isNull (employee); } ) // only salaries > 10000 .filter( (employee) => employee.getSalary() > 100000 ) // Find the first one .findFirst() // Return null .orElse( null ); expect( employee.getSalary() ).toBe( 200000 ); • Stream performs the map and two filter operations, one element at a time. • Since the salary of id 1 is not greater than 100000, the processing moves on to the next element. • Id 2 satisfies both of the filter predicates and hence the stream evaluates the terminal operation findFirst() and returns the result. • No operations are performed on id 3 and 4.
  • 21. Let’s Get Started! install cbstreams StreamBuilder@cbstreams • The StreamBuilder is injected where needed • Helps you build streams out of native CFML data types • Strings, Files, Arrays, Structs, Queries, Nulls • Helps you build infinite or closure based streams • You can strong type elements for the stream if needed • For mathematical operations • int, long, or double
  • 22. Empty Streams emptyStream = streamBuilder.new(); emptyStream = streamBuilder.new().empty(); • Simple way to build streams with no elements • Useful? Maybe…
  • 23. Building Custom Streams builder = streamBuilder.builder(); myData.each( function( item ){ builder.add( item ); } ); myStream = builder.build(); stream = streamBuilder.new() .of( "a", "hello", "stream" ); stream = streamBuilder.new() .of( argumentCollection=myData ); • Two approaches: • builder() - Add your own data via the add() method • Of( arguments ) - Via an array of arguments
  • 24. Streams of Characters stream = streamBuilder.new().ofChars( "Welcome to Streams" ); • Stream of string characters • Great for parsing, lookups, etc.
  • 25. File Streams stream = streamBuilder.new().ofFile( absolutePath ); try{ //work on the stream } finally{ stream.close(); } • Non Blocking I/O Classes • Stream of file lines • Throw any file size to it, I dare ya!
  • 26. Generate Infinite Streams // Generate 100 random numbers stream = streamBuilder.new().generate( function(){ return randRange( 1, 100 ); } ).limit( 100 ); // Seeded iteration stream = streamBuilder.new().iterate( 40, function( x ){ return x + 2; } ).limit( 20 ); • Infinite streams of data • Start with a seed or no seeded results • Make sure you limit them or wait forever….
  • 27. Ranged Streams stream = streamBuilder.new().range( 1, 200 ); stream = streamBuilder.new().rangeClosed( 1, 2030 ); stream = streamBuilder.new().rangeClosed( 1, qUsers.recordcount ); • Create open or closed ranges • Similar to of() but a whole less typing
  • 28. Intermediate Operations • Remember, they are lazy, nothing gets done until a terminator is called. • Result is always a stream Operation Description limit( maxSize ) Limit the stream processing distinct() Return only distinct elements skip( n ) Skip from the first element to n sorted( comparator ) Sort a stream using a compactor closure unordered() Return an unordered stream (default) onClose( closeHandler ) Attach a listener to when the close operation is called concat( stream1, stream2 ) Concatenates two streams together peek( action ) Allows you to peek on the element in the order is called Map( mapper ) Transform the elements into something else filter( predicate ) Returns a new stream containing only the requested elements parallel() Convert the stream to a parallel multi-threaded stream
  • 29. Terminal Operations • They kick off processing of elements sequentially or in parallel Operation Description iterator() Returns a java iterator spliterator() Returns a java spliterator close() Close the stream toArray() Convert the stream back into an array count() Count the elements in the stream forEach( action ) Iterate through the elements calling the action closure forEachOrdered( action ) Iterate through the elements calling the action closure in order, even in parallel reduce( accumulator, identity ) Fold, reduces the stream to a single element. max( comparator ) Returns the max value in the stream, if a comparator is passed its called for you min( comparator ) Returns the min value in the stream, if a comparator is passed its called for you average( comparator ) Returns the avg value in the stream, if a comparator is passed its called for you summaryStatistics() Gives you a struct of stats containing: { min, max, count, sum, average }
  • 30. Short-Circuit Operations • Also terminal, but can short-circuit processing of the stream Operation Description findAny() Find any element in the stream findFirst() Find the first element in the stream anyMatch( predicate ) Returns a boolean that indicates if any of the elements match the predicate closure allMatch( predicate ) Returns a boolean that indicates if ALL of the elements match the predicate closure noneMatch( predicate ) Returns a boolean that indicates if none of the elements match the predicate closure
  • 31. Collectors • Finalizes the stream by converting it to concrete collections • CBStreams auto-converts Java -> CFML Data Types Operation Description collect() Return an array of the final elements collectGroupingBy( classifier ) Build a final collection according to the classifier lambda/closure that will classify the keys in the group. End result is usually a struct of data collectAverage( mapper, primitive=long ) Collect an average according to the mapper function/closure and data type passed collectSum( mapper, primitive=long ) Collect a sum according to the mapper function/closure and data type passed collectSummary( mapper, primitive=long ) Collect a statistics struct according to the mapper function and data type passed collectAsList( delimiter=“,”, prefix, suffix ) Collect results into a string list with a delimiter and attached prefix and/or suffix. collectAsStruct( keyId, valueID, overwrite=true ) Collect the elements into a struct by leveraging the key identifier and the value identifier from the stream of elements to pass into the collection. collectPartitioningBy( predicate ) partitions the input elements according to a Predicate closure/lambda, and organizes them into a Struct of <Boolean, array >.
  • 32. Lambda/Closure References • CBStreams converts CFML Closures -> Java Lambdas • Let’s investigate them by Java name: // BiFunction, BinaryOperator function( previous, item ){ return item; } // Comparator function compare( o1, o2 ){ return -,+ or 0 for equal } // Consumer void function( item ){ } // Function, ToDoubleFunction, ToIntFunction, ToLongFunction, UnaryOperator function( item ){ return something; } // Predicate boolean function( item ){ return false; } // Supplier function(){ return something; } // Runnable void function(){ // execute something }
  • 33. CBStreams Optionals • Most return values are not the actual values but a CFML Optional • Wraps a Java Optional • Simple functional value container instead of doing null checks, with some cool functions Operation Description isPresent() Returns boolean if value is present ifPresent( consumer ) If value is present call the consumer closure for you filter( predicate ) If a value is present and the value matches the predicate then return another Optional :) map( mapper ) If a value is present, apply the mapping function and return another Optional get() Get the value! orElse( other ) Get the value or the `other` if the value is null orElseGet( other ) Get the value or if not present call the other closure to return a value hashCode() Unique hash code of the value toString() Debugging
  • 34. Examples myArray = [ "ddd2", "aaa2", "bbb1", "aaa1", "bbb3", "ccc", "bbb2", "ddd1" ]; // Filtering streamBuilder.new( myArray ) .filter( function( item ){ return item.startsWith( "a" ); } ) .forEach( function( item ){ writedump( item ); } );
  • 35. Examples // Sorted Stream streamBuilder.new( myArray ) .sorted() .filter( function( item ){ return item.startsWith( "a" ); } ) .forEach( function( item ){ writedump( item ); } );
  • 36. Examples // Mapping streamBuilder.new( myArray ) .map( function( item ){ return item.ucase(); }) .sorted( function( a, b ){ return a.compareNoCase( b ); } .forEach( function( item ){ writedump( item ); } );
  • 37. Examples // Partition stream to a struct of arrays according to even/odd var isEven = streamBuilder.new( 2,4,5,6,8 ) .collectPartitioningBy( function(i){ return i % 2 == 0; } ); expect( isEven[ "true" ].size() ).toBe( 4 ); expect( isEven[ "false" ].size() ).toBe( 1 );
  • 38. Examples // Group employees into character groups component{ var groupByAlphabet = streamBuilder.of( employeeArray ) .collectGroupingBy( function( employee ){ return listFirst( employee.getlastName(), “” ); } ); expect( groupByAlphabet.get( 'B' ).get( 0 ).getName() ) .toBe( "Bill Gates" ); expect( groupByAlphabet.get( 'J' ).get( 0 ).getName() ) .toBe( "Jeff Bezos" ); expect( groupByAlphabet.get( 'M' ).get( 0 ).getName() ) .toBe( "Mark Zuckerberg" ); }
  • 39. Examples // Matching anyStartsWithA = streamBuilder .new( myArray ) .anyMatch( function( item ){ return item.startsWith( "a" ); } ); writeDump( anyStartsWithA ); // true allStartsWithA = streamBuilder .new( myArray ) .allMatch( function( item ){ return item.startsWith( "a" ); } ); writeDump( anyStartsWithA ); // false
  • 40. Examples noneStartsWithZ = streamBuilder .new( myArray ) .noneMatch((s) -> s.startsWith("z")); noneStartsWithZ = streamBuilder .new( myArray ) .noneMatch( function( item ){ return item.startsWith( "z" ); } ); writeDump( noneStartsWithZ ); // true
  • 41. Examples // Reduce optional = streamBuilder .new( myArray ) .sorted() .reduce( function( s1, s2 ){ return s1 & "#" & s2; } ); writedump( optional.get() );
  • 42. Examples // Parallel Sorted Count count = streamBuilder .new( myArray ) .parallel() .sorted() .count();
  • 43. Implement JDK 9-10 features Threading Intricacies to solve cbORM, Quick Integration qb Integration ColdBox Integration Reactive Streams Roadmap
  • 44. Questions?? ● After the presentation in the Breakout Room ● On the Boxteam slack channel - boxteam.herokuapp.com ● On Twitter @lmajano @gpickin @ortussolutions