This document summarizes an Internet of Things magic show presented by Stephen Chin and Angela Caicedo at a JavaOne conference. The show demonstrated three magic tricks enabled by IoT technologies:
1. Mind reading: A jacket with sensors gave feedback to correctly predict the audience member's selection from a menu.
2. Lightning reflexes: An IoT-enabled grabber reacted in real-time to lights and sounds to play a game.
3. Materialization: A 3D printer was used to demonstrate making objects appear from nothing using code and IoT technologies.
The show highlighted how IoT, Java, sensors, actuators and other technologies can enable interactive experiences and "magic" through
The Ring programming language version 1.9 book - Part 56 of 210Mahmoud Samir Fayed
The document discusses using TrueType fonts, playing sound files, scaling and rotating images, displaying transparent images, and using threads in Ring using the Allegro library. It provides code examples for loading and displaying TrueType fonts, playing wav sound files, rotating and scaling bitmap images, displaying images with transparency, and creating and running multiple threads simultaneously.
The Ring programming language version 1.5.4 book - Part 47 of 185Mahmoud Samir Fayed
The document provides examples of using RingLibSDL to create games using the SDL, SDL_image, SDL_ttf and SDL_mixer libraries. It shows how to create a window, display images, switch between images, draw rectangles, display PNG images, use TrueType fonts, and display transparent images.
Un aperçu du format Mach-O, en particulier où sont situées les chaînes de caractères constantes et où sont définies les classes, méthodes ObjC 1.0/2.0. Mais tout cela avec un besoin concret effectivement rencontré : pouvoir réusiner du code après sa compilation.
The Ring programming language version 1.5.1 book - Part 45 of 180Mahmoud Samir Fayed
The document provides examples of using various graphics, sound, and threading capabilities in the Ring programming language using the Allegro library. It demonstrates how to load and display bitmaps, play sound files, scale and rotate images, use transparency, and create threads. Code samples are provided to illustrate drawing bitmaps, text, loading TrueType fonts, reserving samples, playing sounds, and having multiple threads execute loops and output text.
Using Android Things to Detect & Exterminate ReptiliansNilhcem
Using Android Things and machine learning, this document proposes a project to detect and exterminate reptilians. It describes using TensorFlow on Android Things to create an image classifier trained to identify reptilians in photos. It then discusses using various Android Things peripherals like sensors, displays, motors and relays to detect approaching reptilians and trigger extermination devices like flamethrowers or chainsaws. The document argues Android Things is a good platform for such a project due to its access to local computation, Google services and a wide range of hardware. It concludes by encouraging people to try Android Things development.
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)Stephen Chin
This document discusses setting up a Raspberry Pi for kids to learn coding and game development using Java. It provides instructions on installing Linux and Java on the Pi, connecting a touchscreen and other accessories to build a coding lab kit. The document then demonstrates how to use streams, filters, maps and other Java 8 lambda features to program interactive games and simulations using the Pi kit.
This document summarizes an Internet of Things magic show presented by Stephen Chin and Angela Caicedo at a JavaOne conference. The show demonstrated three magic tricks enabled by IoT technologies:
1. Mind reading: A jacket with sensors gave feedback to correctly predict the audience member's selection from a menu.
2. Lightning reflexes: An IoT-enabled grabber reacted in real-time to lights and sounds to play a game.
3. Materialization: A 3D printer was used to demonstrate making objects appear from nothing using code and IoT technologies.
The show highlighted how IoT, Java, sensors, actuators and other technologies can enable interactive experiences and "magic" through
The Ring programming language version 1.9 book - Part 56 of 210Mahmoud Samir Fayed
The document discusses using TrueType fonts, playing sound files, scaling and rotating images, displaying transparent images, and using threads in Ring using the Allegro library. It provides code examples for loading and displaying TrueType fonts, playing wav sound files, rotating and scaling bitmap images, displaying images with transparency, and creating and running multiple threads simultaneously.
The Ring programming language version 1.5.4 book - Part 47 of 185Mahmoud Samir Fayed
The document provides examples of using RingLibSDL to create games using the SDL, SDL_image, SDL_ttf and SDL_mixer libraries. It shows how to create a window, display images, switch between images, draw rectangles, display PNG images, use TrueType fonts, and display transparent images.
Un aperçu du format Mach-O, en particulier où sont situées les chaînes de caractères constantes et où sont définies les classes, méthodes ObjC 1.0/2.0. Mais tout cela avec un besoin concret effectivement rencontré : pouvoir réusiner du code après sa compilation.
The Ring programming language version 1.5.1 book - Part 45 of 180Mahmoud Samir Fayed
The document provides examples of using various graphics, sound, and threading capabilities in the Ring programming language using the Allegro library. It demonstrates how to load and display bitmaps, play sound files, scale and rotate images, use transparency, and create threads. Code samples are provided to illustrate drawing bitmaps, text, loading TrueType fonts, reserving samples, playing sounds, and having multiple threads execute loops and output text.
Using Android Things to Detect & Exterminate ReptiliansNilhcem
Using Android Things and machine learning, this document proposes a project to detect and exterminate reptilians. It describes using TensorFlow on Android Things to create an image classifier trained to identify reptilians in photos. It then discusses using various Android Things peripherals like sensors, displays, motors and relays to detect approaching reptilians and trigger extermination devices like flamethrowers or chainsaws. The document argues Android Things is a good platform for such a project due to its access to local computation, Google services and a wide range of hardware. It concludes by encouraging people to try Android Things development.
Raspberry Pi Gaming 4 Kids (Devoxx4Kids)Stephen Chin
This document discusses setting up a Raspberry Pi for kids to learn coding and game development using Java. It provides instructions on installing Linux and Java on the Pi, connecting a touchscreen and other accessories to build a coding lab kit. The document then demonstrates how to use streams, filters, maps and other Java 8 lambda features to program interactive games and simulations using the Pi kit.
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
Django Celery - A distributed task queueAlex Eftimie
This document introduces django-celery, an open source asynchronous task queue/job queue for Django projects. It discusses how celery allows distributing tasks across multiple workers for parallel processing. Tasks can run independently, in chains, groups or with callbacks. Celery integrates with Django and allows offloading long-running tasks from the main request-response cycle for improved performance. Examples show how celery can be used to parallelize operations like generating PDFs or processing uploaded images.
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
Europython 2011 - Playing tasks with Django & CeleryMauro Rocco
This document discusses using Django and Celery for asynchronous task processing. Some key points:
- Celery allows defining and processing asynchronous tasks across multiple machines in a distributed, fault-tolerant way. It supports scheduling via cron-like functionality.
- Django-celery provides a Django app that integrates Celery with the Django admin for task scheduling and monitoring. It replaces Celery configuration with Django settings.
- Unique tasks ensure only one instance of a task runs at a time across all machines. This is useful for accessing sensitive resources atomically. Custom locking and concurrency handling is implemented.
- Centralized logging is implemented by connecting signal handlers to Celery's logging setup. This allows sending all worker logs to a syslog
Physical Web is an important component for the Smart Cities and for monetizing IoT projects. This talk explain what is it and how to implement it using Eddystone protocol.
Celery is an asynchronous task queue/job queue based on distributed message passing. It allows tasks to be executed asynchronously by worker servers using a message passing protocol like AMQP. Celery can be used to process tasks in the background outside of the HTTP request/response cycle, run periodic tasks, interact with APIs, and more. It uses brokers like RabbitMQ to push tasks to workers to execute tasks in parallel. Task results are stored for retrieval. Celery provides features like task retries, task sets, periodic tasks, and Django views for interacting with tasks.
Home Automation with Android Things and the Google AssistantNilhcem
This document discusses using Android Things and the Google Assistant for home automation. It provides examples of controlling smart home devices like lights and switches through actions, traits, and device syncing. Code samples are given for communicating with devices over Bluetooth, GPIO, UART, and infrared to control lights, fans, outlets and more. Additional resources are provided on building smart home apps with Actions on Google and reverse engineering protocols for interoperability.
The document discusses ECMAScript 6 (ES6), a major update to JavaScript. It describes new features added in five acts, including modules, syntax enhancements, classes, functions improvements, and tools for compiling ES6 to older JavaScript versions. Key additions are modules, classes, arrow functions, let/const variables, template literals, and promises to support asynchronous programming. Compilers like Babel allow using ES6 features while targeting older JavaScript environments.
The next version of JavaScript, ES6, is starting to arrive. Many of its features are simple enhancements to the language we already have: things like arrow functions, class syntax, and destructuring. But other features will change the way we program JavaScript, fundamentally expanding the capabilities of the language and reshaping our future codebases. In this talk we'll focus on two of these, discovering the the myriad possibilities of generators and the many tricks you can pull of with template strings.
This document provides an overview of Celery, an open-source distributed task queue written in Python. It discusses what Celery is used for, its core architecture including brokers, tasks, workers, and monitoring. It also covers key Celery concepts like signatures, tasks workflows using groups, chains, chords, maps and more. The document explains how to define and call tasks, and configure workers with options like autoreloading, autoscaling, rate limits, and user components. Monitoring is also covered, highlighting the Flower web monitor for task progress and statistics.
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...Fwdays
Probably every backend developer had to face the frontend. I am sure that this interaction did not always end without mental trauma. However, today, thanks to Full Stack frameworks, we can forget about this headache, because we have the opportunity to describe and generate a frontend on the PHP side.
Kotlin Coroutines Flow is coming to provide a cold asynchronous data stream that emits values sequentially within a coroutine. Flow allows mapping, filtering, and collecting values, handles exceptions transparently, and preserves context. It can integrate with existing APIs like Room and Retrofit using adapters, and is the primary way to handle async streams going forward. Channels will still be used for hot streams and synchronization between coroutines.
My DEEPSEC 2012 talk explores the fine art of packaging when it comes to exploits. No this is not another talk about packers or crypters. We are talking STYLE! A successful exploit is one that is innovatively delivered, in style. We shall be talking about a number of sneaky, funny and innovative techniques for delivering exploits to their doorsteps without annoyances like anti-virus or content filtering getting in the way.
This talk goes beyond the obvious obfuscation. We combine the power of web hacking, the power of sophisticated exploit development and goofball creativity to ensure that exploits get delivered and detonate on time, as planned. Did you know you can literally paint an exploit on canvas? Have you heard of chameleon Javascript? This and more in the talk!
The document discusses Kotlin coroutines and how they can be used to write asynchronous code in a synchronous, sequential way. It explains what coroutines are, how they work internally using continuation-passing style (CPS) transformation and state machines, and compares them to callbacks. It also outlines some of the benefits of using coroutines, such as structured concurrency, light weight execution, built-in cancellation, and simplifying asynchronous code. Finally, it provides examples of how to use common coroutine builders like launch, async, and coroutineScope in a basic Android application with ViewModels.
Puppet is used at Janrain to provision cloud servers, deploy applications, and manage infrastructure in an automated and repeatable way. Key aspects include:
- Cloud servers are provisioned using a Ruby script that launches instances with Puppet pre-configured via cloud-init.
- Puppet signs certificates and installs a base configuration including users, SSH keys, common applications, and monitoring tools.
- Version control and environments are used to collaborate and safely roll out changes.
- Puppet manages DNS, storage volumes, application deployments and more, keeping infrastructure in a known state.
- Tools like Puppetcommander help avoid load issues and keep Puppet runs orderly as the infrastructure scales
Celery is an open source asynchronous task queue/job queue based on distributed message passing. It allows tasks to be executed concurrently, in the background across multiple servers. Common use cases include running long tasks like API calls or image processing without blocking the main process, load balancing tasks across servers, and concurrent execution of batch jobs. Celery uses message brokers like RabbitMQ to asynchronously queue and schedule tasks. Tasks are defined as Python functions which get executed by worker processes. The workflow involves defining tasks, adding tasks to the queue from views or management commands, and having workers process the tasks.
"Wix Engineering Media AI Photo Studio", Mykola MykhailychFwdays
In this talk, we will review components of the Wix Engineering AI-based image processing toolbox: super-resolution, automatic enhancement, cutout, etc. We'll share insights about models in production and their metrics. We'll show how ML models can improve user experience and make core products even more helpful.
The document summarizes Roman Elizarov's presentation on Kotlin coroutines at the JVM Language Summit in 2017. The presentation recapped the initial Kotlin coroutines prototype, discussed issues with its design, and outlined the solutions adopted in Kotlin 1.1. This included using suspending functions instead of async/await keywords, tail suspension to avoid stack overflows, and abstraction to provide a natural coroutine declaration syntax.
API Python Chess: Distribution of Chess Wins based on random movesYao Yao
Yao Yao
https://github.com/yaowser/python-chess
https://youtu.be/MayH8Yd3yqE
Distribution of chess wins: black and white expected values from random moves
Python chess library with move generation and validation, Polyglot opening book probing, PGN reading and writing, Gaviota tablebase probing, Syzygy tablebase probing, and UCI engine communication
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...Stephen Chin
Presented at GeeCON 2011: JavaFX Script is going away, but the JavaFX Platform is getting a new face with pure Java APIs. In this session, you will see how you can leverage the new JavaFX 2.0 APIs from a host of different JVM languages, including JRuby, Clojure, Groovy, and Scala.
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
Django Celery - A distributed task queueAlex Eftimie
This document introduces django-celery, an open source asynchronous task queue/job queue for Django projects. It discusses how celery allows distributing tasks across multiple workers for parallel processing. Tasks can run independently, in chains, groups or with callbacks. Celery integrates with Django and allows offloading long-running tasks from the main request-response cycle for improved performance. Examples show how celery can be used to parallelize operations like generating PDFs or processing uploaded images.
Kotlin Coroutines provide a new way to write asynchronous and concurrent code using suspending functions and structured concurrency. Coroutines avoid callbacks and allow sequencing of asynchronous code using async/await. Coroutines are lightweight threads that can be suspended and resumed. Channels allow coroutines to communicate and share data. Flows provide a reactive streams API for coroutines. Kotlin coroutines offer improvements over other asynchronous programming models like callbacks and RxJava.
Europython 2011 - Playing tasks with Django & CeleryMauro Rocco
This document discusses using Django and Celery for asynchronous task processing. Some key points:
- Celery allows defining and processing asynchronous tasks across multiple machines in a distributed, fault-tolerant way. It supports scheduling via cron-like functionality.
- Django-celery provides a Django app that integrates Celery with the Django admin for task scheduling and monitoring. It replaces Celery configuration with Django settings.
- Unique tasks ensure only one instance of a task runs at a time across all machines. This is useful for accessing sensitive resources atomically. Custom locking and concurrency handling is implemented.
- Centralized logging is implemented by connecting signal handlers to Celery's logging setup. This allows sending all worker logs to a syslog
Physical Web is an important component for the Smart Cities and for monetizing IoT projects. This talk explain what is it and how to implement it using Eddystone protocol.
Celery is an asynchronous task queue/job queue based on distributed message passing. It allows tasks to be executed asynchronously by worker servers using a message passing protocol like AMQP. Celery can be used to process tasks in the background outside of the HTTP request/response cycle, run periodic tasks, interact with APIs, and more. It uses brokers like RabbitMQ to push tasks to workers to execute tasks in parallel. Task results are stored for retrieval. Celery provides features like task retries, task sets, periodic tasks, and Django views for interacting with tasks.
Home Automation with Android Things and the Google AssistantNilhcem
This document discusses using Android Things and the Google Assistant for home automation. It provides examples of controlling smart home devices like lights and switches through actions, traits, and device syncing. Code samples are given for communicating with devices over Bluetooth, GPIO, UART, and infrared to control lights, fans, outlets and more. Additional resources are provided on building smart home apps with Actions on Google and reverse engineering protocols for interoperability.
The document discusses ECMAScript 6 (ES6), a major update to JavaScript. It describes new features added in five acts, including modules, syntax enhancements, classes, functions improvements, and tools for compiling ES6 to older JavaScript versions. Key additions are modules, classes, arrow functions, let/const variables, template literals, and promises to support asynchronous programming. Compilers like Babel allow using ES6 features while targeting older JavaScript environments.
The next version of JavaScript, ES6, is starting to arrive. Many of its features are simple enhancements to the language we already have: things like arrow functions, class syntax, and destructuring. But other features will change the way we program JavaScript, fundamentally expanding the capabilities of the language and reshaping our future codebases. In this talk we'll focus on two of these, discovering the the myriad possibilities of generators and the many tricks you can pull of with template strings.
This document provides an overview of Celery, an open-source distributed task queue written in Python. It discusses what Celery is used for, its core architecture including brokers, tasks, workers, and monitoring. It also covers key Celery concepts like signatures, tasks workflows using groups, chains, chords, maps and more. The document explains how to define and call tasks, and configure workers with options like autoreloading, autoscaling, rate limits, and user components. Monitoring is also covered, highlighting the Flower web monitor for task progress and statistics.
"Full Stack frameworks or a story about how to reconcile Front (good) and Bac...Fwdays
Probably every backend developer had to face the frontend. I am sure that this interaction did not always end without mental trauma. However, today, thanks to Full Stack frameworks, we can forget about this headache, because we have the opportunity to describe and generate a frontend on the PHP side.
Kotlin Coroutines Flow is coming to provide a cold asynchronous data stream that emits values sequentially within a coroutine. Flow allows mapping, filtering, and collecting values, handles exceptions transparently, and preserves context. It can integrate with existing APIs like Room and Retrofit using adapters, and is the primary way to handle async streams going forward. Channels will still be used for hot streams and synchronization between coroutines.
My DEEPSEC 2012 talk explores the fine art of packaging when it comes to exploits. No this is not another talk about packers or crypters. We are talking STYLE! A successful exploit is one that is innovatively delivered, in style. We shall be talking about a number of sneaky, funny and innovative techniques for delivering exploits to their doorsteps without annoyances like anti-virus or content filtering getting in the way.
This talk goes beyond the obvious obfuscation. We combine the power of web hacking, the power of sophisticated exploit development and goofball creativity to ensure that exploits get delivered and detonate on time, as planned. Did you know you can literally paint an exploit on canvas? Have you heard of chameleon Javascript? This and more in the talk!
The document discusses Kotlin coroutines and how they can be used to write asynchronous code in a synchronous, sequential way. It explains what coroutines are, how they work internally using continuation-passing style (CPS) transformation and state machines, and compares them to callbacks. It also outlines some of the benefits of using coroutines, such as structured concurrency, light weight execution, built-in cancellation, and simplifying asynchronous code. Finally, it provides examples of how to use common coroutine builders like launch, async, and coroutineScope in a basic Android application with ViewModels.
Puppet is used at Janrain to provision cloud servers, deploy applications, and manage infrastructure in an automated and repeatable way. Key aspects include:
- Cloud servers are provisioned using a Ruby script that launches instances with Puppet pre-configured via cloud-init.
- Puppet signs certificates and installs a base configuration including users, SSH keys, common applications, and monitoring tools.
- Version control and environments are used to collaborate and safely roll out changes.
- Puppet manages DNS, storage volumes, application deployments and more, keeping infrastructure in a known state.
- Tools like Puppetcommander help avoid load issues and keep Puppet runs orderly as the infrastructure scales
Celery is an open source asynchronous task queue/job queue based on distributed message passing. It allows tasks to be executed concurrently, in the background across multiple servers. Common use cases include running long tasks like API calls or image processing without blocking the main process, load balancing tasks across servers, and concurrent execution of batch jobs. Celery uses message brokers like RabbitMQ to asynchronously queue and schedule tasks. Tasks are defined as Python functions which get executed by worker processes. The workflow involves defining tasks, adding tasks to the queue from views or management commands, and having workers process the tasks.
"Wix Engineering Media AI Photo Studio", Mykola MykhailychFwdays
In this talk, we will review components of the Wix Engineering AI-based image processing toolbox: super-resolution, automatic enhancement, cutout, etc. We'll share insights about models in production and their metrics. We'll show how ML models can improve user experience and make core products even more helpful.
The document summarizes Roman Elizarov's presentation on Kotlin coroutines at the JVM Language Summit in 2017. The presentation recapped the initial Kotlin coroutines prototype, discussed issues with its design, and outlined the solutions adopted in Kotlin 1.1. This included using suspending functions instead of async/await keywords, tail suspension to avoid stack overflows, and abstraction to provide a natural coroutine declaration syntax.
API Python Chess: Distribution of Chess Wins based on random movesYao Yao
Yao Yao
https://github.com/yaowser/python-chess
https://youtu.be/MayH8Yd3yqE
Distribution of chess wins: black and white expected values from random moves
Python chess library with move generation and validation, Polyglot opening book probing, PGN reading and writing, Gaviota tablebase probing, Syzygy tablebase probing, and UCI engine communication
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and V...Stephen Chin
Presented at GeeCON 2011: JavaFX Script is going away, but the JavaFX Platform is getting a new face with pure Java APIs. In this session, you will see how you can leverage the new JavaFX 2.0 APIs from a host of different JVM languages, including JRuby, Clojure, Groovy, and Scala.
JavaFX Your Way: Building JavaFX Applications with Alternative LanguagesStephen Chin
JavaFX is more than a language. It is also a platform for building immersive applications with graphics, animation, and rich media. In this session, you will see how you can leverage JavaFX from a host of different JVM languages, including Java, JRuby, Groovy, Scala, and Clojure.
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chinjaxconf
JavaFX 2 is the next version of a revolutionary rich client platform for developing immersive desktop applications. One of the new features in JavaFX 2 is a set of pure Java APIs that can be used from any JVM language, opening up tremendous possibilities. This presentation demonstrates the potential of using JavaFX 2 together with alternative languages such as Groovy, Clojure, and Scala. It also will showcase the successor to JavaFX Script, Visage, a DSL with features specifically targeted at helping create clean UIs.
1) GroovyFX allows building JavaFX user interfaces using Groovy's declarative syntax and binding capabilities.
2) It provides a DSL for creating common UI elements like buttons, text fields, labels etc and laying them out in containers like border panes, grids and scenes.
3) GroovyFX also supports data binding that automatically updates UI elements when bound properties change, animation and event handling.
This document provides an introduction and overview of JavaFX. It discusses what JavaFX is, its scene graph and stack, scripting language features, basic data types, and animation framework. It also provides resources for downloading JavaFX, tutorials, forums and projects.
Here are the key points about closure arguments in Groovy:
- Closures can take arguments like regular methods
- Arguments are specified inside the closure definition between parentheses ()
- Argument names are specified like method parameters (e.g. num, id)
- If no arguments are needed, the parentheses can be omitted
- The last argument can optionally be a special variable called "it" which represents the argument passed to the closure
- Closures are first-class and can be passed to methods like regular arguments
So in summary:
Closures in Groovy allow defining inline anonymous functions that can take arguments like regular methods. The arguments are specified in the closure definition between parentheses and represent the values passed when calling
Apresentação em português dos motivos para escolher ScalaFX para criar aplicativos nativos para as plataformas Mac OS X, Linux e Windows. Explico em português minha caminhada atrás das alternativas no mundo do JavaFX2 após a retirada do JavaFX Script em setembro de 2010. Descubra aqui por que eu fiquei com ScalaFX como alternativa mais elegante e fácil de programar.
Clojure and Swing – a new productivity sweet spot? discusses how Clojure, a Lisp dialect that runs on the JVM, can be used to develop graphical user interfaces (GUIs) using Java Swing in a more productive way than plain Java. It presents several advantages of Clojure for Swing development, such as reducing boilerplate code, easier definition of actions and event bindings, and increased flexibility and reusability through functional programming techniques. Examples are provided of common Swing programming tasks implemented more concisely and readably in Clojure compared to Java. The document concludes that Clojure is a powerful and flexible language that offers opportunities to apply Lisp concepts to Swing GUI development
This document provides an overview of JavaFX, including:
- What JavaFX is and its main components like the JavaFX Framework and JavaFX Script language
- Demos of shapes, animations, and other graphics capabilities in JavaFX
- An overview of the JavaFX architecture and scene graph project for building user interfaces
- Resources for learning more about and getting started with JavaFX development
The document discusses XML-free programming approaches for Java server and client development. It begins with a humorous history of angle brackets and XML. It then outlines three tenets of XML-free programming: 1) storing configuration with code, 2) using JSON for data transfer modeling the domain, and 3) designing programming languages for humans. Examples are provided comparing XML and non-XML approaches in Java, Groovy, Scala, and Visage. The presentation concludes by describing a sample JavaOne speakers application implemented without XML for the server, data transfer, and client.
The document provides an overview of Groovy and Java code examples for performing common tasks like printing "Hello World", reading files, making web requests, using strings, importing packages, and using Swing/SwingBuilder for GUIs. It also shows examples of using Groovy with Java libraries for Excel files, Ant, and JSON. Additional sections cover parallel processing with GPars, contract programming with GContracts, method chaining, Grails basics, and Gaelyk controllers and views.
- The document discusses using the Rubeus gem to access Java Swing and JDBC from JRuby.
- Rubeus provides a DSL for easily creating Java Swing windows and accessing databases using JDBC from Ruby code.
- Examples show how to create a basic Swing window with text fields and buttons, as well as execute JDBC queries and access database metadata.
This document provides an overview of the Griffon framework for building desktop applications in Groovy and Java. It discusses key Griffon concepts like conventions over configuration, MVC patterns, built-in testing support, and automation of repetitive tasks. The document also covers Griffon features such as lifecycle scripts, binding, threading, and popular plugins. Resources for learning more about Griffon and its community are provided at the end.
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.
Effective Java with Groovy & Kotlin - How Languages Influence Adoption of Goo...Naresha K
There are several instances where Groovy and Kotlin take different approaches to implement Effective Java. As a participant, you walk away appreciating the simplicity with which these JVM languages empower the developers. The talk also provides food for thought - how languages can influence its users to adopt good practices.
The document provides an overview of JavaFX including:
- Its origins and why it was created as an alternative to Flash and Silverlight.
- Key aspects of the JavaFX language such as being object-oriented, functional, and statically typed.
- A crash course demonstrating basic JavaFX concepts like creating a stage and scene.
- The WidgetFX platform for building desktop widgets using JavaFX.
- The JFXtras library which adds additional controls, layouts, and utilities to JavaFX.
Similar to JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage (20)
With the rise of DevOps, Cloud Computing, and Container technologies, how you approach development has dramatically changed. Learn how to take advantage of microservices, serverless, and cloud-native technologies with the latest DevOps techniques to create hyperproductive teams.
10 Ways Everyone Can Support the Java CommunityStephen Chin
Foojay is all about the community helping to take Java forward, so as an attendee of the Friends of OpenJDK FOSDEM devroom you are already on your way towards making the Java community better!
But what can we all encourage our friends and colleagues to do in order to make the Java community more vibrant, active, and welcoming.
In this presentation, you will learn all of the insider secrets on how to support the worldwide community of 12 million Java developers.
Java Clients and JavaFX: The Definitive GuideStephen Chin
This talk is for professionals building Java applications for desktop, mobile, and embedded devices in the cloud age. It will help you build enhanced visual experiences and deploy modern, easy-to-maintain client applications across a variety of platforms. These applications can take advantage of the latest user interface components, 3D technology, and cloud services to create immersive visualizations and enable high-value data manipulation. Learn from Stephen Chin, lead author of the definitive Java client reference, how to leverage the latest open-source Java client technologies to build rich, responsive, and modern UIs.
Speaker: Stephen Chin
Bio: Stephen Chin is Senior Director of Developer Relations at JFrog, author of Raspberry Pi with Java, The Definitive Guide to Modern Client Development, and Pro JavaFX Platform. He has keynoted numerous Java conferences around the world including Oracle Code One (formerly JavaOne), where he is an 8-time Rock Star Award recipient. Stephen is an avid motorcyclist who has done evangelism tours in Europe, Japan, and Brazil, interviewing hackers in their natural habitat and posting the videos on http://nighthacking.org/. When he is not traveling, he enjoys teaching kids how to do embedded and robot programming together with his teenage daughter.
With the rise of DevOps, low cost Cloud Computing, and emerging Container technologies, the landscape for how you approach development has dramatically changed. This talk is focused on helping Java developers to adapt to this new landscape and take advantage of microservices, serverless, and cloud-native technologies with the latest DevOps techniques to simplify their build and create hyperproductive teams. Some of the technologies you will learn about in this talk include source control, build declaration, CI/CD, package management, containerization, and security.
Learn from the combined experience of the presenters who are experts in the Java and DevOps domains on the best tools, technologies, and methodologies to build your next cloud-native application or refactor your monolith. We cover the entire DevOps toolchain from source control through CI/CD through containerized deployments with an emphasis on maintaining efficiency and control from the source code and dependencies.
Java Clients and JavaFX - Presented to LJCStephen Chin
This session is for professionals building Java applications for desktop, mobile, and embedded devices in the cloud age. It will help you build enhanced visual experiences and deploy modern, easy-to-maintain client applications across a variety of platforms. These applications can take advantage of the latest user interface components, 3D technology, and cloud services to create immersive visualizations and enable high-value data manipulation.
Learn from Stephen Chin, lead author of the definitive Java client reference, how to leverage the latest open-source Java client technologies to build rich, responsive, and modern UIs.
RetroPi Handheld Raspberry Pi Gaming ConsoleStephen Chin
In this session I will walk you through how to build your own retro handheld console that is powered by Java, runs on a Raspberry Pi, and is printed on a 3D printer. Some of the topics that we will cover along the journey include:
• Hacking Java on the Raspberry Pi
• Rigging input devices with Pi4J
• Insane performance tuning on the JVM
• Why your boss [or SO] needs to buy you a 3D printer!
And of course your retro gaming mettle will be put to the test, so make sure to dust off your old 8 and 16 bit consoles to prepare.
This presentation is about the most fun you can have while still legitimately calling this conference “work.” In fact, I will hopefully inspire you to do your own creative “work” leveraging Java and Raspberry Pi to hack the real world.
When JavaFX Script was released, the mobile component was an important part. It was also one of the reasons many people and analysts believed in JavaFX as a real cross-platform client-side framework. For a number of reasons, JavaFX on mobile disappeared from the official Java roadmap. Fortunately, the OpenJFX team at Oracle made all the required sources available, and the JavaFXPorts initiative worked on providing JavaFX SDK's for the mobile platforms. In this session, we will show the current state of JavaFX on Mobile. We will show how to create a real cross-platform JavaFX Application using an IDE, and how easy it actually is to deploy that application on Android and iOS devices. We will show some of the features and limitations, and talk about the eco-system that is starting to take shape.
Confessions of a Former Agile Methodologist (JFrog Edition)Stephen Chin
I am best known for my work as a technology author and evangelist, but before this I used to be a methodology guru. Find out about what I learned in my 14+ year journey through the Agile methodologies and trends that have reshaped what we know as modern software development practices. This version of the talk has a few Easter Eggs for the JFrog guys who were instrumental in the build and test infrastructure I succeeded with, and invited me to speak at their awesome SwampUP event in Napa.
This document provides information about using Lego EV3 robots with LeJOS, including how to set up the software and connect to the EV3 brick from Windows. It describes the hardware components of the EV3 brick and various sensors. It also includes steps to build a wind turbine project with a fan, light sensor, and motors to rotate the turbine and fan. Code examples are provided to control the motors and read the light sensor.
Confessions of a Former Agile MethodologistStephen Chin
While I am best known as a Java evangelist, my day job prior to joining Oracle was Chief Agile Methodologist where I facilitated 3 company-wide Agile rollouts. If you are skeptical of folks trying to sell you certifications, frustrated with the institution of new processes and tracking systems, or wary of process experts taking the place of technical leadership, then this is the session for you. Come learn the insider secrets of how Agile works in a large enterprise from someone who has been in the eye of the hurricane. However, be warned that this knowledge will give you the power to change the development culture in your organization for better or worse -- are you ready to shoulder this responsibility?
Surviving as a zombie is tough... with the constant risks of sunlight, fire, and pesky mobs, doing your job of infecting the local villagers can be deadly. Fortunately, with the new JavaFX ZombieTime app, powered by the JSR 310 Date and Time API, you can rest easy. With built-in time zone and DST support you no longer have to worry about roaming around under the scorching hot sun. Accurately calculate out how long you have to infect the villagers before you decompose using Durations. And coordinate global attacks on the humans by syncing with your undead brethren on Instants. With the power of Java 8, eradicating the human race with a highly infectious virus has never been easier!
This presentation is designed to teach Java Date and Time APIs to the undead, but the living are welcome to be our "guests". You may also learn some JavaFX in the process -- that is entirely my fault. Any correlation between the characters and events in this presentation and the impending extinction of mankind is purely coincidental.
The document discusses JavaFX and its capabilities for building applications across platforms like Android and desktop systems. It provides an overview of JavaFX's cross-platform graphics, animation, and media support. It also outlines how to get JavaFX, develop applications with it using common IDEs, and deploy applications to Android devices. The document demonstrates a simple JavaFX application with animating circles and provides information on JavaFX layouts, controls, themes, and visual development tools.
This document provides instructions for setting up and using a Raspberry Pi with a touchscreen to run Java applications. It outlines downloading and installing Java 8 on the Raspberry Pi, connecting the touchscreen and other hardware, setting up the WiFi connection, and provides an example of running a sample JavaFX application. It also describes additional sensors that can be connected and sample code for interacting with them through the Pi4J library.
This document discusses using Java SE on small devices like tablets, Pis, and Legos. It outlines how Java SE 8 supports these types of devices better than previous versions through improved APIs, language features, and performance. It provides examples of projects like LeJOS that run Java on Lego Mindstorms robots and discusses tools like DukePad for developing Java applications on tablets. The document advocates getting involved in open source projects to help expand Java's reach to more small devices and embedded systems.
DukeScript is a new way of writing JavaScript applications that lets you take advantage of a powerful binding model to connect to Java code running in a local JVM.
English version of the Devoxx4Kids workshop deck to teach programming using the NAO humanoid robot. (Credit to Daniel De Luca for content creation and Nicolas Rigaud on translation)
This document discusses using a Raspberry Pi with a touchscreen to teach kids how to code and experiment with Java. It provides step-by-step instructions on setting up the hardware, installing Java on the Pi, and running sample JavaFX applications. It also explains Java streaming concepts like filtering, mapping, and reducing through code examples using a "Mary Had a Little Lamb" theme. The goal is to make coding accessible and fun for children through hands-on projects on affordable hardware.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Letter and Document Automation for Bonterra Impact Management (fka Social Sol...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on automated letter generation for Bonterra Impact Management using Google Workspace or Microsoft 365.
Interested in deploying letter generation automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
A Comprehensive Guide to DeFi Development Services in 2024Intelisync
DeFi represents a paradigm shift in the financial industry. Instead of relying on traditional, centralized institutions like banks, DeFi leverages blockchain technology to create a decentralized network of financial services. This means that financial transactions can occur directly between parties, without intermediaries, using smart contracts on platforms like Ethereum.
In 2024, we are witnessing an explosion of new DeFi projects and protocols, each pushing the boundaries of what’s possible in finance.
In summary, DeFi in 2024 is not just a trend; it’s a revolution that democratizes finance, enhances security and transparency, and fosters continuous innovation. As we proceed through this presentation, we'll explore the various components and services of DeFi in detail, shedding light on how they are transforming the financial landscape.
At Intelisync, we specialize in providing comprehensive DeFi development services tailored to meet the unique needs of our clients. From smart contract development to dApp creation and security audits, we ensure that your DeFi project is built with innovation, security, and scalability in mind. Trust Intelisync to guide you through the intricate landscape of decentralized finance and unlock the full potential of blockchain technology.
Ready to take your DeFi project to the next level? Partner with Intelisync for expert DeFi development services today!
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-und-domino-lizenzkostenreduzierung-in-der-welt-von-dlau/
DLAU und die Lizenzen nach dem CCB- und CCX-Modell sind für viele in der HCL-Community seit letztem Jahr ein heißes Thema. Als Notes- oder Domino-Kunde haben Sie vielleicht mit unerwartet hohen Benutzerzahlen und Lizenzgebühren zu kämpfen. Sie fragen sich vielleicht, wie diese neue Art der Lizenzierung funktioniert und welchen Nutzen sie Ihnen bringt. Vor allem wollen Sie sicherlich Ihr Budget einhalten und Kosten sparen, wo immer möglich. Das verstehen wir und wir möchten Ihnen dabei helfen!
Wir erklären Ihnen, wie Sie häufige Konfigurationsprobleme lösen können, die dazu führen können, dass mehr Benutzer gezählt werden als nötig, und wie Sie überflüssige oder ungenutzte Konten identifizieren und entfernen können, um Geld zu sparen. Es gibt auch einige Ansätze, die zu unnötigen Ausgaben führen können, z. B. wenn ein Personendokument anstelle eines Mail-Ins für geteilte Mailboxen verwendet wird. Wir zeigen Ihnen solche Fälle und deren Lösungen. Und natürlich erklären wir Ihnen das neue Lizenzmodell.
Nehmen Sie an diesem Webinar teil, bei dem HCL-Ambassador Marc Thomas und Gastredner Franz Walder Ihnen diese neue Welt näherbringen. Es vermittelt Ihnen die Tools und das Know-how, um den Überblick zu bewahren. Sie werden in der Lage sein, Ihre Kosten durch eine optimierte Domino-Konfiguration zu reduzieren und auch in Zukunft gering zu halten.
Diese Themen werden behandelt
- Reduzierung der Lizenzkosten durch Auffinden und Beheben von Fehlkonfigurationen und überflüssigen Konten
- Wie funktionieren CCB- und CCX-Lizenzen wirklich?
- Verstehen des DLAU-Tools und wie man es am besten nutzt
- Tipps für häufige Problembereiche, wie z. B. Team-Postfächer, Funktions-/Testbenutzer usw.
- Praxisbeispiele und Best Practices zum sofortigen Umsetzen
Building Production Ready Search Pipelines with Spark and MilvusZilliz
Spark is the widely used ETL tool for processing, indexing and ingesting data to serving stack for search. Milvus is the production-ready open-source vector database. In this talk we will show how to use Spark to process unstructured data to extract vector representations, and push the vectors to Milvus vector database for search serving.
Programming Foundation Models with DSPy - Meetup SlidesZilliz
Prompting language models is hard, while programming language models is easy. In this talk, I will discuss the state-of-the-art framework DSPy for programming foundation models with its powerful optimizers and runtime constraint system.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
Trusted Execution Environment for Decentralized Process MiningLucaBarbaro3
Presentation of the paper "Trusted Execution Environment for Decentralized Process Mining" given during the CAiSE 2024 Conference in Cyprus on June 7, 2024.
Digital Marketing Trends in 2024 | Guide for Staying AheadWask
https://www.wask.co/ebooks/digital-marketing-trends-in-2024
Feeling lost in the digital marketing whirlwind of 2024? Technology is changing, consumer habits are evolving, and staying ahead of the curve feels like a never-ending pursuit. This e-book is your compass. Dive into actionable insights to handle the complexities of modern marketing. From hyper-personalization to the power of user-generated content, learn how to build long-term relationships with your audience and unlock the secrets to success in the ever-shifting digital landscape.
GraphRAG for Life Science to increase LLM accuracyTomaz Bratanic
GraphRAG for life science domain, where you retriever information from biomedical knowledge graphs using LLMs to increase the accuracy and performance of generated answers
Introduction of Cybersecurity with OSS at Code Europe 2024Hiroshi SHIBATA
I develop the Ruby programming language, RubyGems, and Bundler, which are package managers for Ruby. Today, I will introduce how to enhance the security of your application using open-source software (OSS) examples from Ruby and RubyGems.
The first topic is CVE (Common Vulnerabilities and Exposures). I have published CVEs many times. But what exactly is a CVE? I'll provide a basic understanding of CVEs and explain how to detect and handle vulnerabilities in OSS.
Next, let's discuss package managers. Package managers play a critical role in the OSS ecosystem. I'll explain how to manage library dependencies in your application.
I'll share insights into how the Ruby and RubyGems core team works to keep our ecosystem safe. By the end of this talk, you'll have a better understanding of how to safeguard your code.
Introduction of Cybersecurity with OSS at Code Europe 2024
JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage
1. JavaFX 2.0 With Alternative Languages - Groovy, Clojure, Scala, Fantom, and Visage Stephen Chin Chief Agile Methodologist, GXS steveonjava@gmail.com tweet: @steveonjava
2. About the Presenter Stephen Chin Java Champion Family Man Chief Agile Methodologist, GXS Author, Pro JavaFX Platform OSCON Java Conference Chair Motorcyclist
3. Pro JavaFX 2 Platform Coming Soon! Coming 2nd half of this year All examples rewritten in Java Will cover the new JavaFX 2.0 APIs 3
4. Disclaimer: This is code-heavy THE FOLLOWING IS INTENDED TO STIMULATE CREATIVE USE OF JVM LANGUAGES. AFTER WATCHING THIS PRESENTATION YOU MAY FEEL COMPELLED TO START LEARNING A NEW JVM LANGUAGE AND WANT TO APPLY IT AT YOUR WORKPLACE. THE PRESENTER IS NOT LIABLE FOR ANY INNOVATION, BREAKTHROUGHS, OR NP-COMPLETE SOLUTIONS THAT MAY RESULT.
7. Programming Languages JavaFX 2.0 APIs are now in Java Pure Java APIs for all of JavaFX Expose JavaFX Binding, Sequences as Java APIs Embrace all JVM languages JRuby, Clojure, Groovy, Scala Fantom, Mira, Jython, etc. JavaFX Script is no longer supported by Oracle Existing JavaFX Script based applications will continue to run Visage is the open-source successor to the JavaFX Script language
8. JavaFX in Java JavaFX API follows JavaBeans approach Similar in feel to other UI toolkits (Swing, etc) Uses builder pattern to minimize boilerplate
9. Example Application public class HelloStage extends Application { @Override public void start(Stage stage) { stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Group root = new Group(); Scene scene = new Scene(root); scene.setFill(Color.LIGHTGREEN); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { launch(HelloStage.class, args); } }
10. Binding Unquestionably the biggest JavaFX Script innovation Supported via a PropertyBinding class Lazy invocation for high performance Static construction syntax for simple cases e.g.: bindTo(<property>)
11. Observable Pseudo-Properties Supports watching for changes to properties Implemented via anonymous inner classes Will take advantage of closures in the future
12. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { });
13. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); The property we want to watch
14. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { }); Only one listener used with generics to specify the data type
15. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) { } }); Refers to the Rectangle.hoverProperty()
16. Observable Pseudo-Properties final Rectangle rect = new Rectangle(); rect.setX(40); rect.setY(40); rect.setWidth(100); rect.setHeight(200); rect.hoverProperty().addListener(new ChangeListener<Boolean>() { public void changed(ObservableValue<? extends Boolean> property, Boolean oldValue, Boolean value) { rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } });
17. Sequences in Java Replaced with an Observable List Public API is based on JavaFX sequences Internal code can use lighter collections API JavaFX 2.0 also has an Observable Map
25. JRuby Closure Conversion rect.hoverProperty.addListener() do |prop, oldVal, newVal| rect.fill = rect.hover ? Color::GREEN : Color::RED; end 23
26. JRubySwiby require 'swiby' class HelloWorldModel attr_accessor :saying end model = HelloWorldModel.new model.saying = "Hello World" Frame { title "Hello World“ width 200 content { Label { text bind(model,:saying) } } visible true } 24
27. 25 JavaFX With Clojure Artwork by Augusto Sellhorn http://sellmic.com/
28. A Little About Clojure Started in 2007 by Rich Hickey Functional Programming Language Derived from LISP Optimized for High Concurrency … and looks nothing like Java! 26 (def hello (fn [] "Hello world")) (hello)
29. Clojure Syntax in One Slide Symbols numbers – 2.178 ratios – 355/113 strings – “clojure”, “rocks” characters – symbols – a b c d keywords – :alpha :beta boolean – true, false null - nil Collections (commas optional) Lists (1, 2, 3, 4, 5) Vectors [1, 2, 3, 4, 5] Maps {:a 1, :b 2, :c 3, :d 4} Sets #{:a :b :c :d :e} 27 (plus macros that are syntactic sugar wrapping the above)
30. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 28
31. Clojure GUI Example (defnjavafxapp[] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 29 Create a Function for the Application
32. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 30 Initialize the Stage and Scene Variables
33. Clojure GUI Example (defnjavafxapp [] (let [stage (Stage. "JavaFX Stage") scene (Scene.)] (.setFill scene Color/LIGHTGREEN) (.setWidth stage 600) (.setHeight stage 450) (.setScene stage scene) (.setVisible stage true))) (javafxapp) 31 Call Setter Methods on Scene and Stage
41. Closures in Clojure 39 Inner classes can be created using proxy (.addListenerhoverProperty (proxy [ChangeListener] [] (changed [p, o, v] (.setFillrect (if (.isHoverrect) Color/GREEN Color/RED)))))
42. Closures in Clojure Inner classes can be created using proxy 40 Proxy form: (proxy [class] [args] fs+) f => (name [params*] body) (.addListenerhoverProperty (proxy[ChangeListener][] (changed [p, o, v] (.setFillrect (if (.isHoverrect) Color/GREEN Color/RED)))))
44. Features of Groovy Tight integration with Java Very easy to port from Java to Groovy Declarative syntax Familiar to JavaFX Script developers Builders
45. Step 1: Lazy conversion to Groovy class HelloStage extends Application { void start(stage) { stage.setTitle("Hello Stage (Groovy)"); stage.setWidth(600); stage.setHeight(450); Group root = new Group(); Scene scene = new Scene(root); scene.setFill(Color.LIGHTSKYBLUE); stage.setScene(scene); stage.setVisible(true); } static void main(args) { launch(HelloStage.class, args); } }
53. Step 2: Java-ish Groovy Animations final Timeline timeline = new Timeline( cycleCount: Timeline.INDEFINITE, autoReverse: true ) final KeyValue kv1 = new KeyValue (rect1.xProperty(), 200); final KeyValue kv2 = new KeyValue (rect2.yProperty(), 200); final KeyValue kv3 = new KeyValue (circle1.radiusProperty(), 200); final KeyFramekf = new KeyFrame(Duration.valueOf(750), kv1, kv2, kv3); timeline.getKeyFrames().add(kf); timeline.play();
54. Step 3: GroovyFX Animation timeline = timeline(cycleCount: Timeline.INDEFINITE, autoReverse: true) { at 750.ms { change (rect1, "y") { to 200 } change (rect2, "x") { to 200 } change (circle, "radius") { to 200 } } } timeline.play();
55. Groovy Closures - With interface coercion def f = { p, o, v -> rect.setFill(rect.isHover() ? Color.GREEN : Color.RED); } as ChangeListener; rect.hoverProperty().addListener(f);
57. What is Scala Started in 2001 by Martin Odersky Compiles to Java bytecodes Pure object-oriented language Also a functional programming language 55
58. Why Scala? Shares many language features with JavaFX Script that make GUI programming easier: Static type checking – Catch your errors at compile time Closures – Wrap behavior and pass it by reference Declarative – Express the UI by describing what it should look like Scala also supports DSLs! 56
59. Java vs. Scala DSL public class HelloStage extends Application { public void start(Stage stage) { stage.setTitle("Hello Stage"); stage.setWidth(600); stage.setHeight(450); Scene scene = new Scene(); scene.setFill(Color.LIGHTGREEN); Rectangle rect = new Rectangle(); rect.setX(25); rect.setY(40); rect.setWidth(100); rect.setHeight(50); rect.setFill(Color.RED); stage.add(rect); stage.setScene(scene); stage.setVisible(true); } public static void main(String[] args) { Launcher.launch(HelloStage.class, args); } } object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } 57 21 Lines 541 Characters 17 Lines 324 Characters
60. object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } 58
61. 59 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Base class for JavaFX applications
62. 60 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Declarative Stage definition
63. 61 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } Inline property definitions
64. 62 object HelloJavaFX extends JavaFXApplication { def stage = new Stage { title = "Hello Stage" width = 600 height = 450 scene = new Scene { fill = Color.LIGHTGREEN content = List(new Rectangle { x = 25 y = 40 width = 100 height = 50 fill = Color.RED }) } } } List Construction Syntax
65. Animation in Scala def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } 63
66. def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } Animation in Scala 64 Duration set by Constructor Parameter
67. Animation in Scala 65 def timeline = new Timeline { repeatCount = INDEFINITE autoReverse = true keyFrames = List( new KeyFrame(time: 50) { values = List( new KeyValue(rect1.xProperty -> 300), new KeyValue(rect2.yProperty -> 500), new KeyValue(rect2.widthProperty -> 150) ) } ) } Operator overloading for animation syntax
68. Closures in Scala 66 Closures are also supported in Scala And they are 100% type-safe rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED })
69. Closures in Scala Closures are also supported in Scala And they are 100% type-safe 67 rect.hoverProperty.addListener((p, o, v) => { rect.fill = if (rect.hover) Color.GREEN else Color.RED }) Compact syntax (params) => {body}
70. Other JVM Languages to Try Jython Started by Jim Hugunin High Performance Python Mirah Invented by Charles Nutter Originally called Duby Local Type Inference, Static and Dynamic Typing Fantom Created by Brian and Andy Frank Originally called Fan Built-in Declarative Syntax Portable to Java and .NET Local Type Inference, Static and Dynamic Typing 68
77. Visage on Android Curious? Drop by room 4 after this talk to find out more…
78. Conclusion You can write JavaFX applications in pure Java JavaFX is also usable in alternate languages Over time improved support is possible Groovy Builders, Scala DSL, Visage
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
There are two kinds of listener: ‘changedListener’ and ‘ChangingListener’. Being informed of the change before it happens allow for it to be vetoed.It is also possible to either watch a single property, or all properties belonging to a bean.Note that the value passed to the callback is the old value. This is to ensure that we aren’t eagerly computing the new value when it might not be required. To get the new value, you can call the function on the bean or via the propertyReference
Slight conversion to Groovy. This can be compiled by the Groovy compiler and run, but basically there is only one line difference (the ‘static void main’ line)
This is the same code as the previous slide, taking advantage of some of the Groovy syntax tricks. This is getting to look a lot more like JavaFX Script.
This DSL handles running on the EDT, and can actually be run as-is – there is no need for a class declaration, or anything else to ensure that we’re on the EDT. This is getting us fairly close to the simple JavaFX Script at the beginning
This DSL handles running on the EDT, and can actually be run as-is – there is no need for a class declaration, or anything else to ensure that we’re on the EDT. This is getting us fairly close to the simple JavaFX Script at the beginning