A short introduction (with many examples) to the Scala programming language and also an introduction to using the Play! Framework for modern, safe, efffcient and reactive web applications.
Asynchronous web apps with the Play Framework 2.0Oscar Renalias
This document discusses Play's asynchronous capabilities for building scalable and responsive web applications. It begins by explaining the traditional blocking request processing model and Play's asynchronous non-blocking model. It then covers asynchronous requests using Futures and Promises in Play. Examples are provided for making actions asynchronous using asynchronous responses. The document also discusses reactive IO in Play using Enumerators and Iteratees for non-blocking streaming of data. Real world use cases for asynchronous programming include asynchronous web services, streaming files and data, and websockets.
This document discusses asynchronous I/O in Java and Scala using the Play Framework. It describes how LinkedIn uses a service-oriented architecture with hundreds of services making requests to each other. It then covers how Play supports non-blocking I/O using asynchronous code, promises, and futures to allow parallel requests without blocking threads. Key points covered include using map and flatMap to transform promises and futures, handling errors and timeouts, and the benefits of non-blocking I/O for scalability.
Akka is using the Actors together with STM to create a unified runtime and programming model for scaling both UP (multi-core) and OUT (grid/cloud). Akka provides location transparency by abstracting away both these tangents of scalability by turning them into an ops task. This gives the Akka runtime freedom to do adaptive automatic load-balancing, cluster rebalancing, replication & partitioning
Node.js vs Play Framework (with Japanese subtitles)Yevgeniy Brikman
Video: http://www.nicovideo.jp/watch/1410857293
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This version of the presentation has Japanese subtitles. For the English only version, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework
This document discusses using Akka and actors for building scalable and concurrent applications in Scala. It introduces actors as fundamental units of computation that communicate asynchronously via message passing. Akka provides tools for creating actor systems and hierarchies. The document uses a monitoring application called Scotchdog as an example, with actors to represent services that are monitored by a watchdog actor. It describes how messages are used to start, stop and check services, and how the watchdog can aggregate status from child actors. The document also briefly mentions using Akka's scheduler and finite state machines to implement more complex actor behaviors.
Futures allow asynchronous and non-blocking operations in Scala. They represent a value that may be available in the future. Promises allow producing values for futures - a promise can be used to complete a future with a value. Futures can be composed using methods like map, flatMap, and recover to build asynchronous workflows. Callbacks allow non-blocking handling of future results.
This document discusses common misconceptions around Java EE concurrency and provides best practices for asynchronous and parallel programming in Java EE. It covers improper uses of threads, thread pools, and synchronization, and recommends using message-driven beans, Java EE singleton beans, asynchronous methods, and the fork/join framework as better alternatives. The document also provides code examples and discusses transaction management, load balancing, and throughput.
1. Akka is a toolkit for building concurrent and distributed applications on the JVM based on the actor model.
2. Actors communicate asynchronously by message passing and each actor processes one message at a time in its mailbox.
3. Akka provides features for concurrency, distribution, and fault-tolerance through actors, remoting, and supervision.
This document provides an overview of servlets and JSPs. It discusses how servlets were developed to address disadvantages of CGI programs. Servlets run within a web container and have a lifecycle of init(), service(), and destroy() methods. The document also covers implementing a simple servlet, using HttpServletRequest and HttpServletResponse objects, and configuring servlets in web.xml. It describes how JSPs work by being converted to servlets and discusses JSP directives, actions, and scripting elements.
This document provides an overview of building a Scala web application using the Play! framework. It begins with introductions to Scala and the Play! framework. It then covers topics like request handling, views, forms, database integration, the build system, internationalization, and testing. Exercises are provided to demonstrate creating routes, controllers, actions, views, forms, database models and more. The presenter is available to answer questions after the session and provides information on open positions at their company Lucid Software.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
System Integration with Akka and Apache Camelkrasserm
This document summarizes the Apache Camel integration framework and how it can be used with Akka actors. Camel provides a domain-specific language and components for integration patterns and protocols. Akka actors handle asynchronous message processing and can be used as Camel consumers and producers through Akka-Camel integration. Consumer actors receive messages from Camel endpoints, while producer actors send messages to endpoints. Actor components allow actors to be used directly in Camel routes.
This slide shows you how to use Akka cluster in Java.
Source Code: https://github.com/jiayun/akka_samples
If you want to use the links in slide, please download the pdf file.
DISQUS is a comment system that handles high volumes of traffic, with up to 17,000 requests per second and 250 million monthly visitors. They face challenges in unpredictable spikes in traffic and ensuring high availability. Their architecture includes over 100 servers split between web servers, databases, caching, and load balancing. They employ techniques like vertical and horizontal data partitioning, atomic updates, delayed signals, consistent caching, and feature flags to scale their large Django application.
Scala is an alternative JVM language with both object-oriented and functional programming paradigms. Scala development with the Java EE 7 platform is definitely possible and can be a pleasant experience. If you have uncertainty about how Scala can fit around the Java EE 7 platform, then this session aims to illustrate the huge benefit that Scala adoption can bring to the platform. Many other developers are taking advantage and the challenge of the JVM’s capability of being a vessel for multi-language programming. You no longer have to write every single project using Java, even if you like Lambdas experiences. For the developer and engineering terms that feeling a little braver than usual, Scala is attractive as it is strongly typed and lets you set the gauge on how object oriented or how functional you want to be. You will learn how to reuse the annotations and creating Scala plain object safely and concisely. This session will highlight and contrast the experience I had developing Scala solutions with Java EE, and there will be plenty of advice about using the functional programming features against the Java object oriented API.
Scala language overview
Java EE 7 architecture and design
WildFly 8 application server
Using Gradle as a build tool
How to create beans in Scala with dependency injection
JAX-RS endpoints
Servlet Endpoints
JMS Messaging
Scala adoption advice and hints for sustainable team development
This document summarizes advanced Akka features presented by Martin Kanters and Johan Janssen. It covers local and remote actors, scheduling, clustering, routing, cluster singletons, sharding, persistence, Akka HTTP, and finite state machines. The presentation introduces these features and provides examples to illustrate how they can be used with Akka.
ave time learning on your own. Start Building with React, MongoDB, Express, & Node. The MERN Stack.
Learning a new JavaScript framework is difficult. You can spend weeks learning new concepts. If an online example doesn’t work, you may spend countless hours Googling, searching Stack Overflow and blogs for the solution.
Take the fast track and learn from an experienced Senior Software Engineer and professional instructor!
About this Course
This highly interactive course features a large amount of student labs and hands-on coding. You will be taught how to assemble the complete stack required to build a modern web app using React.js, MongoDB (a NoSQL database) and Express (a framework for web application servers). This course will also cover many other tools that go into building a complete web application: React Router, React-Bootstrap, Redux, Babel, and Webpack.
What You Will Learn
• How to use modern JavaScript features
• Webpack
• Node & Express
• Reading and writing data to a MongoDB database
• Babel
• React
• State Management with Redux
• Mongoose
• And More!
The document provides an introduction to Typesafe Activator and the Play Framework. It discusses how Activator is a tool that helps developers get started with the Typesafe Reactive Platform and Play applications. It also covers some core features of Play like routing, templates, assets, data access with Slick and JSON, and concurrency with Futures, Actors, and WebSockets.
Java EE 6 CDI Integrates with Spring & JSFJiayun Zhou
This document discusses integrating Java Contexts and Dependency Injection (CDI) with other Java technologies like Spring and JavaServer Faces (JSF). It covers CDI concepts like the Inversion of Control pattern and dependency injection. It also provides examples of using CDI with Spring, integrating CDI and JSF, and using CDI interceptors. The document recommends some libraries for CDI integration and provides sample code links.
Don't Wait! Develop Responsive Applications with Java EE7 InsteadWASdev Community
The document discusses how to develop responsive applications with Java EE7. It focuses on using asynchronous processing and non-blocking I/O to maximize throughput and handle many requests. Key technologies discussed include JAX-RS 2.0 asynchronous processing, the Concurrency Utilities, the WebSocket API, and non-blocking I/O in Servlet 3.1. Code examples are provided for implementing asynchronous processing using these different Java EE 7 technologies.
This document provides an overview of core web application development using servlets and JSPs. It discusses what servlets and JSPs are, their lifecycles, how they interact with clients, and why they are useful for enterprise application development. Servlets are Java programs that handle requests and responses, while JSPs make it easier for designers and developers to work together by separating template data from dynamic content generation code. The document outlines the initialization, execution, and destruction phases of the servlet and JSP lifecycles, and how JSPs are translated into servlets. It also covers request parameters, sessions, JSP elements like directives and scripting tags, implicit objects, and variable scopes in J
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...Magneta AI
Антон Кириллов, Zeptolab (Москва)
Доклад посвящен обзору ключевых технологий стека Typesafe и анализу ключевых преимуществ и недостатков на примере реального проекта:
* Действительно ли Scala - “более лучшая” Java? Что следует знать, начиная внедрять Scala.
* Play Framework: больше чем просто контейнер. Архитектура и возможности.
* Доступ к базам данных: библиотеки и подходы, эволюция схемы БД во времени
* Actors: безболезненная многопоточность!
* Simple Build Tool: не совсем simple, но крайне функциональный инструмент автоматической сборки.
Рассматриваемые технологии позволяют “из коробки” начать создавать прототипы веб-приложений за очень короткое время и в дальнейшем наращивать их функционал. Тем не менее, из-за молодости стека существует большое количество “граблей”, о которых следует знать, принимая решение об использовании данного набора технологий.
The document provides an overview of the Play framework, a stateless and non-blocking web application framework for Java and Scala. It discusses key aspects of Play including its goals of being developer-friendly, fully compiled and type-safe, integration of JSON and other features. It also contrasts stateful versus stateless web application architectures and threaded versus event-driven web servers. Finally, it covers setting up a new Play project, project structure and running a Play application.
Futures allow asynchronous and non-blocking operations in Scala. They represent a value that may be available in the future. Promises allow producing values for futures - a promise can be used to complete a future with a value. Futures can be composed using methods like map, flatMap, and recover to build asynchronous workflows. Callbacks allow non-blocking handling of future results.
This document discusses common misconceptions around Java EE concurrency and provides best practices for asynchronous and parallel programming in Java EE. It covers improper uses of threads, thread pools, and synchronization, and recommends using message-driven beans, Java EE singleton beans, asynchronous methods, and the fork/join framework as better alternatives. The document also provides code examples and discusses transaction management, load balancing, and throughput.
1. Akka is a toolkit for building concurrent and distributed applications on the JVM based on the actor model.
2. Actors communicate asynchronously by message passing and each actor processes one message at a time in its mailbox.
3. Akka provides features for concurrency, distribution, and fault-tolerance through actors, remoting, and supervision.
This document provides an overview of servlets and JSPs. It discusses how servlets were developed to address disadvantages of CGI programs. Servlets run within a web container and have a lifecycle of init(), service(), and destroy() methods. The document also covers implementing a simple servlet, using HttpServletRequest and HttpServletResponse objects, and configuring servlets in web.xml. It describes how JSPs work by being converted to servlets and discusses JSP directives, actions, and scripting elements.
This document provides an overview of building a Scala web application using the Play! framework. It begins with introductions to Scala and the Play! framework. It then covers topics like request handling, views, forms, database integration, the build system, internationalization, and testing. Exercises are provided to demonstrate creating routes, controllers, actions, views, forms, database models and more. The presenter is available to answer questions after the session and provides information on open positions at their company Lucid Software.
Full stack development with node and NoSQL - All Things Open - October 2017Matthew Groves
What is different about this generation of web applications? A solid development approach must consider latency, throughput, and interactivity demanded by users users across mobile devices, web browsers, and IoT. These applications often use NoSQL to support a flexible data model and easy scalability required for modern development.
A full stack application (composed of Couchbase, WebAPI, Angular2, and ASP.NET/ASP.NET Core) will be demonstrated in this session. The individual parts of a stack may vary, but the overall design is the focus.
JavaFX 2 and Scala - Like Milk and Cookies (33rd Degrees)Stephen Chin
JavaFX 2.0 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2.0 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the benefits of using JavaFX 2.0 together with the Scala programming language to provide a type-safe declarative syntax with support for lazy bindings and collections. Advanced language features, such as DelayedInit and @specialized will be discussed, as will ways of forcing prioritization of implicit conversions for n-level cases. Those who survive the pure technical geekiness of this talk will be rewarded with plenty of JavaFX UI eye candy.
System Integration with Akka and Apache Camelkrasserm
This document summarizes the Apache Camel integration framework and how it can be used with Akka actors. Camel provides a domain-specific language and components for integration patterns and protocols. Akka actors handle asynchronous message processing and can be used as Camel consumers and producers through Akka-Camel integration. Consumer actors receive messages from Camel endpoints, while producer actors send messages to endpoints. Actor components allow actors to be used directly in Camel routes.
This slide shows you how to use Akka cluster in Java.
Source Code: https://github.com/jiayun/akka_samples
If you want to use the links in slide, please download the pdf file.
DISQUS is a comment system that handles high volumes of traffic, with up to 17,000 requests per second and 250 million monthly visitors. They face challenges in unpredictable spikes in traffic and ensuring high availability. Their architecture includes over 100 servers split between web servers, databases, caching, and load balancing. They employ techniques like vertical and horizontal data partitioning, atomic updates, delayed signals, consistent caching, and feature flags to scale their large Django application.
Scala is an alternative JVM language with both object-oriented and functional programming paradigms. Scala development with the Java EE 7 platform is definitely possible and can be a pleasant experience. If you have uncertainty about how Scala can fit around the Java EE 7 platform, then this session aims to illustrate the huge benefit that Scala adoption can bring to the platform. Many other developers are taking advantage and the challenge of the JVM’s capability of being a vessel for multi-language programming. You no longer have to write every single project using Java, even if you like Lambdas experiences. For the developer and engineering terms that feeling a little braver than usual, Scala is attractive as it is strongly typed and lets you set the gauge on how object oriented or how functional you want to be. You will learn how to reuse the annotations and creating Scala plain object safely and concisely. This session will highlight and contrast the experience I had developing Scala solutions with Java EE, and there will be plenty of advice about using the functional programming features against the Java object oriented API.
Scala language overview
Java EE 7 architecture and design
WildFly 8 application server
Using Gradle as a build tool
How to create beans in Scala with dependency injection
JAX-RS endpoints
Servlet Endpoints
JMS Messaging
Scala adoption advice and hints for sustainable team development
This document summarizes advanced Akka features presented by Martin Kanters and Johan Janssen. It covers local and remote actors, scheduling, clustering, routing, cluster singletons, sharding, persistence, Akka HTTP, and finite state machines. The presentation introduces these features and provides examples to illustrate how they can be used with Akka.
ave time learning on your own. Start Building with React, MongoDB, Express, & Node. The MERN Stack.
Learning a new JavaScript framework is difficult. You can spend weeks learning new concepts. If an online example doesn’t work, you may spend countless hours Googling, searching Stack Overflow and blogs for the solution.
Take the fast track and learn from an experienced Senior Software Engineer and professional instructor!
About this Course
This highly interactive course features a large amount of student labs and hands-on coding. You will be taught how to assemble the complete stack required to build a modern web app using React.js, MongoDB (a NoSQL database) and Express (a framework for web application servers). This course will also cover many other tools that go into building a complete web application: React Router, React-Bootstrap, Redux, Babel, and Webpack.
What You Will Learn
• How to use modern JavaScript features
• Webpack
• Node & Express
• Reading and writing data to a MongoDB database
• Babel
• React
• State Management with Redux
• Mongoose
• And More!
The document provides an introduction to Typesafe Activator and the Play Framework. It discusses how Activator is a tool that helps developers get started with the Typesafe Reactive Platform and Play applications. It also covers some core features of Play like routing, templates, assets, data access with Slick and JSON, and concurrency with Futures, Actors, and WebSockets.
Java EE 6 CDI Integrates with Spring & JSFJiayun Zhou
This document discusses integrating Java Contexts and Dependency Injection (CDI) with other Java technologies like Spring and JavaServer Faces (JSF). It covers CDI concepts like the Inversion of Control pattern and dependency injection. It also provides examples of using CDI with Spring, integrating CDI and JSF, and using CDI interceptors. The document recommends some libraries for CDI integration and provides sample code links.
Don't Wait! Develop Responsive Applications with Java EE7 InsteadWASdev Community
The document discusses how to develop responsive applications with Java EE7. It focuses on using asynchronous processing and non-blocking I/O to maximize throughput and handle many requests. Key technologies discussed include JAX-RS 2.0 asynchronous processing, the Concurrency Utilities, the WebSocket API, and non-blocking I/O in Servlet 3.1. Code examples are provided for implementing asynchronous processing using these different Java EE 7 technologies.
This document provides an overview of core web application development using servlets and JSPs. It discusses what servlets and JSPs are, their lifecycles, how they interact with clients, and why they are useful for enterprise application development. Servlets are Java programs that handle requests and responses, while JSPs make it easier for designers and developers to work together by separating template data from dynamic content generation code. The document outlines the initialization, execution, and destruction phases of the servlet and JSP lifecycles, and how JSPs are translated into servlets. It also covers request parameters, sessions, JSP elements like directives and scripting tags, implicit objects, and variable scopes in J
Scala, Play Framework и SBT для быстрого прототипирования и разработки веб-пр...Magneta AI
Антон Кириллов, Zeptolab (Москва)
Доклад посвящен обзору ключевых технологий стека Typesafe и анализу ключевых преимуществ и недостатков на примере реального проекта:
* Действительно ли Scala - “более лучшая” Java? Что следует знать, начиная внедрять Scala.
* Play Framework: больше чем просто контейнер. Архитектура и возможности.
* Доступ к базам данных: библиотеки и подходы, эволюция схемы БД во времени
* Actors: безболезненная многопоточность!
* Simple Build Tool: не совсем simple, но крайне функциональный инструмент автоматической сборки.
Рассматриваемые технологии позволяют “из коробки” начать создавать прототипы веб-приложений за очень короткое время и в дальнейшем наращивать их функционал. Тем не менее, из-за молодости стека существует большое количество “граблей”, о которых следует знать, принимая решение об использовании данного набора технологий.
The document provides an overview of the Play framework, a stateless and non-blocking web application framework for Java and Scala. It discusses key aspects of Play including its goals of being developer-friendly, fully compiled and type-safe, integration of JSON and other features. It also contrasts stateful versus stateless web application architectures and threaded versus event-driven web servers. Finally, it covers setting up a new Play project, project structure and running a Play application.
Este documento proporciona información sobre los requerimientos y horarios académicos para los estudiantes de cuarto año básico de la semana del 6 al 10 de junio en el Colegio Camilo Henríquez. Incluye detalles sobre los libros, materiales y horarios requeridos para cada asignatura, así como enlaces de recursos adicionales en línea. También presenta el calendario de evaluaciones para el mes de junio.
This document discusses different types of pronouns in English including relative pronouns like that, which, who, whom, whose, whichever, whoever. It also covers demonstrative pronouns in singular and plural forms like this, these, that, those. Finally, it mentions reflexive pronouns in singular and plural like myself, ourselves, yourself, yourselves, himself, themselves, herself, itself.
Recruit, Retain, Realize - How Third Party Transactional Data Can Power Your ...Doug Oldfield
This presentation provides an overview of many types of commercial B2C data on the market as well as how and when to use each type. We also cover how special and unique transactional data is and how this type of data can be incredibly powerful in predicting response.
Presentation at DevFest 2012 about Javascript development in AngularJS with design api using Apiary.io and best practices from 1y experience at Jobs.cz
A look at how organizations can use social listening and analysis as input into their social media and business strategies. Shares case studies, use cases, and processes.
El documento es un informativo semanal para los padres de un curso de sexto básico. Informa sobre los requerimientos y actividades de la próxima semana, incluyendo el aniversario del colegio el jueves y viernes, las asignaturas y temas que se verán, los materiales necesarios, y las evaluaciones programadas. También incluye información sobre nivelación, biblioteca virtual, y horarios de atención de los profesores.
This 3 sentence document describes a comic book created by student 807 for a lesson 4 reading assignment. The comic book was based on Alice's Adventures in Wonderland and was created in October 2014.
My presentation at the DMU-hosted seminar [held on 8 December 2011] on THE ASSAULT ON UNIVERSITIES: Privatisation, Secrecy and the Future of Higher Education.
The Play Framework is a web framework for Java and Scala that provides a lightweight and scalable architecture built on Akka. It allows for the creation of RESTful applications with non-blocking I/O and real-time capabilities. Play embraces modern web technologies and includes features for persistence, security, internationalization and more.
The FREon Decay Experiment (FREDE) team from Wroclaw University of Technology in Poland plans to launch a payload into the stratosphere via rocket or balloon to study Freon decay phenomena in the ozone layer. The experiment would examine the chemical processes of Freon decay and collect data on factors like pressure and temperature at different layers of the stratosphere. The team has developed the on-board systems architecture and mechanical design for the stratospheric payload and has undergone training for the REXUS/BEXUS program launch.
This document proposes a gamification system for LinkedIn Groups to encourage more user participation. It details:
- Current low levels of member participation in groups
- A scoring system that awards points for positive contributions and deducts for negative actions
- Plans to test different scoring algorithms and display user contribution levels and top contributor status
- Goals of increasing unique users and page views in groups by encouraging more contributions
- Potential future expansions like moderating low-scoring members and different experiences for top contributors
The document proposes an idea for a website called GiveAndGet.com that functions as an online community and information exchange portal. It would allow members to help each other by sharing transportation via ridesharing, finding accommodations for holidays, exchanging coupons for shopping, and accessing other services. The site aims to help people live more consciously, cleverly, and environmentally friendly. It would operate through members registering and participating in topical communities while leveraging opportunities for business through advertising and sponsored services.
Este documento proporciona recomendaciones para mejorar la conversión, fomentar la adopción, aumentar la participación de los usuarios y las ventas cruzadas en eBay. Las sugerencias incluyen utilizar subtítulos y opciones de letra en los anuncios, imágenes de alta calidad, información sobre el vendedor, programas de fidelización y recordatorios de correo electrónico. También recomienda analizar las palabras clave, incluir titulares descriptivos y una barra de navegación para mejorar la experiencia del usuario.
Webinar Netwrix: Individuare & Indagare comportamenti anomali degli utenti con visibilità a 360°, introduzione a Netwrix Auditor 8.5, l’unica piattaforma di governance, sicurezza e visibilità completa per ambienti hybrid cloud
iPEP is a platform that allows users to organize both physical and electronic files in one place, making it easy to find information stored in different locations. It combines paper filing methodology with web technology to retrieve files online or offline within seconds. The document discusses iPEP subscription plans, including individual access for $197 per year or network access for multiple users and projects starting at $447 for setup. Becoming an iPEP specialist is also mentioned.
Multimodal Residual Learning for Visual QANamHyuk Ahn
Multimodal Residual Network (MRN) extends residual learning to visual question answering to achieve state-of-the-art results. MRN introduces shortcut connections between question and image embeddings to avoid degradation from very deep networks. Evaluation shows MRN outperforms stacked attention networks and improves with increased depth up to 3 blocks. Implicit attention maps reveal spatial focus without weighted sums.
BCS SPA 2010 - An Introduction to Scala for Java DevelopersMiles Sabin
This document provides an introduction to Scala for Java developers. It outlines how Scala cleans up Java syntax by making semi-colons optional, using == for equals and eq for reference equality, and allowing periods to be omitted. It also describes how Scala goes beyond Java by supporting features like case classes, pattern matching, named and default arguments, and mixin composition with traits. The document provides examples of using these features and explains how Scala seamlessly interoperates with Java.
An Introduction to Scala for Java DevelopersMiles Sabin
The document provides an introduction to Scala for Java developers. It outlines key features of Scala including cleaning up Java syntax, going beyond Java with features like case classes, traits, and pattern matching, and its functional focus including support for higher-order functions, the Option type, and for comprehensions. The document also briefly discusses the Scala IDE for Eclipse.
The document discusses Scala, a programming language designed to be scalable. It can be used for both small and large programs. Scala combines object-oriented and functional programming. It interoperates seamlessly with Java but allows developers to add new constructs like actors through libraries. The Scala community is growing, with industrial adoption starting at companies like Twitter.
This document provides an introduction to Scala for Java developers. It discusses that Scala is a hybrid object-oriented and functional language that runs on the JVM and interoperates well with Java. It highlights several features of Scala that allow for more concise code compared to Java, such as type inference, expressions instead of statements, higher-order functions, and case classes.
An Introduction to Scala - Blending OO and Functional ParadigmsMiles Sabin
Scala is a programming language that blends object-oriented and functional programming. It is designed to be compatible with Java and runs on the JVM. Scala has features like functions as first-class values, pattern matching, and immutable data structures. It aims to improve on Java syntax and provides tools like case classes and for comprehensions. Scala sees growing adoption in companies like Twitter and LinkedIn and future releases will continue to explore new type systems and features.
This document provides an introduction to Scala concepts and features compared to Java, including how to set up Scala, the Simple Build Tool (SBT), case classes, lazy definitions, imports, objects, pattern matching, collections, higher-order functions, partial functions, currying, implicit conversions, and implicit parameters. Useful Scala resources are also listed.
Java is an object-oriented language like C++ that is interpreted, garbage collected, and can be compiled. It was designed to be portable, distributed, multithreaded, and robust. Key features include interfaces that allow unrelated classes to satisfy requirements, events and listeners for event-driven programming, reflection for introspection and metaprogramming, and a large library of packages.
Java is an object-oriented language like C++ that is interpreted, garbage collected, and can be compiled. It was designed to be portable, distributed, multithreaded, and robust. Key features include interfaces that allow unrelated classes to satisfy requirements, events and listeners for event-driven programming, reflection for introspection and dynamic behavior, and a large library of packages.
Java is an object-oriented programming language created by James Gosling at Sun Microsystems in 1995. It is platform independent, meaning programs written in Java can run on any system that supports Java without needing to be recompiled. The document provides an overview of Java, including its history and development, basic concepts like classes and objects, and how to write simple Java programs. It also discusses Java's advantages like being simple, object-oriented, portable, multithreaded, and secure.
Scala and jvm_languages_praveen_technologistpmanvi
Scala is a programming language for the Java Virtual Machine that combines object-oriented and functional programming concepts. It is fully interoperable with Java code and libraries. Scala aims to be more concise and expressive than Java by allowing both object-oriented and functional programming styles. Experts have praised Scala for its ability to solve many of Java's design issues like verbosity. Scala provides features like case classes, pattern matching, XML literals, and functional collections that reduce boilerplate code compared to Java.
A Brief Introduction to Scala for Java DevelopersMiles Sabin
Scala is a programming language that blends object-oriented and functional programming styles. It is designed to interoperate with Java code and runs on the Java Virtual Machine. Some key features of Scala include case classes, pattern matching, traits for mixing functionality, and immutable data structures. Scala code compiles to Java bytecode, allowing seamless use of Java libraries and tools.
Miles Sabin Introduction To Scala For Java DevelopersSkills Matter
Scala is a programming language that blends object-oriented and functional programming styles. It is designed to interoperate with Java code and runs on the Java Virtual Machine. Some key features of Scala include case classes, pattern matching, traits for mixing behavior, and immutable data structures. Scala code compiles to Java bytecode, allowing seamless use of Java libraries and tools.
This document summarizes Martin Odersky's talk about the past, present, and future of the Scala programming language over the next 5 years. It discusses Scala's growth in popularity and adoption from 2003-2009. It also outlines new features in the 2.8 version including improved collections, package objects, named parameters, and improved tooling. Finally, it discusses focus areas for the next 5 years including improved concurrency, parallelism, static typing, and language abstractions to support reliable concurrent programming.
Martin Odersky discusses the past, present, and future of Scala over the past 5 years and next 5 years. Key points include:
- Scala has grown significantly in usage and community over the past 6 years since its first release.
- Scala 2.8 will include improvements like new collections, package objects, named/default parameters, and better tool support.
- Over the next 5 years, Scala will focus on improving concurrency and parallelism through better abstractions, analyses, and static typing support.
Martin Odersky outlines the growth and adoption of Scala over the past 6 years and discusses Scala's future direction over the next 5 years. Key points include:
- Scala has grown from its first classroom use in 2003 to filling a full day of talks at JavaOne in 2009 and developing a large user community.
- Scala 2.8 will include new collections, package objects, named/default parameters, and improved tool support.
- Over the next 5 years, Scala will focus on concurrency and parallelism features at all levels from primitives to tools.
- Other areas of focus include extended libraries, performance improvements, and standardized compiler plugin architecture.
Scala 2.8 will include improvements to collections, package objects, named and default parameters, and faster generics through specialization. Over the next 5 years, focus will be on concurrency and parallelism at all levels. Better tools like an improved REPL and IDE integration are also planned. The essence of Scala is concentrating on powerful abstractions to reduce boilerplate and allow powerful libraries.
This document discusses functional programming languages Scala and Clojure that run on the Java Virtual Machine (JVM). It provides an overview of what functional programming is, why it is becoming more important with multi-core processors, and why developing new languages on the JVM is advantageous due to its existing investments and performance. Specific details are given about Clojure, including how it has tight integration with Java and the JVM, uses immutable collections and lazy sequences, and provides primitives for concurrency. Scala is described as a functional language that is fast, expressive, and statically typed with features like traits, pattern matching, and XML literals. The document concludes that as developers we should choose the right tools for our
The document discusses Scala and why some developers think it could replace Java on the JVM. It provides quotes from several influential developers, including the creator of Java and Groovy, expressing their view that Scala is the best candidate to replace Java in the long run. Specifically, James Gosling says that if he had to pick another language on the JVM besides Java, it would be Scala. Charlie Nutter describes Scala as the current heir apparent to the Java throne and the momentum behind Scala is now unquestionable. James Strachan says that if he had seen the Programming in Scala book in 2003, he may have never created Groovy and that his tip for a long term replacement for Java is
JavaScript is evolving with the addition of modules, platform consistency, and harmony features. Modules allow JavaScript code to be organized and avoid naming collisions. CommonJS and AMD module formats are used widely. Platform consistency is improved through polyfills that mimic future APIs for older browsers. Harmony brings language-level modules and features like destructuring assignment, default parameters, and promises to JavaScript. Traceur compiles Harmony code to existing JavaScript.
The document compares the J2EE and .NET platforms, providing a layer-by-layer comparison of their infrastructures. It discusses similarities and differences in areas like runtime systems, object models, statements, exceptions, base classes, multithreading, deployment, component models, and database access. Key similarities include support for interfaces, inheritance, namespaces/packages, and reflection APIs. Differences include .NET's unified treatment of value and reference types and support for attributes, indexers, and operator overloading.
O documento discute a técnica de aprendizado de máquina chamada rotulação automática para prever tags em documentos. Ele apresenta três exemplos de algoritmos de aprendizado de máquina que podem ser usados: regressão linear, árvore de decisão e Naive Bayes. O documento também discute como lidar com problemas de aprendizado de máquina multi-rótulo.
First steps with Keras 2: A tutorial with ExamplesFelipe
In this presentation, we give a brief introduction to Keras and Neural networks, and use examples to explain how to build and train neural network models using this framework.
Talk given as part of an event by Rio Machine Learning Meetup.
Word embeddings introdução, motivação e exemplosFelipe
O documento apresenta uma introdução aos word embeddings, motivando sua utilização para representar palavras de forma distribuída e de baixa dimensionalidade. Explica como os modelos de linguagem neurais treinam embeddings de forma não supervisionada e como o Word2Vec tornou esse treinamento mais eficiente através de otimizações. Finalmente, discute aplicações e trabalhos futuros com embeddings.
This document provides an overview of popular cloud computing certifications from Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), and vendor-neutral certifications. It describes the purpose and requirements for certifications like AWS Certified Solutions Architect - Associate, MCSA: Cloud Platform, GCP Cloud Architect, and CompTIA Cloud+. The document also notes that certifications focus on roles like cloud architect, software engineer, and DevOps engineer, and that newer certifications address specific cloud aspects such as security and analytics.
This document provides an overview of using Elasticsearch for data analytics. It discusses various aggregation techniques in Elasticsearch like terms, min/max/avg/sum, cardinality, histogram, date_histogram, and nested aggregations. It also covers mappings, dynamic templates, and general tips for working with aggregations. The main takeaways are that aggregations in Elasticsearch provide insights into data distributions and relationships similarly to GROUP BY in SQL, and that mappings and templates can optimize how data is indexed for aggregation purposes.
Cloudwatch: Monitoring your Services with Metrics and AlarmsFelipe
CloudWatch is AWS's monitoring and metrics service that collects data from AWS services and allows users to set alarms and view metrics. It collects both built-in metrics provided by AWS services as well as custom metrics defined by users. CloudWatch allows viewing metrics and setting alarms in the console, through APIs, and via integration with other AWS services. It provides visibility into applications and infrastructure to help with decisions around capacity planning and troubleshooting.
Cloudwatch: Monitoring your AWS services with Metrics and AlarmsFelipe
Brief intro to AWS Cloudwatch. Motivation, examples and use cases. Shows how you can collect and monitors metrics for all your AWS services to better control your applications and infrastructure. #cloud-computing #aws #amazon-web-services
Online Machine Learning: introduction and examplesFelipe
In this talk I introduce the topic of Online Machine Learning, which deals with techniques for doing machine learning in an online setting, i.e. where you train your model a few examples at a time, rather than using the full dataset (off-line learning).
Aws cost optimization: lessons learned, strategies, tips and toolsFelipe
A couple of useful resources that may help you lower your AWS bill at the end of the month. Includes AWS Resources, Third-party Solutions and general tips and lessons learned.
Exemplos de uso de apache spark usando aws elastic map reduceFelipe
[1] O documento apresenta exemplos de uso do Apache Spark no AWS Elastic MapReduce (EMR), incluindo processamento em batch e streaming de dados. [2] Inclui detalhes sobre a criação de clusters no EMR e execução de códigos Spark tanto em modo batch quanto streaming. [3] Apresenta exemplos de códigos Spark para contagem de palavras em batch e contagem de tweets em streaming que podem ser executados no EMR.
Pré processamento de grandes dados com Apache SparkFelipe
O documento apresenta o framework Apache Spark para pré-processamento de grandes dados, abordando conceitos como RDDs, DataFrames, UDFs e a biblioteca Spark ML. É demonstrado um estudo de caso completo de pré-processamento de um conjunto de dados de reviews da Amazon contendo 82 milhões de registros.
Hadoop MapReduce and Apache Spark on EMR: comparing performance for distribut...Felipe
O documento compara o desempenho do Hadoop MapReduce e do Apache Spark para cargas de trabalho distribuídas, usando duas tarefas: wordcount distribuído em um conjunto de dados de 18GB e clusterização K-means em um conjunto de dados de livros da Amazon de 15GB. O Spark mostrou desempenho superior, especialmente para tarefas iterativas como K-means. A configuração correta é importante para o desempenho, e o Spark se beneficiou da alocação dinâmica de recursos.
Boas práticas no desenvolvimento de softwareFelipe
Um pequeno conjunto de boas práticas para o desenvolvimento de software. O conteúdo é recomendado para desenvolvedores iniciantes ou intermediários. O foco é em desenvolvimento Web, baseado em Sistemas de Informação, com uma linguagem fracamente tipada. Os exemplos são dados na linguagem PHP.
Introducing Rachinations, a game execution engine and Ruby-based DSL that can be used to test out game designs and evaluate hypotheses and analyze gameplay. It is an implementation of Dr. J. Dormans' Machinations framework for game design.
Conceitos e exemplos em versionamento de códigoFelipe
Uma pequena apresentação dedicada a expôr desenvolvedores a conceitos e termos relacionados ao controle de versão de código em projetos de software; essa é uma prática essencial no desenvolvimento de software com a qual todos os desenvolvedores se depararão no decorrer de suas carreiras.
DevOps Series: Extending vagrant with Puppet for configuration managementFelipe
This is a short presentation on the reasons why you would augment your Vagrant installation with a full-fledged provisioner like Puppet and some examples of basic things you can do with it.
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrantFelipe
Vagrant allows users to define reproducible and testable machine configurations using configuration files. It supports various operating systems and virtualization providers. The document outlines the basics of using Vagrant, including adding base boxes, creating Vagrantfiles to define configurations, provisioning machines, and commonly used commands. It is useful for developers who need consistent environments or who configure machines for others.
A small presentation with some quick explanation of what D3.js is and a few examples of what it can do for you. It can be used for a quick presentation (20-30 mins) after which you should have an idea of whether you can use D3.js for your project.
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPathCommunity
Join this UiPath Community Berlin meetup to explore the Orchestrator API, Swagger interface, and the Test Manager API. Learn how to leverage these tools to streamline automation, enhance testing, and integrate more efficiently with UiPath. Perfect for developers, testers, and automation enthusiasts!
📕 Agenda
Welcome & Introductions
Orchestrator API Overview
Exploring the Swagger Interface
Test Manager API Highlights
Streamlining Automation & Testing with APIs (Demo)
Q&A and Open Discussion
Perfect for developers, testers, and automation enthusiasts!
👉 Join our UiPath Community Berlin chapter: https://community.uipath.com/berlin/
This session streamed live on April 29, 2025, 18:00 CET.
Check out all our upcoming UiPath Community sessions at https://community.uipath.com/events/.
Generative Artificial Intelligence (GenAI) in BusinessDr. Tathagat Varma
My talk for the Indian School of Business (ISB) Emerging Leaders Program Cohort 9. In this talk, I discussed key issues around adoption of GenAI in business - benefits, opportunities and limitations. I also discussed how my research on Theory of Cognitive Chasms helps address some of these issues
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul
Artificial intelligence is changing how businesses operate. Companies are using AI agents to automate tasks, reduce time spent on repetitive work, and focus more on high-value activities. Noah Loul, an AI strategist and entrepreneur, has helped dozens of companies streamline their operations using smart automation. He believes AI agents aren't just tools—they're workers that take on repeatable tasks so your human team can focus on what matters. If you want to reduce time waste and increase output, AI agents are the next move.
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025BookNet Canada
Book industry standards are evolving rapidly. In the first part of this session, we’ll share an overview of key developments from 2024 and the early months of 2025. Then, BookNet’s resident standards expert, Tom Richardson, and CEO, Lauren Stewart, have a forward-looking conversation about what’s next.
Link to recording, transcript, and accompanying resource: https://bnctechforum.ca/sessions/standardsgoals-for-2025-standards-certification-roundup/
Presented by BookNet Canada on May 6, 2025 with support from the Department of Canadian Heritage.
How Can I use the AI Hype in my Business Context?Daniel Lehner
𝙄𝙨 𝘼𝙄 𝙟𝙪𝙨𝙩 𝙝𝙮𝙥𝙚? 𝙊𝙧 𝙞𝙨 𝙞𝙩 𝙩𝙝𝙚 𝙜𝙖𝙢𝙚 𝙘𝙝𝙖𝙣𝙜𝙚𝙧 𝙮𝙤𝙪𝙧 𝙗𝙪𝙨𝙞𝙣𝙚𝙨𝙨 𝙣𝙚𝙚𝙙𝙨?
Everyone’s talking about AI but is anyone really using it to create real value?
Most companies want to leverage AI. Few know 𝗵𝗼𝘄.
✅ What exactly should you ask to find real AI opportunities?
✅ Which AI techniques actually fit your business?
✅ Is your data even ready for AI?
If you’re not sure, you’re not alone. This is a condensed version of the slides I presented at a Linkedin webinar for Tecnovy on 28.04.2025.
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveScyllaDB
Want to learn practical tips for designing systems that can scale efficiently without compromising speed?
Join us for a workshop where we’ll address these challenges head-on and explore how to architect low-latency systems using Rust. During this free interactive workshop oriented for developers, engineers, and architects, we’ll cover how Rust’s unique language features and the Tokio async runtime enable high-performance application development.
As you explore key principles of designing low-latency systems with Rust, you will learn how to:
- Create and compile a real-world app with Rust
- Connect the application to ScyllaDB (NoSQL data store)
- Negotiate tradeoffs related to data modeling and querying
- Manage and monitor the database for consistently low latencies
Artificial Intelligence is providing benefits in many areas of work within the heritage sector, from image analysis, to ideas generation, and new research tools. However, it is more critical than ever for people, with analogue intelligence, to ensure the integrity and ethical use of AI. Including real people can improve the use of AI by identifying potential biases, cross-checking results, refining workflows, and providing contextual relevance to AI-driven results.
News about the impact of AI often paints a rosy picture. In practice, there are many potential pitfalls. This presentation discusses these issues and looks at the role of analogue intelligence and analogue interfaces in providing the best results to our audiences. How do we deal with factually incorrect results? How do we get content generated that better reflects the diversity of our communities? What roles are there for physical, in-person experiences in the digital world?
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersToradex
Toradex brings robust Linux support to SMARC (Smart Mobility Architecture), ensuring high performance and long-term reliability for embedded applications. Here’s how:
• Optimized Torizon OS & Yocto Support – Toradex provides Torizon OS, a Debian-based easy-to-use platform, and Yocto BSPs for customized Linux images on SMARC modules.
• Seamless Integration with i.MX 8M Plus and i.MX 95 – Toradex SMARC solutions leverage NXP’s i.MX 8 M Plus and i.MX 95 SoCs, delivering power efficiency and AI-ready performance.
• Secure and Reliable – With Secure Boot, over-the-air (OTA) updates, and LTS kernel support, Toradex ensures industrial-grade security and longevity.
• Containerized Workflows for AI & IoT – Support for Docker, ROS, and real-time Linux enables scalable AI, ML, and IoT applications.
• Strong Ecosystem & Developer Support – Toradex offers comprehensive documentation, developer tools, and dedicated support, accelerating time-to-market.
With Toradex’s Linux support for SMARC, developers get a scalable, secure, and high-performance solution for industrial, medical, and AI-driven applications.
Do you have a specific project or application in mind where you're considering SMARC? We can help with Free Compatibility Check and help you with quick time-to-market
For more information: https://www.toradex.com/computer-on-modules/smarc-arm-family
Technology Trends in 2025: AI and Big Data AnalyticsInData Labs
At InData Labs, we have been keeping an ear to the ground, looking out for AI-enabled digital transformation trends coming our way in 2025. Our report will provide a look into the technology landscape of the future, including:
-Artificial Intelligence Market Overview
-Strategies for AI Adoption in 2025
-Anticipated drivers of AI adoption and transformative technologies
-Benefits of AI and Big data for your business
-Tips on how to prepare your business for innovation
-AI and data privacy: Strategies for securing data privacy in AI models, etc.
Download your free copy nowand implement the key findings to improve your business.
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxAnoop Ashok
In today's fast-paced retail environment, efficiency is key. Every minute counts, and every penny matters. One tool that can significantly boost your store's efficiency is a well-executed planogram. These visual merchandising blueprints not only enhance store layouts but also save time and money in the process.
Dev Dives: Automate and orchestrate your processes with UiPath MaestroUiPathCommunity
This session is designed to equip developers with the skills needed to build mission-critical, end-to-end processes that seamlessly orchestrate agents, people, and robots.
📕 Here's what you can expect:
- Modeling: Build end-to-end processes using BPMN.
- Implementing: Integrate agentic tasks, RPA, APIs, and advanced decisioning into processes.
- Operating: Control process instances with rewind, replay, pause, and stop functions.
- Monitoring: Use dashboards and embedded analytics for real-time insights into process instances.
This webinar is a must-attend for developers looking to enhance their agentic automation skills and orchestrate robust, mission-critical processes.
👨🏫 Speaker:
Andrei Vintila, Principal Product Manager @UiPath
This session streamed live on April 29, 2025, 16:00 CET.
Check out all our upcoming Dev Dives sessions at https://community.uipath.com/dev-dives-automation-developer-2025/.
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...Alan Dix
Talk at the final event of Data Fusion Dynamics: A Collaborative UK-Saudi Initiative in Cybersecurity and Artificial Intelligence funded by the British Council UK-Saudi Challenge Fund 2024, Cardiff Metropolitan University, 29th April 2025
https://alandix.com/academic/talks/CMet2025-AI-Changes-Everything/
Is AI just another technology, or does it fundamentally change the way we live and think?
Every technology has a direct impact with micro-ethical consequences, some good, some bad. However more profound are the ways in which some technologies reshape the very fabric of society with macro-ethical impacts. The invention of the stirrup revolutionised mounted combat, but as a side effect gave rise to the feudal system, which still shapes politics today. The internal combustion engine offers personal freedom and creates pollution, but has also transformed the nature of urban planning and international trade. When we look at AI the micro-ethical issues, such as bias, are most obvious, but the macro-ethical challenges may be greater.
At a micro-ethical level AI has the potential to deepen social, ethnic and gender bias, issues I have warned about since the early 1990s! It is also being used increasingly on the battlefield. However, it also offers amazing opportunities in health and educations, as the recent Nobel prizes for the developers of AlphaFold illustrate. More radically, the need to encode ethics acts as a mirror to surface essential ethical problems and conflicts.
At the macro-ethical level, by the early 2000s digital technology had already begun to undermine sovereignty (e.g. gambling), market economics (through network effects and emergent monopolies), and the very meaning of money. Modern AI is the child of big data, big computation and ultimately big business, intensifying the inherent tendency of digital technology to concentrate power. AI is already unravelling the fundamentals of the social, political and economic world around us, but this is a world that needs radical reimagining to overcome the global environmental and human challenges that confront us. Our challenge is whether to let the threads fall as they may, or to use them to weave a better future.
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc
Most consumers believe they’re making informed decisions about their personal data—adjusting privacy settings, blocking trackers, and opting out where they can. However, our new research reveals that while awareness is high, taking meaningful action is still lacking. On the corporate side, many organizations report strong policies for managing third-party data and consumer consent yet fall short when it comes to consistency, accountability and transparency.
This session will explore the research findings from TrustArc’s Privacy Pulse Survey, examining consumer attitudes toward personal data collection and practical suggestions for corporate practices around purchasing third-party data.
Attendees will learn:
- Consumer awareness around data brokers and what consumers are doing to limit data collection
- How businesses assess third-party vendors and their consent management operations
- Where business preparedness needs improvement
- What these trends mean for the future of privacy governance and public trust
This discussion is essential for privacy, risk, and compliance professionals who want to ground their strategies in current data and prepare for what’s next in the privacy landscape.
1. Short intro to Scala and the
Play! Framework
50 - 60 minutes
Last updated: Sept 2014 [email protected]
Leveraging modern programming techniques to make
safer, faster and more predictable applications
3. Scala - Background
● Created by Martin Odersky at EPFL in 2003
● Aimed at overcoming Java’s weaknesses while allowing for easy migration
for former Java developers
● One of the few object-functional languages (also: F#)
● One of the JVM-compliant languages (also: groovy, clojure, jruby, jython)
4. Scala selling points
● Functional/Object Oriented hybrid - use one, the other, or both
● More elegant, less painful concurrency constructs
● Uncluttered, concise syntax
● Seamless interoperability and compatibility with Java
● Typing: expressive type system / static typing / type safety / type inference
5. Quick syntax walkthrough
● no type declaration prior to use (due to type-inference)
var msg = "Hello, world!"
● braces are only needed for multiline blocks
def max(x: Int, y: Int) = if (x > y) x else y
def max2(x: Int, y: Int) = {
if (x > y) x
else y
}
no braces
yes braces
6. Quick syntax walkthrough
● no semicolons at the end (unless you want multiple statements)
println(line); println(line)
println(line)
println(line)
equivalent code
7. Quick syntax walkthrough
● type comes after variable name (only when required or for usability)
def max(x: Int, y: Int): Int =
if (x > y) x else y
val m = new HashMap[Int, String] ()
required types for
val m1: Map[Int, String] = new HashMap()
arguments
optional return type
either is acceptable
not necessary to annotate both sides
val m2: HashMap[Int, String] = new HashMap[Int, String] ()
8. Quick syntax walkthrough
● val for immutable variables, var for mutable variables
val msg = "Hello, world!"
msg = "Another message!" // ERROR: reassignment to val
var msg2 = "Hello, world!"
msg2 = "Another message!" // no error
9. Quick syntax walkthrough
● statements also return a value (if, for, while, def) - which means they are
also expressions
var result1 = ""
if(marks >= 50)
result = "passed"
else
result = "failed"
val result2 = if(marks >= 50)
"passed"
else
"failed"
using if as a
statement
if as an expression
10. Quick syntax walkthrough
● return statements are allowed but generally not needed
def multiply(a: Int,b:Int):Int =
return a*b
def sum(x:Int,y:Int) =
x + y
def greet() = println( "Hello, world!" )
explicitly using return
When no return is provided,
last value computed by the
function is returned
Functions that return no
useful values have a result
type of Unit
11. Quick syntax walkthrough
● function literals or anonymous functions
(x: Int) => x * 2
val double = (x: Int) => x * 2
● example usage: as parameter to function map:
List(1,2,3,4,5).map{ (x: Int) => x * 2 }
//evaluates to List(2, 4, 6, 8, 10)
a function that takes an Int
and multiplies it by two
function value being
assigned to a variable
function map takes another
function as argument
12. Scala, Java Comparison
scala class MyClass(index: Int, name: String)
class MyClass {
private int index;
private String name;
public MyClass(int index, String name) {
this.index = index;
this.name = name;
}
}
java
13. Scala, Java Comparison
scala val nameHasUpperCase = name.exists(_.isUpper)
boolean nameHasUpperCase = false;
for (int i = 0; i < name.length(); ++i) {
if (Character.isUpperCase(name.charAt(i))) {
nameHasUpperCase = true;
break;
}
}
java
14. Scala, Java Interoperability
● You can use Java code in Scala as-is (i.e. no changes needed).
● Scala classes can subclass Java classes, you can instantiate Java classes
in Scala, you can access methods, fields (even if they are static), etc.
● You can also use Scala code in Java projects, as long as you don’t use
many advanced Scala concepts that are not possible in Java.
● Similar code generated by Scala and Java usually generates the exact
same bytecode, as can be verified using tools like javap
15. Environment
● Console
● sbt - dependency and package management
● JVM integration
● Typesafe products (Akka, Play, Activator, Spray, Slick, etc)
● All of your favourite Java libraries
● Testing suites (Unit, Integration, Acceptance, Property-based, etc)
● Small but high-level community
16. Weaknesses
● It’s a large language. Users are advised not to try to use many different
concepts at the same time, especially when starting out.
● Scala has a somewhat steep learning curve and its complex type system is
powerful but hard to grasp at times.
● Implicit conversions are useful but easily misused and may make code
harder to understand.
● Complex function signatures may put some off.
17. Play Framework
● MVC Web Framework; supports Java and Scala
● Created in 2007
● Used at Linkedin, Coursera, The Guardian, etc.
● Uses sbt for dependency management
● As of September 2014, it has had 5000 commits by over 350 contributors.
● The Simplest Possible Play App
18. Play Features
● Play has all default features one can expect from a modern framework:
○ MVC-based separation of concerns
○ Support for ORMs (Java) or FRMs (Scala)
○ Rich models with support for Forms, Validation, etc.
○ Database Migration (called evolutions)
○ Template engine (Scala-based)
○ Extensive routing
○ Support for REST-only Apps
○ Lots of community-provided plugins
○ Supported by Typesafe
20. Play Framework - Examples
● Displaying a view from a controller action
package controllers
import play.api._
import play.api.mvc._
object Application extends Controller {
def index = Action {
Ok(views.html.index("Your new application is ready."))
}
}
import libraries
create a controller
define actions as methods
21. Play Framework - Examples
● Displaying a view with some data
package controllers
import models._
import play.api._
import play.api.mvc._
import play.api.Play.current
object Application extends Controller {
this method returns a List[Computer]
def index = Action { implicit request =>
val computers = Computer .list
Ok(views.html.web.index( "Hello! I'm the WEB!" , computers))
}
}
the Computer model was defined in
package models (not shown here)
instantiate a view file and feed it
a string and a list of computers
22. Activator
● Web-based IDE and project viewer, built by Typesafe
● A large number of sample applications (templates) to study and learn from
23. Resources
● Scala Programming Language (Wikipedia Article)
● Scala official site
● Typesafe
● Programming in Scala Book on Amazon
● A preset Virtual Machine for Scala/Play Development
● Functional Programming Principles in Scala on Coursera
● Principles of Reactive Programming on Coursera
● Play Framework Official Website
● ScalaJavaInterop Project
● Play Framework (Wikipedia Article)
● Using Scala on Heroku
● Typesafe Activator
● All Available Activator Templates