The document discusses various approaches and best practices for testing JavaScript code. It covers topics like behavior-driven development with Jasmine, testing asynchronous code using spies, waiting for asynchronous operations to complete, testing interactions with the DOM, testing legacy untested JavaScript code, and setting up continuous integration for JavaScript tests.
The document discusses using the JavaScript testing framework Jasmine. It provides examples of writing tests using Jasmine's BDD syntax and matchers. It also covers best practices like testing asynchronous code using spies, setting up fixtures for DOM testing, extending Jasmine with custom matchers, and considerations for continuous integration and legacy code testing.
The document discusses some of the features and benefits of CoffeeScript, a programming language that compiles to JavaScript. It covers how CoffeeScript works by compiling CoffeeScript files to JavaScript, its easier syntax compared to JavaScript, built-in protections from common JavaScript issues, and how it results in less code. Specific features highlighted include object definitions, functions, operators, string interpolation, conditionals, scoping, and pattern matching.
Less ismorewithcoffeescript webdirectionsfeb2012Jo Cranford
Slides from my lightning talk at Web Directions in Sydney, 23 February 2012. I wanted to demonstrate some of the ways CoffeeScript makes my life easier as a developer, by making my JavaScript code much faster and easier to read.
Programa simulacion de ventas de aeropuertoAnel Sosa
This document describes a Java program that simulates an airport ticket booking system. It generates random numbers to determine ticket prices, destinations, and number of tickets purchased for a given number of passengers. It displays the results in a table and calculates total revenue and number of tickets sold. The program uses algorithms, arrays, and loops to simulate the random assignment of flight details and calculates various statistics from the results.
The magic of jQuery's CSS-based selection makes it easy to think about our code in terms of the DOM, and sometimes that approach is exactly right. Other times, though, what we're trying to accomplish is only tangentially related to our nodes, and opting for an approach where we think in terms of functionality -- not how that functionality is manifested on our page -- can pay big dividends in terms of flexibility. In this talk, we'll look at a small sample application where the DOM takes a back seat to functionality-focused modules, and see how the approach can change the way we write and organize our code.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
This document provides examples of refactoring Java code to use Guava libraries and utilities. It shows code snippets before and after refactoring to use Guava's Objects, Preconditions, Collections, Splitter, Joiner, Ranges and other utilities to clean up code and make it more readable and robust. Refactoring includes using Guava to validate arguments, create immutable collections, handle nulls safely, join/split strings, and represent ranges.
Using Templates to Achieve Awesomer ArchitectureGarann Means
Templates are the best kind of tool: simple to write and implement, but powerful enough to make your architecture slicker and your code leaner. Getting markup out of your Javascript is a huge deal, but templates can help with more than that. They can manage repeated code snippets, allow you to deftly switch states in single page applications, and help keep your code DRY when supporting users with and without Javascript enabled. Using and extending them creatively can make any architecture a little awesomer.
The document discusses using the JavaScript testing framework Jasmine. It provides examples of writing tests using Jasmine's BDD syntax and matchers. It also covers best practices like testing asynchronous code using spies, setting up fixtures for DOM testing, extending Jasmine with custom matchers, and considerations for continuous integration and legacy code testing.
The document discusses some of the features and benefits of CoffeeScript, a programming language that compiles to JavaScript. It covers how CoffeeScript works by compiling CoffeeScript files to JavaScript, its easier syntax compared to JavaScript, built-in protections from common JavaScript issues, and how it results in less code. Specific features highlighted include object definitions, functions, operators, string interpolation, conditionals, scoping, and pattern matching.
Less ismorewithcoffeescript webdirectionsfeb2012Jo Cranford
Slides from my lightning talk at Web Directions in Sydney, 23 February 2012. I wanted to demonstrate some of the ways CoffeeScript makes my life easier as a developer, by making my JavaScript code much faster and easier to read.
Programa simulacion de ventas de aeropuertoAnel Sosa
This document describes a Java program that simulates an airport ticket booking system. It generates random numbers to determine ticket prices, destinations, and number of tickets purchased for a given number of passengers. It displays the results in a table and calculates total revenue and number of tickets sold. The program uses algorithms, arrays, and loops to simulate the random assignment of flight details and calculates various statistics from the results.
The magic of jQuery's CSS-based selection makes it easy to think about our code in terms of the DOM, and sometimes that approach is exactly right. Other times, though, what we're trying to accomplish is only tangentially related to our nodes, and opting for an approach where we think in terms of functionality -- not how that functionality is manifested on our page -- can pay big dividends in terms of flexibility. In this talk, we'll look at a small sample application where the DOM takes a back seat to functionality-focused modules, and see how the approach can change the way we write and organize our code.
«Objective-C Runtime в примерах» — Алексей Сторожев, e-Legione-Legion
Цель доклада — вдохновить разработчиков на более глубокое изучение возможностей Objective-C Runtime, показать способы исследования системы, воодушевить аудиторию на эксперименты.
В докладе показаны несколько примеров использования Objective-C Runtime для решения нетипичных задач. Первый пример - реализация простого KVO своими руками тремя способами. Вторым примером показана полезность исследования приватных классов. Рассказано, как во время работы программы получить информацию о протянутых IBOutlet и IBAction в xib и storyboard. В каждом примере присутствуют особенности реализации, на которых сделан акцент и показаны варианты решения или обхода.
This document provides examples of refactoring Java code to use Guava libraries and utilities. It shows code snippets before and after refactoring to use Guava's Objects, Preconditions, Collections, Splitter, Joiner, Ranges and other utilities to clean up code and make it more readable and robust. Refactoring includes using Guava to validate arguments, create immutable collections, handle nulls safely, join/split strings, and represent ranges.
Using Templates to Achieve Awesomer ArchitectureGarann Means
Templates are the best kind of tool: simple to write and implement, but powerful enough to make your architecture slicker and your code leaner. Getting markup out of your Javascript is a huge deal, but templates can help with more than that. They can manage repeated code snippets, allow you to deftly switch states in single page applications, and help keep your code DRY when supporting users with and without Javascript enabled. Using and extending them creatively can make any architecture a little awesomer.
The document discusses using static types to validate function arguments and return values in JavaScript. It begins by showing an example of a sum function that validates its elements argument is an array of numbers, throwing errors otherwise. It notes benefits like preventing improper usage, but also drawbacks like problems only showing at runtime. The document then recommends employing type systems like TypeScript as a "body guard" to validate at compile time instead of runtime. It provides examples of TypeScript code validating function arguments and return types to catch errors early.
This document discusses integrating the JRebel plugin with NetBeans by patching NetBeans platform classes at load time. Specifically, it covers adding buttons, menus, and options to NetBeans, integrating with the NetBeans debugger and server adaptors, and programmatically patching NetBeans classes using Javassist to inject JRebel JVM arguments into the server launch process.
Google Guava - Core libraries for Java & AndroidJordi Gerona
Talk at GDG DevFest Barcelona 2013.
The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.
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.
This document provides an introduction to Groovy for Java developers. It discusses Groovy's features such as closures, optional typing and syntax, and how it compiles to Java bytecode. It then provides examples of writing a simple Groovy script to generate XML, using closures, mocking objects in tests, and building projects with Ant.
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.
jQuery Data Manipulate API - A source code dissecting journeyHuiyi Yan
Represent major data manipulate API in jQuery 1.6; such as .data(), removeData(), index(), globalEval() and so no. Also, HTML5 data-* attributes. I will walk you through with diving into jQuery source code and find out the killing techniques used in jQuery.
Hadoop est devenu une référence dans l’univers du BigData, et MapReduce, un nouveau paradigme pour exploiter les données. Implémenter directement les traitements de données avec MapReduce donne certainement le plus de flexibilité, mais cela revient à utiliser de l’assembleur. Cascalog est sans doute l’alternative la plus concise. Basée sur Clojure, cette solution vous laisse dans un environnement familier (la JVM) tout en vous apportant une abstraction fort utile par le biais de la programmation logique.
The Guava project contains several of Google’s core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth. There will be the slides presenting most useful and interesting features of Guava (v.12) that makes stuff simpler, better and code cleaner. We will cover most of the com.google.common.base.* classes and basic use of functions in collection and Google collections and few other features that are part of Guava and I find them very useful. Some of you will think that there is an overlap with Apache commons – and it’s true, but Guava is built with expectation that there is a Function and a Predicate class as well as various builders which makes it really cool and simple for many use cases.
Nessa apresentação demonstro como aplicar alguns dos Architecture Components disponíveis no Jetpack em uma arquitetura que segue o padrão Clean com MVVM.
This document provides an overview and examples of using Google Guava, an open-source Java library that includes common libraries useful for writing Java code. It highlights some key classes and methods in Guava, including annotations, strings, collections, I/O, and more. Code samples demonstrate using Guava features like predicates, sets, files, and InetAddress utilities.
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
The document discusses the goals and design of Zepto.js, a JavaScript framework for mobile web applications. It aims to have a very small codebase that is easy to use, extends native browser APIs, and avoids non-essential browser implementations. It provides a jQuery-like API but takes advantage of mobile features for better performance on small screens and devices with limited bandwidth.
This document provides an overview of JavaScript and HTML5 capabilities including:
- Canvas element for drawing
- Video element for playing video files
- Geolocation API to detect user location
- Local and session storage for browser data
- PostMessage API for cross-window communication
It discusses JavaScript language features like variables, functions, and scope and shows examples of working with the DOM, events, and extending native objects. The document is an introduction to modern web technologies enabled by JavaScript and HTML5.
The document discusses a talk titled "Beyond the DOM: Sane Structure for JS Apps" given by Rebecca Murphey at BVJS 2012. It provides code snippets for handling click events on objects and submitting a Twitter search form to retrieve results and display them on the page. The document advocates for moving beyond just manipulating the DOM and having a sane structure for JavaScript applications.
This document contains code for a Java GUI application called EasyGUI that allows users to generate automation results for order processing. It contains classes like EasyGUI, EasyButton, and BatchEngine that create a GUI, handle button clicks, and execute automation batches. When the submit button is clicked, it validates the order ID, runs batches to get conversation IDs, account numbers, and CSIXML files, and displays the results. It uses GridBagLayout to arrange components on the main panel and stores selection values in variables like orderID and accountNumber to pass to batch processing methods.
Slides for presentation on Google Guava I gave at the Near Infinity (www.nearinfinity.com) 2013 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/google-guava-samples
This presentation will starts with an Introduction to object-oriented programming. And presentation main objective is to create javascript object and parse it in different way.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
This document provides an introduction and overview of the Google Guava libraries. It describes what Guava is, why developers would use it, how it compares to Apache Commons libraries, its design principles and release cycles. It provides descriptions of some key Guava packages and classes for common Java utilities, including Preconditions, Optional, Objects, Strings, Charsets, CaseFormat, CharMatcher, Joiner and Splitter. The document aims to explain the purpose and usage of important Guava functionality.
This document provides an overview of new features introduced in JavaScript over time, including functional array methods added in 2006, generators and iterators added in 2007, expression closures and destructuring assignment added in 2008, and default parameters, rest parameters, and for-of loops added in ES6. It discusses how the language has evolved to include nicer object APIs, Maps, Sets, and other data structures.
The document discusses using static types to validate function arguments and return values in JavaScript. It begins by showing an example of a sum function that validates its elements argument is an array of numbers, throwing errors otherwise. It notes benefits like preventing improper usage, but also drawbacks like problems only showing at runtime. The document then recommends employing type systems like TypeScript as a "body guard" to validate at compile time instead of runtime. It provides examples of TypeScript code validating function arguments and return types to catch errors early.
This document discusses integrating the JRebel plugin with NetBeans by patching NetBeans platform classes at load time. Specifically, it covers adding buttons, menus, and options to NetBeans, integrating with the NetBeans debugger and server adaptors, and programmatically patching NetBeans classes using Javassist to inject JRebel JVM arguments into the server launch process.
Google Guava - Core libraries for Java & AndroidJordi Gerona
Talk at GDG DevFest Barcelona 2013.
The Guava project contains several of Google's core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth.
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.
This document provides an introduction to Groovy for Java developers. It discusses Groovy's features such as closures, optional typing and syntax, and how it compiles to Java bytecode. It then provides examples of writing a simple Groovy script to generate XML, using closures, mocking objects in tests, and building projects with Ant.
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.
jQuery Data Manipulate API - A source code dissecting journeyHuiyi Yan
Represent major data manipulate API in jQuery 1.6; such as .data(), removeData(), index(), globalEval() and so no. Also, HTML5 data-* attributes. I will walk you through with diving into jQuery source code and find out the killing techniques used in jQuery.
Hadoop est devenu une référence dans l’univers du BigData, et MapReduce, un nouveau paradigme pour exploiter les données. Implémenter directement les traitements de données avec MapReduce donne certainement le plus de flexibilité, mais cela revient à utiliser de l’assembleur. Cascalog est sans doute l’alternative la plus concise. Basée sur Clojure, cette solution vous laisse dans un environnement familier (la JVM) tout en vous apportant une abstraction fort utile par le biais de la programmation logique.
The Guava project contains several of Google’s core libraries that we rely on in our Java-based projects: collections, caching, primitives support, concurrency libraries, common annotations, string processing, I/O, and so forth. There will be the slides presenting most useful and interesting features of Guava (v.12) that makes stuff simpler, better and code cleaner. We will cover most of the com.google.common.base.* classes and basic use of functions in collection and Google collections and few other features that are part of Guava and I find them very useful. Some of you will think that there is an overlap with Apache commons – and it’s true, but Guava is built with expectation that there is a Function and a Predicate class as well as various builders which makes it really cool and simple for many use cases.
Nessa apresentação demonstro como aplicar alguns dos Architecture Components disponíveis no Jetpack em uma arquitetura que segue o padrão Clean com MVVM.
This document provides an overview and examples of using Google Guava, an open-source Java library that includes common libraries useful for writing Java code. It highlights some key classes and methods in Guava, including annotations, strings, collections, I/O, and more. Code samples demonstrate using Guava features like predicates, sets, files, and InetAddress utilities.
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2KThomas Fuchs
The document discusses the goals and design of Zepto.js, a JavaScript framework for mobile web applications. It aims to have a very small codebase that is easy to use, extends native browser APIs, and avoids non-essential browser implementations. It provides a jQuery-like API but takes advantage of mobile features for better performance on small screens and devices with limited bandwidth.
This document provides an overview of JavaScript and HTML5 capabilities including:
- Canvas element for drawing
- Video element for playing video files
- Geolocation API to detect user location
- Local and session storage for browser data
- PostMessage API for cross-window communication
It discusses JavaScript language features like variables, functions, and scope and shows examples of working with the DOM, events, and extending native objects. The document is an introduction to modern web technologies enabled by JavaScript and HTML5.
The document discusses a talk titled "Beyond the DOM: Sane Structure for JS Apps" given by Rebecca Murphey at BVJS 2012. It provides code snippets for handling click events on objects and submitting a Twitter search form to retrieve results and display them on the page. The document advocates for moving beyond just manipulating the DOM and having a sane structure for JavaScript applications.
This document contains code for a Java GUI application called EasyGUI that allows users to generate automation results for order processing. It contains classes like EasyGUI, EasyButton, and BatchEngine that create a GUI, handle button clicks, and execute automation batches. When the submit button is clicked, it validates the order ID, runs batches to get conversation IDs, account numbers, and CSIXML files, and displays the results. It uses GridBagLayout to arrange components on the main panel and stores selection values in variables like orderID and accountNumber to pass to batch processing methods.
Slides for presentation on Google Guava I gave at the Near Infinity (www.nearinfinity.com) 2013 spring conference.
The associated sample code is on GitHub at https://github.com/sleberknight/google-guava-samples
This presentation will starts with an Introduction to object-oriented programming. And presentation main objective is to create javascript object and parse it in different way.
The document discusses object oriented JavaScript. It covers JavaScript types and constructors, creating custom types, using prototypes for inheritance and instance members. It also discusses namespaces, visibility, and polymorphism in JavaScript. Useful design patterns like factories, singletons, and modules are presented. The presentation provides examples and explanations of these core JavaScript concepts.
This document provides an introduction and overview of the Google Guava libraries. It describes what Guava is, why developers would use it, how it compares to Apache Commons libraries, its design principles and release cycles. It provides descriptions of some key Guava packages and classes for common Java utilities, including Preconditions, Optional, Objects, Strings, Charsets, CaseFormat, CharMatcher, Joiner and Splitter. The document aims to explain the purpose and usage of important Guava functionality.
This document provides an overview of new features introduced in JavaScript over time, including functional array methods added in 2006, generators and iterators added in 2007, expression closures and destructuring assignment added in 2008, and default parameters, rest parameters, and for-of loops added in ES6. It discusses how the language has evolved to include nicer object APIs, Maps, Sets, and other data structures.
jQuery & 10,000 Global Functions: Working with Legacy JavaScriptGuy Royse
Long ago, in the late days of the first Internet boom, before jQuery, before Underscore, before Angular, there was a web application built by a large corporation. This application was written as a server-side application using server-side technology like Java or PHP. A tiny seed of JavaScript was added to some of the pages of this application to give it a little sizzle.
Over the ages, this tiny bit of JavaScript grew like kudzu. Most of it was embedded in the HTML in
Integrate Spring MVC with RequireJS & Backbone.js & Spring Data JPACheng Ta Yeh
This document contains slides from a presentation on integrating Spring MVC with RequireJS, Backbone.js, and Spring Data JPA. It discusses problems with front-end development like lack of standards and coupling data to the DOM. It then introduces Backbone.js and RequireJS as solutions, showing sample code. It also covers defining a RESTful interface, using Spring MVC as a REST server, parameter and return types, and unit testing controllers. Finally, it discusses the layer architecture and data conversion between Spring MVC and Spring Data JPA.
Declarative web data visualization using ClojureScriptOSCON Byrum
The document discusses declarative web data visualization using ClojureScript. It begins with an agenda that includes discussing what visualization is, doing it on the internet with tools like D3, and providing an example. It then covers using ClojureScript for visualization by treating data as a first-class concept, and provides a sample visualization code example to map flight data to HTML elements.
The document summarizes key announcements from Google IO about Android tools and APIs, including:
Gradle was updated to version 1.6 with improved dependency management, library support, and build variants. Volley was introduced as a new networking library that improves on AsyncTask with prioritization, caching, and cancellation. The Mobile Backend Starter provides a no-code backend with Google auth and Cloud Messaging built in. Location APIs were expanded with contextual listeners and geofencing capabilities. The Activity Recognition API detects user activities like walking and cycling. The Game API integrates achievements, leaderboards, cloud saves, and multiplayer across platforms. The Google Play Console was updated with new analytics and publishing tools.
The document discusses different patterns for handling asynchronous code in JavaScript: callbacks, promises, and AMD (Asynchronous Module Definition). It outlines issues with nested callbacks and inflexible APIs. Promises and AMD aim to address these by allowing composition of asynchronous operations and defining module dependencies. The document provides examples of implementing PubSub with events, making and piping promises, and using AMD to load dependencies asynchronously. It concludes that callbacks should generally be avoided in favor of promises or AMD for asynchronous code.
The jQuery community has provided thousands of useful plugins which can be stitched together to create exceptional websites. However, organizing those plugins, tracking their upstream changes and managing dependencies can become a nightmare with a system to help you manage. JavascriptMVC, and specifically its new version 3 release, provides a framework for organizing outside code, integrating it into your workflow and compressing down to a single output javascript file. This talk will focus on taking external plugins such as jQuery Tools, jQuery UI and other popular plugins and creating a workflow for building larger applications from these components. I will show how to use the JavascriptMVC “getter” and “pluginify” scripts to pull external resources. With JavascriptMVC 3, css and javascript can be packaged together creating truly convenient widgets. I will also demonstrate how often-used pieces of functionality can be abstracted into plugins and shared with the general community via Github.
The document discusses test driven development (TDD). It covers the evolution of testing, automated testing, and the motivations and principles of TDD. The main points of TDD are covered, including writing a test first that fails, then writing code to make the test pass, and refactoring the code. An interactive session demonstrates applying TDD to developing a task list application, including tests for title, ID, completion status, and saving tasks to a database. The importance of covering variations with tests and the risks of focusing only on 100% test coverage are also discussed.
The document provides an introduction to jQuery, explaining what it is, its benefits over traditional JavaScript, and how it can be used. Key points covered include:
- jQuery is a lightweight JavaScript library that makes client-side scripting easier by providing cross-browser compatibility and methods for selecting, manipulating, and traversing DOM elements.
- jQuery solves many cross-browser issues that exist with traditional JavaScript and allows unobtrusive JavaScript that separates behavior from content.
- jQuery simplifies many common tasks like DOM traversal and manipulation through methods like $.(), selectors, events, effects, and plugins. This allows easier and more readable code compared to traditional JavaScript.
- The document provides examples of how to use
The document provides an overview of the YUI library. It discusses:
1) What YUI is and its main components like the JavaScript library, CSS foundation, documentation tools, build tools, testing tools, and more.
2) Some of the core utilities included in YUI like Event, Node, YUI Global Object, Array, mix, extend, augment, Object, merge, clone, and Module.
3) How to use YUI features like the loader, events, DOM events, custom events, Node, IO, Transition, and infrastructure components like Base, Attributes, Plugin, and Widget.
Jasmine is a JavaScript testing framework that allows developers to write unit tests for their JavaScript code. The document discusses what Jasmine is, its features and structure. It provides examples of how to write tests using Jasmine including describing suites and specs, expectations, spies, asynchronous tests and testing jQuery code. References for learning more about Jasmine are also included.
This document provides an introduction to jQuery, including examples of how to use jQuery. It discusses jQuery plugins, performance tips for jQuery, and jQuery deferreds/promises. Some key points:
- jQuery is a JavaScript library that allows DOM manipulation and event handling via JavaScript
- jQuery code uses $ as an alias for jQuery functions
- Plugins can extend jQuery's functionality
- For performance, cache selections, append outside loops, detach/reattach elements being modified
- Deferreds/promises allow asynchronous functions to be chained together
The document contains Java code for connecting to a MySQL database and performing CRUD (create, read, update, delete) operations on a student record table. It includes code to insert, update, display, and delete student records by getting/setting values from text fields and JTables. Database connections are established using JDBC and queries are executed using Statement objects to manipulate student data in the database table.
The document discusses jQuery, a JavaScript library that makes DOM scripting and Ajax requests easier. It provides functions to select elements, handle events, animate elements and load JSON data. Some key features include CSS selector syntax, DOM manipulation methods, event handling and Ajax functions. The document also covers plugins, effects, and utilities included in jQuery.
1) The document discusses creating Java applets and using classes in an applet. It includes examples of creating classes to calculate compound interest, graph mathematical functions, and create a timer applet.
2) The examples create classes like Invest and Graph that perform calculations and drawing. They are used in applets that allow users to set inputs and see results updated.
3) The timer applet example uses the Timer class from Swing to repeatedly repaint random colored circles on a schedule.
Unit testing JavaScript code with Jasmine allows developers to test functionality in isolation through matchers, spies, and asynchronous handling. Key benefits include cheaper QA, better documentation, improved code quality, and easier debugging. While some are deterred by complex asynchronous code or small projects, unit testing pays off through early bug detection and confidence that features work as intended.
Workshop JavaScript Testing. Frameworks. Client vs Server Testing. Jasmine. Chai. Nock. Sinon. Spec Runners: Karma. TDD. Code coverage. Building a testable JS app.
Presentado por ing: Raúl Delgado y Mario García
The document discusses JavaScript objects and functions. It explains that JavaScript objects are collections of name-value pairs similar to dictionaries. Functions in JavaScript are objects that support function call operations. The document also covers constructor functions, prototypes, closures, and namespaces in JavaScript.
Similar to Testing javascriptwithjasmine sydjs (20)
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.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
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.
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!
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.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
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!
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
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.
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.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
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.
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
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.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
3. BDD With Jasmine Is
Awesome Sauce
describe("Score Calculation Behaviour", function() {
it("should score 0 when no pins are knocked down", function() {
var game = new BowlingGame(10);
game.roll(0);
expect(game.score()).toBe(0);
});
});
Thursday, 19 July 12
5. What About ...
• Asynchronous goodness
• Interacting with teh DOMz
• Evil Legacy Code
• Continuous Integration
• Clean readable tests that reflect your domain
Thursday, 19 July 12
8. The JavaScript Code
var Presentation = function() {
this.presenters = [];
};
Presentation.prototype.loadPresenters = function() {
var presenters = this.presenters;
$.getJSON("people.json", function(data) {
$.each(data, function(idx, person) {
presenters.push(person);
});
});
};
Thursday, 19 July 12
9. Easy, Right?
describe("How not to test an asynchronous function", function
() {
it("should load the presenters", function () {
var presentation = new Presentation();
presentation.loadPresenters();
expect(presentation.presenters.length).toBe(2);
});
});
Thursday, 19 July 12
11. But This Might Work ...
describe("Still not ideal though", function () {
it("should load the presenters", function () {
spyOn($, "getJSON").andCallFake(function (url, callback) {
callback([{},{}]);
})
var presentation = new Presentation();
presentation.loadPresenters();
expect(presentation.presenters.length).toBe(2);
});
});
Thursday, 19 July 12
13. Spy On An Existing Method
it("can spy on an existing method", function() {
var fakeElement = $("<div style='display:none'></div>");
spyOn(fakeElement, 'show');
var toggleable = new Toggleable(fakeElement);
toggleable.toggle();
expect(fakeElement.show).toHaveBeenCalled();
});
Thursday, 19 July 12
14. Spy On An Existing Method
it("can create a method for you", function() {
var fakeElement = {};
fakeElement.css = function() {};
fakeElement.show = jasmine.createSpy("Show spy");
var toggleable = new Toggleable(fakeElement);
toggleable.toggle();
expect(fakeElement.show).toHaveBeenCalled();
});
Thursday, 19 July 12
15. Wait, There’s More ...
• expect(spy).not.toHaveBeenCalled()
• createSpy().andReturn(something)
• createSpy().andCallFake(function() {})
• createSpy().andCallThrough()
Thursday, 19 July 12
16. Spy On The Details
• expect(spy).toHaveBeenCalled()
• expect(spy.callCount).toBe(x)
• expect(spy).toHaveBeenCalledWith()
• Tip: use jasmine.any(Function/Object) for parameters
you don’t care about
Thursday, 19 July 12
17. ... And We’re Back.
Sooooo ... spies are great and all,
but what if your callback function
takes a while to run?
Thursday, 19 July 12
18. Don’t Do This At Home.
Presentation.prototype.loadPresentersMoreSlowly = function() {
var preso = this;
$.getJSON("people.json", function(data) {
setTimeout(function() {
$.each(data, function(idx, person) {
preso.presenters.push(person);
});
}, 2000);
});
};
Thursday, 19 July 12
19. Don’t Do This, Either.
it("should have loaded after three seconds, right?", function()
{
spyOn($, "getJSON").andCallFake(function(url, callback) {
callback([{}, {}]);
})
var presentation = new Presentation();
presentation.loadPresentersMoreSlowly();
setTimeout(function() {
expect(presentation.presenters.length).toBe(2);
}, 3000);
});
Thursday, 19 July 12
20. But What If I Just ...
Presentation.prototype.loadPresentersMoreSlowly = function() {
var preso = this;
$.getJSON("people.json", function(data) {
setTimeout(function() {
$.each(data, function(idx, person) {
preso.presenters.push(person);
});
preso.presentersHaveLoaded = true;
}, 2000);
});
};
Thursday, 19 July 12
21. Now Wait, Wait ... RUN!
it("should load the presenters", function() {
spyOn($, "getJSON").andCallFake(function(url, callback) {
callback([{}, {}]);
})
var presentation = new Presentation();
presentation.loadPresentersMoreSlowly();
waitsFor(function() {
return presentation.presentersHaveLoaded;
}, "presenters have loaded");
runs(function() {
expect(presentation.presenters.length).toBe(2);
});
});
Thursday, 19 July 12
22. Testing Interaction With The
DOM
• Do you REALLY need to?
• Tests will have a high maintenance cost
• Instead separate logic from view and test logic
• Use templates for the view
Thursday, 19 July 12
23. Testing Interaction With The
DOM
it("should display the score", function() {
setFixtures("<div id='score'></div>");
var bowlingGameView = new BowlingGameView();
bowlingGameView.showScore(100);
expect($("#score").text()).toBe("Your current score is 100");
});
https://github.com/velesin/jasmine-jquery
Thursday, 19 July 12
24. Legacy (untested)
JavaScript Code
• Long methods
• Violation of Single Responsibility Principle
• Side effects
• Lack of dependency injection
• Lots of new X()
• Unclear intentions
Thursday, 19 July 12
25. Testing Interaction
it("should call the method on the dependency", function() {
var dependency = {};
dependency.method = jasmine.createSpy();
var myObject = new Something(dependency);
myObject.doSomething();
expect(dependency.method).toHaveBeenCalled();
});
Thursday, 19 July 12
26. If Dependencies Aren’t
Injected ...
var LegacySomething = function() {
this.doSomething = function() {
var dependency = new Dependency();
dependency.method();
};
};
Thursday, 19 July 12
27. Create Stubs
it("is a pain but not impossible", function() {
Dependency = function() {};
Dependency.prototype.method = jasmine.createSpy()
var myObject = new LegacySomething();
myObject.doSomething();
expect(Dependency.prototype.method).toHaveBeenCalled();
});
Thursday, 19 July 12
30. Maven
> mvn clean test
http://searls.github.com/jasmine-maven-plugin/
Thursday, 19 July 12
31. Node.js
> jasmine-node specs/
https://github.com/mhevery/jasmine-node
Thursday, 19 July 12
32. Rhino
• Download:
• Rhino (js.jar) from Mozilla
• env.rhino.js from www.envjs.com
• Jasmine console reporter from Larry Myers Jasmine
Reporters project (github)
http://www.build-doctor.com/2010/12/08/javascript-bdd-jasmine/
Thursday, 19 July 12
33. Rhino
load('env.rhino.1.2.js');
Envjs.scriptTypes['text/javascript'] = true;
var specFile;
for (i = 0; i < arguments.length; i++) {
specFile = arguments[i];
console.log("Loading: " + specFile);
window.location = specFile
}
> java -jar js.jar -opt -1 env.bootstrap.js ../SpecRunner.html
Thursday, 19 July 12
34. Extending Jasmine With
Custom Matchers
it("should match the latitude and longitude", function() {
var pointOnMap = { latitude: "51.23", longitude: "-10.14" };
expect(pointOnMap.latitude).toBe("51.23");
expect(pointOnMap.longitude).toBe("-10.14");
});
it("should match the latitude and longitude", function() {
var pointOnMap = { latitude: "51.23", longitude: "-10.14" };
expect(pointOnMap).toHaveLatitude("51.23");
expect(pointOnMap).toHaveLongitude("-10.14");
});
Thursday, 19 July 12
35. Extending Jasmine With
Custom Matchers
it("should match the latitude and longitude", function() {
var pointOnMap = { latitude: "51.23", longitude: "-10.14" };
expect(pointOnMap).toHaveLatLongCoordinates("51.23", "-10.14");
});
Thursday, 19 July 12