Lab session given at OSCON Java 2011:
Visage is the successor to the JavaFX Script Language, a domain-specific language for writing UIs. It excels at rapid application design and can be used on any platform that supports Java. In this lab you will have an opportunity to write Visage applications that deploy to and run on Android mobile devices. No prior experience with Android or Visage development is required.
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.
This document discusses JavaFX and its capabilities for incorporating media and animation. It provides an overview of the JavaFX platform and roadmap, and describes features of the JavaFX Script programming language like binding, animation, and media playback. It also covers tools for JavaFX development and deployment basics, including software requirements and the JavaFX SDK.
The document discusses React, Redux, and ES6/7 features. It begins with an overview of React lifecycles and class components. It then provides a brief introduction to Redux, including core concepts like actions, reducers, and unidirectional data flow. The document also includes an example to demonstrate how React and Redux can work together, with Redux managing application state in the store and React components interacting via container components.
This document discusses Java EE 6 Web Beans, which define a unifying dependency injection and contextual lifecycle model. Some key points:
- Web Beans are defined in JSR-299 and provide a richer dependency management model for Java EE 6 that integrates web and transactional tiers.
- Objects can be injected including EJBs, resources, producers. Scopes like request and conversation are supported.
- Producer methods allow controlling object instantiation. Events allow decoupling producers and observers. Specialization allows overriding beans.
- The reference implementation is integrated in JBoss and GlassFish. It provides extra integrations and is available for other containers via addons. The JSR is in its second public
This document provides a summary of Han Janghyun's background and experience. It includes:
1. Han Janghyun previously worked as a senior developer at Samsung SDS and has experience implementing TV platform JavaScript applications and retail solution servers and frontends.
2. He now works as a freelance developer and operates the blog han41858.tistory.com. He is also writing a translation of the book Angular 2.
3. Han Janghyun is also involved in operating GDG Korea Web Tech.
A look at how HTML5 aims to plug the holes that Flash has been filling in browsers for the last decade, looking at both HTML5 and non-HTML5 JavaScript APIs.
For Flash Brighton in Feb 2010.
Slides for JJUG(Japan Java User Group) 2009 Fall BOF.
Talking about groovy history, new features in Groovy 1.6,1.7.
Especially focused on AST Transformations.
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.
This document discusses JavaFX and its capabilities for incorporating media and animation. It provides an overview of the JavaFX platform and roadmap, and describes features of the JavaFX Script programming language like binding, animation, and media playback. It also covers tools for JavaFX development and deployment basics, including software requirements and the JavaFX SDK.
The document discusses React, Redux, and ES6/7 features. It begins with an overview of React lifecycles and class components. It then provides a brief introduction to Redux, including core concepts like actions, reducers, and unidirectional data flow. The document also includes an example to demonstrate how React and Redux can work together, with Redux managing application state in the store and React components interacting via container components.
This document discusses Java EE 6 Web Beans, which define a unifying dependency injection and contextual lifecycle model. Some key points:
- Web Beans are defined in JSR-299 and provide a richer dependency management model for Java EE 6 that integrates web and transactional tiers.
- Objects can be injected including EJBs, resources, producers. Scopes like request and conversation are supported.
- Producer methods allow controlling object instantiation. Events allow decoupling producers and observers. Specialization allows overriding beans.
- The reference implementation is integrated in JBoss and GlassFish. It provides extra integrations and is available for other containers via addons. The JSR is in its second public
This document provides a summary of Han Janghyun's background and experience. It includes:
1. Han Janghyun previously worked as a senior developer at Samsung SDS and has experience implementing TV platform JavaScript applications and retail solution servers and frontends.
2. He now works as a freelance developer and operates the blog han41858.tistory.com. He is also writing a translation of the book Angular 2.
3. Han Janghyun is also involved in operating GDG Korea Web Tech.
A look at how HTML5 aims to plug the holes that Flash has been filling in browsers for the last decade, looking at both HTML5 and non-HTML5 JavaScript APIs.
For Flash Brighton in Feb 2010.
Slides for JJUG(Japan Java User Group) 2009 Fall BOF.
Talking about groovy history, new features in Groovy 1.6,1.7.
Especially focused on AST Transformations.
JavaFX is used by many companies and organizations for a variety of applications. Some key uses of JavaFX include:
- Embedded applications, including on devices like phones and set-top boxes.
- Mobile applications, as JavaFX supports deploying to iOS and Android.
- Web applications, with JavaFX code running in browsers using a plugin or port to HTML5.
- Traditional desktop applications, where JavaFX can provide a modern user interface for programs.
- Specific examples given include office management software by an AIDS foundation in Germany.
This document discusses managing change and achieving regression isolation using dynamic Groovy edges. It describes how Groovy can be used to build edge components, such as web service clients, in a way that makes it easier to update them and reduce the need for full regression testing when changes occur. Groovy allows direct access to XML payloads using techniques like the Markup Builder and XML Slurper. The document provides examples of using Groovy to detect web service changes and consume web services. It also discusses strategies for configuring Groovy scripts in Spring applications.
♥ Play Framework is an open-source web application framework for Java and Scala that follows the model-view-controller (MVC) architectural pattern. It supports dependency injection, routing, and asynchronous programming. Some key features include routing, controllers, database access using Slick, evolutions for database schema changes, and support for functional programming concepts like Option, Either, and Future.
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesRob Tweed
This presentation is Part 14 of the EWD 3 Training Course. It explains how (and when) to use Ajax/HTTP messaging instead of WebSockets within your QEWD applications
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
The document discusses the key features of Java EE 7 including improved developer productivity through more annotated POJOs, less boilerplate code, and a cohesive integrated platform. It highlights top features such as WebSocket client/server endpoints, batch applications, JSON processing, concurrency utilities, simplified JMS API, and more annotated POJOs. The document provides details on these features and code examples for concepts like WebSocket chat servers, JSON streaming API, batch job specification, and simplified JMS message sending.
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
From framework coupled code to microservices through DDD modules. The presentation discussed the evolution from monolithic frameworks to microservices architecture through various stages:
1) Old days of framework coupled code with low autonomy, maintainability and learning curve.
2) Use of MVC frameworks improved isolation but code was still highly coupled.
3) Focus on testing drove adoption of SOLID principles at a micro scale.
4) Domain-Driven Design introduced modules per domain concept improving decoupling, semantics and testability.
5) Further decomposition into bounded contexts and microservices provided more autonomy for teams but introduced new accidental complexities around infrastructure and coordination.
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.
This document provides an overview of the JavaFX community and ecosystem, including key people, blogs, books, tutorials, projects, frameworks, libraries, and more. It encourages joining the JavaFX community and contributing to open source projects to help grow skills. The presentation highlights over 30 frameworks and 45 libraries that have been developed for JavaFX.
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
This document provides an overview of various open source Ajax solutions including jQuery + DWR, GWT, and ZK. jQuery is a JavaScript library that simplifies DOM manipulation and AJAX requests. DWR allows making remote procedure calls from JavaScript to Java. GWT compiles Java code to JavaScript and supports component-based development. ZK is a server-centric framework that uses XML markup and allows building rich web applications in pure Java without writing JavaScript.
This document summarizes new features in JDK 7 including updates to XML stack, JDBC, RowSet, class loading, JVM performance improvements, garbage collection, I/O, graphics APIs, collections, and strict class file checking. It also previews planned features for JDK 8 such as support for modular programming, annotations, collections improvements, lambda expressions, and modularization.
HTML5 is all the rage with the cool kids, and although there's a lot of focus on the new language, there's lots of interesting new JavaScript APIs both in the HTML5 spec and separated out. This presentation will take you through demos and code behind the new JavaScript APIs, and explore where these features can be used
Bring your Spring knowledge up-to-date by attending this workshop.
Instead of diving into functionality which was already there in older Spring versions, we will focus on the new Spring 4 features. We will however point out small API differences.
The structure of the Workshop will be as follows:
1. Java SE & Java EE support
2. Spring Core
3. Spring WebMVC
4. WebSockets & Messaging
5. Testing Improvements
The document discusses differences in how web front-end standards are implemented across browsers. It covers topics like IE's hasLayout and block formatting contexts compared to specifications, line boxes and inline formatting contexts, differences between DOM attributes and JavaScript properties, and script optimization in Firefox's TraceMonkey engine.
Custom gutenberg block development in reactImran Sayed
This document provides an overview of building Gutenberg blocks. It discusses writing blocks in ES5 vs ESNext/JSX and using @wordpress/scripts to handle dependencies and configuration. Registering blocks client-side with registerBlockType is covered, along with defining edit and save functions. Attributes, reusable RichText components, and state management are also summarized. Building blocks involves 3 steps - installing packages, registering the block client-side, and adding edit/save functions.
This document provides an introduction to Vaadin, including:
1. Vaadin allows building rich web UIs using Java and HTML. It uses a client-server architecture with the UI running on the server and JavaScript/HTML on the client.
2. Key features include rich UI components, support for any JVM language, no browser plugins required, and embracing of Java standards.
3. The document recommends getting started with Vaadin by generating a Maven archetype project in Eclipse.
탑크리에듀(http://www.topcredu.co.kr)에서 제공하는 스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)강좌입니다. Spring Ioc 실습(어노테이션기반, 인터페이스, 세터주입)에 대한 자료이니 많은 도움 되셨길 바랍니다. http://ojc.asia/ 에 들어가시면 보다 많은 자료들이 게시되어 있으니 참고바랍니다^^.
Basic Tutorial of React for ProgrammersDavid Rodenas
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
This document contains a summary of JavaScript features introduced in ES6 and later versions by Janghyun Han. It discusses features such as variables, arrow functions, template literals, classes, modules, promises, and generators. For each feature, it provides code examples to demonstrate usage and differences from earlier JavaScript versions. The document aims to help readers learn about modern JavaScript language improvements.
Hands-on lab given at #geecon for Visage Android development. A full VirtualBox image for running through the lab yourself is supplied here:
http://projavafx.com/VisageLab/
Visage is a declarative language for building user interfaces that compiles to JavaFX. It aims to simplify UI design by allowing developers to write interfaces in a natural way. Some key advantages of Visage include being less code for more productivity, an intuitive graphical structure, and easy programming constructs for bindings and transitions. Visage applications can be built for JavaFX, Android, and Vaadin platforms. It provides a declarative alternative to the imperative XML and code-based approaches of these platforms.
JavaFX is used by many companies and organizations for a variety of applications. Some key uses of JavaFX include:
- Embedded applications, including on devices like phones and set-top boxes.
- Mobile applications, as JavaFX supports deploying to iOS and Android.
- Web applications, with JavaFX code running in browsers using a plugin or port to HTML5.
- Traditional desktop applications, where JavaFX can provide a modern user interface for programs.
- Specific examples given include office management software by an AIDS foundation in Germany.
This document discusses managing change and achieving regression isolation using dynamic Groovy edges. It describes how Groovy can be used to build edge components, such as web service clients, in a way that makes it easier to update them and reduce the need for full regression testing when changes occur. Groovy allows direct access to XML payloads using techniques like the Markup Builder and XML Slurper. The document provides examples of using Groovy to detect web service changes and consume web services. It also discusses strategies for configuring Groovy scripts in Spring applications.
♥ Play Framework is an open-source web application framework for Java and Scala that follows the model-view-controller (MVC) architectural pattern. It supports dependency injection, routing, and asynchronous programming. Some key features include routing, controllers, database access using Slick, evolutions for database schema changes, and support for functional programming concepts like Option, Either, and Future.
EWD 3 Training Course Part 14: Using Ajax for QEWD MessagesRob Tweed
This presentation is Part 14 of the EWD 3 Training Course. It explains how (and when) to use Ajax/HTTP messaging instead of WebSockets within your QEWD applications
Java EE 7: Boosting Productivity and Embracing HTML5Arun Gupta
The document discusses the key features of Java EE 7 including improved developer productivity through more annotated POJOs, less boilerplate code, and a cohesive integrated platform. It highlights top features such as WebSocket client/server endpoints, batch applications, JSON processing, concurrency utilities, simplified JMS API, and more annotated POJOs. The document provides details on these features and code examples for concepts like WebSocket chat servers, JSON streaming API, batch job specification, and simplified JMS message sending.
From framework coupled code to #microservices through #DDD /by @codelytvCodelyTV
From framework coupled code to microservices through DDD modules. The presentation discussed the evolution from monolithic frameworks to microservices architecture through various stages:
1) Old days of framework coupled code with low autonomy, maintainability and learning curve.
2) Use of MVC frameworks improved isolation but code was still highly coupled.
3) Focus on testing drove adoption of SOLID principles at a micro scale.
4) Domain-Driven Design introduced modules per domain concept improving decoupling, semantics and testability.
5) Further decomposition into bounded contexts and microservices provided more autonomy for teams but introduced new accidental complexities around infrastructure and coordination.
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.
This document provides an overview of the JavaFX community and ecosystem, including key people, blogs, books, tutorials, projects, frameworks, libraries, and more. It encourages joining the JavaFX community and contributing to open source projects to help grow skills. The presentation highlights over 30 frameworks and 45 libraries that have been developed for JavaFX.
Open Source Ajax Solution @OSDC.tw 2009Robbie Cheng
This document provides an overview of various open source Ajax solutions including jQuery + DWR, GWT, and ZK. jQuery is a JavaScript library that simplifies DOM manipulation and AJAX requests. DWR allows making remote procedure calls from JavaScript to Java. GWT compiles Java code to JavaScript and supports component-based development. ZK is a server-centric framework that uses XML markup and allows building rich web applications in pure Java without writing JavaScript.
This document summarizes new features in JDK 7 including updates to XML stack, JDBC, RowSet, class loading, JVM performance improvements, garbage collection, I/O, graphics APIs, collections, and strict class file checking. It also previews planned features for JDK 8 such as support for modular programming, annotations, collections improvements, lambda expressions, and modularization.
HTML5 is all the rage with the cool kids, and although there's a lot of focus on the new language, there's lots of interesting new JavaScript APIs both in the HTML5 spec and separated out. This presentation will take you through demos and code behind the new JavaScript APIs, and explore where these features can be used
Bring your Spring knowledge up-to-date by attending this workshop.
Instead of diving into functionality which was already there in older Spring versions, we will focus on the new Spring 4 features. We will however point out small API differences.
The structure of the Workshop will be as follows:
1. Java SE & Java EE support
2. Spring Core
3. Spring WebMVC
4. WebSockets & Messaging
5. Testing Improvements
The document discusses differences in how web front-end standards are implemented across browsers. It covers topics like IE's hasLayout and block formatting contexts compared to specifications, line boxes and inline formatting contexts, differences between DOM attributes and JavaScript properties, and script optimization in Firefox's TraceMonkey engine.
Custom gutenberg block development in reactImran Sayed
This document provides an overview of building Gutenberg blocks. It discusses writing blocks in ES5 vs ESNext/JSX and using @wordpress/scripts to handle dependencies and configuration. Registering blocks client-side with registerBlockType is covered, along with defining edit and save functions. Attributes, reusable RichText components, and state management are also summarized. Building blocks involves 3 steps - installing packages, registering the block client-side, and adding edit/save functions.
This document provides an introduction to Vaadin, including:
1. Vaadin allows building rich web UIs using Java and HTML. It uses a client-server architecture with the UI running on the server and JavaScript/HTML on the client.
2. Key features include rich UI components, support for any JVM language, no browser plugins required, and embracing of Java standards.
3. The document recommends getting started with Vaadin by generating a Maven archetype project in Eclipse.
탑크리에듀(http://www.topcredu.co.kr)에서 제공하는 스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)강좌입니다. Spring Ioc 실습(어노테이션기반, 인터페이스, 세터주입)에 대한 자료이니 많은 도움 되셨길 바랍니다. http://ojc.asia/ 에 들어가시면 보다 많은 자료들이 게시되어 있으니 참고바랍니다^^.
Basic Tutorial of React for ProgrammersDavid Rodenas
This is the support of a course to teach React programming for Java and C# programmers. It covers from its origins in Facebook til separation of presentational and container components. What is JSX, rules, state, props, refactoring, conditionals, repeats, forms, synchronizing values, composition, and so on.
This document contains a summary of JavaScript features introduced in ES6 and later versions by Janghyun Han. It discusses features such as variables, arrow functions, template literals, classes, modules, promises, and generators. For each feature, it provides code examples to demonstrate usage and differences from earlier JavaScript versions. The document aims to help readers learn about modern JavaScript language improvements.
Hands-on lab given at #geecon for Visage Android development. A full VirtualBox image for running through the lab yourself is supplied here:
http://projavafx.com/VisageLab/
Visage is a declarative language for building user interfaces that compiles to JavaFX. It aims to simplify UI design by allowing developers to write interfaces in a natural way. Some key advantages of Visage include being less code for more productivity, an intuitive graphical structure, and easy programming constructs for bindings and transitions. Visage applications can be built for JavaFX, Android, and Vaadin platforms. It provides a declarative alternative to the imperative XML and code-based approaches of these platforms.
Visage is the successor to the JavaFX Script Language, a domain-specific language for writing UIs. It excels at rapid application design and can be used on any platform that supports Java.
In this session you will learn how to supercharge your Android development by using Visage to create declarative UIs. Visage Android exposes the full set of Android APIs, allows you to mix Java and Visage code in the same application, and generates code that deploys to and runs on Android mobile devices.
React Native allows developers to build mobile apps using JavaScript and React skills instead of Objective-C or Java. It uses native components and JavaScript to render apps that look and feel like native mobile apps. Getting started requires Node.js, React Native CLI, and Xcode or Android Studio depending on the target platform. Apps are run and tested using the React Native CLI. Styling uses JavaScript stylesheets and components accept a style prop. The pros are a unified codebase and faster development, while the cons include less control over styling and performance profiling challenges.
Hybrid applications are web applications (or web pages) in the native browser, such as
UIWebView in iOS and WebView in Android (not Safari or Chrome). Hybrid Mobile
Applications are Commonly Developed using CSS, HTML & Javascript.
This document introduces React Native, which allows developers to build native mobile apps for iOS and Android from JavaScript. React Native uses React to construct mobile user interfaces and allows sharing of code across platforms. It renders native UI components rather than webviews, supports flexbox layout, and exposes platform APIs. Developers can build full-stack universal apps that share code between web and mobile using React Native and tools like Redux. It provides benefits like hot reloading, native performance, and the ability to add it incrementally to existing apps.
The document introduces the Play Framework version 2.1 and highlights its key features. It demonstrates building a sample application in Scala using Play's reactive, non-blocking architecture. Key features discussed include Play's built-in support for Scala, reactive programming, JSON APIs, routing, templates, and testing.
"JavaME + Android in action" CCT-CEJUG Dezembro 2008Vando Batista
Mini-cursos de JavaME e Android no evento do CEJUG Café com Tapioca, em Dezembro de 2008.
1. Introdução: overview do desenvolvimento em Java para dispositivos portáteis/móveis
2. Java ME in action: tutorial hands-on de desenvolvimento (mini-curso)
3. Android in action: tutorial hands-on de desenvolvimento (mini-curso)
Autor: Vando Batista
This document provides an overview of best practices for Android Wear development. It discusses how to pair Wear devices, common APIs with Android, showing notifications, distributing Wear apps, defining layouts, accessing views, useful libraries like Gson and EventBus, and other tips.
- Play 2.0 is a web framework for Java and Scala that simplifies development by embracing HTTP rather than fighting it
- It takes a new approach to building web apps in Java by not being built on top of servlet APIs and using an asynchronous programming model
- Developing, testing, and deploying a Play app locally and to CloudFoundry involves creating a project, running it locally, and pushing the compiled code to CloudFoundry which automatically detects and supports Play apps
Learn how to develop for Android, beyond the Hello World android app - Cape T...Joseph Kandi
Learn the core Android App development concepts beyond creating the Android App. We used the Yamba app from the Learning Android demonstrate the use of Android Activities, Services, Broadcast Receivers, Intents and Content Providers.
125 고성능 web view-deview 2013 발표 자료_공유용NAVER D2
The document discusses ways to improve the performance of hybrid mobile applications that use WebView. It describes how WebView has less powerful capabilities and worse web standard compatibility compared to mobile browsers. This can cause issues like fragmentation across device versions.
The document proposes techniques for creating a high-performance WebView, including adding new capabilities like WebSockets, and replacing slower native elements like Canvas 2D with optimized custom implementations. It provides code examples for calling JavaScript from native and vice versa on Android and iOS. Lessons learned emphasize minimizing native/JavaScript communication and dealing with threading issues.
Phobos is a lightweight JavaScript web application framework that allows all application logic to be written in JavaScript. It runs on the Java platform and supports full-featured IDE development. Phobos integrates JavaScript and Java libraries and allows JavaScript code to be run across client, server, and database tiers for a unified programming model.
The document introduces Android programming and provides an overview of key concepts including:
- Android applications are developed using Java and compiled into APK files to run on the Android operating system which uses a Linux kernel and Dalvik virtual machine.
- The AndroidManifest.xml file contains app metadata and declares app components like activities, services, and permissions.
- UI resources like layouts, drawables, and strings are organized by screen density in folders like res/layout-hdpi. Common layouts include LinearLayout and RelativeLayout.
- Activities display app screens and follow a back stack model. Fragments allow modular reuse of UI.
- Services run in the background, AsyncTask simpl
React Native for multi-platform mobile applicationsMatteo Manchi
Since its 2013 release, React has brought a new way to design UI components in the world wide web. The same foundamentals have been taken to another important environment in our contemporary world: the mobile application.
This month we'll see the philosophy behind React Native - learn once, write anywhere - and how this new framework helps new developers to build native apps using React.
NativeScript: Cross-Platform Mobile Apps with JavaScript and AngularTodd Anglin
Do you want to build native mobile apps for iOS and Android? Are you a web developer? Then NativeScript is the perfect framework for you. NativeScript is an open source framework for creating native mobile apps using the skills of the web developer: JavaScript, CSS and simple tag-based markup. Create rich, high-performance iOS and Android apps with 100% native UI using many of the skills you already have.
Topics covered include:
NativeScript framework core concepts and getting started
Accessing native device capabilities with JavaScript
Building native mobile apps with Angular 2
Common app patterns (login, settings, data bound list and more)
Styling NativeScript with CSS
Targeting specific devices and screens
Debugging and deploying to devices
There has never been a better (and easier) way for web developers to create native mobile apps.
[JMaghreb 2014] Developing JavaScript Mobile Apps Using Apache CordovaHazem Saleh
Apache Cordova is a platform for building native mobile applications using common Web technologies (HTML, CSS and JavaScript). Apache Cordova offers a set of APIs that allow the mobile application developers to access mobile native functions such as (Audio, Camera, File, Battery, Contacts …etc) using JavaScript. Although there are many JavaScript mobile application frameworks, jQuery mobile is one of the best mobile web application frameworks which allows the web developers to develop web applications that are mobile friendly. This session illustrates how to use Apache Cordova with the combination of jQuery mobile in order to develop a native Android application and deploy on a real Android device. The demo application (“Memo” application) utilizes mobile native functions (Audio and Camera) using pure JavaScript.
This document discusses setting up PhoneGap for the Bada mobile platform. It outlines the steps to install prerequisites like Eclipse, Java, and Android SDK. It also explains how to download the PhoneGap source code and build an example PhoneGap app. The key tasks are to identify the Bada equivalent of Android's WebView class and determine the native interfaces needed by PhoneGap's JavaScript library to integrate with Bada natively.
ZK MVVM, Spring & JPA On Two PaaS CloudsSimon Massey
1) The document discusses deploying a Java MVVM sample application called ZkToDo2 to two Platform as a Service (PaaS) clouds: Heroku and Openshift.
2) The application uses ZK, Spring, and JPA with a relational database and follows the MVVM pattern. Data bindings in ZK allow the view to be updated automatically based on changes to the view model.
3) Maven build profiles are used to swap Spring configurations to deploy the same codebase to different platforms like JBoss or clouds. The document demonstrates committing changes locally and deploying to both clouds with a single command.
Apache Cordova allows developers to use standard web technologies like HTML, CSS, and JavaScript to build applications that can be deployed across various mobile platforms. It provides an API that enables access to device capabilities and features. Developers can also create custom plugins to access native functionality that is not included in the core Cordova API.
Similar to Visage Android Hands-on Lab (OSCON) (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?
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
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)
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.
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
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.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
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
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
CAKE: Sharing Slices of Confidential Data on BlockchainClaudio Di Ciccio
Presented at the CAiSE 2024 Forum, Intelligent Information Systems, June 6th, Limassol, Cyprus.
Synopsis: Cooperative information systems typically involve various entities in a collaborative process within a distributed environment. Blockchain technology offers a mechanism for automating such processes, even when only partial trust exists among participants. The data stored on the blockchain is replicated across all nodes in the network, ensuring accessibility to all participants. While this aspect facilitates traceability, integrity, and persistence, it poses challenges for adopting public blockchains in enterprise settings due to confidentiality issues. In this paper, we present a software tool named Control Access via Key Encryption (CAKE), designed to ensure data confidentiality in scenarios involving public blockchains. After outlining its core components and functionalities, we showcase the application of CAKE in the context of a real-world cyber-security project within the logistics domain.
Paper: https://doi.org/10.1007/978-3-031-61000-4_16
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfTechgropse Pvt.Ltd.
In this blog post, we'll delve into the intersection of AI and app development in Saudi Arabia, focusing on the food delivery sector. We'll explore how AI is revolutionizing the way Saudi consumers order food, how restaurants manage their operations, and how delivery partners navigate the bustling streets of cities like Riyadh, Jeddah, and Dammam. Through real-world case studies, we'll showcase how leading Saudi food delivery apps are leveraging AI to redefine convenience, personalization, and efficiency.
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
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.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
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.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
3. The Visage Language
§ Statically Compiled Language
§ Based on F3 / JavaFX Script
§ Planning Support for Different
Platforms:
- JavaFX 2.0
- Android
- Apache Pivot
> “Visage is a domain specific
language (DSL) designed for the - Flex
express purpose of writing user
interfaces.” - JSF
3
4. What Does Visage Look Like?
Stage {
var input:TextBox;
title: bind input.text
Scene {
input = TextBox {
color: #DDCC33
}
}
}
4
5. UI Focused Language Features
§ Declarative Object Construction
- Code looks like the UI it is representing.
§ Data Binding
- Variables can be bound to UI state, allowing automatic updates and
behavior to be triggered.
§ UI Definition Literals
- Built-in literal syntax for colors, angles, lengths, and durations
§ Null Safety
- Application logic will proceed even if intermediate variables are undefined
or null.
5
6. Visage on Android
§ Visage Runs as a Native App on Android
§ Full Access to all the Android APIs
§ Declarative Layer on Top of Android APIs
6
8. Exercise 1.A – Android Setup
§ Setup and run the VirtualBox image
§ Create an emulator instance
§ Create a new Android project from the command line
§ Run the project in the emulator
8
9. Setting Up Your Machine
1. Copy these files off the USB stick
(or from http://projavafx.com/VisageLab/):
- VirtualBox for your platform (Mac, Windows, or Linux)
- VisageLab folder
1. Decompress
VisageLab/Visage Dev2.vdi.zip
2. Install VirtualBox
3. Open Visage Dev.vbox
9
10. Set Up Your Device for Debugging
§ And mount it from:
- Devices > USB Devices > (your-device-name)
10
10
11. Or Create a Virtual Android Device
§ Launch the AVD Manager by typing: android
11
12. Setting Up Your Project
§ Project creation command:
- android create project –t 1 –p HelloVisage –k org.test –a HelloVisage
§ Arguments:
- n : Project name (optional)
- t : Target ID of the new project (required)
- p : Project directory (required)
- k : Package name for the application (required)
- a : Name of the default Activity (required)
12
14. Plus some more Java…
public class HelloVisage extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedIS) {
super.onCreate(savedIS);
setContentView(R.layout.main);
}
}
14
15. Run Your Project
§ cd HelloVisage
§ ant install
§ Open it in the applications menu
15
16. Exercise 1.B – All Java Conversion
§ Make sure you have the basic project running first
§ Convert the XML Code to Java
§ Run the all Java project
§ You should get identical results
16
17. Converted XML Code (simplified)
public class HelloVisage extends Activity {
@Override public void onCreate(Bundle savedIS) {
super.onCreate(savedIS);
Context context = getApplicationContext();
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
TextView text = new TextView(context);
text.setText("Hello World, Java Only");
layout.addView(text);
setContentView(layout);
}
}
17
18. (and here are the imports…)
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;
18
19. Exercise 1.C – DDMS Debugging
§ So you made a mistake in your code… the compiler can’t catch
everything
- (even if you didn’t make a mistake, force one… a beautiful
NullPointerException will do)
§ Launch DDMS and select your emulator/device
19
20. Break the code (change in bold)
public class HelloVisage extends Activity {
@Override public void onCreate(Bundle savedIS) {
super.onCreate(savedIS);
Context context = getApplicationContext();
LinearLayout layout = null;//new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
TextView text = new TextView(context);
text.setText("Hello World, HelloVisage");
layout.addView(text);
setContentView(layout);
}
}
20
22. Exercise 1.D – Visage Port
§ Modify the build script to compile Visage
§ Copy the Visage Runtime libraries
§ Convert the Java code to Visage
§ Run on device/emulator
22
26. Copy Over the Runtime JAR
§ Copy:
- javafxrt.jar
§ From:
- $visagehome/lib/shared/
§ To:
- $projectdir/libs
26
27. Straight JavaFX Conversion...
public class Test extends Activity {
override function onCreate(savedInstanceState:Bundle) {
super.onCreate(savedInstanceState);
def context = getApplicationContext();
def layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
def text = new TextView(context);
text.setText("Hello World, Hello Long Visage");
layout.addView(text);
setContentView(layout);
}
}
27
35. Language Similarities
Java is… Visage is…
§ Statically typed § Statically typed
§ Compiled to bytecodes § Compiled to bytecodes
§ Runs on the JVM § Runs on the JVM
§ Has a large library § Can call Java libraries
35
37. Integrating Visage and Java
§ Calling Java from Visage
- Can call Java interface or classes directly
- Automatic conversion to and from Arrays and Collections
- Can even extend Java interfaces and classes
§ Calling Visage from Java
- Easiest way is to create a Java interface that Visage extends
- Can invoke Visage as a script and get results back
37
39. Datatype Support
DataType
Java Equivalent
Range
Examples
Boolean
boolean
true or false
true, false
Integer
int
-2147483648 to 2147483647
2009, 03731, 0x07d9
Number
Float
1.40×10-45 and 3.40×1038
3.14, 3e8, 1.380E-23
String
String
N/A
"java's", 'in"side"er'
Duration
<None>
-263 to 263-1 milliseconds
1h, 5m, 30s, 500ms
Length <None> dp, sp, em, %, mm, cm, in 2mm, 5sp, 1in
Angle <None> rad, deg, turn 1rad, 30deg
Color <None> #RRGGBB, #RGB, #CCCCCC, #202020|D0
#RRGGBB|AA, #RGB|A
Character
char
0 to 65535
0, 20, 32
Byte
byte
-128 to 127
-5, 0, 5
Short
short
-32768 to 32767
-300, 0, 521
Long
long
-263 to 263-1
2009, 03731, 0x07d9
Float
float
1.40×10-45 and 3.40×1038
3.14, 3e8, 1.380E-23
Double
double
4.94×10-324 and 1.80×10308
3.14, 3e231, 1.380E-123
39
40. Visage Operators
Operator
Meaning
Precedence
Examples
++
Pre/post increment
1
++i, i++
--
Pre/post decrement
1
--i, i--
not
Boolean negation
2
not (cond)
*
Multiply
3
2 * 5, 1h * 4
/
Divide
3
9 / 3, 1m / 3
mod
Modulo
3
20 mod 3
+
Add
4
0 + 2, 1m + 20s
-
Subtract (or negate)
4 (2)
-2, 32 -3, 1h -5m
> Multiplication and division of two durations is allowed, but not meaningful
> Underflows/Overflows will fail silently, producing inaccurate results
> Divide by zero will throw a runtime exception
40
41. Visage Operators (continued)
Operator
Meaning
Precedence
Examples
==
Equal
5
value1 == value2, 4 == 4
!=
Not equal
5
value1 != value2, 5 != 4
<
Lessthan
5
value1 < value2, 4 < 5
<=
Lessthanorequal
5
value1 <= value2, 5 <= 5
>
Greater than
5
value1 > value2, 6 > 5
>=
Greater than or equal
5
value1 >= value2, 6 >= 6
instanceof
Is instance of class
6
node instanceof Text
as
Typecast to class
6
node as Text
and
Boolean and
7
cond1 and cond2
or
Boolean or
8
cond1 or cond2
+=
Add and assign
9
value += 5
-=
Subtract and assign
9
value -= 3
*=
Multiply and assign
9
value *= 2
/=
Divide and assign
9
value /=4
=
Assign
9
value = 7
41
42. Access Modifiers
Modifier
Name
Description
<default>
Script only access
Only accessible within the same script file
package
Package access
Only accessible within the same package
protected
Protected access
Only accessible within the same package or by subclasses.
public
Public access
Can be accessed anywhere.
public-read
Read access modifier
Var/def modifier to allow a variable to be read anywhere
public-init
Init access modifier
Var/def modifier to allow a variable to be initialized or read anywhere
42
43. Data Binding
§ A variable or a constant can be bound to an expression
- var x = bind a + b;
§ The bound expression is remembered
§ The dependencies of the expression is watched
§ Variable is updated lazily when possible
43
48. Merging Build Scripts
§ Update the build.xml file:
Set the project name to “ConfigReporter”
§ Update the strings.xml file:
Set the app_name to “ConfigReporter”
§ Load the NetBeans property files (in build.xml):
<property file="nbproject/private/config.properties"/>
<property file="nbproject/private/configs/${config}.properties"/>
<property file="nbproject/private/private.properties"/>
<property file="${user.properties.file}"/>
<property file="nbproject/configs/${config}.properties"/>
<property file="nbproject/project.properties"/>
48
58. Exercise 2.E – Android Settings
§ Create a Settings Activity
§ Populate it with the following preferences:
- Text
- Password
- List
§ Launch it from the Button control
58
59. Settings Class
public class Settings extends PreferenceActivity {
var usernamePref:EditTextPreference;
var passwordPref:EditTextPreference;
var pollingPref:ListPreference;
override var screen = PreferenceScreen {
preferences: [
…
59
67. What Bind Updates
var x = bind if(a) then b else c
§ x is updated if a or b or c changes
var x = bind for (i in [a..b]) { i * i }
§ Not everything is recalculated
§ If a = 1 and b = 2, x is [1, 4]
§ If b changes to 3, only the added element is calculated
1 4 9
67
68. Binding to Expressions
§ Binding to a block
§ Bound block may contain any number of defs followed by one
expression
§ Dependencies of block is backtraced from the expression
§ Binding to function invocation expression
- Regular function: dependencies are parameters
- Bound function: backtraced from final expression inside function
68
69. Binding to Object Literals
var a = 3; var b = 4;
var p = bind Point { x: a, y: b };
var q = bind Point { x: bind a, y: b };
var r = bind Point { x: bind a, y: bind b };
§ When a changes:
- p gets a new instance of Point
- q and r keep the old instance with a new x value
- r will never get a new instance of Point
- (the outer bind in r is useless)
69
70. Visage Sequences
§ Represents collections of homogeneous data
§ A fundamental container data type
§ Rich set of language facilities
§ Contributor to declarative syntax
§ Automatic conversion to and from Java Arrays and Collections
70
71. Creating Sequences
§ Explicit sequence expression
- [1, 3, 5, 7, 9]
§ Elements are separated by commas
§ Comma may be omitted if element ends with brace
1 3 5 7 9
71
72. Creating Sequences
§ Numeric sequence with range expressions:
- [1..10] 1 2 3 4 5 6 7 8 9 10
§ Can have a step:
- [1..10 step 2] 1 3 5 7 9
- [0.0..0.9 step 0.1] 0 .1 .2 .3 .4 .5 .6 .7 .8 .9
§ Can be decreasing:
- [10..1 step -3] 10 7 4 1
§ Beware of step that goes opposite direction:
- [10..1] is []
§ Exclusive right end
- [1..<5] 1 2 3 4
73. Getting Info from Sequences
ints = [1, 3, 5, 7, 9]
1 3 5 7 9
[0] [1] [2] [3] [4]
§ sizeof ints is 5
§ ints[0] is 1, ints[1] is 3, ..., ints[4] is 9
§ ints[-1] is 0 (default value of Integer), so is ints[5]
§ For a sequence of objects, the default is null
73
74. Getting Slices from Sequences
ints = [1, 3, 5, 7, 9]
1 3 5 7 9
[0] [1] [2] [3] [4]
§ ints[0..2] is [1, 3, 5]
§ ints[0..<2] is [1, 3]
§ ints[2..] is [5, 7, 9]
§ ints[2..<] is [5, 7]
§ ints[2..0], ints[-2..-1], ints[5..6] are all []s
74
75. Getting Subsets from Sequences
ints = [1, 3, 5, 7, 9]
1 3 5 7 9
[0] [1] [2] [3] [4]
§ ints[k | k > 6] is:
- [7, 9] (k > 6 is a condition)
§ ints[k | indexof k < 2] is:
- [1, 3]
§ ints[k | k > 10] is:
- []
75
78. Sequence Puzzlers
What is the size of this sequence:
§ [1..10 step -1]
What does this evaluate to:
§ [10..<20 step 2][k|k>17]
What is the size of this sequence:
§ sizeof [20..1 step -3]