JavaFX and Scala - Like Milk and CookiesStephen Chin
Presentation on Scala and JavaFX given at Scala Days. Shows how the ScalaFX API can be used to write cleaner and more maintainable code for your JavaFX applications in the Scala language. Also goes over implementation details that may be useful to other Scala DSL creators and has some quotes from Stephen Coulbourne to "lighten" things up.
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.
Cleaner APIs, Cleaner UIs with Visage (33rd Degrees)Stephen Chin
Visage is a JVM language designed specifically for UI development, with special syntax for hierarchically describing UIs, binding data and behavior, and representing UI specific concepts such as animation, layout, and styles. It also is a full-featured language with a full compiler tool-chain, static compilation to JVM bytecodes, and IDE plug-ins. This talk will demonstrate how to use the Visage language to build UIs for JavaFX 2.0, Vaadin, and Android. Find out how you can take control of your UI development by writing cleaner, more maintainable UI code using the Visage language in your existing Java projects.
This document provides an overview of new features in Java 8, including lambda expressions, default methods on interfaces, bulk data operations on collections, and other library enhancements. It discusses how lambda expressions allow for closures in Java and interface evolution with default methods. It also provides code examples of using lambda expressions for event handling and animation in a JavaFX application that makes circles vanish when clicked.
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.
Slides for the Reactive 3D Game Engine presented at ScalaDays 2014.
Shows the demo of the 3D engine, followed by the description of the reactive 3D game engine - how reactive dependencies between input, time and game logic are expressed, how to deal with GC issues, how to model game state using Reactive Collections.
Moving from JFreeChart to JavaFX with JavaFX Chart ExtensionsBruce Schubert
JavaOne 2015 - Moving Enterprise Data from JFreeChart to JavaFX [CON7008]
JFreeChart provides very sophisticated charting capabilities which has made it the de facto charting tool for countless Java applications. JavaFX also provides beautiful and enticing charts which rival JFreeChart in many areas. This presentation discusses the challenges and experiences in moving complex business driven charts from JFreeChart to JavaFX, including using JFree's ChartViewer class. I share the lessons learned as I crossed the bridge from Swing-based charts to JavaFX charts.
JavaFX and Scala - Like Milk and CookiesStephen Chin
Presentation on Scala and JavaFX given at Scala Days. Shows how the ScalaFX API can be used to write cleaner and more maintainable code for your JavaFX applications in the Scala language. Also goes over implementation details that may be useful to other Scala DSL creators and has some quotes from Stephen Coulbourne to "lighten" things up.
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.
Cleaner APIs, Cleaner UIs with Visage (33rd Degrees)Stephen Chin
Visage is a JVM language designed specifically for UI development, with special syntax for hierarchically describing UIs, binding data and behavior, and representing UI specific concepts such as animation, layout, and styles. It also is a full-featured language with a full compiler tool-chain, static compilation to JVM bytecodes, and IDE plug-ins. This talk will demonstrate how to use the Visage language to build UIs for JavaFX 2.0, Vaadin, and Android. Find out how you can take control of your UI development by writing cleaner, more maintainable UI code using the Visage language in your existing Java projects.
This document provides an overview of new features in Java 8, including lambda expressions, default methods on interfaces, bulk data operations on collections, and other library enhancements. It discusses how lambda expressions allow for closures in Java and interface evolution with default methods. It also provides code examples of using lambda expressions for event handling and animation in a JavaFX application that makes circles vanish when clicked.
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.
Slides for the Reactive 3D Game Engine presented at ScalaDays 2014.
Shows the demo of the 3D engine, followed by the description of the reactive 3D game engine - how reactive dependencies between input, time and game logic are expressed, how to deal with GC issues, how to model game state using Reactive Collections.
Moving from JFreeChart to JavaFX with JavaFX Chart ExtensionsBruce Schubert
JavaOne 2015 - Moving Enterprise Data from JFreeChart to JavaFX [CON7008]
JFreeChart provides very sophisticated charting capabilities which has made it the de facto charting tool for countless Java applications. JavaFX also provides beautiful and enticing charts which rival JFreeChart in many areas. This presentation discusses the challenges and experiences in moving complex business driven charts from JFreeChart to JavaFX, including using JFree's ChartViewer class. I share the lessons learned as I crossed the bridge from Swing-based charts to JavaFX charts.
This document provides an overview of JavaFX 2.0 and how to build JavaFX applications. It discusses the JavaFX 2.0 platform, building applications in Java, GroovyFX, ScalaFX and Visage, and the JavaFX 2.0 architecture. The document contains code examples for building a simple "Hello World" application in each technology. It also covers JavaFX properties, lists and binding capabilities.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
Beyond Breakpoints: Advanced Debugging with XCodeAijaz Ansari
This document contains code snippets and notes from a presentation or workshop about debugging techniques using tools like NSLog, LLDB, and jq. It discusses debugging crashes, testing hypotheses, and examining memory usage. It also demonstrates using the jq tool to parse and filter JSON data within the LLDB debugger. Code examples show setting breakpoints, accessing variables, and calling jq from a Python lldb command to apply jq filters to JSON strings from the debugger.
The document introduces Scala and provides an overview of Scala basics including variables, functions, objects, classes, traits, pattern matching, for-comprehensions and more. It also discusses Scala's capabilities for generic programming, lazy evaluation, and integration with Java. Examples are provided throughout to demonstrate Scala concepts.
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
Backbone.js allows developers to structure JavaScript web applications as a set of models, views, and a router. Models contain application data, views are responsible for the UI, and the router handles application state and linking views to URLs. Collections are used to manage multiple models. Events are used to coordinate changes between the different components.
Ralph Schindler (of Zend Framework) and Jon Wage (of Doctrine) presented these slides for a webinar hosted by zend.com (webinar available online).
Links are contained within the slides to the demo application that was also used during the webinar.
This document provides an overview of Scala and compares it to Java. It discusses Scala's object-oriented and functional capabilities, how it compiles to JVM bytecode, and benefits like less boilerplate code and support for functional programming. Examples are given of implementing a simple Property class in both Java and Scala to illustrate concepts like case classes, immutable fields, and less lines of code in Scala. The document also touches on Java interoperability, learning Scala gradually, XML processing capabilities, testing frameworks, and tool/library support.
The Ring programming language version 1.2 book - Part 79 of 84Mahmoud Samir Fayed
The document discusses extending Ring by adding new classes and functions. It can be done by writing C/C++ code and compiling it into a DLL that can be loaded from Ring using LoadLib(). Functions defined in the DLL can then be called from Ring. Alternatively, RingQt classes can be extended by defining new classes that inherit from existing Qt classes. A code generator written in Ring is also presented that can automatically generate wrapper code to interface with external C/C++ libraries from Ring.
The Ring programming language version 1.9 book - Part 53 of 210Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web application framework. It includes code for user authentication using a database, classes for database access and web controllers, and descriptions of the main classes and methods in the WebLib API for generating HTML pages and handling requests. The document covers key concepts like generating pages dynamically based on request parameters, working with databases using Model classes, and common tasks like cookies, file uploads, and URL encoding.
This document provides code examples in Java, Groovy, Scala, and Jython for solving the anagram problem of finding all permutations of words that can be formed from letters in a given input. The Java code is presented first, followed by simplified versions using Groovy, Scala, and Jython that take advantage of features in those languages like closures, functional programming, and dynamic typing. The examples demonstrate building a multimap to group words by their alphagrams, filtering to find groups above a minimum size, sorting the results, and printing the output.
The Ring programming language version 1.2 book - Part 35 of 84Mahmoud Samir Fayed
The document discusses using the RingLibSDL library to create games in Ring using SDL, SDL_image, SDL_ttf, and SDL_mixer. It provides examples of how to create a window, display images, switch between images, draw rectangles, use TTF fonts, handle events like closing the window, mouse events, and playing sounds. The examples demonstrate basic 2D game programming tasks like initializing libraries, loading assets, rendering to the screen, getting input, and playing audio.
The document provides an agenda for a Clojure Deep Dive presentation. The agenda includes sections on the Core Language, Standard Tools, Clojure Compilation, and Clojure Pitfalls. It then goes on to describe various aspects of the Clojure core language such as forms, functions, namespaces, and more.
Scala is becoming the language of choice for many development teams. This talk highlights how Scala excels in the world of multi-core processing and explores how it compares to Java 8.
Video Presentation: http://youtu.be/8vxTowBXJSg
This document summarizes a paper on the impossibility of batch updates for cryptographic accumulators. It shows that batch updates, which allow efficient witness updates for multiple insertions and deletions with a single update, cannot be achieved for cryptographic accumulators. The proof demonstrates that the size of the update information required is Ω(m log(N/m)), where m is the number of deletions and N is the total number of elements. Therefore, the size of the update information grows with the number of deletions, preventing truly efficient batch updates.
PHP and MySQL Tips and tricks, DC 2007Damien Seguy
Like opening a long hidden treasure chest, this session will bring many jewels back to the programming light. We'll cover a number of lesser known PHP function and MySQL functionalities, that will help at daily tasks. They will be applied in various fields, including security, performances, standard compliance and simply fun to program.
The document discusses XML parsers and compares DOM and SAX parsers. DOM parsers build an in-memory tree representation of the XML document, allowing random access but using more memory. SAX parsers use callbacks to stream the XML events to the client, using less memory but providing event-based access. The document also provides an overview of the popular Xerces-J parser and gives an example of using DOM and SAX parsers to extract circle element information from an XML document.
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.
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
This document provides an overview of JavaFX 2.0 and how to build JavaFX applications. It discusses the JavaFX 2.0 platform, building applications in Java, GroovyFX, ScalaFX and Visage, and the JavaFX 2.0 architecture. The document contains code examples for building a simple "Hello World" application in each technology. It also covers JavaFX properties, lists and binding capabilities.
The Ring programming language version 1.6 book - Part 46 of 189Mahmoud Samir Fayed
This document summarizes code from the Ring documentation related to user registration, login, and database classes. It describes classes for users, models, views, controllers, and languages that allow for user registration, login, form views, and routing. It also summarizes the Database, ModelBase, and ControllerBase classes that provide functionality for connecting to databases, executing queries, and managing model data.
The Ring programming language version 1.2 book - Part 32 of 84Mahmoud Samir Fayed
The document discusses user registration and login functionality in Ring. It describes classes for users (Model, View & Controller), form views for registration and login, and code to handle registration, login, and checking authentication. It also summarizes classes for database access (Database), model objects (ModelBase), and controllers (ControllerBase).
Beyond Breakpoints: Advanced Debugging with XCodeAijaz Ansari
This document contains code snippets and notes from a presentation or workshop about debugging techniques using tools like NSLog, LLDB, and jq. It discusses debugging crashes, testing hypotheses, and examining memory usage. It also demonstrates using the jq tool to parse and filter JSON data within the LLDB debugger. Code examples show setting breakpoints, accessing variables, and calling jq from a Python lldb command to apply jq filters to JSON strings from the debugger.
The document introduces Scala and provides an overview of Scala basics including variables, functions, objects, classes, traits, pattern matching, for-comprehensions and more. It also discusses Scala's capabilities for generic programming, lazy evaluation, and integration with Java. Examples are provided throughout to demonstrate Scala concepts.
Backbone.js: Run your Application Inside The BrowserHoward Lewis Ship
Backbone.js allows developers to structure JavaScript web applications as a set of models, views, and a router. Models contain application data, views are responsible for the UI, and the router handles application state and linking views to URLs. Collections are used to manage multiple models. Events are used to coordinate changes between the different components.
Ralph Schindler (of Zend Framework) and Jon Wage (of Doctrine) presented these slides for a webinar hosted by zend.com (webinar available online).
Links are contained within the slides to the demo application that was also used during the webinar.
This document provides an overview of Scala and compares it to Java. It discusses Scala's object-oriented and functional capabilities, how it compiles to JVM bytecode, and benefits like less boilerplate code and support for functional programming. Examples are given of implementing a simple Property class in both Java and Scala to illustrate concepts like case classes, immutable fields, and less lines of code in Scala. The document also touches on Java interoperability, learning Scala gradually, XML processing capabilities, testing frameworks, and tool/library support.
The Ring programming language version 1.2 book - Part 79 of 84Mahmoud Samir Fayed
The document discusses extending Ring by adding new classes and functions. It can be done by writing C/C++ code and compiling it into a DLL that can be loaded from Ring using LoadLib(). Functions defined in the DLL can then be called from Ring. Alternatively, RingQt classes can be extended by defining new classes that inherit from existing Qt classes. A code generator written in Ring is also presented that can automatically generate wrapper code to interface with external C/C++ libraries from Ring.
The Ring programming language version 1.9 book - Part 53 of 210Mahmoud Samir Fayed
This document provides code examples and documentation for Ring's web application framework. It includes code for user authentication using a database, classes for database access and web controllers, and descriptions of the main classes and methods in the WebLib API for generating HTML pages and handling requests. The document covers key concepts like generating pages dynamically based on request parameters, working with databases using Model classes, and common tasks like cookies, file uploads, and URL encoding.
This document provides code examples in Java, Groovy, Scala, and Jython for solving the anagram problem of finding all permutations of words that can be formed from letters in a given input. The Java code is presented first, followed by simplified versions using Groovy, Scala, and Jython that take advantage of features in those languages like closures, functional programming, and dynamic typing. The examples demonstrate building a multimap to group words by their alphagrams, filtering to find groups above a minimum size, sorting the results, and printing the output.
The Ring programming language version 1.2 book - Part 35 of 84Mahmoud Samir Fayed
The document discusses using the RingLibSDL library to create games in Ring using SDL, SDL_image, SDL_ttf, and SDL_mixer. It provides examples of how to create a window, display images, switch between images, draw rectangles, use TTF fonts, handle events like closing the window, mouse events, and playing sounds. The examples demonstrate basic 2D game programming tasks like initializing libraries, loading assets, rendering to the screen, getting input, and playing audio.
The document provides an agenda for a Clojure Deep Dive presentation. The agenda includes sections on the Core Language, Standard Tools, Clojure Compilation, and Clojure Pitfalls. It then goes on to describe various aspects of the Clojure core language such as forms, functions, namespaces, and more.
Scala is becoming the language of choice for many development teams. This talk highlights how Scala excels in the world of multi-core processing and explores how it compares to Java 8.
Video Presentation: http://youtu.be/8vxTowBXJSg
This document summarizes a paper on the impossibility of batch updates for cryptographic accumulators. It shows that batch updates, which allow efficient witness updates for multiple insertions and deletions with a single update, cannot be achieved for cryptographic accumulators. The proof demonstrates that the size of the update information required is Ω(m log(N/m)), where m is the number of deletions and N is the total number of elements. Therefore, the size of the update information grows with the number of deletions, preventing truly efficient batch updates.
PHP and MySQL Tips and tricks, DC 2007Damien Seguy
Like opening a long hidden treasure chest, this session will bring many jewels back to the programming light. We'll cover a number of lesser known PHP function and MySQL functionalities, that will help at daily tasks. They will be applied in various fields, including security, performances, standard compliance and simply fun to program.
The document discusses XML parsers and compares DOM and SAX parsers. DOM parsers build an in-memory tree representation of the XML document, allowing random access but using more memory. SAX parsers use callbacks to stream the XML events to the client, using less memory but providing event-based access. The document also provides an overview of the popular Xerces-J parser and gives an example of using DOM and SAX parsers to extract circle element information from an XML document.
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.
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
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?
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.
The document discusses using JavaFX on Raspberry Pi devices. It provides examples of JavaFX applications written in both Java and the GroovyFX declarative syntax. It demonstrates how GroovyFX simplifies common tasks like creating UI elements, adding animations, handling events, and laying out components compared to the Java approach.
Based on the core.async library Clojure allows a CSP programming style, so your system is made up of asynchronous, lightweight processes which communicate through channels.
The talk shows common pitfalls in classic OO GUI
approaches and shows how to tackle some of these problems in a fundamentally simpler way.
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.
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.
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.
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.
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.
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.
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 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.
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 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.
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.
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.
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.
In a world where users have ever higher expectations from the apps they use, having data always available, even when the device is offline, has become increasingly important.
In this talk you will learn how thinking "offline first" not only makes your app architecture better but also result in cleaner code and happier users.
I will introduce Realm, a new database for easy persistence, and demonstrate how it enables truly reactive UI's by fitting seamlessly into the standard network stack of Retrofit and RxJava.
Finally we will take a look at the new Realm Mobile Platform, which provides real-time synchronization between devices, enabling features previously out of reach for many development teams.
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 overview of the Scala programming language. Some key points:
- Scala runs on the Java Virtual Machine and was created by Martin Odersky at EPFL.
- It has been around since 2003 and the current stable release is 2.7.7. Release 2.8 beta 1 is due out soon.
- Scala combines object-oriented and functional programming. It has features like pattern matching, actors, XML literals, and more that differ from Java. Everything in Scala is an object.
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.
This document provides an overview of coding in style with Scala. It discusses embracing expressions over statements, operator notation, using language features to simplify code, favoring higher-order functions, manipulating data with collections, working with asynchronous code and futures, macro programming to transform ASTs, and new features coming in Scala 2.11 like potential modularization and performance improvements. The document encourages idiomatic Scala techniques like favoring expressions, embracing operators, letting the language do work, aiming higher with higher-order functions, and embracing new language features.
This document provides an introduction to Scala. It discusses:
- Who the author is and their background with Scala and Spark
- Why Scala is a scalable language that runs on the JVM and supports object oriented and functional programming
- How to install Scala and use the Scala interpreter
- Basic Scala syntax like defining values and variables, type inference, strings, tuples, objects, importing classes
- Common functions and operations like map, reduce, anonymous functions, pattern matching
- Code samples for RDD relations and SparkPi
- Tips for using Scala in practice including SBT and good IDEs like IntelliJ
This document discusses new features in ES6/ES2015 including let and const (block scope), template strings, arrow functions, default function parameters, destructuring, classes, inheritance, promises, and async/await. It provides code examples for each feature and recommends using Babel to compile JavaScript and use these new features today across browsers.
The document introduces the Mobello mobile web app framework. It provides an overview of Mobello, describing it as a JavaScript framework for building richly interactive mobile web apps. It outlines key Mobello concepts like scene controllers, navigators, components for UI elements, theming capabilities, and the Mobello Studio IDE. The document also compares declarative vs programmatic approaches and shows code examples for key framework aspects like scenes, navigation, animation, and component creation.
This document introduces higher order functions (HOFs) in Scala. It provides examples of how HOFs such as map and filter can transform collections in more idiomatic and functional ways compared to imperative approaches using loops. Key benefits of HOFs include producing immutable and thread-safe results without needing to manually manage intermediate data structures. The document also briefly outlines some other powerful HOFs like reduce, partition, min, max and parallel collections.
The document provides documentation for an SVG generation library in Go. It describes functions for reading Flickr photo data, parsing it into structures, and drawing an image grid. Key functions include flickrAPI to call the Flickr API, makeURI to convert photo details to URLs, and imageGrid to read the response, create an SVG group, and add linked image elements in a grid layout.
Not so long ago Microsoft announced a new language trageting on front-end developers. Everybody's reaction was like: Why?!! Is it just Microsoft darting back to Google?!
So, why a new language? JavaScript has its bad parts. Mostly you can avoid them or workaraund. You can emulate class-based OOP style, modules, scoping and even run-time typing. But that is doomed to be clumsy. That's not in the language design. Google has pointed out these flaws, provided a new language and failed. Will the story of TypeScript be any different?
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
Emerging Languages: A Tour of the HorizonAlex Payne
A tour of a number of new programming languages, organized by the job they're best suited for. Presented at Philadelphia Emerging Technology for the Enterprise 2012.
Similar to Hacking JavaFX with Groovy, Clojure, Scala, 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.
This document discusses JavaFX and how to develop applications with it. It provides an overview of JavaFX's capabilities like cross-platform animation and graphics acceleration. It explains how to get JavaFX, develop with it using popular IDEs, and create a simple "Hello World" application. It also discusses running JavaFX on embedded boards like BeagleBone and upcoming support for Raspberry Pi. The conclusion summarizes that JavaFX enables visually rich apps that can be deployed via browser, web start, or native packaging.
Moving to the Client - JavaFX and HTML5Stephen Chin
Stephen Chin presented on moving applications to the client using JavaFX and HTML5. He provided a history of HTML and discussed key HTML5 features like Canvas, offline storage, and WebSockets. He demonstrated displaying HTML in JavaFX using the WebView control and calling JavaScript from JavaFX. Chin also showed responsive design techniques and discussed using JavaScript frameworks like jQuery for cross-browser compatibility. Finally, he highlighted Oracle Cloud Platform services for running databases and Java applications in the cloud.
JavaFX 2 - A Java Developer's Guide (San Antonio JUG Version)Stephen Chin
This document summarizes a presentation about JavaFX 2. It introduces the presenter and provides his credentials. It also lists resources for learning JavaFX like books, blogs and websites. The presentation covers getting started with JavaFX, using JavaFX UI controls, using media classes with Spring, and using the SceneBuilder tool to develop JavaFX applications visually. Code examples are provided and demonstrated.
The document discusses using the Spring Framework with JavaFX. It provides an overview of a presentation on this topic, including introductions of the presenter and resources discussed. Examples shown include using media classes, Spring data and security, and the SceneBuilder tool for developing JavaFX user interfaces. The presentation aims to demonstrate how to build robust applications integrating the Spring backend with the JavaFX frontend.
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
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.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Webinar: Designing a schema for a Data WarehouseFederico Razzoli
Are you new to data warehouses (DWH)? Do you need to check whether your data warehouse follows the best practices for a good design? In both cases, this webinar is for you.
A data warehouse is a central relational database that contains all measurements about a business or an organisation. This data comes from a variety of heterogeneous data sources, which includes databases of any type that back the applications used by the company, data files exported by some applications, or APIs provided by internal or external services.
But designing a data warehouse correctly is a hard task, which requires gathering information about the business processes that need to be analysed in the first place. These processes must be translated into so-called star schemas, which means, denormalised databases where each table represents a dimension or facts.
We will discuss these topics:
- How to gather information about a business;
- Understanding dictionaries and how to identify business entities;
- Dimensions and facts;
- Setting a table granularity;
- Types of facts;
- Types of dimensions;
- Snowflakes and how to avoid them;
- Expanding existing dimensions and facts.
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.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceIndexBug
Imagine a world where machines not only perform tasks but also learn, adapt, and make decisions. This is the promise of Artificial Intelligence (AI), a technology that's not just enhancing our lives but revolutionizing entire industries.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
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.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
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.
Hacking JavaFX with Groovy, Clojure, Scala, and Visage
1. Hacking JavaFX with Groovy, Clojure,
Scala, and Visage
Stephen Chin
Java Evangelist, Oracle
stephen.chin@oracle.com
tweet: @steveonjava
2. Meet the Presenter
Stephen Chin
> Java Evangelist, Oracle
> Author, Pro JavaFX Platform 2
Family Man
> Open Source Hacker
JFXtras
ScalaFX
Motorcyclist Visage
> User Group Co-Leader
Silicon Valley JavaFX
User Group
Streamed Live!
3. Safe Harbor Statement
The following is intended to outline our general product
direction. It is intended for information purposes only, and
may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality,
and should not be relied upon in making purchasing
decisions. The development, release, and timing of any
features or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
4. JavaFX 2.0 Platform
Immersive Application Experience
Leverage your Java skills with modern JavaFX
APIs
> Cross-platform Animation, Video, Charting
> Integrate Java, JavaScript, and HTML5 in the
same application
> New graphics stack takes advantage of
hardware acceleration for 2D and 3D
applications
> Use your favorite IDE: NetBeans, Eclipse,
IntelliJ, etc.
6. Programming Languages
> JavaFX 2.0 APIs are now in Java
Pure Java APIs for all of JavaFX
Binding and Sequences exposed as Java APIs
FXML Markup for tooling
> Embrace all JVM languages
Groovy, Scala, Clojure, JRuby
Fantom, Mira, Gosu, 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. Vanishing Circles in Java
public class VanishingCircles extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Vanishing Circles");
Group root = new Group();
Scene scene = new Scene(root, 800, 600, Color.BLACK);
List<Circle> circles = new ArrayList<Circle>();
for (int i = 0; i < 50; i++) {
final Circle circle = new Circle(150);
circle.setCenterX(Math.random() * 800);
circle.setCenterY(Math.random() * 600);
circle.setFill(new Color(Math.random(), Math.random(), Math.random(), .2));
40 Lines
circle.setEffect(new BoxBlur(10, 10, 3));
circle.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
public void handle(MouseEvent t) {
KeyValue collapse = new KeyValue(circle.radiusProperty(), 0);
1299 Characters
new Timeline(new KeyFrame(Duration.seconds(3), collapse)).play();
}
});
circle.setStroke(Color.WHITE);
circle.strokeWidthProperty().bind(Bindings.when(circle.hoverProperty())
.then(4)
.otherwise(0));
circles.add(circle);
}
root.getChildren().addAll(circles);
primaryStage.setScene(scene);
primaryStage.show();
Timeline moveCircles = new Timeline();
for (Circle circle : circles) {
KeyValue moveX = new KeyValue(circle.centerXProperty(), Math.random() * 800);
KeyValue moveY = new KeyValue(circle.centerYProperty(), Math.random() * 600);
moveCircles.getKeyFrames().add(new KeyFrame(Duration.seconds(40), moveX, moveY));
}
moveCircles.play();
}
}
8
9. Application Skeleton
public class VanishingCircles extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Vanishing Circles");
Group root = new Group();
Scene scene = new Scene(root, 800, 600, Color.BLACK);
[create the circles…]
root.getChildren().addAll(circles);
primaryStage.setScene(scene);
primaryStage.show();
[begin the animation…]
}
}
10. Create the Circles
List<Circle> circles = new ArrayList<Circle>();
for (int i = 0; i < 50; i++) {
final Circle circle = new Circle(150);
circle.setCenterX(Math.random() * 800);
circle.setCenterY(Math.random() * 600);
circle.setFill(new Color(Math.random(), Math.random(),
Math.random(), .2));
circle.setEffect(new BoxBlur(10, 10, 3));
circle.setStroke(Color.WHITE);
[setup binding…]
[setup event listeners…]
circles.add(circle);
}
10
15. Features of Groovy
> Modern language
Closures
AST Transforms
Strongly typed dynamic language
> Tight integration with Java
Very easy to port from Java to Groovy
> Declarative syntax with GroovyFX Builders
Familiar to Groovy and JavaFX Script developers
16. Java vs. GroovyFX DSL
public class VanishingCircles extends Application { GroovyFX.start { primaryStage ->
def sg = new SceneGraphBuilder()
public static void main(String[] args) { def rand = new Random().&nextInt
Application.launch(args); def circles = []
}
sg.stage(title: 'Vanishing Circles', show: true) {
@Override scene(fill: black, width: 800, height: 600) {
public void start(Stage primaryStage) { 50.times {
primaryStage.setTitle("Vanishing Circles"); circles << circle(centerX: rand(800), centerY: rand(600), radius: 150, stroke: white,
Group root = new Group(); strokeWidth: bind('hover', converter: {val -> val ? 4 : 0})) {
Scene scene = new Scene(root, 800, 600, Color.BLACK); fill rgb(rand(255), rand(255), rand(255), 0.2)
List<Circle> circles = new ArrayList<Circle>(); effect boxBlur(width: 10, height: 10, iterations: 3)
for (int i = 0; i < 50; i++) { onMouseClicked { e ->
29 Lines
final Circle circle = new Circle(150); timeline {
40 Lines
circle.setCenterX(Math.random() * 800);
circle.setCenterY(Math.random() * 600);
circle.setFill(new Color(Math.random(), Math.random(), Math.random(), .2));
circle.setEffect(new BoxBlur(10, 10, 3)); }
}
at(3.s) { change e.source.radiusProperty() to 0 }
}.play()
1299 Characters
circle.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
public void handle(MouseEvent t) {
KeyValue collapse = new KeyValue(circle.radiusProperty(), 0);
new Timeline(new KeyFrame(Duration.seconds(3), collapse)).play();
}
}
671 Characters
timeline(cycleCount: Timeline.INDEFINITE, autoReverse: true) {
} circles.each { circle ->
}); at (40.s) {
circle.setStroke(Color.WHITE); change circle.centerXProperty() to rand(800)
circle.strokeWidthProperty().bind(Bindings.when(circle.hoverProperty()) change circle.centerYProperty() to rand(600)
.then(4) }
.otherwise(0)); }
circles.add(circle); }.play()
} }
root.getChildren().addAll(circles); }
primaryStage.setScene(scene);
primaryStage.show();
Timeline moveCircles = new Timeline();
for (Circle circle : circles) {
KeyValue moveX = new KeyValue(circle.centerXProperty(), Math.random() * 800);
KeyValue moveY = new KeyValue(circle.centerYProperty(), Math.random() * 600);
moveCircles.getKeyFrames().add(new KeyFrame(Duration.seconds(40), moveX, moveY));
}
moveCircles.play();
}
}
16
43. A Little About Clojure
> Started in 2007 by Rich Hickey
> Functional Programming Language
> Derived from LISP
> Optimized for High Concurrency
(def hello (fn [] "Hello world"))
(hello)
> … and looks nothing like Java!
43
44. Clojure Syntax in One Slide
Symbols Collections
(commas optional)
> numbers – 2.178 > Lists
> ratios – 355/113 (1, 2, 3, 4, 5)
> strings – “clojure”, “rocks” > Vectors
> characters – a b c d [1, 2, 3, 4, 5]
> symbols – a b c d > Maps
> keywords – :alpha :beta {:a 1, :b 2, :c 3, :d 4}
> boolean – true, false > Sets
> null - nil #{:a :b :c :d :e}
(plus macros that are syntactic sugar wrapping the above)
44
48. Closures in Clojure
> Inner classes can be created using proxy
(.addListener hoverProperty
(proxy [ChangeListener] []
(handle [p, o, v]
(.setFill rect
(if (.isHover rect) Color/GREEN Color/RED)))))
48
49. Closures in Clojure
> Inner classes can be created using proxy
Proxy form:
(proxy [class] [args] fs+)
f => (name [params*] body)
(.addListener hoverProperty
(proxy [ChangeListener] []
(handle [p, o, v]
(.setFill rect
(if (.isHover rect) Color/GREEN Color/RED)))))
49
51. What is Scala
2001 2006
• Scala Started • Scala v2.0
2003/2004 2011
• Scala v1.0 • Scala 2.9.2 (latest)
> Started in 2001 by Martin Odersky
> Compiles to Java bytecodes
> Pure object-oriented language
> Also a functional programming language
51
52. Java vs. Scala DSL
public class VanishingCircles extends Application { object VanishingCircles extends JFXApp {
var circles: Seq[Circle] = null
public static void main(String[] args) { stage = new Stage {
Application.launch(args); title = "Vanishing Circles"
} width = 800
height = 600
@Override scene = new Scene {
public void start(Stage primaryStage) { fill = BLACK
primaryStage.setTitle("Vanishing Circles"); circles = for (i <- 0 until 50) yield new Circle {
Group root = new Group(); centerX = random * 800
Scene scene = new Scene(root, 800, 600, Color.BLACK); centerY = random * 600
List<Circle> circles = new ArrayList<Circle>(); radius = 150
for (int i = 0; i < 50; i++) { fill = color(random, random, random, .2)
final Circle circle = new Circle(150); effect = new BoxBlur(10, 10, 3)
40 Lines
circle.setCenterX(Math.random() * 800);
circle.setCenterY(Math.random() * 600);
circle.setFill(new Color(Math.random(), Math.random(), Math.random(), .2));
circle.setEffect(new BoxBlur(10, 10, 3));
33 Lines
strokeWidth <== when (hover) then 4 otherwise 0
stroke = WHITE
onMouseClicked = {
Timeline(at (3 s) {radius -> 0}).play()
1299 Characters
circle.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
public void handle(MouseEvent t) {
KeyValue collapse = new KeyValue(circle.radiusProperty(), 0);
new Timeline(new KeyFrame(Duration.seconds(3), collapse)).play(); }
}
}
591 Characters
content = circles
} }
});
circle.setStroke(Color.WHITE); new Timeline {
circle.strokeWidthProperty().bind(Bindings.when(circle.hoverProperty()) cycleCount = INDEFINITE
.then(4) autoReverse = true
.otherwise(0)); keyFrames = for (circle <- circles) yield at (40 s) {
circles.add(circle); Set(
} circle.centerX -> random * stage.width,
root.getChildren().addAll(circles); circle.centerY -> random * stage.height
primaryStage.setScene(scene); )
primaryStage.show(); }
}.play();
Timeline moveCircles = new Timeline(); }
for (Circle circle : circles) {
KeyValue moveX = new KeyValue(circle.centerXProperty(), Math.random() * 800);
KeyValue moveY = new KeyValue(circle.centerYProperty(), Math.random() * 600);
moveCircles.getKeyFrames().add(new KeyFrame(Duration.seconds(40), moveX, moveY));
}
moveCircles.play();
}
}
52
53. object VanishingCircles extends JFXApp {
stage = new Stage {
title = "Disappearing Circles"
width = 800
height = 600
scene = new Scene {
fill = BLACK
children = for (i <- 0 until 50) yield new Circle {
centerX = random * 800
centerY = random * 600
radius = 150
fill = color(random, random, random, 0.2)
effect = new BoxBlur(10, 10, 3)
}
}
}
}
53
54. object VanishingCircles extends JFXApp {
stage = new Stage {
title = "Disappearing Circles"
width = 800
height Base class for JavaFX applications
= 600
scene = new Scene {
fill = BLACK
children = for (i <- 0 until 50) yield new Circle {
centerX = random * 800
centerY = random * 600
radius = 150
fill = color(random, random, random, 0.2)
effect = new BoxBlur(10, 10, 3)
}
}
}
}
54
55. object VanishingCircles extends JFXApp {
stage = new Stage {
title = "Disappearing Circles"
width = 800
height = 600
scene = new Scene { Declarative Stage definition
fill = BLACK
children = for (i <- 0 until 50) yield new Circle {
centerX = random * 800
centerY = random * 600
radius = 150
fill = color(random, random, random, 0.2)
effect = new BoxBlur(10, 10, 3)
}
}
}
}
55
56. object VanishingCircles extends JFXApp {
stage = new Stage {
title = "Disappearing Circles"
width = 800 Inline property definitions
height = 600
scene = new Scene {
fill = BLACK
children = for (i <- 0 until 50) yield new Circle {
centerX = random * 800
centerY = random * 600
radius = 150
fill = color(random, random, random, 0.2)
effect = new BoxBlur(10, 10, 3)
}
}
}
}
56
57. object VanishingCircles extends JFXApp {
stage = new Stage {
title = "Disappearing Circles"
width = 800
height = 600 Sequence Creation Via Loop
scene = new Scene {
fill = BLACK
children = for (i <- 0 until 50) yield new Circle {
centerX = random * 800
centerY = random * 600
radius = 150
fill = color(random, random, random, 0.2)
effect = new BoxBlur(10, 10, 3)
}
}
}
}
57
58. Binding in Scala
Infix Addition/Subtraction/Multiplication/Division:
height <== rect1.height + rect2.height
Aggregate Operators:
width <== max(rect1.width, rect2.width, rect3.width)
Conditional Expressions:
strokeWidth <== when (hover) then 4 otherwise 0
Compound Expressions:
text <== when (rect.hover || circle.hover && !disabled) then
textField.text + " is enabled" otherwise "disabled"
58
59. Animation in Scala
val timeline = new Timeline {
cycleCount = INDEFINITE
autoReverse = true
keyFrames = for (circle <- circles) yield at (40 s) {
Set(
circle.centerX -> random * stage.width,
circle.centerY -> random * stage.height
)
}
}
timeline.play();
59
60. JavaFX Script-like animation
Animation in Scala syntax: at (duration) {keyframes}
val timeline = new Timeline {
cycleCount = INDEFINITE
autoReverse = true
keyFrames = for (circle <- circles) yield at (40 s) {
Set(
circle.centerX -> random * stage.width,
circle.centerY -> random * stage.height
)
}
}
timeline.play();
60
61. Animation in Scala
val timeline = new Timeline {
cycleCount = INDEFINITE
autoReverse = true
keyFrames = for (circle <- circles) yield at (40 s) {
Set(
circle.centerX -> random * stage.width,
circle.centerY -> random * stage.height
)
}
}
Operator overloading for animation
timeline.play();
syntax
61
62. Animation in Scala
val timeline = new Timeline {
cycleCount = INDEFINITE
autoReverse = true
keyFrames = for (circle <- circles) yield at (40 s) {
Set(
circle.centerX -> random * stage.width tween EASE_BOTH,
circle.centerY -> random * stage.height tween EASE_IN
)
}
}
timeline.play(); Optional tween
syntax
62
63. Event Listeners in Scala
> Supported using the built-in Closure syntax
> Arguments for event objects
> 100% type-safe
onMouseClicked = { (e: MouseEvent) =>
Timeline(at(3 s){radius->0}).play()
}
63
64. Event Listeners in Scala
> Supported using the built-in Closure syntax
> Arguments for event objects
> 100% type-safe
onMouseClicked = { (e: MouseEvent) =>
Timeline(at(3 s){radius->0}).play()
}
Compact syntax
{body}
64
65. Event Listeners in Scala
> Supported using the built-in Closure syntax
> Arguments for event objects
Event parameter
> 100% type-safe {(event) => body}
onMouseClicked = { (e: MouseEvent) =>
Timeline(at(3 s){radius->0}).play()
}
65
66. TableView in ScalaFX
def dateFormat = new SimpleDateFormat("yyyy-MM-dd")
new TableView[Speaker](persons) {
columns = Seq(
new TableColumn[Speaker, String] {
text: "Name"
converter = {_.firstName}
} new TableColumn[Speaker, String] {
text: "Age"
converter = {_.age}
} new TableColumn[Speaker, String] {
text: "Gender"
converter = {_.gender}
} new TableColumn[Speaker, String] {
text: "Birth"
converter = {dateFormat.format(_.dob)},
}
)}
66
68. About Project Visage
> “Visage is a domain specific language (DSL) designed for the
express purpose of writing user interfaces.”
> Visage project goals:
Compile to JavaFX Java APIs
Evolve the Language (Annotations, Maps, etc.)
Support Other Toolkits
> Come join the team!
> For more info: http://visage-lang.org/
68
69. Java vs. Visage DSL
public class VanishingCircles extends Application { var circles:Circle[];
Stage {
public static void main(String[] args) { title: "Vanishing Circles"
Application.launch(args); Scene {
} width: 800
height: 600
@Override fill: BLACK
public void start(Stage primaryStage) { Group {
primaryStage.setTitle("Vanishing Circles"); circles = for (i in [1..50]) {
Group root = new Group(); def c:Circle = Circle {
Scene scene = new Scene(root, 800, 600, Color.BLACK); centerX: random() * 800
List<Circle> circles = new ArrayList<Circle>(); centerY: random() * 600
for (int i = 0; i < 50; i++) { radius: 150
final Circle circle = new Circle(150); fill: color(random(), random(), random(), .2)
40 Lines
circle.setCenterX(Math.random() * 800);
circle.setCenterY(Math.random() * 600);
circle.setFill(new Color(Math.random(), Math.random(), Math.random(), .2));
circle.setEffect(new BoxBlur(10, 10, 3));
35 Lines
effect: BoxBlur {
height: 10
width: 10
iterations: 3
1299 Characters
circle.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
public void handle(MouseEvent t) {
KeyValue collapse = new KeyValue(circle.radiusProperty(), 0);
new Timeline(new KeyFrame(Duration.seconds(3), collapse)).play();
}
487 Characters
stroke: WHITE
strokeWidth: bind if (c.hover) 5 else 0
onMouseClicked: function(e) {
} Timeline {at (3s) {c.radius => 0}}.play()
}); }
circle.setStroke(Color.WHITE); }
circle.strokeWidthProperty().bind(Bindings.when(circle.hoverProperty()) }
.then(4) }
.otherwise(0)); }
circles.add(circle); }
}
root.getChildren().addAll(circles); Timeline {
primaryStage.setScene(scene); for (circle in circles) at (40s) {
primaryStage.show(); circle.centerX => random() * 800;
circle.centerY => random() * 600
Timeline moveCircles = new Timeline(); }
for (Circle circle : circles) { }.play()
KeyValue moveX = new KeyValue(circle.centerXProperty(), Math.random() * 800);
KeyValue moveY = new KeyValue(circle.centerYProperty(), Math.random() * 600);
moveCircles.getKeyFrames().add(new KeyFrame(Duration.seconds(40), moveX, moveY));
}
moveCircles.play();
}
}
69
70. How about JavaFX on… Visage
Stage {
title: "Vanishing Circles"
scene: Scene {
width: 800
height: 600
fill: BLACK
content: Group {
circles = for (i in [1..50]) {
Circle {
centerX: random() * 800
centerY: random() * 600
}
}
}
}
}
70
71. How about JavaFX on… Visage
Stage {
title: "Vanishing Circles"
scene: Scene {
width: 800
height: 600
fill: BLACK
content: Group {
circles = for (i in [1..50]) {
Circle {
centerX: random() * 800
centerY: random() * 600
}
}
}
}
}
71
72. How about JavaFX on… Visage
Stage {
title: "Vanishing Circles"
Scene {
width: 800
height: 600
fill: BLACK
Group {
circles = for (i in [1..50]) {
Circle {
centerX: random() * 800
centerY: random() * 600
}
}
}
}
}
72
74. Visage and JavaFX 2.0 are made for each other…
> Enhanced Binding
Retains lazy evaluation properties with additional expressive power
> Integrated Collections
Sequences and Maps automatically convert between JavaFX
Observable Lists/Maps
> Built-in Animation Syntax
Ties into JavaFX animation subsystem
Provides consistent, clean APIs
74
75. Other JVM Languages to Try
> JRuby
Faithful to Ruby language with the power of the JVM
> Gosu
Up and coming language created at GuideWire
Easy to enhance libraries and create DSLs
> Mirah
Invented by Charles Nutter
Local Type Inference, Static and Dynamic Typing
> Fantom
Created by Brian and Andy Frank
Portable to Java and .NET
Local Type Inference, Static and Dynamic Typing
75
76. Conclusion
> You can write JavaFX applications in pure Java
> JavaFX is also usable in alternate languages
> You can get improved support using DSL libraries
GroovyFX
ScalaFX
> Or a dedicated UI JVM Language
Visage
77. Stephen Chin
stephen.chin@oracle.com
tweet: @steveonjava
Thanks to Dean Iverson and Jonathan Giles for help preparing this talk 77