The document discusses new features in Java 8 and Eclipse support for these features, including:
- Early access builds of Eclipse provide support for some Java 8 features like type annotations, default methods, and lambda expressions, though support is still evolving.
- The Java 8 features include default methods in interfaces to allow interface evolution, lambda expressions as a cleaner way to represent code as data than anonymous classes, and type annotations to allow pluggable type systems for constraints like nullness.
- The Eclipse Java development team is working to fully support these Java 8 features in Eclipse with IDE features like code completion and static analysis tools leveraging the new language features.
Functional programming in Java 8 allows for:
1) The use of lambda expressions and streams for a more declarative programming style without iteration.
2) Functional interfaces like Function, Predicate, and Consumer along with lambda expressions enable function composition and chaining.
3) Features like immutable collections help reduce mutability and side effects, important aspects of functional programming.
JDT Embraces Lambda Expressions - EclipseCon North America 2014Noopur Gupta
Java 8 is coming. It is happening right here. Developers of your favorite Java IDE are participating in shaping this long awaited milestone for the Java ecosystem: On time with the GA of Java 8, JDT will ship its first release with support for developing in Java 8.
If you have a basic understanding of the new features in Java 8, come here and learn how the JDT team mastered the challenges of lifting the Eclipse Java IDE to the next language version.
The main focus of this talk will be on lambda expressions, touching also some changes in the libraries that leverage lambda expressions. We will expose some examples demonstrating the complexity of the language and mention some caveats which should help you avoid some unpleasent surprises.
We will demo how to get started using Java 8 in Eclipse and show the latest tool features for working with lambda expressions including new quick assists etc.
Finally, we'll give a retrospective discussion of the situation of the JDT team, in terms of team changes, contributors, deadlines, interaction with expert groups, with the Eclipse community, and more.
The document provides an introduction to Java 8 streams. It discusses intermediate and terminal stream operations such as filter(), sorted(), forEach(), and reduce(). It describes reductions like max(), min(), sum(), count(), and average(). It covers find methods, match methods, and Optional. It also discusses limiting, skipping, and distinct elements in streams.
1. The document discusses functional programming in Scala, focusing on why FP is useful, its core concepts, and tools like for-comprehensions, Try and Either.
2. It explains key FP concepts like pure functions, referential transparency, and how Scala supports both functional and imperative styles.
3. Functional programming enables testability, reusability, parallelism and comprehension through immutable data and higher-order functions. The document also covers tools like for-comprehensions for working with collections and Try/Either for handling errors in a functional way.
JavaScript is the programming language of HTML and the Web.
JavaScript is easy to learn.
This Presentation will teach you JavaScript from basic to advanced.
Functional programming in Java 8 allows for:
1) The use of lambda expressions and streams for a more declarative programming style without iteration.
2) Functional interfaces like Function, Predicate, and Consumer along with lambda expressions enable function composition and chaining.
3) Features like immutable collections help reduce mutability and side effects, important aspects of functional programming.
JDT Embraces Lambda Expressions - EclipseCon North America 2014Noopur Gupta
Java 8 is coming. It is happening right here. Developers of your favorite Java IDE are participating in shaping this long awaited milestone for the Java ecosystem: On time with the GA of Java 8, JDT will ship its first release with support for developing in Java 8.
If you have a basic understanding of the new features in Java 8, come here and learn how the JDT team mastered the challenges of lifting the Eclipse Java IDE to the next language version.
The main focus of this talk will be on lambda expressions, touching also some changes in the libraries that leverage lambda expressions. We will expose some examples demonstrating the complexity of the language and mention some caveats which should help you avoid some unpleasent surprises.
We will demo how to get started using Java 8 in Eclipse and show the latest tool features for working with lambda expressions including new quick assists etc.
Finally, we'll give a retrospective discussion of the situation of the JDT team, in terms of team changes, contributors, deadlines, interaction with expert groups, with the Eclipse community, and more.
The document provides an introduction to Java 8 streams. It discusses intermediate and terminal stream operations such as filter(), sorted(), forEach(), and reduce(). It describes reductions like max(), min(), sum(), count(), and average(). It covers find methods, match methods, and Optional. It also discusses limiting, skipping, and distinct elements in streams.
1. The document discusses functional programming in Scala, focusing on why FP is useful, its core concepts, and tools like for-comprehensions, Try and Either.
2. It explains key FP concepts like pure functions, referential transparency, and how Scala supports both functional and imperative styles.
3. Functional programming enables testability, reusability, parallelism and comprehension through immutable data and higher-order functions. The document also covers tools like for-comprehensions for working with collections and Try/Either for handling errors in a functional way.
JavaScript is the programming language of HTML and the Web.
JavaScript is easy to learn.
This Presentation will teach you JavaScript from basic to advanced.
Eclipse and Java 8 - Eclipse Day India 2013Noopur Gupta
This document discusses new features in Java 8 related to lambda expressions, including functional interfaces, lambda syntax, method references, and interface improvements like default and static methods. It provides examples and explanations of how lambda expressions reduce overhead compared to anonymous classes by using invokedynamic bytecode and JRE optimizations. It also covers type annotations which allow annotations on type uses in addition to declarations to enable improved static analysis.
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Miles Sabin
The Scala IDE for Eclipse has undergone significant changes from its early beginnings as a simple syntax highlighting plugin to its current state with deeper integration with Eclipse and the Scala compiler. Recent work has focused on improving navigation features like hyperlinking and leveraging Eclipse's JDT for indexing Scala code. The presenter calls on developers to contribute to ongoing efforts to lower barriers to contributing and improve infrastructure, documentation, and communication channels around the Scala IDE project.
This document provides an overview of the new features in Ada 2012 including:
- Improved support for program correctness through pre- and postconditions, type invariants, and subtype predicates.
- New and improved container libraries including bounded containers, holder containers, and multiway trees.
- Increased programming expressiveness through features like conditional expressions, quantified expressions, expression functions, and case expressions.
- Enhancements to visibility rules and the use of incomplete types.
- New concurrency and real-time constructs for managing resources on multicore systems.
Functional programming has started (re)gaining prominence in recent years, and with good reason too. Functional programs lend an elegant solution to the concurrency problem, result in more modular systems, are more concise and are easier to test. While modern languages like Scala and Clojure have embraced the functional style whole-heartedly, Java has lagged a bit behind in its treatment of functions as first-class citizens. With the advent of Java 8 and its support for lambdas, however, Java programmers can finally start reaping the power of functional programs as well. Even without Java 8, it is possible to adopt a functional style with the aid of excellent libraries such as Guava.
The document summarizes many of the new features introduced in PHP 5, including an overhauled object model with reference handling, visibility, constructors and destructors. It also discusses the Standard PHP Library (SPL) which provides classes and interfaces to solve common problems. New functions, extensions and other language improvements like type hinting and exceptions are covered. The presentation encourages developers to adopt PHP 5 features for improved object oriented programming.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in code like syntax, semantic, and run-time errors.
This document provides an introduction to the C programming language. It discusses the basic structure of C programs which consist of functions, with one main function that is executed first. The main components are described as input, output, and central processing units. C uses characters like letters, numbers, and symbols. Key words and identifiers are used to name variables and functions. The document then goes on to explain other C fundamentals like data types, operators, control structures and more in detail across several chapters.
This document provides an overview of key concepts in Java programming including:
- Java code is compiled to bytecode that can run on any machine with a Java Virtual Machine.
- Java uses object-oriented programming with classes and methods.
- Variables must be declared before use and can be initialized.
- Basic arithmetic operators can be used to write expressions in Java.
The document summarizes new features in C# 3.0 and VB 9.0 in Visual Studio 2008, including extension methods, lambda expressions, LINQ, and expression trees. Extension methods allow extending existing types without inheritance. Lambda expressions provide a compact way to write anonymous functions. LINQ allows querying over different data sources using a common syntax. Expression trees represent LINQ queries as data structures for translation into other languages like SQL.
- Highlight the performance benefits of using Java 8 - after all, you’ll probably have to persuade "The Management" that tampering with
existing code is worthwhile
- Demonstrate how to identify areas of code that can be updated to use Java 8 features, and how to pick which changes will give you the
most benefit
- Demonstrate how to automatically refactor your code to make use of features like lambdas and streams
- Cover some of the pros and cons of using the new features - including suggestions of when refactoring may NOT be the best idea.
6 MONTHS JAVA TRAINING is very popular course at DUCAT. This course has the perfect mix of contents to prepare the participants to become a Java developer or programmer. Equipped with Java Training from DUCAT will open a flood gates of opportunities for the participants. The major reasons are the technology itself and the course content. JAVA is used for developing web based and non-web based application and even for programming for mobiles.
This document provides an overview of new features in Java 8, including lambda expressions, streams, date/time APIs, Nashorn JavaScript engine, and improved string joining capabilities. Key points covered include lambda expressions allowing anonymous functions, streams supporting parallel processing of collections, immutable date/time classes, using Nashorn to execute JavaScript from Java code, and the StringJoiner class and String join method for concatenating strings.
The document provides an overview of object-oriented programming (OOP) concepts and the Java programming language. It discusses key OOP concepts like encapsulation, inheritance, polymorphism and abstraction. It then describes how to write, compile and run a basic Java program. Key aspects of the Java language like classes, objects, methods and constructors are explained. The document also discusses how Java programs are executed using a Java Virtual Machine (JVM).
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)PROIDEA
Kolejny język dla JVM? Dlaczego Kotlin? Czy to już czas na porzucenie Javy? Chcę się podzielić moim odczuciem na temat języka Kotlin począwszy od motywacji dla której powstał, przez cechy które posiada, po stan obecny i perspektywę rozwoju. Jeśli chcielibyście używać cech innych znanych języków na platformie JVM, nie przepisując całych aplikacji - poznajcie alternatywę.
This document discusses Java 8 features including defining methods in interfaces, functional programming concepts, lambda expressions, and the stream API. Key points include: interfaces can now define default and static methods; functional programming uses declarative code, avoids mutability, and handles concurrency; lambda expressions define anonymous methods; and the stream API processes data in parallel streams to leverage multi-core architectures.
Introduction to functional programming, with Elixirkirandanduprolu
This document introduces functional programming with Elixir. It discusses how functional programming is an alternative paradigm to object-oriented programming, with concepts like pure functions, immutable data, and functions as first-class citizens. Elixir is a functional language that runs on the Erlang VM, allowing it to easily build concurrent, distributed, and fault-tolerant systems. It provides many benefits over Erlang like better tooling and syntax. The document outlines Elixir's core concepts like modules, functions, pattern matching, and the pipeline operator and provides examples of how to work with Elixir's basic datatypes.
The document discusses the key concepts of functional programming including:
- Functional programming uses functions as building blocks and avoids mutable state and side effects.
- Pure functions, immutability, recursion, and function composition are important characteristics.
- Functional programming is well-suited for concurrency since immutable data prevents data races.
- Some benefits of functional programming include simpler code for complex problems, increased correctness from avoiding side effects, and ease of parallelization for concurrency.
The document provides an overview of functional programming concepts in Java 8. It discusses how functions are now first-class citizens in Java that can be passed as parameters and returned from other functions. Lambda expressions are introduced as anonymous functions that can be used to concisely represent implementations of functional interfaces. The document also discusses how lambda expressions are compiled using invokedynamic rather than by converting them to anonymous inner classes, and how this allows them to be more efficient. Finally, it covers additional Java 8 features like streams that further support a functional style of programming.
This document summarizes new C# 3.0 features including implicit typing, lambda expressions, and extension methods. Implicit typing allows declaring variables without an explicit type using the 'var' keyword. Lambda expressions provide a concise way to pass code as arguments using the '=>' operator. Extension methods allow adding methods to existing types without modifying them by defining methods in static classes that take the extended type as the first parameter.
Cover Basic concept for Functional Programming in Java. Define new functional interfaces, lambda expressions, how to translate lambda expression, JVM deal with new byte code etc. This is not the perfect slides for functional programming, but trying cover simple basic functional programming.
Eclipse and Java 8 - Eclipse Day India 2013Noopur Gupta
This document discusses new features in Java 8 related to lambda expressions, including functional interfaces, lambda syntax, method references, and interface improvements like default and static methods. It provides examples and explanations of how lambda expressions reduce overhead compared to anonymous classes by using invokedynamic bytecode and JRE optimizations. It also covers type annotations which allow annotations on type uses in addition to declarations to enable improved static analysis.
Scaladays 2010 - The Scala IDE for Eclipse - Retrospect and Prospect for 2.8 ...Miles Sabin
The Scala IDE for Eclipse has undergone significant changes from its early beginnings as a simple syntax highlighting plugin to its current state with deeper integration with Eclipse and the Scala compiler. Recent work has focused on improving navigation features like hyperlinking and leveraging Eclipse's JDT for indexing Scala code. The presenter calls on developers to contribute to ongoing efforts to lower barriers to contributing and improve infrastructure, documentation, and communication channels around the Scala IDE project.
This document provides an overview of the new features in Ada 2012 including:
- Improved support for program correctness through pre- and postconditions, type invariants, and subtype predicates.
- New and improved container libraries including bounded containers, holder containers, and multiway trees.
- Increased programming expressiveness through features like conditional expressions, quantified expressions, expression functions, and case expressions.
- Enhancements to visibility rules and the use of incomplete types.
- New concurrency and real-time constructs for managing resources on multicore systems.
Functional programming has started (re)gaining prominence in recent years, and with good reason too. Functional programs lend an elegant solution to the concurrency problem, result in more modular systems, are more concise and are easier to test. While modern languages like Scala and Clojure have embraced the functional style whole-heartedly, Java has lagged a bit behind in its treatment of functions as first-class citizens. With the advent of Java 8 and its support for lambdas, however, Java programmers can finally start reaping the power of functional programs as well. Even without Java 8, it is possible to adopt a functional style with the aid of excellent libraries such as Guava.
The document summarizes many of the new features introduced in PHP 5, including an overhauled object model with reference handling, visibility, constructors and destructors. It also discusses the Standard PHP Library (SPL) which provides classes and interfaces to solve common problems. New functions, extensions and other language improvements like type hinting and exceptions are covered. The presentation encourages developers to adopt PHP 5 features for improved object oriented programming.
This document discusses different programming paradigms and languages. It describes batch programs which run without user interaction and event-driven programs which respond to user events. It lists many popular programming languages from Machine Language to Java and C#, and describes low-level languages that are close to machine code and high-level languages that are more human-readable. It also discusses language translators like compilers, interpreters, and assemblers and how they convert code between languages. Finally, it covers testing, debugging, and different types of errors in code like syntax, semantic, and run-time errors.
This document provides an introduction to the C programming language. It discusses the basic structure of C programs which consist of functions, with one main function that is executed first. The main components are described as input, output, and central processing units. C uses characters like letters, numbers, and symbols. Key words and identifiers are used to name variables and functions. The document then goes on to explain other C fundamentals like data types, operators, control structures and more in detail across several chapters.
This document provides an overview of key concepts in Java programming including:
- Java code is compiled to bytecode that can run on any machine with a Java Virtual Machine.
- Java uses object-oriented programming with classes and methods.
- Variables must be declared before use and can be initialized.
- Basic arithmetic operators can be used to write expressions in Java.
The document summarizes new features in C# 3.0 and VB 9.0 in Visual Studio 2008, including extension methods, lambda expressions, LINQ, and expression trees. Extension methods allow extending existing types without inheritance. Lambda expressions provide a compact way to write anonymous functions. LINQ allows querying over different data sources using a common syntax. Expression trees represent LINQ queries as data structures for translation into other languages like SQL.
- Highlight the performance benefits of using Java 8 - after all, you’ll probably have to persuade "The Management" that tampering with
existing code is worthwhile
- Demonstrate how to identify areas of code that can be updated to use Java 8 features, and how to pick which changes will give you the
most benefit
- Demonstrate how to automatically refactor your code to make use of features like lambdas and streams
- Cover some of the pros and cons of using the new features - including suggestions of when refactoring may NOT be the best idea.
6 MONTHS JAVA TRAINING is very popular course at DUCAT. This course has the perfect mix of contents to prepare the participants to become a Java developer or programmer. Equipped with Java Training from DUCAT will open a flood gates of opportunities for the participants. The major reasons are the technology itself and the course content. JAVA is used for developing web based and non-web based application and even for programming for mobiles.
This document provides an overview of new features in Java 8, including lambda expressions, streams, date/time APIs, Nashorn JavaScript engine, and improved string joining capabilities. Key points covered include lambda expressions allowing anonymous functions, streams supporting parallel processing of collections, immutable date/time classes, using Nashorn to execute JavaScript from Java code, and the StringJoiner class and String join method for concatenating strings.
The document provides an overview of object-oriented programming (OOP) concepts and the Java programming language. It discusses key OOP concepts like encapsulation, inheritance, polymorphism and abstraction. It then describes how to write, compile and run a basic Java program. Key aspects of the Java language like classes, objects, methods and constructors are explained. The document also discusses how Java programs are executed using a Java Virtual Machine (JVM).
JDD 2017: Kotlin for Java developers (Tomasz Kleszczyński)PROIDEA
Kolejny język dla JVM? Dlaczego Kotlin? Czy to już czas na porzucenie Javy? Chcę się podzielić moim odczuciem na temat języka Kotlin począwszy od motywacji dla której powstał, przez cechy które posiada, po stan obecny i perspektywę rozwoju. Jeśli chcielibyście używać cech innych znanych języków na platformie JVM, nie przepisując całych aplikacji - poznajcie alternatywę.
This document discusses Java 8 features including defining methods in interfaces, functional programming concepts, lambda expressions, and the stream API. Key points include: interfaces can now define default and static methods; functional programming uses declarative code, avoids mutability, and handles concurrency; lambda expressions define anonymous methods; and the stream API processes data in parallel streams to leverage multi-core architectures.
Introduction to functional programming, with Elixirkirandanduprolu
This document introduces functional programming with Elixir. It discusses how functional programming is an alternative paradigm to object-oriented programming, with concepts like pure functions, immutable data, and functions as first-class citizens. Elixir is a functional language that runs on the Erlang VM, allowing it to easily build concurrent, distributed, and fault-tolerant systems. It provides many benefits over Erlang like better tooling and syntax. The document outlines Elixir's core concepts like modules, functions, pattern matching, and the pipeline operator and provides examples of how to work with Elixir's basic datatypes.
The document discusses the key concepts of functional programming including:
- Functional programming uses functions as building blocks and avoids mutable state and side effects.
- Pure functions, immutability, recursion, and function composition are important characteristics.
- Functional programming is well-suited for concurrency since immutable data prevents data races.
- Some benefits of functional programming include simpler code for complex problems, increased correctness from avoiding side effects, and ease of parallelization for concurrency.
The document provides an overview of functional programming concepts in Java 8. It discusses how functions are now first-class citizens in Java that can be passed as parameters and returned from other functions. Lambda expressions are introduced as anonymous functions that can be used to concisely represent implementations of functional interfaces. The document also discusses how lambda expressions are compiled using invokedynamic rather than by converting them to anonymous inner classes, and how this allows them to be more efficient. Finally, it covers additional Java 8 features like streams that further support a functional style of programming.
This document summarizes new C# 3.0 features including implicit typing, lambda expressions, and extension methods. Implicit typing allows declaring variables without an explicit type using the 'var' keyword. Lambda expressions provide a concise way to pass code as arguments using the '=>' operator. Extension methods allow adding methods to existing types without modifying them by defining methods in static classes that take the extended type as the first parameter.
Cover Basic concept for Functional Programming in Java. Define new functional interfaces, lambda expressions, how to translate lambda expression, JVM deal with new byte code etc. This is not the perfect slides for functional programming, but trying cover simple basic functional programming.
Here are a few thoughts in response to your questions:
- Lambda expressions will significantly improve readability and reduce noise in Java code by allowing for more concise one-liners compared to anonymous inner classes. However, debugging lambdas could potentially be more challenging since they are anonymous by nature. Tools and IDE support will need to evolve to help with this.
- With features like lambdas and default methods, Java 8 aims to become more competitive with languages like C# and Scala that already have closures and functional capabilities. However, Java's large existing code base and ecosystem give it advantages over newer languages.
- For Java 8 to be widely adopted, projects should start evaluating and migrating to it as early access
This document provides an overview of Spark Catalyst including:
- Catalyst trees and expressions represent logical and physical query plans
- Expressions have datatypes and operate on Row objects
- Custom expressions can be defined
- Code generation improves expression evaluation performance by generating Java code via Janino compiler
- Key concepts like trees, expressions, datatypes, rows, code generation and Janino compiler are explained through examples
An overview of Java's history on Android and direction for the JVM on the future of Android, this talk compiles Java 8/9 APIs to Java 6, offering developers, back to Ice Cream Sandwich, more goodies to play with!
Design and Implementation of the Security Graph LanguageAsankhaya Sharma
Today software is built in fundamentally different
ways from how it was a decade ago. It is increasingly common
for applications to be assembled out of open-source components,
resulting in the use of large amounts of third-party code. This
third-party code is a means for vulnerabilities to make their
way downstream into applications. Recent vulnerabilities such
as Heartbleed, FREAK SSL/TLS, GHOST, and the Equifax data
breach (due to a flaw in Apache Struts) were ultimately caused
by third-party components. We argue that an automated way to
audit the open-source ecosystem, catalog existing vulnerabilities,
and discover new flaws is essential to using open-source safely.
To this end, we describe the Security Graph Language (SGL), a
domain-specific language for analysing graph-structured datasets
of open-source code and cataloguing vulnerabilities. SGL allows
users to express complex queries on relations between libraries
and vulnerabilities in the style of a program analysis language.
SGL queries double as an executable representation for vulnerabilities, allowing vulnerabilities to be automatically checked
against a database and deduplicated using a canonical representation. We outline a novel optimisation for SGL queries based on
regular path query containment, improving query performance up to 3 orders of magnitude. We also demonstrate the
effectiveness of SGL in practice to find zero-day vulnerabilities
by identifying sever
Functional Programming in JavaScript & ESNextUnfold UI
Functional programming concepts and techniques in JavaScript are summarized. Key points include:
- Functional programming avoids mutations by performing computations through expressions.
- Pure functions always return the same output for a given input and have no side effects.
- Higher order functions, currying, composition, and functors are important functional programming tools.
- JavaScript supports functional programming through features like arrow functions, modules, and libraries.
- ECMAScript development follows a multi-stage process and is overseen by TC39 and ECMA.
In this presentation, we (Jonatan and Marco) investigated the new official and hidden features of Java 12.
We collected code examples and stories behind this release. We were happy about some features and disappointed with others.
We hope that with these slides you can learn quickly and with fun what's coming with the new version of Java.
This document provides an overview of lambda expressions in Java 8. It begins with an introduction to lambda expressions and their history in Java. Lambda expressions allow implementing functional interfaces more concisely than anonymous classes. The document discusses key aspects of lambda expressions like syntax, argument lists, return types, and local variable capture. It also explains how lambda expressions integrate with functional interfaces to provide a target type within Java's type system. The overall goal of lambda expressions is to support parallel operations on collections in the Java class library.
Apache Spark has rocked the big data landscape, becoming the largest open source big data community with over 750 contributors from more than 200 organizations. Spark's core tenants of speed, ease of use, and its unified programming model fit neatly with the high performance, scalable, and manageable characteristics of modern Java runtimes. In this talk Tim Ellison, a JVM developer at IBM, shows some of the unique Java 8 capabilities in the JIT compiler, fast networking, serialization techniques, and GPU off-loading that deliver the ultimate big data platform for solving business problems. Tim will demonstrate how solutions, previously infeasible with regular Java programming, become possible with this high performance Spark core runtime, enabling you to solve problems smarter and faster.
A compiler is a computer program which helps you transform source code written in a high-level language into low-level machine language.
Correctness, speed of compilation, preserve the correct the meaning of the code are some important features of compiler design.
Compilers are divided into three parts 1) Single Pass Compilers 2)Two Pass Compilers, and 3) Multipass Compilers.
The “compiler” was word first used in the early 1950s by Grace Murray Hopper.
Steps for Language processing system are: Preprocessor, Interpreter, Assembler, Linker/Loader.
Important compiler construction tools are 1) Scanner generators, 2)Syntax-3) directed translation engines, 4) Parser generators, 5) Automatic code generators.
The main task of the compiler is to verify the entire program, so there are no syntax or semantic errors.
This is a beginner-level programming session where you will learn the fundamentals of Java. Between each lesson, you'll have skill testing in the form of quizzes, as well as hands-on experience in the field.
Apache Spark MLlib 2.0 Preview: Data Science and ProductionDatabricks
This talk highlights major improvements in Machine Learning (ML) targeted for Apache Spark 2.0. The MLlib 2.0 release focuses on ease of use for data science—both for casual and power users. We will discuss 3 key improvements: persisting models for production, customizing Pipelines, and improvements to models and APIs critical to data science.
(1) MLlib simplifies moving ML models to production by adding full support for model and Pipeline persistence. Individual models—and entire Pipelines including feature transformations—can be built on one Spark deployment, saved, and loaded onto other Spark deployments for production and serving.
(2) Users will find it much easier to implement custom feature transformers and models. Abstractions automatically handle input schema validation, as well as persistence for saving and loading models.
(3) For statisticians and data scientists, MLlib has doubled down on Generalized Linear Models (GLMs), which are key algorithms for many use cases. MLlib now supports more GLM families and link functions, handles corner cases more gracefully, and provides more model statistics. Also, expanded language APIs allow data scientists using Python and R to call many more algorithms.
Finally, we will demonstrate these improvements live and show how they facilitate getting started with ML on Spark, customizing implementations, and moving to production.
Let's PHP in a better way! - Coding Recommendations.Leekas Shep
This document provides recommendations for PHP coding standards and principles. It discusses the PEAR, Zend, and PSR coding standards, as well as the SOLID principles of single responsibility, open/closed, Liskov substitution, interface segregation, and dependency inversion. Specific design patterns like strategy, facade, and decorator are also covered at a high level. The overall message is about continuously improving coding skills through learning and applying best practices.
Data Science Salon: A Journey of Deploying a Data Science Engine to ProductionFormulatedby
Presented by Mostafa Madjipour., Senior Data Scientist at Time Inc.
Next DSS NYC Event 👉 https://datascience.salon/newyork/
Next DSS LA Event 👉 https://datascience.salon/la/
Reducing the gap between R&D and production is still a challenge for data science/ machine learning engineering groups in many companies. Typically, data scientists develop the data-driven models in a research-oriented programming environment (such as R and python). Next, the data/machine learning engineers rewrite the code (typically in another programming language) in a way that is easy to integrate with production services.
This process has some disadvantages: 1) It is time consuming; 2) slows the impact of data science team on business; 3) code rewriting is prone to errors.
A possible solution to overcome the aforementioned disadvantages would be to implement a deployment strategy that easily embeds/transforms the model created by data scientists. Packages such as jPMML, MLeap, PFA, and PMML among others are developed for this purpose.
In this talk we review some of the mentioned packages, motivated by a project at Time Inc. The project involves development of a near real-time recommender system, which includes a predictor engine, paired with a set of business rules.
Java was created in 1990 by James Gosling at Sun Microsystems to control microprocessors embedded in consumer devices. It was designed to be platform independent, reliable, and compact. Over time, Java expanded to support web and internet applications. Major versions included Java 1.0 in 1995, Java 1.1 in 1997, Java 1.2 in 1999, and Java 1.3 in 2002, each adding new packages, classes, and functionality. Key features of Java include being platform independent, object-oriented, having automatic memory management via garbage collection, and prioritizing security.
1. The document discusses using machine learning to help optimize generic compilers by learning better heuristics and parameters from large amounts of data.
2. Early works tried feature engineering and traditional machine learning models with limited success due to the large design space.
3. DeepTune used an LSTM model with embedding layers to directly learn optimizations from program code and outperformed baselines on two hardware targets.
4. CompilerGym is proposed as a framework to implement and evaluate machine learning-based compiler optimizations as reinforcement learning agents interacting with a compiler environment.
Introduction to Spark ML Pipelines WorkshopHolden Karau
Introduction to Spark ML Pipelines Workshop slides - companion IJupyter notebooks in Python & Scala are available from my github at https://github.com/holdenk/spark-intro-ml-pipeline-workshop
This document discusses LINQ (Language Integrated Query) features in C#, including introducing LINQ to Objects, basic query expressions for projection and selection, and anonymous types. It provides examples of how LINQ to Objects maps to extension methods, functional and declarative expressibility using LINQ, details about the LINQ translation process from query expressions to method calls, and examples of using anonymous types.
Java Performance Testing for Everyone - Shelley LambertEclipse Day India
This document discusses performance testing of Java applications and the tools used at AdoptOpenJDK. It provides an overview of the scope of testing done at AdoptOpenJDK across multiple Java implementations, platforms, and versions. It defines key performance metrics and the basic steps of performance testing. Tools used at AdoptOpenJDK are introduced, including PerfNext for running benchmarks, the Test Results Summary Service for analyzing and comparing results, and BumbleBench for simplifying microbenchmark implementation. The document encourages open collaboration to advance innovation in performance testing.
Eclipse IDE Tips and Tricks - Lakshmi Priya ShanmugamEclipse Day India
This document provides an overview of tips and tricks for the Eclipse IDE. It discusses how to configure workspaces, navigate code, code more efficiently using features like quick assist and templates, work with Java 8 and newer features, perform searches, debug code using various features, and view active keyboard shortcuts. The document also mentions finding additional tips and tricks in the Eclipse help menu.
This document discusses pattern matching in Java. It provides examples of using patterns to match types, destructure objects, and match constants to simplify expressions. Pattern matching allows testing types, extracting values, and reducing conditional logic. Key patterns include type tests, destructuring, constants, variables, and wildcards. Pattern matching can be used in if/else statements and switch expressions to concisely handle different cases.
Machine Learning for Java Developers - Nasser EbrahimEclipse Day India
This document outlines an agenda for a machine learning workshop for Java developers. The agenda includes introductions to machine learning algorithms like linear regression, logistic regression, K-nearest neighbors, and K-means clustering. It also discusses machine learning frameworks for Java like Weka, Deeplearning4j, and how to use Jupyter notebooks with Java. The workshop will demonstrate examples using these tools and frameworks.
This document discusses how to make Eclipse applications compatible with high DPI monitors. It covers:
1. Problems that arise when scaling UI elements on high DPI displays like icons appearing smaller.
2. How SWT provides auto-scaling of images and layout on Windows and Linux to address this.
3. Steps developers can take to make apps HiDPI compatible including using high resolution images, image providers that return images scaled for different zoom levels, and HiDPI aware APIs.
Please Behave Yourself: BDD and automating Eclipse RCP applications using JBe...Eclipse Day India
This document discusses Behavior Driven Development (BDD) and how to achieve test automation using Eclipse. It provides an overview of BDD principles and techniques like test-driven development (TDD). It also describes the JBehave framework for BDD and how to set up test execution and reporting using Ant/Maven. Finally, it explains how the SWTBot tool can be used for scenario testing of Eclipse Rich Client Platform (RCP) applications as part of a BDD approach.
Supporting Java™ 9 in Eclipse - A critical perspective - Stephan HerrmannEclipse Day India
The document discusses supporting Java 9 in Eclipse through 4 acts. Act 1 introduces Java modules and demonstrates them in Eclipse. Act 2 discusses issues with existing Eclipse APIs due to Java 9 changes. Act 3 explores complexities around split packages and package references between modules. Act 4 discusses representing Java 9 module options in the Eclipse UI. The conclusion reflects on encapsulation, isolation and compatibility challenges with Java 9.
Eclipse Day India 2015 - Rest with Java (jax rs) and jerseyEclipse Day India
This document discusses REST APIs using Java (JAX-RS) and Jersey. It provides an overview of REST concepts and the JAX-RS and Jersey frameworks. It demonstrates how to create a basic Jersey project in Eclipse and implement CRUD operations. It also discusses using Swagger to generate documentation for RESTful APIs from JAX-RS annotations.
Eclipse Day India 2015 - Java bytecode analysis and JITEclipse Day India
This document discusses Java bytecode and optimizations performed by the Java Virtual Machine (JVM) and just-in-time (JIT) compilers. It covers topics like Java bytecode basics, bytecode tools, how the JVM works, optimizations like inlining and caching, issues with benchmarking, and logging options. The goal is to help understand how Java code is compiled and executed at the bytecode level for better performance.
This document provides a brief overview of Java 8 features including functional interfaces, lambda expressions, stream API, and Optional class. It discusses how functional interfaces provide target types for lambda expressions and can have a single abstract method. Lambda expressions allow implementing functional interfaces concisely without anonymous classes. The stream API provides a powerful way to process collections in a declarative way using lambda expressions. The Optional class avoids null pointer exceptions and allows chaining of method calls on objects that may be null.
This document discusses Eclipse support for Java 9 features. It introduces the Java Runtime (JRT) in Java 9 and the modular image format which replaces rt.jar. It describes how the Eclipse JDT Core is affected by not being able to directly access classes in modular images. The document then outlines the jrt:/ protocol and filesystem provider for enumerating and reading classes from modular images in Java 9. It demonstrates updated Eclipse package explorer and search features for Java 9 and notes ongoing work and future plans for full JDT support of Java 9 features.
Eclipse Day India 2015 - Keynote - Stephan HerrmannEclipse Day India
This document summarizes Stephan Herrmann's presentation on innovation through programming languages and tools. Some key points discussed include:
- Java 8 introduced major new features like lambda expressions that require compiler and tooling support. Eclipse has implemented support for Java 8.
- Type inference for lambda expressions requires solving constraints to determine omitted types.
- Having multiple implementations of new language features helps improve quality by finding bugs. Eclipse's implementation was used by other implementations.
- NullPointerExceptions remain a major problem in Java programs. Techniques like flow analysis and null annotations in Eclipse aim to help developers avoid NPEs.
Eclipse Day India 2015 - Eclipse RCP testing using Jubula based automationEclipse Day India
This document provides an overview of Jubula, an automated testing tool for Rich Client Platform (RCP) applications. It discusses why testing and test automation are important, and introduces Jubula as a tool that allows writing tests without coding by using a drag-and-drop interface. The document demonstrates Jubula's components, test setup, event handlers, and provides a quick demo and discussion of writing tests using Jubula. It also notes some cons of Jubula, such as limitations of regular expressions and database issues, before concluding with references for further information.
This document discusses Oomph, a tool for automating the setup of Eclipse development environments. Oomph can download the required Eclipse installation, plugins, and project code repositories. It can also configure integration with task management tools like Jira. This provides a reliable solution for setting up standard Eclipse environments and avoids the need to manually install and configure multiple components. Oomph represents an improvement over previous solutions that required custom installations or documentation on setup procedures.
Eclipse Day India 2015 - Keynote (Mike Milinkovich)Eclipse Day India
The document discusses how the Eclipse community works and is organized. It outlines key trends driving software development towards open source like how software is becoming more important and cheaper. It then describes principles that guide Eclipse like openness, transparency, meritocracy and independence. Finally, it highlights some example Eclipse projects like their IDE platform, Che IDE for the web, and tools for long lifecycle embedded systems.
Eclipse Day India 2015 - Unleashing the Java 8 Tooling in EclipseEclipse Day India
The document discusses Eclipse tooling for Java 8 features like lambda expressions, default methods, and method references. It announces a demonstration of these Eclipse features at the EclipseCon NA 2015 conference, taking place the following day from 11:50-12:40 at the demo booth. The demonstration will cover how to configure Eclipse for Java 8 development and showcase views and tools for working with Java 8 code.
This document discusses Node.js development using the Eclipse Orion IDE and deployment to Bluemix. It introduces IBM DevOps Services (JazzHub), which allows developers to collaborate on software projects hosted in the cloud. JazzHub provides task tracking, agile planning, integrated source control, and browser-based development using Eclipse Orion, allowing developers to work from anywhere without downloads. The document demonstrates Node.js development with Orion and deployment of projects to Bluemix.
The document discusses SWT features and contributions. It provides an agenda for a technical deep dive on SWT including 10 features that may not be known, recent work, useful tools, and how to contribute. It outlines setting up an SWT development environment, reporting bugs, contributing fixes through Gerrit, and future plans such as interoperability with JavaFX and Wayland support.
Ankur Sharma has worked with Eclipse for 8 years, previously as a committer and co-lead for the Eclipse PDE project. He is currently employed by EMC2. The document discusses the challenges of builds, particularly dependency and versioning issues. It compares PDE builds and Maven builds, noting that PDE builds better understand Eclipse artifacts but Maven has advantages for dependency management and integration with source control systems and CI/CD. The conclusion is that there is no single best approach and the choice depends on the complexity and needs of the application.
Orion is a browser-based open tools integration platform for developing web applications entirely within a web browser. It includes features like a navigator to browse and manage files, an editor for coding JavaScript, CSS, HTML, and Java, integrated search capabilities, Git source control integration, the ability to launch projects as websites, and a client-server architecture that allows for extensibility through plugins. Orion provides developers with an IDE experience directly within their web browser.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfChart Kalyan
A Mix Chart displays historical data of numbers in a graphical or tabular form. The Kalyan Rajdhani Mix Chart specifically shows the results of a sequence of numbers over different periods.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Skybuffer SAM4U tool for SAP license adoptionTatiana Kojar
Manage and optimize your license adoption and consumption with SAM4U, an SAP free customer software asset management tool.
SAM4U, an SAP complimentary software asset management tool for customers, delivers a detailed and well-structured overview of license inventory and usage with a user-friendly interface. We offer a hosted, cost-effective, and performance-optimized SAM4U setup in the Skybuffer Cloud environment. You retain ownership of the system and data, while we manage the ABAP 7.58 infrastructure, ensuring fixed Total Cost of Ownership (TCO) and exceptional services through the SAP Fiori interface.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
JDT embraces lambda expressions
1. 8
8
Srikanth Sankaran
IBM India
Stephan Herrmann
GK Software
BETA_JAVA8
2. 8 Eclipse and Java™ 8
● Java 8 features available in early access builds:
– JSR308 - Type Annotations.
– JEP120 - Repeating Annotations.
– JEP118 - Method Parameter Reflection.
– JSR269 - Pluggable Annotation Processor API &
javax.lang.model API enhancements for Java 8.
– Support for “code carrying” interface methods.
● Partial support for
– Lambda Expressions & Method/Constructor references
– Overload resolution & Type inference changes still evolving
● had been blocked by incomplete specification until late September
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 3
3. 8 Eclipse and Java™ 8
● IDE features available in early access builds:
– Type annotations based static null analysis
● substantially complete, open issues exist
– Code completion, code selection/navigation, search engine
● for completed features
– Code formatter and code “reconciler”
– IDE enablement support:
● AST API's, programmatic AST rewriting API support etc
● Full fledged IDE support work in high gear:
– Early access build refreshes very soon.
● JDT team:
– 12 committers + 1 contributor + 1 GSOC student
+ 2 past committers on consulting role.
Java8
Java8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 4
4. 8 New Kinds of Methods
● defender methods
● virtual extension methods
● static interface methods
● default methods
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 6
5. 8 New Kinds of Methods
Those are only 2 kinds :)
● Code carrying methods in interfaces:
– static methods
● non-OO programming even in interfaces
– default methods
previous names:
● defender methods
● virtual extension methods
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 7
6. 8 Default Methods - Intention
● Intention
– support evolution of interfaces in libraries:
add methods to an interface w/o breaking implementors
– still legal:
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 8
7. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 9
8
Default Methods - Consequences
● Consequences
– Java 8 has multiple inheritance, sort-of
– but little help for corner cases
Root
m()
Both
Left
D m()
Right
D m()
resolve:
8. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 10
8
Default Methods - Consequences
● Consequences
– Java 8 has multiple inheritance, sort-of
– but little help for corner cases
Both
Left
D m()
Right
m()
The default method m() inherited from Left conflicts
with another method inherited from Right
Advice: Don't!
9. 8 Default Methods - Compatibility
● Designed for compatibility during evolution
● For the price of compatibility
– Recipe for disaster:
● implement java.util.List → compile against JRE 7 → OK
● upgrade to JRE 8 but compile as 1.7
The type MyList<E> must implement the inherited abstract method Collection<E>.stream()
– Undefined compiler behavior
● 1.7 compiler cannot handle default methods (from .class)
● ecj and javac differ – no plans to assimilate
● depending on compiler implementation details, not specification
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 12
10. 8 Default Methods - Compatibility
● Designed for compatibility during evolution
● For the price of compatibility
– Recipe for disaster:
● implement java.util.List → compile against JRE 7 → OK
● upgrade to JRE 8 but compile as 1.7
The type MyList<E> must implement the inherited abstract method Collection<E>.stream()
– Undefined compiler behavior
● 1.7 compiler cannot handle default methods (from .class)
● ecj and javac differ – no plans to assimilate
● depending on compiler implementation details, not specification
Advice: Don't mix -source 1.7 & JRE8!
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 13
12. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 15
8
Introducing Lambda Expressions
● Lambda Expressions, Closures, Anonymous Methods
– what is in a name ?
● A function + “captured state” (may have non-locals)
– accessible even when outside of defining lexical scope
● Theoretical framework dates back several decades:
– Lambda (1930's – Church, Lisp – 1958)
– Closure (1960's - Landin, Scheme - 1975)
– Common idiomatic device in functional programming.
● Paradigm of passing a "code block as data"
13. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 16
8
Java 7 Style of “Code as Data”
● Via anonymous classes
14. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 17
8
Java 7 Style of “Code as Data”
● Via anonymous classes
So if lambda expressions
help model "code as data"
are they just
old wine in a new bottle?
No!
15. 8 Lambda Expressions
● Eliminate thorny issues with anonymous classes
– Verbose/clunky Syntax
– Scoping
● anonymous classes introduce their own scopes
● interplay between names in enclosing scope ↔ inherited names
– Capture
● can only capture explicitly final outer locals
● necessarily capture enclosing class instance (memory leaks)
● Lambdas
– address the above, designed to be flexible & optimizable
– much more pleasing & efficient to program with call backs
– With default methods, enabled Collections overhaul.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 18
16. 8 λ Syntax and Examples
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 20
17. 8 Target typing
● Lambda expression is basically
– an anonymous method
– with possibly "captured" enclosing state
● At the grammar level, lambdas are expressions (duh!)
– Can occur anywhere an expression can
– Introduces severe complications in parsing.
● Legally however,
– Lambda needs a context that defines a "target type"
– Everywhere else will have to rejected by the compiler.
– Assignment, initialization, casts, method/ctor invocation,
lambda expression body, conditional expressions and return
statements are contexts that provide target type.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 21
18. 8 Target Typing Examples
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 22
19. 8 Functional Interfaces
● The target type must be a functional interface
● Functional interface
– Declares a single abstract method
– Some methods don't count:
● Default & static methods - they are not abstract
● May freely redeclare java.lang.Object's methods
– May be tagged with @FunctionalInterface to express intent
● So the lambda object implements the functional interface
● Another way of constructing objects
– apart from the SE7 ways
(new, reflection, serialization, clone ...)
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 23
20. 8 Lambda Syntax examples
– Parameter types
● explicit, or
● inferred from target functional interface methods
– Body
● expression, or
● block.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 24
– ()
● can be omitted if a singleton parameter
21. 8 Lambda Syntax examples
– Parameter types
● explicit, or
Trade-off between
conciseness of expression
● inferred from target functional interface methods
– Body
● expression, or
● block.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 25
– ()
● can be omitted if a singleton parameter
vs
clarity of code
-
in the hands of the programmer
22. 8 Variable capture
● A lambda can refer to enclosing method's locals
– Captured state constitutes the "referencing environment"
– Compiler can infer finality
– Captured state is not mutable.
● Properly: capture of "immutable outer local's value"
– Mutability of outer locals implies race conditions
– Mutability would necessarily impose serial execution.
– Lambda creation & invocation could be far apart.
● may be in different threads, may be after enclosing method return
● This "constraint" actually enables parallelism.
● Enclosing class instance captured only if referred to.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 26
23. 8 Method References
● Similar to lambda expressions
– Require a target type that must be a functional interface
– Serve as instances of the functional interface
– Rather than providing a method body,
they refer to an existing method
– Several variants offered.
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 27
24. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 28
8
Lambda code generation
● Not lowered into anonymous classes - i.e not just syntactic sugar
● What does the following print ?
● Lambda object creation under the hood:
– Handled by "Lambda metafactory" API in JRE.
– Compilers generates suitable calls to the metafactory.
– Enables various optimizations.
25. 8 Putting it all together
● Here is a nice example from SOTL[*]
[*] http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-final.html
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 29
26. JDT features in the works 8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 30
27. JDT features in the works 8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 31
28. JDT features in the works 8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 32
29. JDT features in the works 8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 33
31. 8 Annotations in more Places
● Java 5: annotate declarations
– ElementType: packages, classes, fields, methods, locals …
● Java 8: annotate types
– ElementType.TYPE_USE
– ElementType.TYPE_PARAMETER
So what?
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 36
32. 8 Why Care About Types?
● Type = Constraints on values
To detect anomalies
– missing capability
– incompatible assignment
– undeclared capability
● Constraint checking avoids errors
– No Such Method / Field
● Basic statically typed OO
– ClassCastException
● Generics
– ??ExcepMtioyn pet example: NullPointerException
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 37
33. Let the Type System 8
Handle Nullity
● Ideally: Java would force explicit choice
– String definitely a String, never null
– String? either a String or null
– Type system ensures: no dereferencing of null
● Nullity as a language feature?
– Heavy weight, incompatible change
– Language change for each new constraint?
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 38
34. 8 Pluggable Type System
● Make it easier to add new constraints
– Only one new syntax for all kinds of constraints
● Make it easier to add new type checkers
– Checker Framework (Michael Ernst – U of Washington)
● Examples
– @NonNull
– @Interned equals(== , equals)
– @Immutable value cannot change (Java 5 ?)
– @ReadOnly value cannot change via this reference
– @UI code requires to run on the SWT UI thread
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 39
35. Can't Java 5 Do All This?
@Target(ElementType.PARAMETER)
@interface NonNull5 {}
void java5(@NonNull5 String arg);
arg is qualified to be non-null
@Target(ElementType.TYPE_USE)
@interface NonNull8 {}
void java8(@NonNull8 String arg);
String is qualified to be non-null
String is qualified to be non-null
@Target(ElementType.METHOD)
@interface NonNull5 {}
@NonNull5 String java5();
java5 is qualified to be non-null
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 40
8
@Target(ElementType.TYPE_USE)
@interface NonNull8 {}
@NonNull8 String java8();
● We've been lying about the method result
– but we can't lie about everything, e.g.:
void printFirstDog(@NonNull List<Dog> dogs) {
dogs.get(0).bark();
}
NPE?
36. l1 cannot contain
null elements
Null type mismatch: required '@NonNull String'
but the provided value is null
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 41
8
void bad(List<String> unknown, List<@Nullable String> withNulls) {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add(null);
String first = l1.get(0);
if (first == null) return;
l1 = unknown;
l1 = withNulls;
String canNull = withNulls.get(0);
System.out.println(canNull.toUpperCase());
}
@NonNull List<@Nullable String> l2 = new ArrayList<>();
l2 can contain
null elements
Annotated Generics
void good() {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add("Hello");
for (String elem : l1)
System.out.println(elem.toUpperCase());
l2.add(null);
for (String unknown : l2)
if (unknown != null)
System.out.println(unknown.toUpperCase());
}
Null type mismatch: required '@NonNull String'
but the provided value is null
37. l1 cannot contain
null elements
Null comparison always yields false:
The variable first cannot be null at this location
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 42
8
void bad(List<String> unknown, List<@Nullable String> withNulls) {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add(null);
String first = l1.get(0);
if (first == null) return;
l1 = unknown;
l1 = withNulls;
String canNull = withNulls.get(0);
System.out.println(canNull.toUpperCase());
}
@NonNull List<@Nullable String> l2 = new ArrayList<>();
l2 can contain
null elements
Annotated Generics
void good() {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add("Hello");
for (String elem : l1)
System.out.println(elem.toUpperCase());
l2.add(null);
for (String unknown : l2)
if (unknown != null)
System.out.println(unknown.toUpperCase());
}
Null comparison always yields false:
The variable first cannot be null at this location
38. l1 cannot contain
null elements
Null type safety (type annotations): The expression of type 'List<String>'
needs unchecked conversion to conform to '@NonNull List<@NonNull String>'
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 43
8
void bad(List<String> unknown, List<@Nullable String> withNulls) {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add(null);
String first = l1.get(0);
if (first == null) return;
l1 = unknown;
l1 = withNulls;
String canNull = withNulls.get(0);
System.out.println(canNull.toUpperCase());
}
@NonNull List<@Nullable String> l2 = new ArrayList<>();
l2 can contain
null elements
Annotated Generics
void good() {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add("Hello");
for (String elem : l1)
System.out.println(elem.toUpperCase());
l2.add(null);
for (String unknown : l2)
if (unknown != null)
System.out.println(unknown.toUpperCase());
}
Null type safety (type annotations): The expression of type 'List<String>'
needs unchecked conversion to conform to '@NonNull List<@NonNull String>'
39. l1 cannot contain
null elements
Null type mismatch (type annotations):
required '@NonNull List<@NonNull String>'
but this expression has type 'List<@Nullable String>'
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 44
8
void bad(List<String> unknown, List<@Nullable String> withNulls) {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add(null);
String first = l1.get(0);
if (first == null) return;
l1 = unknown;
l1 = withNulls;
String canNull = withNulls.get(0);
System.out.println(canNull.toUpperCase());
}
@NonNull List<@Nullable String> l2 = new ArrayList<>();
l2 can contain
null elements
Annotated Generics
void good() {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add("Hello");
for (String elem : l1)
System.out.println(elem.toUpperCase());
l2.add(null);
for (String unknown : l2)
if (unknown != null)
System.out.println(unknown.toUpperCase());
}
Null type mismatch (type annotations):
required '@NonNull List<@NonNull String>'
but this expression has type 'List<@Nullable String>'
40. l1 cannot contain
null elements
Potential null pointer access:
The variable canNull may be null at this location
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 45
8
void bad(List<String> unknown, List<@Nullable String> withNulls) {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add(null);
String first = l1.get(0);
if (first == null) return;
l1 = unknown;
l1 = withNulls;
String canNull = withNulls.get(0);
System.out.println(canNull.toUpperCase());
}
@NonNull List<@Nullable String> l2 = new ArrayList<>();
l2 can contain
null elements
Annotated Generics
void good() {
@NonNull List<@NonNull String> l1 = new ArrayList<>();
l1.add("Hello");
for (String elem : l1)
System.out.println(elem.toUpperCase());
l2.add(null);
for (String unknown : l2)
if (unknown != null)
System.out.println(unknown.toUpperCase());
}
Potential null pointer access:
The variable canNull may be null at this location
41. 8 Framework Development (1)
● So you want to be smart:
public interface ILib<E> {
@NonNull E work(@Nullable E e);
}
● But will clients like it?
public class LibImpl implements ILib<String> {
@Override
public @Nullable String work(@NonNull String e) { return null; }
● If thou usest annotations know thy co/contravariance
– @Nullable parameter is irreversible
– Design bug in guava's Predicate / Function
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 47
}
42. 8 Framework Development (2)
● Avoid overspecification, make interfaces null-generic:
public interface Function<I,O> {
O apply(I in);
}
● Let clients decide
class ToString implements Function<@NonNull Object, @Nullable String> {
@Override
public @Nullable String apply(@NonNull Object o) { return o.toString(); }
No NPE!
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 48
}
● Putting the pieces together
<@NonNull I, @Nullable O> Collection<O> map1(Collection<I> in, Function<I, O> f) { … }
<@Nullable I, @NonNull O> Collection<O> map2(Collection<I> in, Function<I, O> f) { … }
...
List<@NonNull Object> in = new ArrayList<>();
Collection<@Nullable String> out = map1(in, new ToString());
43. 8 Caveat: Arrays
void test (@NonNull String [] stringsOrNulls) {
System.out.println(stringsOrNulls[0]);
● Semantics are changing from Java 7 to Java 8
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 49
}
array of nonnull elements the array can still be null Þ NPE
void test (String @NonNull [] stringsOrNulls) {
System.out.println(stringsOrNulls[0]);
}
nonnull array NPE- safe (but may print “null”)
44. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 50
8
Status: Annotated Type Analysis
● Implemented EA: @NonNull, @Nullable
– Much analysis already performed
● known & unknown bugs
– Editor may show more bogus errors
● Project > Clean and Problems View
● Planned: @Uninterned
● Proposed: @UiEffect, @Ui …
– by [Colin S. Gordon, Werner Dietl, Michael D. Ernst, and Dan Grossman]
– SWT: bye, bye, “Invalid thread access”
45. 8 Status: Type Annotations
● Supported by
– Compiler
– DOM AST
– APT
● Work in progress
– respect during
CCttrrll CCttrrll 1 CAtlrtl T
● Not yet supported by
– Java model
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 51
46. 8 TypeBinding Backstage Story
aka “Symbol”
● Type bindings are “interned”
– OK to use ==
● Broken by encoding type annotations in type bindings
● Solution
– Find/replace == comparisons for T <: TypeBinding
– Tweak our compiler to do this
– Plan: publish the tweak, controlled by @Uninterned
Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 52
47. Srikanth Sankaran, Stephan Herrmann: Eclipse and Java 8 - EclipseCon Europe 2013 # 53
8
Dramatis personæ
● Jay Arthanareeswaran
● Anirban Chakarborty
● Manoj Palat
● Shankha Banerjee
● Manju Mathew
● Noopur Gupta
● Deepak Azad
● Srikanth Sankaran
● Olivier Thomann
● Andy Clement
● Michael Rennie
● Jesper S. Møller
● Walter Harley
● Stephan Herrmann
● Dani Megert
● Markus Keller
● Early Access:
– http://wiki.eclipse.org/JDT_Core/Java8
● We invite you to test - defect reports welcome !