The more we work with Java 8, the more we go into the rabbit hole. Did they add all those streams, lambdas, monads, Optionals and CompletableFutures only to confuse us? It surely looks so! And Java 9 that heads our way brings even more of what we like the most, more puzzlers, of course! In this season we as usual have a great batch of the best Java WTF, great jokes to present them and great prizes for the winners!
1. The document introduces the Equinox project template for developing a basic Spring and Struts application called MyUsers.
2. Equinox provides the project structure, dependencies, and build files to quickly set up the environment for development.
3. The tutorial will guide the reader through creating the project using Equinox, configuring Hibernate and Spring, implementing DAOs and business logic, and adding user interface elements with Struts and JSP.
This document discusses testing and testable code. It will cover test driven development, testing, and creating testable code. The speaker will discuss two common pitfalls when doing TDD - acting as a "TDD prophet" or "TDD architect". True TDD practice involves picking a requirement, writing a test for it, making the test fail, writing code to make it pass, and refactoring. Bugs driven tests and creating testable code from the beginning are recommended for learning TDD. Testable code should be declarative, easy to read and test, and promote good design.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them.
Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Baruch Sadogursky
Moar puzzlers! The more we work with Java 8, the more we go into the rabbit hole. Did they add all those streams, lambdas, monads, Optionals and CompletableFutures only to confuse us? It surely looks so! And Java 9 that heads our way brings even more of what we like the most, more puzzlers, of course! In this season we as usual have a great batch of the best Java WTF, great jokes to present them and great prizes for the winners!
You know what to expect by now: funny and puzzling questions about Java 8 and Java 9, JFrog t-shirts are airborne, the usual combo of learning and fun ahead!
This document contains code samples in multiple programming languages, including Cobol, Lolcode, Coldfusion, Ruby, and pseudocode. It shows name processing and validation routines in Cobol, a conversation with pets in Lolcode, formatting currency values for different locales in Coldfusion, making an API request in Ruby, and various functions, loops, flags, and conditions in pseudocode.
Java Puzzlers NG S02: Down the Rabbit Hole as presented at DevNexus 2017Baruch Sadogursky
Moar puzzlers! The more we work with Java 8, the more we go into the rabbit hole. Did they add all those streams, lambdas, monads, Optionals and CompletableFutures only to confuse us? It surely looks so! And Java 9 that heads our way brings even more of what we like the most, more puzzlers, of course! In this season we as usual have a great batch of the best Java WTF, great jokes to present them and great prizes for the winners!
Testing containers with TestContainers @ AJUG 7/18/2017Viktor Gamov
You never know how your application performs once deployed to the production. Sure, you have unit tests, and your test coverage is sky high. However, you might depend on external resources like databases, web services, and distributed caches. Moreover, without a proper integration testing, you cannot be confident about the stability of your production environment. A long time ago, long before the invention of Docker, configuring the environment for integration testing was incredibly complicated and tedious. Developers and Ops were using fake database implementations, mocking servers, and all kinds of weird tricks to implement the environment without the real environment, but it was ugly, bulky, faulty and not cross-platform as well. Thanks to Docker, those days are long gone, now we can quickly prepare the environment with Docker for our tests.
In this talk, I would like to spread the word about awesome project TestContainers – an open source library that exposes API for JUnit tests. It provides lightweight, disposable instances of shared databases, distributed caches or grids, or anything else that can run in a Docker container, all securely and reliably downloaded from your Docker Hub.
1. The document introduces the Equinox project template for developing a basic Spring and Struts application called MyUsers.
2. Equinox provides the project structure, dependencies, and build files to quickly set up the environment for development.
3. The tutorial will guide the reader through creating the project using Equinox, configuring Hibernate and Spring, implementing DAOs and business logic, and adding user interface elements with Struts and JSP.
This document discusses testing and testable code. It will cover test driven development, testing, and creating testable code. The speaker will discuss two common pitfalls when doing TDD - acting as a "TDD prophet" or "TDD architect". True TDD practice involves picking a requirement, writing a test for it, making the test fail, writing code to make it pass, and refactoring. Bugs driven tests and creating testable code from the beginning are recommended for learning TDD. Testable code should be declarative, easy to read and test, and promote good design.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them.
Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...Baruch Sadogursky
Moar puzzlers! The more we work with Java 8, the more we go into the rabbit hole. Did they add all those streams, lambdas, monads, Optionals and CompletableFutures only to confuse us? It surely looks so! And Java 9 that heads our way brings even more of what we like the most, more puzzlers, of course! In this season we as usual have a great batch of the best Java WTF, great jokes to present them and great prizes for the winners!
You know what to expect by now: funny and puzzling questions about Java 8 and Java 9, JFrog t-shirts are airborne, the usual combo of learning and fun ahead!
This document contains code samples in multiple programming languages, including Cobol, Lolcode, Coldfusion, Ruby, and pseudocode. It shows name processing and validation routines in Cobol, a conversation with pets in Lolcode, formatting currency values for different locales in Coldfusion, making an API request in Ruby, and various functions, loops, flags, and conditions in pseudocode.
Java Puzzlers NG S02: Down the Rabbit Hole as presented at DevNexus 2017Baruch Sadogursky
Moar puzzlers! The more we work with Java 8, the more we go into the rabbit hole. Did they add all those streams, lambdas, monads, Optionals and CompletableFutures only to confuse us? It surely looks so! And Java 9 that heads our way brings even more of what we like the most, more puzzlers, of course! In this season we as usual have a great batch of the best Java WTF, great jokes to present them and great prizes for the winners!
Testing containers with TestContainers @ AJUG 7/18/2017Viktor Gamov
You never know how your application performs once deployed to the production. Sure, you have unit tests, and your test coverage is sky high. However, you might depend on external resources like databases, web services, and distributed caches. Moreover, without a proper integration testing, you cannot be confident about the stability of your production environment. A long time ago, long before the invention of Docker, configuring the environment for integration testing was incredibly complicated and tedious. Developers and Ops were using fake database implementations, mocking servers, and all kinds of weird tricks to implement the environment without the real environment, but it was ugly, bulky, faulty and not cross-platform as well. Thanks to Docker, those days are long gone, now we can quickly prepare the environment with Docker for our tests.
In this talk, I would like to spread the word about awesome project TestContainers – an open source library that exposes API for JUnit tests. It provides lightweight, disposable instances of shared databases, distributed caches or grids, or anything else that can run in a Docker container, all securely and reliably downloaded from your Docker Hub.
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
Performance de sites não tem a ver com a linguagem usada por baixo. O impacto maior é a arquitetura. Nesta palestra falo sobre YSlow, Resque e Solr como algumas das coisas que podemos fazer para melhorar a performance/escalabilidade de aplicações web.
Reload da talk anterior com o mesmo nome. Esta talk foi apresentada no Meetup CSS SP #21 apresentando em detalhes como a feature Maps do Sass funciona e quais são suas vantagens em projetos reais.
I love Ruby! But as in any relationship, to love means that you (often) have to accept the “dark side” too! Ruby is human in nature and has a lot of gotchas, tricks, wierdness and sometimes scary features that I plan to highlight. This talk aims to provide the “Ah-ha!” moments when working in Ruby.
This talk is for beginners and experts alike – in fact, I tag slides to mark their level and beginners can choose to tune out of the heavy stuff!
Talk given at PHP World 2015 about the Hack language released by Facebook. A short history and look at it's key features as well as how Hack and PHP are evolving together.
This document discusses quality assurance (QA) for PHP projects. It introduces various QA tools and techniques including syntax checking, documentation, testing, version control and code coverage. Screenshots are provided to illustrate concepts like detecting bugs early, observing behavior and preventing mistakes. The document also includes exercises for attendees to practice setting up version control with Git, running syntax checks with PHP Lint, generating documentation with phpDocumentor, and testing models with PHPUnit.
The Lean Startup approach has led to a proliferation of analytics tools over the past few years, promising faster feedback cycles and better products for our customers. However, many of the tools and approaches apply to the back-end, are slow and inappropriate or cost you an arm and a leg. And then there is Adobe Analytics...
In this talk, Matt will discuss why we need metrics, some approaches to bring the party to the front-end, and some cheap/low-fi solutions to get you dreaming up metrics until your heart is content.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
The document provides an overview of match-3 games and the DukeScript framework. It discusses how DukeScript allows building match-3 games that run on desktop, Android, iOS, and browsers by gluing together a JVM and HTML5 renderer. It covers implementing game logic and view models, responsive layouts using CSS, sprite animation techniques, and submitting apps to the Google Play and Apple App stores.
A few things could be improved in this test:
1. Extract the HTTP client into a dependency rather than creating it directly in the test. This decouples the test from the implementation details of making HTTP requests.
2. Consider using a mock HTTP client in the test to avoid actual network calls. This makes the test faster and isolated.
3. Split the test into two - one for the POST and one for the GET. Having multiple assertions in one test violates the one-assertion-per-test rule and makes the test less readable.
4. Add more validation of the response, e.g. check status codes, response bodies etc. rather than a single assertion.
So in summary
Groovy is a dynamic language for the Java Virtual Machine that aims to be a better Java. It builds upon Java's strengths while adding features inspired by languages like Python, Ruby, and Smalltalk. Groovy compiles to Java bytecode, so it can be used anywhere Java can be used. Groovy reduces boilerplate code through features like closures and method missing. It also supports metaprogramming through techniques like metaclasses that allow modifying classes at runtime. Developers must be aware of some differences from Java like in polymorphism and how GStrings are lazily evaluated.
[DataSciCon] Divide, distribute and conquer stream v. batchViktor Gamov
Data is flowing everywhere around us, from phones, credit cards, sensor-equipped buildings, vending machines, thermostats, trains, buses, planes, posts to social media, digital pictures and video and so on....
http://www.datascicon.tech
[Philly JUG] Divide, Distribute and Conquer: Stream v. BatchViktor Gamov
This document discusses stream processing versus batch processing. It notes that stream processing involves data that is in motion and processed in real-time using streaming platforms and directed acyclic graphs. Batch processing involves data at rest that is processed through queries on the full dataset. The document also discusses challenges of stream processing like out-of-order and late data, and how windowing can provide a finite view of infinite data streams.
Distributed caching for your next node.js project cf summit - 06-15-2017Viktor Gamov
This document discusses using distributed caching for Node.js projects. It describes how caching can improve performance by offloading expensive parts of an application's architecture and enabling scaling out to multiple machines. The document introduces Hazelcast, an open-source in-memory data grid that provides distributed caching and other capabilities. It also promotes following the Twitter account @gamussa for more information and provides a GitHub link for sample code related to using Hazelcast with Cloud Foundry.
Распределяй и властвуй — 2: Потоки данных наносят ответный ударViktor Gamov
Виктор возвращается с продолжением доклада про обработку данных в памяти! На этот раз он противопоставит «потоковый» подход «пакетному». Как мы знаем, информации, зараза, много! Мало того, что её много, так ещё никто не хочет сидеть и ждать, пока Hadoop-кластер посчитает всё. Big Data уже не интересно, Fast Data — наше новое «всё»! Так что же делать, если новые данные всё прибывают и прибывают по каналам связи (через сокет-сервер ли или модную нынче Кафку) ежесекундно (а может, даже и быстрее)? Можно было бы складывать их в какое-нибудь хранилище и считать по ночам MapReduce-ом. Или всё-таки прибегнем к потоковой обработке? У каждого подхода есть свои преимущества и недостатки: как очевидные, так и те, что не всегда лежат на поверхности. После небольшого введения и обзора терминов Виктор на основе примеров кода покажет, как использовать Hazelcast Jet для распределенной обработки потоковых данных.
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017Viktor Gamov
Вы из тех, кто гонится за производительностью, запихивая в любой цикл Collection.parallelStream()? Задумываетесь, как обойтись без глобальной переделки кода и решить все проблемы с помощью большего количества серверов? Как получить распределённую обработку с линейным ростом производительности? Если подобные вопросы звучат у вас в голове, тогда этот доклад для вас. Оказывается, лишь немногие могут запускать Streams в распределенном режиме — Oracle Coherence, Infinispan, Hazelcast Jet — кто-то за деньги, кто-то бесплатно. На примере Hazelcast Jet Виктор расскажет обо всех деталях распределённой обработки. Кроме того, познакомит слушателей со своим другом Ориентированным Ациклическим Графом и покажет, как с его помощью организована обработка информации поверх API Java 8 Stream. Распределенная! Высокопроизводительная! «В памяти»!
[OracleCode - SF] Distributed caching for your next node.js projectViktor Gamov
Caching keeps the data in memory that either slow to calculate or originate from another underlying back-end system. In this presentation, you will see how to leverage Hazelcast as a distributed cache for Node.js applications. Hazelcast is an open source, elastic, self-balancing, self-healing and highly available in-memory computing platform provides fast, reliable access to scalable in-memory data. This hands-on talk will enable you to get started exploring Hazelcast for Node.js and give your project a jump start in speed and scale. In this talk, will be covered: - How distributed caching works in general. - Capabilities of Node.js client. - Real world use cases and best practices.
[OracleCode SF] In memory analytics with apache spark and hazelcastViktor Gamov
Apache Spark is a distributed computation framework optimized to work in-memory, and heavily influenced by concepts from functional programming languages.
Hazelcast - open source in-memory data grid capable of amazing feats of scale - provides wide range of distributed computing primitives computation, including ExecutorService, M/R and Aggregations frameworks.
The nature of data exploration and analysis requires data scientists be able to ask questions that weren't planned to be asked—and get an answer fast!
In this talk, Viktor will explore Spark and see how it works together with Hazelcast to provide a robust in-memory open-source big data analytics solution!
Java 8 introduced the Stream API as a modern, functional, and very powerful tool for processing collections of data. One of the main benefits of the Stream API is that it hides the details of iteration over the underlying data set, allowing for parallel processing within a single JVM, using a fork/join framework. I will talk about a Stream API implementation that enables parallel processing across many machines and many JVMs. With an explanation of internals of the implementation, I will give an introduction to the general design behind stream processing using DAG (directed acyclic graph) engines and how an actor-based implementation can provide in-memory performance while still leveraging industry-wide known frameworks as Java Streams API.
https://www.jfokus.se/jfokus/talks.jsp#RidingtheJetStreams
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017Viktor Gamov
This slide deck discusses distributed data processing using Java 8 Streams and Hazelcast Jet. It provides an overview of Java Streams and their limitations for large datasets. It then introduces Hazelcast IMDG for distributed caching and collections. Hazelcast Jet is presented as a distributed data processing framework built on Hazelcast IMDG that can be used to distribute and parallelize stream processing. Examples of distributed streams and the directed acyclic graph (DAG) model used by Jet are shown.
Needing more performance from your Java applications? Is latency causing you stress? Repetitive loading of the data in applications, burning CPU time, taxing I/O / disk access? Too many applications caching the same data sets pushing the limits of your data management and application architecture? If so, take a look at JCache! This code-driven session demonstrates how to integrate Hazelcast Distributed Caches into your Spring or Java EE applications. Adding a bunch of annotations to a method can achieve an orders-of-magnitude speed improvement in applications with high-latency.
[JokerConf] Верхом на реактивных стримах, 10/13/2016Viktor Gamov
Вы из тех, кто считает, что, распараллелив любой цикл, можно улучшить перформанс, и Collection.parallelStream() — ваш лучший друг? А как вам идея — вбросить ещё пачку машин и получить распределенную обработку? Интересно? Тогда для вас этот доклад обязателен к просмотру.
Виктор познакомит слушателей со своим другом, Ориентированным (Направленным) Ациклическим Графом (или Маркизом?!), и покажет, как с его помощью была организована распределенная высокопроизводительная система обработки информации в памяти поверх нашего знакомого Java 8 Stream API.
Fisl 11 - Dicas de Desenvolvimento Web com RubyFabio Akita
Performance de sites não tem a ver com a linguagem usada por baixo. O impacto maior é a arquitetura. Nesta palestra falo sobre YSlow, Resque e Solr como algumas das coisas que podemos fazer para melhorar a performance/escalabilidade de aplicações web.
Reload da talk anterior com o mesmo nome. Esta talk foi apresentada no Meetup CSS SP #21 apresentando em detalhes como a feature Maps do Sass funciona e quais são suas vantagens em projetos reais.
I love Ruby! But as in any relationship, to love means that you (often) have to accept the “dark side” too! Ruby is human in nature and has a lot of gotchas, tricks, wierdness and sometimes scary features that I plan to highlight. This talk aims to provide the “Ah-ha!” moments when working in Ruby.
This talk is for beginners and experts alike – in fact, I tag slides to mark their level and beginners can choose to tune out of the heavy stuff!
Talk given at PHP World 2015 about the Hack language released by Facebook. A short history and look at it's key features as well as how Hack and PHP are evolving together.
This document discusses quality assurance (QA) for PHP projects. It introduces various QA tools and techniques including syntax checking, documentation, testing, version control and code coverage. Screenshots are provided to illustrate concepts like detecting bugs early, observing behavior and preventing mistakes. The document also includes exercises for attendees to practice setting up version control with Git, running syntax checks with PHP Lint, generating documentation with phpDocumentor, and testing models with PHPUnit.
The Lean Startup approach has led to a proliferation of analytics tools over the past few years, promising faster feedback cycles and better products for our customers. However, many of the tools and approaches apply to the back-end, are slow and inappropriate or cost you an arm and a leg. And then there is Adobe Analytics...
In this talk, Matt will discuss why we need metrics, some approaches to bring the party to the front-end, and some cheap/low-fi solutions to get you dreaming up metrics until your heart is content.
PHP has its own treasure chest of classic mistakes that surprises even the most seasoned expert : code that dies just by changing its namespace, strpos() that fails to find strings or arrays that changes without touching them. Do that get on your nerves too ? Let’s make a list of them, so we can always teach them to the new guys, spot them during code reviews and kick them out of our code once and for all. Come on, you’re not frightening us !
The document provides an overview of match-3 games and the DukeScript framework. It discusses how DukeScript allows building match-3 games that run on desktop, Android, iOS, and browsers by gluing together a JVM and HTML5 renderer. It covers implementing game logic and view models, responsive layouts using CSS, sprite animation techniques, and submitting apps to the Google Play and Apple App stores.
A few things could be improved in this test:
1. Extract the HTTP client into a dependency rather than creating it directly in the test. This decouples the test from the implementation details of making HTTP requests.
2. Consider using a mock HTTP client in the test to avoid actual network calls. This makes the test faster and isolated.
3. Split the test into two - one for the POST and one for the GET. Having multiple assertions in one test violates the one-assertion-per-test rule and makes the test less readable.
4. Add more validation of the response, e.g. check status codes, response bodies etc. rather than a single assertion.
So in summary
Groovy is a dynamic language for the Java Virtual Machine that aims to be a better Java. It builds upon Java's strengths while adding features inspired by languages like Python, Ruby, and Smalltalk. Groovy compiles to Java bytecode, so it can be used anywhere Java can be used. Groovy reduces boilerplate code through features like closures and method missing. It also supports metaprogramming through techniques like metaclasses that allow modifying classes at runtime. Developers must be aware of some differences from Java like in polymorphism and how GStrings are lazily evaluated.
[DataSciCon] Divide, distribute and conquer stream v. batchViktor Gamov
Data is flowing everywhere around us, from phones, credit cards, sensor-equipped buildings, vending machines, thermostats, trains, buses, planes, posts to social media, digital pictures and video and so on....
http://www.datascicon.tech
[Philly JUG] Divide, Distribute and Conquer: Stream v. BatchViktor Gamov
This document discusses stream processing versus batch processing. It notes that stream processing involves data that is in motion and processed in real-time using streaming platforms and directed acyclic graphs. Batch processing involves data at rest that is processed through queries on the full dataset. The document also discusses challenges of stream processing like out-of-order and late data, and how windowing can provide a finite view of infinite data streams.
Distributed caching for your next node.js project cf summit - 06-15-2017Viktor Gamov
This document discusses using distributed caching for Node.js projects. It describes how caching can improve performance by offloading expensive parts of an application's architecture and enabling scaling out to multiple machines. The document introduces Hazelcast, an open-source in-memory data grid that provides distributed caching and other capabilities. It also promotes following the Twitter account @gamussa for more information and provides a GitHub link for sample code related to using Hazelcast with Cloud Foundry.
Распределяй и властвуй — 2: Потоки данных наносят ответный ударViktor Gamov
Виктор возвращается с продолжением доклада про обработку данных в памяти! На этот раз он противопоставит «потоковый» подход «пакетному». Как мы знаем, информации, зараза, много! Мало того, что её много, так ещё никто не хочет сидеть и ждать, пока Hadoop-кластер посчитает всё. Big Data уже не интересно, Fast Data — наше новое «всё»! Так что же делать, если новые данные всё прибывают и прибывают по каналам связи (через сокет-сервер ли или модную нынче Кафку) ежесекундно (а может, даже и быстрее)? Можно было бы складывать их в какое-нибудь хранилище и считать по ночам MapReduce-ом. Или всё-таки прибегнем к потоковой обработке? У каждого подхода есть свои преимущества и недостатки: как очевидные, так и те, что не всегда лежат на поверхности. После небольшого введения и обзора терминов Виктор на основе примеров кода покажет, как использовать Hazelcast Jet для распределенной обработки потоковых данных.
[JBreak] Блеск И Нищета Распределенных Стримов - 04-04-2017Viktor Gamov
Вы из тех, кто гонится за производительностью, запихивая в любой цикл Collection.parallelStream()? Задумываетесь, как обойтись без глобальной переделки кода и решить все проблемы с помощью большего количества серверов? Как получить распределённую обработку с линейным ростом производительности? Если подобные вопросы звучат у вас в голове, тогда этот доклад для вас. Оказывается, лишь немногие могут запускать Streams в распределенном режиме — Oracle Coherence, Infinispan, Hazelcast Jet — кто-то за деньги, кто-то бесплатно. На примере Hazelcast Jet Виктор расскажет обо всех деталях распределённой обработки. Кроме того, познакомит слушателей со своим другом Ориентированным Ациклическим Графом и покажет, как с его помощью организована обработка информации поверх API Java 8 Stream. Распределенная! Высокопроизводительная! «В памяти»!
[OracleCode - SF] Distributed caching for your next node.js projectViktor Gamov
Caching keeps the data in memory that either slow to calculate or originate from another underlying back-end system. In this presentation, you will see how to leverage Hazelcast as a distributed cache for Node.js applications. Hazelcast is an open source, elastic, self-balancing, self-healing and highly available in-memory computing platform provides fast, reliable access to scalable in-memory data. This hands-on talk will enable you to get started exploring Hazelcast for Node.js and give your project a jump start in speed and scale. In this talk, will be covered: - How distributed caching works in general. - Capabilities of Node.js client. - Real world use cases and best practices.
[OracleCode SF] In memory analytics with apache spark and hazelcastViktor Gamov
Apache Spark is a distributed computation framework optimized to work in-memory, and heavily influenced by concepts from functional programming languages.
Hazelcast - open source in-memory data grid capable of amazing feats of scale - provides wide range of distributed computing primitives computation, including ExecutorService, M/R and Aggregations frameworks.
The nature of data exploration and analysis requires data scientists be able to ask questions that weren't planned to be asked—and get an answer fast!
In this talk, Viktor will explore Spark and see how it works together with Hazelcast to provide a robust in-memory open-source big data analytics solution!
Java 8 introduced the Stream API as a modern, functional, and very powerful tool for processing collections of data. One of the main benefits of the Stream API is that it hides the details of iteration over the underlying data set, allowing for parallel processing within a single JVM, using a fork/join framework. I will talk about a Stream API implementation that enables parallel processing across many machines and many JVMs. With an explanation of internals of the implementation, I will give an introduction to the general design behind stream processing using DAG (directed acyclic graph) engines and how an actor-based implementation can provide in-memory performance while still leveraging industry-wide known frameworks as Java Streams API.
https://www.jfokus.se/jfokus/talks.jsp#RidingtheJetStreams
[NYJavaSig] Riding the Distributed Streams - Feb 2nd, 2017Viktor Gamov
This slide deck discusses distributed data processing using Java 8 Streams and Hazelcast Jet. It provides an overview of Java Streams and their limitations for large datasets. It then introduces Hazelcast IMDG for distributed caching and collections. Hazelcast Jet is presented as a distributed data processing framework built on Hazelcast IMDG that can be used to distribute and parallelize stream processing. Examples of distributed streams and the directed acyclic graph (DAG) model used by Jet are shown.
Needing more performance from your Java applications? Is latency causing you stress? Repetitive loading of the data in applications, burning CPU time, taxing I/O / disk access? Too many applications caching the same data sets pushing the limits of your data management and application architecture? If so, take a look at JCache! This code-driven session demonstrates how to integrate Hazelcast Distributed Caches into your Spring or Java EE applications. Adding a bunch of annotations to a method can achieve an orders-of-magnitude speed improvement in applications with high-latency.
[JokerConf] Верхом на реактивных стримах, 10/13/2016Viktor Gamov
Вы из тех, кто считает, что, распараллелив любой цикл, можно улучшить перформанс, и Collection.parallelStream() — ваш лучший друг? А как вам идея — вбросить ещё пачку машин и получить распределенную обработку? Интересно? Тогда для вас этот доклад обязателен к просмотру.
Виктор познакомит слушателей со своим другом, Ориентированным (Направленным) Ациклическим Графом (или Маркизом?!), и покажет, как с его помощью была организована распределенная высокопроизводительная система обработки информации в памяти поверх нашего знакомого Java 8 Stream API.
JavaOne 2013: «Java and JavaScript - Shaken, Not Stirred»Viktor Gamov
There is a perception in the Java community that JavaScript is a second-league interpreted language with the main purpose of making Web pages a little prettier. But JavaScript is a powerful, flexible, dynamically typed language. And today language has been experiencing its a revival driven by the interest in HTML5. Nashorn is a modern JavaScript engine available on JVM, and it’s already included with JDK8 builds. This presentation is about building polyglot application with Java and JavaScript.
WebSockets: The Current State of the Most Valuable HTML5 API for Java DevelopersViktor Gamov
WebSockets provide a standardized way for web browsers and servers to establish two-way communications channels over a single TCP connection. They allow for more efficient real-time messaging compared to older techniques like polling and long-polling. The WebSocket API defines client-side and server-side interfaces that allow for full-duplex communications that some popular Java application servers and web servers support natively. Common use cases that benefit from WebSockets include chat applications, online games, and real-time updating of social streams.
Functional UI testing of Adobe Flex RIAViktor Gamov
The document discusses functional UI testing of Adobe Flex applications. It covers why testing is important, common testing approaches like unit testing and GUI testing, and automated testing tools for Flex like HP QTP, Selenium, Ranorex, and FlexMonkey. It also discusses best practices for creating test-friendly applications and instrumenting custom components and events to facilitate automated testing.
Testing Flex RIAs for NJ Flex user groupViktor Gamov
Why to test?
● Automation testing and tools overview
● Flex Automation 101
○ Flex Automation Framework building blocks ○ How to prepare you components for
automation testing
● Using FlexMonkey for testing custom
components
The Role of DevOps in Digital Transformation.pdfmohitd6
DevOps plays a crucial role in driving digital transformation by fostering a collaborative culture between development and operations teams. This approach enhances the speed and efficiency of software delivery, ensuring quicker deployment of new features and updates. DevOps practices like continuous integration and continuous delivery (CI/CD) streamline workflows, reduce manual errors, and increase the overall reliability of software systems. By leveraging automation and monitoring tools, organizations can improve system stability, enhance customer experiences, and maintain a competitive edge. Ultimately, DevOps is pivotal in enabling businesses to innovate rapidly, respond to market changes, and achieve their digital transformation goals.
Photoshop Tutorial for Beginners (2024 Edition)alowpalsadig
Photoshop Tutorial for Beginners (2024 Edition)
Explore the evolution of programming and software development and design in 2024. Discover emerging trends shaping the future of coding in our insightful analysis."
Here's an overview:Introduction: The Evolution of Programming and Software DevelopmentThe Rise of Artificial Intelligence and Machine Learning in CodingAdopting Low-Code and No-Code PlatformsQuantum Computing: Entering the Software Development MainstreamIntegration of DevOps with Machine Learning: MLOpsAdvancements in Cybersecurity PracticesThe Growth of Edge ComputingEmerging Programming Languages and FrameworksSoftware Development Ethics and AI RegulationSustainability in Software EngineeringThe Future Workforce: Remote and Distributed TeamsConclusion: Adapting to the Changing Software Development LandscapeIntroduction: The Evolution of Programming and Software Development
Photoshop Tutorial for Beginners (2024 Edition)Explore the evolution of programming and software development and design in 2024. Discover emerging trends shaping the future of coding in our insightful analysis."Here's an overview:Introduction: The Evolution of Programming and Software DevelopmentThe Rise of Artificial Intelligence and Machine Learning in CodingAdopting Low-Code and No-Code PlatformsQuantum Computing: Entering the Software Development MainstreamIntegration of DevOps with Machine Learning: MLOpsAdvancements in Cybersecurity PracticesThe Growth of Edge ComputingEmerging Programming Languages and FrameworksSoftware Development Ethics and AI RegulationSustainability in Software EngineeringThe Future Workforce: Remote and Distributed TeamsConclusion: Adapting to the Changing Software Development LandscapeIntroduction: The Evolution of Programming and Software Development
The importance of developing and designing programming in 2024
Programming design and development represents a vital step in keeping pace with technological advancements and meeting ever-changing market needs. This course is intended for anyone who wants to understand the fundamental importance of software development and design, whether you are a beginner or a professional seeking to update your knowledge.
Course objectives:
1. **Learn about the basics of software development:
- Understanding software development processes and tools.
- Identify the role of programmers and designers in software projects.
2. Understanding the software design process:
- Learn about the principles of good software design.
- Discussing common design patterns such as Object-Oriented Design.
3. The importance of user experience (UX) in modern software:
- Explore how user experience can improve software acceptance and usability.
- Tools and techniques to analyze and improve user experience.
4. Increase efficiency and productivity through modern development tools:
- Access to the latest programming tools and languages used in the industry.
- Study live examples of applications
Building API data products on top of your real-time data infrastructureconfluent
This talk and live demonstration will examine how Confluent and Gravitee.io integrate to unlock value from streaming data through API products.
You will learn how data owners and API providers can document, secure data products on top of Confluent brokers, including schema validation, topic routing and message filtering.
You will also see how data and API consumers can discover and subscribe to products in a developer portal, as well as how they can integrate with Confluent topics through protocols like REST, Websockets, Server-sent Events and Webhooks.
Whether you want to monetize your real-time data, enable new integrations with partners, or provide self-service access to topics through various protocols, this webinar is for you!
What’s new in VictoriaMetrics - Q2 2024 UpdateVictoriaMetrics
These slides were presented during the virtual VictoriaMetrics User Meetup for Q2 2024.
Topics covered:
1. VictoriaMetrics development strategy
* Prioritize bug fixing over new features
* Prioritize security, usability and reliability over new features
* Provide good practices for using existing features, as many of them are overlooked or misused by users
2. New releases in Q2
3. Updates in LTS releases
Security fixes:
● SECURITY: upgrade Go builder from Go1.22.2 to Go1.22.4
● SECURITY: upgrade base docker image (Alpine)
Bugfixes:
● vmui
● vmalert
● vmagent
● vmauth
● vmbackupmanager
4. New Features
* Support SRV URLs in vmagent, vmalert, vmauth
* vmagent: aggregation and relabeling
* vmagent: Global aggregation and relabeling
* vmagent: global aggregation and relabeling
* Stream aggregation
- Add rate_sum aggregation output
- Add rate_avg aggregation output
- Reduce the number of allocated objects in heap during deduplication and aggregation up to 5 times! The change reduces the CPU usage.
* Vultr service discovery
* vmauth: backend TLS setup
5. Let's Encrypt support
All the VictoriaMetrics Enterprise components support automatic issuing of TLS certificates for public HTTPS server via Let’s Encrypt service: https://docs.victoriametrics.com/#automatic-issuing-of-tls-certificates
6. Performance optimizations
● vmagent: reduce CPU usage when sharding among remote storage systems is enabled
● vmalert: reduce CPU usage when evaluating high number of alerting and recording rules.
● vmalert: speed up retrieving rules files from object storages by skipping unchanged objects during reloading.
7. VictoriaMetrics k8s operator
● Add new status.updateStatus field to the all objects with pods. It helps to track rollout updates properly.
● Add more context to the log messages. It must greatly improve debugging process and log quality.
● Changee error handling for reconcile. Operator sends Events into kubernetes API, if any error happened during object reconcile.
See changes at https://github.com/VictoriaMetrics/operator/releases
8. Helm charts: charts/victoria-metrics-distributed
This chart sets up multiple VictoriaMetrics cluster instances on multiple Availability Zones:
● Improved reliability
● Faster read queries
● Easy maintenance
9. Other Updates
● Dashboards and alerting rules updates
● vmui interface improvements and bugfixes
● Security updates
● Add release images built from scratch image. Such images could be more
preferable for using in environments with higher security standards
● Many minor bugfixes and improvements
● See more at https://docs.victoriametrics.com/changelog/
Also check the new VictoriaLogs PlayGround https://play-vmlogs.victoriametrics.com/
DECODING JAVA THREAD DUMPS: MASTER THE ART OF ANALYSISTier1 app
Are you ready to unlock the secrets hidden within Java thread dumps? Join us for a hands-on session where we'll delve into effective troubleshooting patterns to swiftly identify the root causes of production problems. Discover the right tools, techniques, and best practices while exploring *real-world case studies of major outages* in Fortune 500 enterprises. Engage in interactive lab exercises where you'll have the opportunity to troubleshoot thread dumps and uncover performance issues firsthand. Join us and become a master of Java thread dump analysis!
Stork Product Overview: An AI-Powered Autonomous Delivery FleetVince Scalabrino
Imagine a world where instead of blue and brown trucks dropping parcels on our porches, a buzzing drove of drones delivered our goods. Now imagine those drones are controlled by 3 purpose-built AI designed to ensure all packages were delivered as quickly and as economically as possible That's what Stork is all about.
Secure-by-Design Using Hardware and Software Protection for FDA ComplianceICS
This webinar explores the “secure-by-design” approach to medical device software development. During this important session, we will outline which security measures should be considered for compliance, identify technical solutions available on various hardware platforms, summarize hardware protection methods you should consider when building in security and review security software such as Trusted Execution Environments for secure storage of keys and data, and Intrusion Detection Protection Systems to monitor for threats.
A Comprehensive Guide on Implementing Real-World Mobile Testing Strategies fo...kalichargn70th171
In today's fiercely competitive mobile app market, the role of the QA team is pivotal for continuous improvement and sustained success. Effective testing strategies are essential to navigate the challenges confidently and precisely. Ensuring the perfection of mobile apps before they reach end-users requires thoughtful decisions in the testing plan.
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio, Inc.
Alluxio Webinar
June. 18, 2024
For more Alluxio Events: https://www.alluxio.io/events/
Speaker:
- Jianjian Xie (Staff Software Engineer, Alluxio)
As Trino users increasingly rely on cloud object storage for retrieving data, speed and cloud cost have become major challenges. The separation of compute and storage creates latency challenges when querying datasets; scanning data between storage and compute tiers becomes I/O bound. On the other hand, cloud API costs related to GET/LIST operations and cross-region data transfer add up quickly.
The newly introduced Trino file system cache by Alluxio aims to overcome the above challenges. In this session, Jianjian will dive into Trino data caching strategies, the latest test results, and discuss the multi-level caching architecture. This architecture makes Trino 10x faster for data lakes of any scale, from GB to EB.
What you will learn:
- Challenges relating to the speed and costs of running Trino in the cloud
- The new Trino file system cache feature overview, including the latest development status and test results
- A multi-level cache framework for maximized speed, including Trino file system cache and Alluxio distributed cache
- Real-world cases, including a large online payment firm and a top ridesharing company
- The future roadmap of Trino file system cache and Trino-Alluxio integration
Hands-on with Apache Druid: Installation & Data Ingestion StepsservicesNitor
Supercharge your analytics workflow with https://bityl.co/Qcuk Apache Druid's real-time capabilities and seamless Kafka integration. Learn about it in just 14 steps.
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid
IBM watsonx Code Assistant for Z, our latest Generative AI-assisted mainframe application modernization solution. Mainframe (IBM Z) application modernization is a topic that every mainframe client is addressing to various degrees today, driven largely from digital transformation. With generative AI comes the opportunity to reimagine the mainframe application modernization experience. Infusing generative AI will enable speed and trust, help de-risk, and lower total costs associated with heavy-lifting application modernization initiatives. This document provides an overview of the IBM watsonx Code Assistant for Z which uses the power of generative AI to make it easier for developers to selectively modernize COBOL business services while maintaining mainframe qualities of service.
Implementing Odoo, a robust and all-inclusive business management software, can significantly improve your organisation. To get the most out of it and ensure a smooth implementation, it is important to have a strategic plan. This blog shares some essential tips to help you with successful Odoo ERP implementation. From planning and customisation to training and support, this blog outlines some expert advice that will guide you through the process confidently. It is true that adopting a new software can be challenging, and hence, this post has tailored these tips to help you avoid common mistakes and achieve the best results. Whether you run a small business or a large enterprise, these tips will help you streamline operations, boost productivity, and drive growth. Whether you are new to Odoo or looking to improve your current setup, it is essential to learn the key strategies for a successful Odoo implementation. Implementing Odoo doesn’t have to be difficult. With the right approach and guidance, you can use this software to elevate your business. Read on to discover the secrets of a successful Odoo implementation.
Why is successful Odoo implementation crucial?
Implementing Odoo effectively can transform your business by making processes smoother, increasing efficiency, and providing useful insights. It helps align your operations with best practices, boosting productivity and aiding better decision-making. A well-executed implementation ensures you get the most out of your investment, while a poor one can cause disruptions, higher costs, and frustration among employees.
Hyperledger Besu 빨리 따라하기 (Private Networks)wonyong hwang
Hyperledger Besu의 Private Networks에서 진행하는 실습입니다. 주요 내용은 공식 문서인https://besu.hyperledger.org/private-networks/tutorials 의 내용에서 발췌하였으며, Privacy Enabled Network와 Permissioned Network까지 다루고 있습니다.
This is a training session at Hyperledger Besu's Private Networks, with the main content excerpts from the official document besu.hyperledger.org/private-networks/tutorials and even covers the Private Enabled and Permitted Networks.
Superpower Your Apache Kafka Applications Development with Complementary Open...Paul Brebner
Kafka Summit talk (Bangalore, India, May 2, 2024, https://events.bizzabo.com/573863/agenda/session/1300469 )
Many Apache Kafka use cases take advantage of Kafka’s ability to integrate multiple heterogeneous systems for stream processing and real-time machine learning scenarios. But Kafka also exists in a rich ecosystem of related but complementary stream processing technologies and tools, particularly from the open-source community. In this talk, we’ll take you on a tour of a selection of complementary tools that can make Kafka even more powerful. We’ll focus on tools for stream processing and querying, streaming machine learning, stream visibility and observation, stream meta-data, stream visualisation, stream development including testing and the use of Generative AI and LLMs, and stream performance and scalability. By the end you will have a good idea of the types of Kafka “superhero” tools that exist, which are my favourites (and what superpowers they have), and how they combine to save your Kafka applications development universe from swamploads of data stagnation monsters!
Nashik's top web development company, Upturn India Technologies, crafts innovative digital solutions for your success. Partner with us and achieve your goals
Why Apache Kafka Clusters Are Like Galaxies (And Other Cosmic Kafka Quandarie...Paul Brebner
Closing talk for the Performance Engineering track at Community Over Code EU (Bratislava, Slovakia, June 5 2024) https://eu.communityovercode.org/sessions/2024/why-apache-kafka-clusters-are-like-galaxies-and-other-cosmic-kafka-quandaries-explored/ Instaclustr (now part of NetApp) manages 100s of Apache Kafka clusters of many different sizes, for a variety of use cases and customers. For the last 7 years I’ve been focused outwardly on exploring Kafka application development challenges, but recently I decided to look inward and see what I could discover about the performance, scalability and resource characteristics of the Kafka clusters themselves. Using a suite of Performance Engineering techniques, I will reveal some surprising discoveries about cosmic Kafka mysteries in our data centres, related to: cluster sizes and distribution (using Zipf’s Law), horizontal vs. vertical scalability, and predicting Kafka performance using metrics, modelling and regression techniques. These insights are relevant to Kafka developers and operators.
Boost Your Savings with These Money Management AppsJhone kinadey
A money management app can transform your financial life by tracking expenses, creating budgets, and setting financial goals. These apps offer features like real-time expense tracking, bill reminders, and personalized insights to help you save and manage money effectively. With a user-friendly interface, they simplify financial planning, making it easier to stay on top of your finances and achieve long-term financial stability.
36. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
37. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
A. IllegalArgumentException – can’t create semaphore with negative
38. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
A. IllegalArgumentException – can’t create semaphore with negative
B. UnsupportedOperationException – can’t drain when negative
39. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
A. IllegalArgumentException – can’t create semaphore with negative
B. UnsupportedOperationException – can’t drain when negative
C. 0
40. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
A. IllegalArgumentException – can’t create semaphore with negative
B. UnsupportedOperationException – can’t drain when negative
C. 0
D. -42
41. public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
A. IllegalArgumentException – can’t create semaphore with negative
B. UnsupportedOperationException – can’t drain when negative
C. 0
D. -42
45. A. IllegalArgumentException – can’t create semaphore with negative
B. UnsupportedOperationException – can’t drain when negative
C. 0
D. -42
public class PerfectRobbery {
private Semaphore bankAccount = new Semaphore(-42);
public static void main(String[] args) {
PerfectRobbery perfectRobbery = new PerfectRobbery();
perfectRobbery.takeAllMoney();
perfectRobbery.checkBalance();
}
public void takeAllMoney(){
bankAccount.drainPermits();
}
public void checkBalance(){
System.out.println(bankAccount.availablePermits());
}
}
55. A. true/true
B. true/false
C. false/true
Collections.emptyList() == Collections.emptyList();
Collections.emptyIterator() == Collections.emptyIterator();
@gamussa #PhillyETE
56. A. true/true
B. true/false
C. false/true
D. false/false
Collections.emptyList() == Collections.emptyList();
Collections.emptyIterator() == Collections.emptyIterator();
@gamussa #PhillyETE
57. A. true/true
B. true/false
C. false/true
D. false/false
Collections.emptyList() == Collections.emptyList();
Collections.emptyIterator() == Collections.emptyIterator();
@gamussa #PhillyETE
63. A. true/true
B. true/false
C. false/true
Spliterators.emptySpliterator() == Spliterators.emptySpliterator();
Stream.empty() == Stream.empty();
64. A. true/true
B. true/false
C. false/true
D. false/false
Spliterators.emptySpliterator() == Spliterators.emptySpliterator();
Stream.empty() == Stream.empty();
65. A. true/true
B. true/false
C. false/true
D. false/false
Spliterators.emptySpliterator() == Spliterators.emptySpliterator();
Stream.empty() == Stream.empty();
68. A. true/true
B. true/false
C. false/true
D. false/false
Spliterators.emptySpliterator() == Spliterators.emptySpliterator();
Stream.empty() == Stream.empty();
@gamussa #PhillyETE
73. ”Identical”
1. Has the same state
2. Not related to “equals and hashcode” contract
3. Not related to references to objects in
memory
@gamussa #PhillyETE
74. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
@gamussa #PhillyETE
75. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
A. Absolutely identical empty lists
@gamussa #PhillyETE
76. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
A. Absolutely identical empty lists
B. Absolutely identical non-empty lists
@gamussa #PhillyETE
77. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
A. Absolutely identical empty lists
B. Absolutely identical non-empty lists
C. Non-identical empty lists
@gamussa #PhillyETE
78. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
A. Absolutely identical empty lists
B. Absolutely identical non-empty lists
C. Non-identical empty lists
D. Non-identical non-empty lists
@gamussa #PhillyETE
79. List[] twins = new List[2];
Arrays.setAll(twins, ArrayList::new);
A. Absolutely identical empty lists
B. Absolutely identical non-empty lists
C. Non-identical empty lists
D. Non-identical non-empty lists
@gamussa #PhillyETE
88. A. WTF?! ’Single’ means one, not three!
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
89. A. WTF?! ’Single’ means one, not three!
B. Problem is with partyHard(T), remove it and it will work
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
90. A. WTF?! ’Single’ means one, not three!
B. Problem is with partyHard(T), remove it and it will work
C. Problem is the drinkIn methods, removing one of them and it will
work
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
91. A. WTF?! ’Single’ means one, not three!
B. Problem is with partyHard(T), remove it and it will work
C. Problem is the drinkIn methods, removing one of them and it will
work
D. It will work fine! Both partyHard() and drinkIn() are merged in
SingleAndHappy, leaving one abstract method
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
92. A. WTF?! ’Single’ means one, not three!
B. Problem is with partyHard(T), remove it and it will work
C. Problem is the drinkIn methods, removing one of them and it will
work
D. It will work fine! Both partyHard() and drinkIn() are merged in
SingleAndHappy, leaving one abstract method
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
93.
94.
95. A. WTF?! ’Single’ means one, not three!
B. Problem is with partyHard(T), remove it and it will work
C. Problem are the drinkIn methods, removing it will leave one
abstract method
D. Yes! Both partyHard() and drinkIn() are merged in SingleAndHappy,
leaving one abstract method
public interface Single<T> {
default void partyHard(String songName) { System.out.println(songName); }
void partyHard(T songName);
void drinkIn(T drinkName);
void drinkIn(String dringName);
}
@FunctionalInterface
public interface SingleAndHappy extends Single<String> { }
@gamussa #PhillyETE
98. Hacking the bank
☑Bank software written in Java
☑Hack into it
☑Analyze the accounts
@gamussa #PhillyETE
99. Given the code above, which statement is wrong:
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
100. Given the code above, which statement is wrong:
A. The Set is ordered by hashcode
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
101. Given the code above, which statement is wrong:
A. The Set is ordered by hashcode
B. The order is predictable across multiple runs of the JVM on the same machine
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
102. Given the code above, which statement is wrong:
A. The Set is ordered by hashcode
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
103. Given the code above, which statement is wrong:
A. The Set is ordered by hashcode
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
104. Given the code above, which statement is wrong:
A. The Set is ordered by hashcode
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
105.
106.
107. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts= new HashSet<>(Arrays.asList("Gates", "Buffett", "Bezos", "Zuckerberg"));
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
111. Given the code above, which statement is wrong:
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
112. Given the code above, which statement is wrong:
A. The Set is ordered
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
113. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
114. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
115. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
116. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
120. Given the code above, which statement is wrong:
A. The Set is ordered
B. The order is predictable across multiple runs of the JVM on the same machine
C. The order of elements in Set is not predictable
D. Statements A & B are correct
Set<String> accounts = Set.of("Gates", "Buffett", "Bezos", "Zuckerberg");
System.out.println(”accounts= " + accounts);
@gamussa #PhillyETE
121. private int probe(Object pe) {
int idx = Math.floorMod(pe.hashCode() ^ SALT,
elements.length);
while (true) {
E ee = elements[idx];
if (ee == null) {
return -idx - 1;
} else if (pe.equals(ee)) {
return idx;
} else if (++idx == elements.length) {
idx = 0;
}
}
}
@gamussa #PhillyETE
125. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
@gamussa #PhillyETE
126. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
B. If one of the dependencies was converted to a module,
you have to declare it in module-info in order to use
@gamussa #PhillyETE
127. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
B. If one of the dependencies was converted to a module,
you have to declare it in module-info in order to use
C. Once you added the module-info to your project you
have to declare the dependencies twice, in classpath
and in module-info
@gamussa #PhillyETE
128. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
B. If one of the dependencies was converted to a module,
you have to declare it in module-info in order to use
C. Once you added the module-info to your project you
have to declare the dependencies twice, in classpath
and in module-info
D. None of the above
@gamussa #PhillyETE
129. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
B. If one of the dependencies was converted to a module,
you have to declare it in module-info in order to use
C. Once you added the module-info to your project you
have to declare the dependencies twice, in classpath
and in module-info
D. None of the above
@gamussa #PhillyETE
130.
131.
132. What’s correct?
A. If you convert your application to module, classpath
dependencies will still be resolved correctly
B. If one of the dependencies was converted to a module,
you have to declare it in module-info in order to use
C. Once you added the module-info to your project you
have to declare the dependencies twice, in classpath
and in module-info
D. None of the above
@gamussa #PhillyETE
137. A. You killed them all
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
138. A. You killed them all
B. You killed only even ones
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
139. A. You killed them all
B. You killed only even ones
C. They all survived
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
140. A. You killed them all
B. You killed only even ones
C. They all survived
D. You killed only odd ones
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
141. A. You killed them all
B. You killed only even ones
C. They all survived
D. You killed only odd ones
E. All answers are correct
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
142. A. You killed them all
B. You killed only even ones
C. They all survived
D. You killed only odd ones
E. All answers are correct
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
145. A. You killed them all
B. You killed only even ones
C. They all survived
D. You killed only odd ones
E. All answers are correct
static void killThemAll(Collection<Hero> expendables) {
Iterator<Hero> heroes = expendables.iterator();
heroes.forEachRemaining(e -> {
if (heroes.hasNext()) {
heroes.next();
heroes.remove();
}
});
System.out.println(expendables);
}
156. A. Both work just fine
@FunctionalInterface
public interface OriginalPredicate<T> {
boolean test(T t);
}
OriginalPredicate<Object> lambda = (Object obj) -> "adidas".equals(obj);
OriginalPredicate<Object> methodRef = "adidas"::equals;
157. A. Both work just fine
B. Lambda works, method ref fails
@FunctionalInterface
public interface OriginalPredicate<T> {
boolean test(T t);
}
OriginalPredicate<Object> lambda = (Object obj) -> "adidas".equals(obj);
OriginalPredicate<Object> methodRef = "adidas"::equals;
158. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
@FunctionalInterface
public interface OriginalPredicate<T> {
boolean test(T t);
}
OriginalPredicate<Object> lambda = (Object obj) -> "adidas".equals(obj);
OriginalPredicate<Object> methodRef = "adidas"::equals;
159. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
D. Won’t compile
@FunctionalInterface
public interface OriginalPredicate<T> {
boolean test(T t);
}
OriginalPredicate<Object> lambda = (Object obj) -> "adidas".equals(obj);
OriginalPredicate<Object> methodRef = "adidas"::equals;
160. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
D. Won’t compile
@FunctionalInterface
public interface OriginalPredicate<T> {
boolean test(T t);
}
OriginalPredicate<Object> lambda = (Object obj) -> "adidas".equals(obj);
OriginalPredicate<Object> methodRef = "adidas"::equals;
161.
162.
163. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
D. Not a functional interface, will fail on annotation processing
@FunctionalInterface
public interface CopyCatPredicate {
<T> boolean test(T t);
}
CopyCatPredicate lambda = (Object obj) -> "adadas".equals(obj);
CopyCatPredicate methodRef = "adadas"::equals;
164. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
D. Not a functional interface, will fail on annotation processing
@FunctionalInterface
public interface CopyCatPredicate {
<T> boolean test(T t);
}
CopyCatPredicate lambda = (Object obj) -> "adadas".equals(obj);
CopyCatPredicate methodRef = "adadas"::equals;
165.
166.
167.
168. A. Both work just fine
B. Lambda works, method ref fails
C. Method ref works, lambda fails
D. Not a functional interface, will fail on annotation processing
@FunctionalInterface
public interface CopyCatPredicate {
<T> boolean test(T t);
}
CopyCatPredicate lambda = (Object obj) -> "adadas".equals(obj);
CopyCatPredicate methodRef = "adadas"::equals;
190. filter(new TreeSet<>()::add) filter(i -> new TreeSet<>().add(i))!=
New instance is
created every time!
Instance method is
created once!
@gamussa #PhillyETE
199. A. obvious / obvious
B. obvious / NullPointerException
C. NullPointerException / obvious
D. NullPointerException / NullPointerException
Optional.of("obvious").orElseGet(null);
Optional.empty().map(null).orElse("obvious");
@gamussa #PhillyETE
200. A. obvious / obvious
B. obvious / NullPointerException
C. NullPointerException / obvious
D. NullPointerException / NullPointerException
Optional.of("obvious").orElseGet(null);
Optional.empty().map(null).orElse("obvious");
Will never happen
@gamussa #PhillyETE
201. A. obvious / obvious
B. obvious / NullPointerException
C. NullPointerException / obvious
D. NullPointerException / NullPointerException
Optional.of("obvious").orElseGet(null);
Optional.empty().map(null).orElse("obvious");
Will never happen
Will never happen
@gamussa #PhillyETE
202. A. obvious / obvious
B. obvious / NullPointerException
C. NullPointerException / obvious
D. NullPointerException / NullPointerException
Optional.of("obvious").orElseGet(null);
Optional.empty().map(null).orElse("obvious");
Will never happen
Will never happen
@gamussa #PhillyETE
224. Reuse is only possible for pure functions
@gamussa #PhillyETE
225. Reuse is only possible for pure functions
Consumers accept parameters ==
have state
@gamussa #PhillyETE
226. Reuse is only possible for pure functions
Consumers accept parameters ==
have state
Supplier in 4 has state – the
resolved method reference
@gamussa #PhillyETE