The document provides tips for developing high performance Ajax applications. It discusses planning for performance, measuring performance, optimizing page load speed, and optimizing JavaScript performance. Specific tips include making fewer HTTP requests, minifying assets, lazy-loading code, optimizing the initial rendering, reducing the amount of symbolic lookup in JavaScript, and optimizing regular expressions and string concatenation.
The document summarizes Guillaume Laforge's background and expertise in Groovy and JVM technologies. It then provides an overview of the rich Groovy ecosystem, including frameworks like Grails and Griffon for building applications, GPars for concurrency, and tools for testing, building projects, and interacting with web services. Specific examples are given of how to create a simple console application in Griffon and use various concurrency abstractions in GPars.
This document summarizes techniques for optimizing Angular application performance, including ahead of time compilation, lazy loading, change detection strategies, avoiding memory leaks, and server side rendering. It provides code examples and compares boot times between different configurations. The techniques can improve first meaningful paint time by up to 86% compared to the default configuration.
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"
Мне нравится использовать React. Данная библиотека – отличное решение для многих задач, так как она не навязывает конкретный паттерн или архитектуру. Разработчик сам решает что лучше для той или иной ситуации.
Существует множество уже готовых архитектурных решений. Большинство выбирает Redux. Существует множество библиотек использующее идеи FRP, например Calmm или MobX. Как результат, получаем много подходов, решающие одну и туже задачу.
В своем докладе хочу поговорить о различных архитектурных решениях, пос��отреть на плюсы и минусы той или иной библиотеки, и прийти к консенсусу.
This document discusses JavaScript testing and provides an introduction to test-driven development (TDD) and behavior-driven development (BDD). It describes why software projects fail when code is not tested, the benefits of testing code, and demonstrates writing tests using Mocha and Expect.js for a user creation function.
This document discusses strategies for migrating code from Swift 2.x to Swift 3.0. It recommends first migrating dependencies using tools like CocoaPods and Carthage. It then recommends using Xcode's migration assistant to fix issues, while also preparing code templates beforehand using tools like SwiftGen. Some challenges discussed include changes made automatically by the migrator, optional comparators being removed, and Grand Central Dispatch API changes. References for further information on the Swift 3 migration are provided.
The document discusses unobtrusive JavaScript and the UJS plugin for Rails. It describes separating JavaScript behavior from HTML content and CSS styling. The UJS plugin allows defining behaviors via CSS selectors and keeping scripts in external files. Examples are given of attaching remote behaviors to links and forms using the UJS plugin.
Using JHipster for generating Angular/Spring Boot apps
1. The document discusses using JHipster, an open source tool, to generate Angular and Spring Boot applications. It demonstrates generating both monolithic and microservices applications.
2. Key features of JHipster covered include generating entities, internationalization, and deployment options. Running and developing applications in both development and production modes is explained.
3. Examples are provided of generating sample applications using JHipster's online generator and locally installed generator. This includes reviewing the generated code and application structure.
Web pages can get very complex and slow. In this talk, I share how we solve some of these problems at LinkedIn by leveraging composition and streaming in the Play Framework. This was my keynote for Ping Conference 2014 ( http://www.ping-conf.com/ ): the video is on ustream ( http://www.ustream.tv/recorded/42801129 ) and the sample code is on github ( https://github.com/brikis98/ping-play ).
React is a UI library that is changing the way web applications are written. While there are many benefits to using React, managing an application's complexity as it scales is one of the most powerful.
Good karma: UX Patterns and Unit Testing in Angular with Karma
The document discusses unit testing in Angular with Karma. It provides examples of UX patterns in Angular like binding elements to variables, lists, and click handlers. It also covers what controllers and scopes are and examples of testing components in Angular like services, factories, and UI elements. Hands-on examples are provided for setting up a test environment and writing tests.
Developing a Sling application is only half the story - or perhaps even less. Automated testing is of great importance for insuring code quality and reducing regression risk. Sling presents an interesting challenge, as its technology stack does not get as much attention as more mainstream ones. As such, we had the pleasure of developing our own patterns and testing tools, while integrating the foundations that already existed. This presentation will walk through the various available tools and show how they can be used to cover a Sling-based application.
This document discusses OHHTTPStubs, a library for stubbing network requests in iOS unit and integration tests. It provides examples of how to use OHHTTPStubs to stub requests and responses using files, JSON objects or code. The document also presents two use cases - refactoring existing network code to make it testable, and stubbing requests for features that depend on not-yet-implemented web services, to allow development and testing ahead of server integration.
The document discusses how PHP 5.3 changes the implementation of common design patterns like the Singleton pattern and Observer pattern through the use of anonymous functions. It provides code examples of implementing these patterns in PHP 4/5.0-5.2 versus PHP 5.3 using features like closures, late static binding, and __invoke(). The document also proposes building a dependency injection container in PHP 5.3 using anonymous functions to describe object creation without instantiating objects. This approach results in a simple yet fully-featured dependency injector implementation in around 40 lines of code.
The document discusses using Selenium IDE to record and play test cases for web applications. It provides an overview of key web technologies like HTTP, HTML, DOM, CSS, and JavaScript. It then covers how to install and use Selenium IDE to record tests, modify test cases, handle random input, and run tests on a standalone Selenium server in different browsers.
Video: https://www.youtube.com/watch?v=b6yLwvNSDck
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This is the English version of the presentation. For the version with Japanese subtitles, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework-with-japanese-subtitles
El fotógrafo Peter Menzel viajó por el mundo y fotografió a 30 familias de 24 países diferentes, junto con la comida que consumirían en una semana y sus gastos. Su libro "Hungry Planet" muestra estas fotos y revela grandes diferencias entre los productos, tamaños de familias y gastos semanales que van desde $5.03 en Bután hasta $500.07 en Alemania.
This document summarizes research on electrostatic complexes in polymer materials science. It discusses using non-covalent interactions like π-stacking, coordination via metals, and hydrogen bonding to build supermolecular structures from polymer assemblies. It also describes techniques like layer-by-layer assembly and complex coacervation to encapsulate and pattern materials. The research aims to better understand parameters affecting polyelectrolyte brush structures and interactions through experiments using surface force apparatus.
El documento describe diferentes tipos de hadas japonesas, incluyendo hadas Kawasaki que viven en ciénagas y hacen pociones amorosas, hadas florales que habitan en flores y les dan color o acompañan novias, hadas estelares que hacen constelaciones florales, y hadas del aire, agua, amanecer, noche, y otras más que viven en diferentes elementos naturales y se dedican a tareas relacionadas.
The document repeatedly lists the phrase "Jokes.StevenWongBlog.com" over 50 times without any other text or context. It provides no clear information about the content or purpose beyond mentioning a blog related to jokes.
La fuerza se mide en newtons y es la acción capaz de modificar el estado de movimiento o reposo de un cuerpo. La fuerza puede poner un cuerpo en movimiento al empujarlo o jalarlo, y la aceleración que alcanza un cuerpo depende directamente de la fuerza aplicada. La masa mide la cantidad de materia contenida en un cuerpo y está relacionada a su inercia, por lo que se requiere más fuerza para mover objetos con mayor masa.
Este documento resume los conceptos clave de la industria publicitaria, incluyendo los roles del anunciante, las agencias y los medios. Describe la organización típica de un departamento de marketing, con funciones como el director de marketing, jefe de producto y jefe de medios. También resume los derechos y responsabilidades legales del anunciante según la Ley General de Publicidad española.
The document lists various pairings of people and organizations, some related to Iran and others that are unrelated or nonsensical, including Iranian political and religious figures paired with Hollywood celebrities and technology executives. It expresses a vague feeling that something is wrong and encourages the reader to "See 4 UR Self". The overall content and intent of the document is unclear.
The document contains 11 citations to Flickr photos related to track and field. The citations provide the photo title, Flickr username of the uploader, and URL for each photo. The photos depict various track and field events, teams, and venues from locations around the world.
This document discusses various tools and techniques for testing JavaScript code, including:
1. Unit testing frameworks like Test.Unit that allow writing tests with assertions and automatically running tests.
2. Using Rake tasks to automate running tests and controlling browsers.
3. Behavior-driven development (BDD) techniques like RSpec that allow writing tests as should/is statements directly on objects.
4. Debugging tools like Firebug, Safari Web Inspector, and Microsoft Script Debugger for troubleshooting JavaScript issues.
This document provides an overview of JavaScript concepts including:
- Where JavaScript can run including web browsers and JavaScript engines.
- Key differences from Java like JavaScript arriving as text with no compiler and need to work across runtime environments.
- Tools for debugging and developing JavaScript like Firefox's Firebug and Chrome Developer Tools.
- Variables, functions, objects, and inheritance in JavaScript compared to other languages like Java. Functions can be treated as first-class objects and assigned to properties or passed as callbacks.
Philip Shurpik "Architecting React Native app"Fwdays
React Native становится все более зрелым фреймворком для создания кросс платформенных мобильных приложений. Доклад основан на нашем опыте создания production приложения - от архитектуры до тестирования и CI.
Рассмотрим вопрос переиспользования кода при разработке для разных платформ- что и сколько процентов можно переиспользовать и как этого достичь.
Поговорим о том, как можно очень просто сделать offline-first приложение для чтения и создания данных. И чем нам в этом могут помочь Redux и Redux persist.
Разберем, как максимально просто сделать навигацию в приложении.
И, конечно же, какое production приложение без тестирования и continuous integration? Рассмотрим компонентное тестирование с Enzyme и интеграционное с Appium. А также, как максимально приблизить процесс deploy к тому, чему мы привыкли в web, с помощью CodePush.
The document summarizes Guillaume Laforge's background and expertise in Groovy and JVM technologies. It then provides an overview of the rich Groovy ecosystem, including frameworks like Grails and Griffon for building applications, GPars for concurrency, and tools for testing, building projects, and interacting with web services. Specific examples are given of how to create a simple console application in Griffon and use various concurrency abstractions in GPars.
This document summarizes techniques for optimizing Angular application performance, including ahead of time compilation, lazy loading, change detection strategies, avoiding memory leaks, and server side rendering. It provides code examples and compares boot times between different configurations. The techniques can improve first meaningful paint time by up to 86% compared to the default configuration.
Григорий Шехет "Treasure hunt in the land of Reactive frameworks"Fwdays
Мне нравится использовать React. Данная библиотека – отличное решение для многих задач, так как она не навязывает конкретный паттерн или архитектуру. Разработчик сам решает что лучше для той или иной ситуации.
Существует множество уже готовых архитектурных решений. Большинство выбирает Redux. Существует множество библиотек использующее идеи FRP, например Calmm или MobX. Как результат, получаем много подходов, решающие одну и туже задачу.
В своем докладе хочу поговорить о различных архитектурных решениях, посмотреть на плюсы и минусы той или иной библиотеки, и прийти к консенсусу.
This document discusses JavaScript testing and provides an introduction to test-driven development (TDD) and behavior-driven development (BDD). It describes why software projects fail when code is not tested, the benefits of testing code, and demonstrates writing tests using Mocha and Expect.js for a user creation function.
This document discusses strategies for migrating code from Swift 2.x to Swift 3.0. It recommends first migrating dependencies using tools like CocoaPods and Carthage. It then recommends using Xcode's migration assistant to fix issues, while also preparing code templates beforehand using tools like SwiftGen. Some challenges discussed include changes made automatically by the migrator, optional comparators being removed, and Grand Central Dispatch API changes. References for further information on the Swift 3 migration are provided.
The document discusses unobtrusive JavaScript and the UJS plugin for Rails. It describes separating JavaScript behavior from HTML content and CSS styling. The UJS plugin allows defining behaviors via CSS selectors and keeping scripts in external files. Examples are given of attaching remote behaviors to links and forms using the UJS plugin.
Using JHipster for generating Angular/Spring Boot appsYakov Fain
1. The document discusses using JHipster, an open source tool, to generate Angular and Spring Boot applications. It demonstrates generating both monolithic and microservices applications.
2. Key features of JHipster covered include generating entities, internationalization, and deployment options. Running and developing applications in both development and production modes is explained.
3. Examples are provided of generating sample applications using JHipster's online generator and locally installed generator. This includes reviewing the generated code and application structure.
Web pages can get very complex and slow. In this talk, I share how we solve some of these problems at LinkedIn by leveraging composition and streaming in the Play Framework. This was my keynote for Ping Conference 2014 ( http://www.ping-conf.com/ ): the video is on ustream ( http://www.ustream.tv/recorded/42801129 ) and the sample code is on github ( https://github.com/brikis98/ping-play ).
React is a UI library that is changing the way web applications are written. While there are many benefits to using React, managing an application's complexity as it scales is one of the most powerful.
Good karma: UX Patterns and Unit Testing in Angular with KarmaExoLeaders.com
The document discusses unit testing in Angular with Karma. It provides examples of UX patterns in Angular like binding elements to variables, lists, and click handlers. It also covers what controllers and scopes are and examples of testing components in Angular like services, factories, and UI elements. Hands-on examples are provided for setting up a test environment and writing tests.
Developing a Sling application is only half the story - or perhaps even less. Automated testing is of great importance for insuring code quality and reducing regression risk. Sling presents an interesting challenge, as its technology stack does not get as much attention as more mainstream ones. As such, we had the pleasure of developing our own patterns and testing tools, while integrating the foundations that already existed. This presentation will walk through the various available tools and show how they can be used to cover a Sling-based application.
This document discusses OHHTTPStubs, a library for stubbing network requests in iOS unit and integration tests. It provides examples of how to use OHHTTPStubs to stub requests and responses using files, JSON objects or code. The document also presents two use cases - refactoring existing network code to make it testable, and stubbing requests for features that depend on not-yet-implemented web services, to allow development and testing ahead of server integration.
The document discusses how PHP 5.3 changes the implementation of common design patterns like the Singleton pattern and Observer pattern through the use of anonymous functions. It provides code examples of implementing these patterns in PHP 4/5.0-5.2 versus PHP 5.3 using features like closures, late static binding, and __invoke(). The document also proposes building a dependency injection container in PHP 5.3 using anonymous functions to describe object creation without instantiating objects. This approach results in a simple yet fully-featured dependency injector implementation in around 40 lines of code.
The document discusses using Selenium IDE to record and play test cases for web applications. It provides an overview of key web technologies like HTTP, HTML, DOM, CSS, and JavaScript. It then covers how to install and use Selenium IDE to record tests, modify test cases, handle random input, and run tests on a standalone Selenium server in different browsers.
Video: https://www.youtube.com/watch?v=b6yLwvNSDck
Here's the showdown you've been waiting for: Node.js vs Play Framework. Both are popular open source web frameworks that are built for developer productivity, asynchronous I/O, and the real time web. But which one is easier to learn, test, deploy, debug, and scale? Should you pick Javascript or Scala? The Google v8 engine or the JVM? NPM or Ivy? Grunt or SBT? Two frameworks enter, one framework leaves.
This is the English version of the presentation. For the version with Japanese subtitles, see http://www.slideshare.net/brikis98/nodejs-vs-play-framework-with-japanese-subtitles
El fotógrafo Peter Menzel viajó por el mundo y fotografió a 30 familias de 24 países diferentes, junto con la comida que consumirían en una semana y sus gastos. Su libro "Hungry Planet" muestra estas fotos y revela grandes diferencias entre los productos, tamaños de familias y gastos semanales que van desde $5.03 en Bután hasta $500.07 en Alemania.
This document summarizes research on electrostatic complexes in polymer materials science. It discusses using non-covalent interactions like π-stacking, coordination via metals, and hydrogen bonding to build supermolecular structures from polymer assemblies. It also describes techniques like layer-by-layer assembly and complex coacervation to encapsulate and pattern materials. The research aims to better understand parameters affecting polyelectrolyte brush structures and interactions through experiments using surface force apparatus.
El documento describe diferentes tipos de hadas japonesas, incluyendo hadas Kawasaki que viven en ciénagas y hacen pociones amorosas, hadas florales que habitan en flores y les dan color o acompañan novias, hadas estelares que hacen constelaciones florales, y hadas del aire, agua, amanecer, noche, y otras más que viven en diferentes elementos naturales y se dedican a tareas relacionadas.
The document repeatedly lists the phrase "Jokes.StevenWongBlog.com" over 50 times without any other text or context. It provides no clear information about the content or purpose beyond mentioning a blog related to jokes.
La fuerza se mide en newtons y es la acción capaz de modificar el estado de movimiento o reposo de un cuerpo. La fuerza puede poner un cuerpo en movimiento al empujarlo o jalarlo, y la aceleración que alcanza un cuerpo depende directamente de la fuerza aplicada. La masa mide la cantidad de materia contenida en un cuerpo y está relacionada a su inercia, por lo que se requiere más fuerza para mover objetos con mayor masa.
Este documento resume los conceptos clave de la industria publicitaria, incluyendo los roles del anunciante, las agencias y los medios. Describe la organización típica de un departamento de marketing, con funciones como el director de marketing, jefe de producto y jefe de medios. También resume los derechos y responsabilidades legales del anunciante según la Ley General de Publicidad española.
The document lists various pairings of people and organizations, some related to Iran and others that are unrelated or nonsensical, including Iranian political and religious figures paired with Hollywood celebrities and technology executives. It expresses a vague feeling that something is wrong and encourages the reader to "See 4 UR Self". The overall content and intent of the document is unclear.
The document contains 11 citations to Flickr photos related to track and field. The citations provide the photo title, Flickr username of the uploader, and URL for each photo. The photos depict various track and field events, teams, and venues from locations around the world.
Este documento discute la convergencia de la seguridad física y lógica en las organizaciones. Explica que factores tecnológicos, de proveedores, amenazas y educación están impulsando esta convergencia. También describe los beneficios de una gestión unificada de la seguridad, como una mejor alineación con los objetivos del negocio, un punto único de contacto para temas de seguridad y un mayor intercambio de información entre equipos.
This document provides an overview of the evolution of the internet and web technologies. It discusses early precursors to the internet like Vannevar Bush's memex. It outlines the key developments that led to the creation of the World Wide Web including HTTP and HTML. It then covers the rise of social media and user-generated content through technologies like email, chat, wikis, blogs, photos and video sharing sites. The document also discusses semantic web technologies and standards like RDF and how they add structure and meaning to web content that was previously only accessible to humans.
The document provides information about the PDIUSBD11 USB peripheral chip from Philips Semiconductor, including its features, specifications, pin descriptions, example schematic, and considerations for bus and self-powered operation. It summarizes that the chip allows microcontrollers a USB interface using various transfer modes at full USB speed. However, its documentation and software support are lacking, making initialization difficult without additional information.
Angular Optimization Web Performance MeetupDavid Barreto
This document summarizes techniques for optimizing Angular applications, including ahead-of-time compilation, lazy loading, change detection strategies, avoiding memory leaks, and server-side rendering. It provides code examples and compares the performance of different approaches by measuring load times. The main takeaways are that ahead-of-time compilation, lazy loading, and server-side rendering can each significantly improve load performance, and that change detection strategies and unsubscribing from observables are important for memory usage and efficiency.
Silicon Valley CodeCamp 2008: High performance Ajax with ExtJS and ASP.NETMats Bryntse
This document provides an overview and introduction to using ExtJS with ASP.NET for building high performance AJAX applications. It covers setting up Visual Studio for JavaScript development, debugging techniques, an introduction to ExtJS, examples of ExtJS components like grids and form panels, handling errors, and tips for optimizing AJAX performance.
Talk given at JavaOne 2009 discussing how to build web applications using OSGi. The source for the demo found at http://github.com/mrdon/jforum-plugins/tree/master
Session Abstract: Enterprise Web applications tend to grow like weeds in monolithic complexity. OSGi, although more often associated with Java™ technology-based clients and application servers, can bring a new level of modularity, uptime, and stability that is needed with today's always-on hosted Web applications. OSGi gets really interesting when the pretty architecture diagrams meet the real world, because it consists of various deployment platforms, development environments, and application architectures. This presentation, for Java 2 Platform, Enterprise Edition (J2EE™ platform)-savvy architects and senior developers, provides a practical guide to the Web on OSGi, from integration approach to bundle development, to real-world code you can use today.
The session discusses
• What benefits OSGi brings to the J2EE platform
• Three integration strategies
• How to use Spring DM and Maven to ease development
• Lessons learned from Atlassian's recent OSGi deployment
• A production-ready example to use immediately
The document discusses optimizing performance for Ajax applications. It recommends:
- Keeping client-side code light by only requesting necessary data from the server via JSON messages.
- Avoiding unnecessary DOM touches and reflows which are computationally expensive.
- Measuring performance before and after optimizations to validate improvements rather than relying on intuition.
- Optimizing algorithms and avoiding unnecessary work rather than prematurely optimizing without evidence of need.
- The original vision of the World Wide Web was as a hyperlinked document retrieval system, not for presentation, sessions, or interactivity. If it had stayed true to this vision, modern sites like Yahoo would not exist.
- Browser wars in the 1990s led to proprietary technologies that frustrated developers. The introduction of JavaScript in 1995 allowed for dynamic and interactive web pages.
- By the 2000s, Microsoft's Internet Explorer dominated the browser market, bringing some stability through standards like DOM and DHTML. However, cross-browser differences still posed challenges for developers.
Nobody likes to wait for web pages to load in the browser. The longer it takes, the more dissatisfied the users become. Slow web pages lead to a higher bounce rate and the loss of customers. To solve this kind of problems can be very hard sometimes. Before you even start to optimise your page, you have to understand the workflows a browser performs in order to display a page on the screen. In this talk you will get some insights in the critical rendering path and the javascript engine of your browser that help you to find performance problems and solve them. I will show you also some tools and best practices that make your life easier when it comes to performance.
The document provides an overview of developing high performance web applications, focusing on optimizing front-end performance. It discusses why front-end performance matters, and provides best practices for optimizing page load time, developing responsive interfaces, and efficiently loading and executing JavaScript. The document also covers DOM scripting techniques, tools for profiling and analyzing performance, and how the performance monitoring service Gomez can be extended to better measure client-side metrics.
Writing and Testing JavaScript-heavy Web 2.0 apps with JSUnitAlex Chaffee
With the advent of the so-called Web 2.0 platform, more and more applications are using client-side JavaScript for vital features. In fact, some applications are so JS-heavy that they redefine JavaScript as a full-fledged application development language. In this tutorial we discuss some architectural considerations of JS- and AJAX-heavy applications and present in detail our testing framework, with plenty of code examples.
This document discusses optimizing jQuery and front-end performance. It covers minimizing HTTP requests, file size, and blocking behavior to improve dependency loading. It discusses optimizing initial page rendering through asset ordering, lazy loading, and avoiding reflows and repaints. The document also covers post-load responsiveness techniques like JavaScript optimizations. It provides an overview of jQuery internals and optimizations like chaining selections and avoiding empty sets. Tools mentioned include Google Closure Compiler, dynaTrace AJAX Edition, and Cuzillion.
The document discusses the benefits of using Google Web Toolkit (GWT) for building AJAX applications. It summarizes key features of GWT like cross-compiling Java to JavaScript, deferred binding, compiler optimizations, and UI improvements in GWT 2.x like CSS resources, image inlining, and UiBinder. It encourages adopting GWT for its speed advantages like file caching and reduced payload sizes.
This document provides tips for improving the performance of ASP.NET applications. It discusses ways to optimize ASP.NET pages by reducing page size, minimizing viewstate, and adding caching. It also recommends optimizing database queries, using asynchronous calls judiciously, and profiling SQL to identify inefficient queries. Configuration tips include enabling compression, removing unnecessary HTTP modules, and setting the application pool start mode to AlwaysRunning.
Javascript unit testing, yes we can e bigAndy Peterson
This document discusses test-driven development for JavaScript using ScrewUnit and BlueRidge. It introduces the Carbon Five consulting firm and covers why JavaScript unit testing is important. It then demonstrates how to write behavioral tests using ScrewUnit's BDD style and shows a live example testing a wizard component. Some challenges of JavaScript testing like DOM cleanup and structure are addressed. The document emphasizes that JavaScript testing is possible and can be integrated into the development process.
The document discusses various techniques for enhancing web performance, including:
- Making fewer HTTP requests by combining CSS, JavaScript, and image files
- Placing stylesheets in the <head> for faster page loads
- Moving scripts to the bottom of the page to allow above-the-fold content to load first
- Avoiding CSS expressions and using event handlers instead
- Minifying JavaScript and CSS files to reduce file sizes
- Making AJAX requests cacheable for better performance
Top 7 Angular Best Practices to Organize Your Angular AppKaty Slemon
Learn about Angular best practices to improve the performance of your existing Angular application. Tried and tested clean code checklist for your Angular app.
Presented at Bucharest Java User Group, http://www.bjug.ro/editii/5.html . Project source code available at: https://github.com/bucharest-jug/dropwizard-todo
Javascript allows interactive content on web pages and control of the browser and document. It is an interpreted scripting language that is cross-platform but support varies. Javascript can provide interactive content, control document appearance and content, and interact with the user through event handlers.
This document provides an overview of Firefox extension development using JavaScript. It discusses JavaScript basics like variables, functions, and debugging with alerts. It also covers how to access and manipulate the DOM to work with XUL elements in the extension's GUI. Developers are instructed to place JavaScript code files in the extension's content directory and link them to XUL files using the chrome URI. Further reading links are included to learn more about XUL elements and JavaScript.
This document provides an overview of Firefox extension development using JavaScript. It discusses JavaScript basics like variables, functions, and debugging with alerts. It also covers how to access and manipulate the DOM to work with XUL elements in a GUI. Developers are instructed to place JavaScript code files in the extension's content directory and link them to XUL files using the chrome URI. Further reading links are included to learn more about XUL elements, JavaScript, and tutorials for non-programmers.
Similar to High Performance Ajax Applications 1197671494632682 2 (20)
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...Toru Tamaki
Jindong Gu, Zhen Han, Shuo Chen, Ahmad Beirami, Bailan He, Gengyuan Zhang, Ruotong Liao, Yao Qin, Volker Tresp, Philip Torr "A Systematic Survey of Prompt Engineering on Vision-Language Foundation Models" arXiv2023
https://arxiv.org/abs/2307.12980
UiPath Community Day Kraków: Devs4Devs ConferenceUiPathCommunity
We are honored to launch and host this event for our UiPath Polish Community, with the help of our partners - Proservartner!
We certainly hope we have managed to spike your interest in the subjects to be presented and the incredible networking opportunities at hand, too!
Check out our proposed agenda below 👇👇
08:30 ☕ Welcome coffee (30')
09:00 Opening note/ Intro to UiPath Community (10')
Cristina Vidu, Global Manager, Marketing Community @UiPath
Dawid Kot, Digital Transformation Lead @Proservartner
09:10 Cloud migration - Proservartner & DOVISTA case study (30')
Marcin Drozdowski, Automation CoE Manager @DOVISTA
Pawel Kamiński, RPA developer @DOVISTA
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
09:40 From bottlenecks to breakthroughs: Citizen Development in action (25')
Pawel Poplawski, Director, Improvement and Automation @McCormick & Company
Michał Cieślak, Senior Manager, Automation Programs @McCormick & Company
10:05 Next-level bots: API integration in UiPath Studio (30')
Mikolaj Zielinski, UiPath MVP, Senior Solutions Engineer @Proservartner
10:35 ☕ Coffee Break (15')
10:50 Document Understanding with my RPA Companion (45')
Ewa Gruszka, Enterprise Sales Specialist, AI & ML @UiPath
11:35 Power up your Robots: GenAI and GPT in REFramework (45')
Krzysztof Karaszewski, Global RPA Product Manager
12:20 🍕 Lunch Break (1hr)
13:20 From Concept to Quality: UiPath Test Suite for AI-powered Knowledge Bots (30')
Kamil Miśko, UiPath MVP, Senior RPA Developer @Zurich Insurance
13:50 Communications Mining - focus on AI capabilities (30')
Thomasz Wierzbicki, Business Analyst @Office Samurai
14:20 Polish MVP panel: Insights on MVP award achievements and career profiling
Coordinate Systems in FME 101 - Webinar SlidesSafe Software
If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights.
During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to:
- Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value
- Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems
- Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors
- Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported
- Look Ahead: Gain insights into where FME is headed with coordinate systems in the future
Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!
Comparison Table of DiskWarrior Alternatives.pdfAndrey Yasko
To help you choose the best DiskWarrior alternative, we've compiled a comparison table summarizing the features, pros, cons, and pricing of six alternatives.
Implementations of Fused Deposition Modeling in real worldEmerging Tech
The presentation showcases the diverse real-world applications of Fused Deposition Modeling (FDM) across multiple industries:
1. **Manufacturing**: FDM is utilized in manufacturing for rapid prototyping, creating custom tools and fixtures, and producing functional end-use parts. Companies leverage its cost-effectiveness and flexibility to streamline production processes.
2. **Medical**: In the medical field, FDM is used to create patient-specific anatomical models, surgical guides, and prosthetics. Its ability to produce precise and biocompatible parts supports advancements in personalized healthcare solutions.
3. **Education**: FDM plays a crucial role in education by enabling students to learn about design and engineering through hands-on 3D printing projects. It promotes innovation and practical skill development in STEM disciplines.
4. **Science**: Researchers use FDM to prototype equipment for scientific experiments, build custom laboratory tools, and create models for visualization and testing purposes. It facilitates rapid iteration and customization in scientific endeavors.
5. **Automotive**: Automotive manufacturers employ FDM for prototyping vehicle components, tooling for assembly lines, and customized parts. It speeds up the design validation process and enhances efficiency in automotive engineering.
6. **Consumer Electronics**: FDM is utilized in consumer electronics for designing and prototyping product enclosures, casings, and internal components. It enables rapid iteration and customization to meet evolving consumer demands.
7. **Robotics**: Robotics engineers leverage FDM to prototype robot parts, create lightweight and durable components, and customize robot designs for specific applications. It supports innovation and optimization in robotic systems.
8. **Aerospace**: In aerospace, FDM is used to manufacture lightweight parts, complex geometries, and prototypes of aircraft components. It contributes to cost reduction, faster production cycles, and weight savings in aerospace engineering.
9. **Architecture**: Architects utilize FDM for creating detailed architectural models, prototypes of building components, and intricate designs. It aids in visualizing concepts, testing structural integrity, and communicating design ideas effectively.
Each industry example demonstrates how FDM enhances innovation, accelerates product development, and addresses specific challenges through advanced manufacturing capabilities.
Kief Morris rethinks the infrastructure code delivery lifecycle, advocating for a shift towards composable infrastructure systems. We should shift to designing around deployable components rather than code modules, use more useful levels of abstraction, and drive design and deployment from applications rather than bottom-up, monolithic architecture and delivery.
Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Em...Erasmo Purificato
Slide of the tutorial entitled "Paradigm Shifts in User Modeling: A Journey from Historical Foundations to Emerging Trends" held at UMAP'24: 32nd ACM Conference on User Modeling, Adaptation and Personalization (July 1, 2024 | Cagliari, Italy)
The DealBook is our annual overview of the Ukrainian tech investment industry. This edition comprehensively covers the full year 2023 and the first deals of 2024.
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfjackson110191
These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.
Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.
YOUR RELIABLE WEB DESIGN & DEVELOPMENT TEAM — FOR LASTING SUCCESS
WPRiders is a web development company specialized in WordPress and WooCommerce websites and plugins for customers around the world. The company is headquartered in Bucharest, Romania, but our team members are located all over the world. Our customers are primarily from the US and Western Europe, but we have clients from Australia, Canada and other areas as well.
Some facts about WPRiders and why we are one of the best firms around:
More than 700 five-star reviews! You can check them here.
1500 WordPress projects delivered.
We respond 80% faster than other firms! Data provided by Freshdesk.
We’ve been in business since 2015.
We are located in 7 countries and have 22 team members.
With so many projects delivered, our team knows what works and what doesn’t when it comes to WordPress and WooCommerce.
Our team members are:
- highly experienced developers (employees & contractors with 5 -10+ years of experience),
- great designers with an eye for UX/UI with 10+ years of experience
- project managers with development background who speak both tech and non-tech
- QA specialists
- Conversion Rate Optimisation - CRO experts
They are all working together to provide you with the best possible service. We are passionate about WordPress, and we love creating custom solutions that help our clients achieve their goals.
At WPRiders, we are committed to building long-term relationships with our clients. We believe in accountability, in doing the right thing, as well as in transparency and open communication. You can read more about WPRiders on the About us page.
An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc
Six months into 2024, and it is clear the privacy ecosystem takes no days off!! Regulators continue to implement and enforce new regulations, businesses strive to meet requirements, and technology advances like AI have privacy professionals scratching their heads about managing risk.
What can we learn about the first six months of data privacy trends and events in 2024? How should this inform your privacy program management for the rest of the year?
Join TrustArc, Goodwin, and Snyk privacy experts as they discuss the changes we’ve seen in the first half of 2024 and gain insight into the concrete, actionable steps you can take to up-level your privacy program in the second half of the year.
This webinar will review:
- Key changes to privacy regulations in 2024
- Key themes in privacy and data governance in 2024
- How to maximize your privacy program in the second half of 2024
3. Planning and designing for high performance Plan for performance from day 1 Work closely with designers and product managers Understand design rationale Explain the tradeoffs between design and performance Offer alternatives and show what is possible (prototype) Challenge yourself to implement challenging designs (don't just say no) Help simplify the design and interaction if needed (compromise)
4. Engineering high performance: A few basic rules Less is more Don’t do anything unnecessary. Don’t do anything until it becomes absolutely necessary. Break the rules Make compromises and break best practices, but only as a last resort! Work on improving perceived performance Users can deal with some reasonable amount of slowness if: They are informed appropriately that an operation is pending. The user interface remains reactive at all time. Cheat whenever you can by first updating the UI and then do the work. Need to “lock” all or part of the user interface.
5. Measuring performance Test performance using a setup similar to your users’ environment Profile your code during development Automate profiling/performance testing Keep historical records of how features perform Consider keeping some (small amount of) profiling code in production
7. Yahoo!'s Exceptional Performance rules Make Fewer HTTP Requests Use a Content Delivery Network Add an Expires Header Gzip Components (including JS!) Put CSS at the Top Move Scripts to the Bottom Avoid CSS Expressions Make JavaScript and CSS External Reduce DNS Lookups Minify JavaScript Avoid Redirects Remove Duplicate Scripts Configure ETags Make Ajax Cacheable See http://developer.yahoo.com/performance/ for more information. A web page works in 3 (sometimes imbricated) stages: load render run These rules cover mostly the first stage.
8. Asset optimization Minify CSS and JavaScript files: Use the YUI Compressor [ http://developer.yahoo.com/yui/compressor/ ] Stay away from so-called advanced compression schemes - like Packer Combine CSS and JavaScript files: At build time [ http://www.julienlecomte.net/blog/2007/09/16/ ] At run time Optimize image assets: PngCrush [ http://pmt.sourceforge.net/pngcrush/ ] PngOptimizer [ http://psydk.org/PngOptimizer.php ] etc.
9. Reduce unminified code size Loading and parsing HTML, CSS and JavaScript code is costly. Be concise and write less code. Make good use of JavaScript libraries. Consider splitting your large JavaScript files into smaller files (bundles) when the parsing and compilation of the script takes an excessive amount of time ( Firefox bug #313967 ) Load code (HTML, CSS and JavaScript) on demand (a.k.a “lazy loading”) See http://ajaxpatterns.org/On-Demand_Javascript Use the YUI Loader Dojo's package system JSAN Import System
10. Optimize initial rendering (1/4) Miscellaneous tips... Consider rendering the first view on the server: Be aware of the added page weight You will still need to attach event handlers once the DOM is ready Close Your HTML Tags to Speed Up Parsing: Implicitly closed tags add cost to HTML parsing http://msdn2.microsoft.com/en-us/library/ms533020.aspx#Close_Your_Tags Consider flushing the apache buffer very early on: The download of external CSS files (should be at the top of the page!) may get a head start. May not influence the rendering speed however. Browsers buffer their input before displaying it. Load only essential assets / load assets on a delay or on demand Use the YUI Image Loader
11. Optimize initial rendering (2/4) Don’t always wait for onload ... Most DOM operations can be accomplished before the onload event has fired. If you have control over where your code is going to be inserted in the page, write your init code in a <script> block located right before the closing </body> tag. Otherwise, use the YUI Event utility’s onDOMReady method: YAHOO.util.Event.onDOMReady( function () { // Do something here... // e.g., attach event handlers. });
12. Optimize initial rendering (3/4) Post-load script loading A well designed site should be fully functional, even without JavaScript enabled. Therefore, you may be able to load scripts on a delay. Doing so benefits the loading of other assets (style sheets, images, etc.) Which makes your site load faster Right before the closing </body> tag, insert the following: <script> window.onload = function () { var script = document.createElement( "script" ); script.src = ...; document.body.appendChild(script); }; </script>
13. Optimize initial rendering (4/4) Conditional preloading Preloading assets (JavaScript, CSS, Images, etc.) has the potential to really enhance the user experience. However, one must be smart about when the preloading takes place. Otherwise, the preloading may actually worsen the user experience... http://www.sitepoint.com/article/web-site-optimization-steps/3 Try it at http://search.yahoo.com/
15. Reduce the amount of symbolic look-up: The scope chain (1/2) var g = 7 ; function f(a) { var v = 8 ; x = v + a + g; } f(6); parent Look-up is performed every time a variable is accessed. Variables are resolved backwards from most specific to least specific scope.
16. Reduce the amount of symbolic look-up: The scope chain (2/2) Therefore, declare (with the var keyword) and use variables in the same scope whenever possible, and avoid global variables at all costs. Never use the with keyword, as it prevents the compiler from generating code for fast access to local variables (traverse the object prototype chain first, and then up the scope chain, and so on) Cache the result of expensive look-ups in local variables: var arr = ...; var globalVar = 0 ; ( function () { var i; for (i = 0 ; i < arr.length; i++) { globalVar++; } })(); var arr = ...; var globalVar = 0 ; ( function () { var i, l, localVar; l = arr.length; localVar = globalVar; for (i = 0 ; i < l; i++) { localVar++; } globalVar = localVar; })(); (faster on all A-grade browsers)
17. Reduce the amount of symbolic look-up: The prototype chain function A () {} A.prototype.prop1 = ...; function B () { this .prop2 = ...; } B.prototype = new A(); var b = new B(); B.prototype Accessing members bound to the primary object is about 25% faster than accessing members defined anywhere in the prototype chain. The longer the traversal of the prototype chain, the slower the look-up.
18. Optimize object instantiation If you need to create many objects, consider adding members to the prototype instead of adding them to each individual object in the object constructor (properties are bound once, to the prototype object) This also reduces memory consumption. However, it slows down the look-up of object members. function Foo () {...} Foo.prototype.bar = function () {...}; function Foo () { this .bar = function () {...}; }
19. Don’t use eval ! The string passed to eval (and its relatives, the Function constructor and the setTimeout and setInterval functions) needs to be compiled and interpreted. Extremely slow! Never pass a string to the setTimeout and setInterval functions. Instead, pass an anonymous function like so: setTimeout( function () { // Code to execute on a timeout }, 50 ); Never use eval and the Function constructor (except in some extremely rare cases, and only in code blocks where performance is not critical)
20. Optimize string concatenation On Internet Explorer (JScript), concatenating two strings causes a new string to be allocated, and the two original strings to be copied: var s = “xxx” + “yyy” ; s += “zzz” ; Therefore, it is much faster on Internet Explorer to append strings to an array, and then use Array.join (don’t use this for simple concatenations!) var i, s = “” ; for (i = 0 ; i < 10000 ; i++) { s += “x” ; } var i, s = []; for (i = 0 ; i < 10000 ; i++) { s[i] = “x” ; } s = s.join( “” ); Other JavaScript engines (WebKit, SpiderMonkey) have been optimized to handle string concatenations by doing a realloc + memcpy whenever possible. Use the YUI Compressor!
21. Optimize regular expressions Don’t use the RegExp constructor, unless your regular expression is assembled at runtime. Instead, use regular expression literals. Use the test method if all you want to do is test for a pattern (the exec method carries a small performance penalty) Use non-capturing groups (?: ... ) Stick to simple patterns. If your regular expression looks like the following, reconsider... if ( /loaded|complete/ .test(document.readyState)) {...} (?:(?:)?[])*(?:(?:(?:[^()<>@,;:".00-31]+(?:(?:(?:)?[])+||(?=["()<>@,;:".]))|" (?:[^amp;quot;]|.|(?:(?:)?[]))*"(?:(?:)?[])*)(?:(?:(?:)?[])*(?:[^()<>@,;:".00-31 ]+(?:(?:(?:)?[])+||(?=["()<>@,;:".]))|"(?:[^amp;quot;]|.|(?:(?:)?[]))*"(?:(?:)?[]) *))*@(?:(?:)?[])*(?:[^()<>@,;:".00-31]+(?:(?:(?:)?[])+||(?=["()<>@,;:".]))| ([^]|.)*(?:(?:)?[])*)(?:(?:(?:)?[])*(?:[^()<>@,;:".00-31]+(?:(?:(?:)? [])+||(?=["()<>@,;:".]))|([^]|.)*(?:(?:)?[])*))*|(?:[^()<>@,;:".00- 31]+(?:(?:(?:)?[])+||(?=["()<>@,;:".]))|"(?:[^amp;quot;]|.|(?:(?:)?[]))*"(?:(?:)?[ ])*)*lt;(?:(?:)?[])*(?:@(?:[^()<>@,;:".00-31]+(?:(?:(?:)?[])+||(?=["()<>@,;:". ]))|([^]|.)*(?:(?:)?[])*)(?:(?:(?:)?[])*(?:[^()<>@,;:".00-31]+(?:(?:(?: )?[])+||(?=["()<>@,;:".]))|([^]|.)*(?:(?:)?[])*))*(?:,@(?:(?:)?[]))
22. Caching Caching can be justified by: High cost (CPU or network latency) associated with getting a value Value will be read many times And will not change often! Increases memory consumption tradeoff Memoization: var fn = ( function () { var b = false , v; return function () { if (!b) { v = ...; b = true ; } return v; }; })(); function fn () { if (!fn.b) { fn.v = ...; fn.b = true ; } return fn.v; } var fn = function () { var v = ...; return (fn = function () { return v; })(); }; Module pattern Store value in function object Lazy function definition
23. How to handle long running JavaScript processes (1/2) During long running JavaScript processes, the entire browser UI is frozen Therefore, to maintain a decent user experience, make sure that JavaScript threads never take more than ~ 300 msec (at most) to complete. You can break long running processes into smaller units of work, and chain them using setTimeout . You can also process the data on the server. More info at http://www.julienlecomte.net/blog/2007/10/28 Demo
24. How to handle long running JavaScript processes (2/2) function doSomething (callbackFn) { // Initialize a few things here... ( function () { // Do a little bit of work here... if ( termination condition ) { // We are done callbackFn(); } else { // Process next chunk setTimeout(arguments.callee, 0); } })(); }
25. Miscellaneous tips (1/2) Primitive operations are often faster than the corresponding function calls: var a = 1 , b = 2 , c; c = Math.min(a, b); c = a < b ? a : b; If possible, avoid using try...catch in performance-critical sections: var i; for (i = 0 ; i < 100000 ; i++) { try { ... } catch (e) { ... } } var i; try { for (i = 0 ; i < 100000 ; i++) { ... } } catch (e) { ... } myArray.push(value); myArray[myArray.length] = value; myArray[idx++] = value;
26. Miscellaneous tips (2/2) If possible, avoid for...in in performance-critical sections: var key, value; for (key in myArray) { value = myArray[key]; ... } var i, value, length = myArray.length; for (i = 0 ; i < length; i++) { value = myArray[i]; ... } Branch outside, not inside, whenever the branching condition does not change: function fn () { if (...) { ... } else { ... } } var fn; if (...) { fn = function () {...}; } else { fn = function () {...}; }
28. Document tree modification Using innerHTML var i, j, el, table, tbody, row, cell; el = document.createElement( "div" ); document.body.appendChild(el); table = document.createElement( "table" ); el.appendChild(table); tbody = document.createElement( "tbody" ); table.appendChild(tbody); for (i = 0 ; i < 1000 ; i++) { row = document.createElement( "tr" ); for (j = 0 ; j < 5 ; j++) { cell = document.createElement( "td" ); row.appendChild(cell); } tbody.appendChild(row); } var i, j, el, idx, html; idx = 0 ; html = []; html[idx++] = "<table>" ; for (i = 0 ; i < 1000 ; i++) { html[idx++] = "<tr>" ; for (j = 0 ; j < 5 ; j++) { html[idx++] = "<td></td>" ; } html[idx++] = "</tr>" ; } html[idx++] = "</table>" ; el = document.createElement( "div" ); document.body.appendChild(el); el.innerHTML = html.join( "" ); ( much faster on all A-grade browsers) Warning: See http://www.julienlecomte.net/blog/2007/12/38/
29. Document tree modification Using cloneNode var i, j, el, table, tbody, row, cell; el = document.createElement( "div" ); document.body.appendChild(el); table = document.createElement( "table" ); el.appendChild(table); tbody = document.createElement( "tbody" ); table.appendChild(tbody); for (i = 0 ; i < 1000 ; i++) { row = document.createElement( "tr" ); for (j = 0 ; j < 5 ; j++) { cell = document.createElement( "td" ); row.appendChild(cell); } tbody.appendChild(row); } var i, el, table, tbody, template, row, cell; el = document.createElement( "div" ); document.body.appendChild(el); table = document.createElement( "table" ); el.appendChild(table); tbody = document.createElement( "tbody" ); table.appendChild(tbody); template = document.createElement( "tr" ); for (i = 0 ; i < 5 ; i++) { cell = document.createElement( "td" ); template.appendChild(cell); } for (i = 0 ; i < 1000 ; i++) { row = template.cloneNode(true); tbody.appendChild(row); } (faster on all A-grade browsers – sometimes much faster) Warning: expando properties/attached event handlers are lost!
30. Document tree modification Using DocumentFragment A DocumentFragment (DOM Level 1 Core) is a lightweight Document object. It supports only a subset of the regular DOM methods and properties. IE’s implementation of the DocumentFragment interface does not comply with the W3C specification and returns a regular Document object. var i, j, el, table, tbody, row, cell, docFragment; docFragment = document.createDocumentFragment(); el = document.createElement( "div" ); docFragment.appendChild(el); table = document.createElement( "table" ); el.appendChild(table); tbody = document.createElement( "tbody" ); table.appendChild(tbody); for (i = 0 ; i < 1000 ; i++) { ... } document.body.appendChild(docFragment);
31. Limit the number of event handlers (1/2) Attaching an event handler to hundreds of elements is very costly Multiplying event handlers augments the potential for memory leaks Solution: Use event delegation , a technique that relies on event bubbling <div id= "container" > <ul> <li id= "li-1" > List Item 1 </li> <li id= "li-2" > List Item 2 </li> <li id= "li-3" > List Item 3 </li> <li id= "li-4" > List Item 4 </li> <li id= "li-5" > List Item 5 </li> ... </ul> </div> div#container ul li#li- x text node
32. Limit the number of event handlers (2/2) YAHOO.util.Event.addListener( "container" , "click" , function (e) { var el = YAHOO.util.Event.getTarget(e); while (el.id !== "container" ) { if (el.nodeName.toUpperCase() === "LI" ) { // Do something here... break; } else { el = el.parentNode; } } });
33. Limiting reflows Reflows happen whenever the DOM tree is manipulated. Browsers have optimizations you may take advantage of to minimize reflow: Modifying an invisible element (display:none) does not trigger reflow Modifying an element “off-DOM” does not trigger reflow Batch style changes: Change the value of the style attribute using setAttribute (does not work on Internet Explorer) Example: Change the value of the cssText property of the style object. Example: More maintainable: Change the CSS class name of an element. Example: el.style.cssText = "display:block;width:auto;height:100px;..." ; YAHOO.util.Dom.replaceClass(el, "foo" , "bar" ); el.setAttribute( "style" , "display:block;width:auto;height:100px;..." );
34. Miscellaneous tips... Consider using the onmousedown event instead of the onclick event Get a head start by making use of the small delay between the time a user presses the mouse button and the time he/she releases it. “ Downshift your code”: throttle frequent and expensive actions See http://yuiblog.com/blog/2007/07/09/downshift-your-code/
36. Miscellaneous tips... Use CSS Sprites for Snappy Image Replacement. Avoid using JavaScript for layout. window.onresize is throttled... Use pure CSS instead! Side benefits: improves maintainability, degrades more gracefully, etc. Avoid using Internet Explorer expressions Expressions are constantly evaluated in order to react to environment changes. There are ways to more safely use expressions, but in general, you shouldn’t need/use them. Avoid using Internet Explorer filters (or keep their use to a minimum) Optimize Table Layout Goal: allow the rendering engine to start rendering a table before it has received all the data Use table-layout:fixed Explicitly define a COL element for each column Set the WIDTH attribute on each col Optimize your CSS selectors [ http://developer.mozilla.org/en/docs/Writing_Efficient_CSS ]
38. Ajax Best Practices Never resort to using synchronous XMLHttpRequest http://yuiblog.com/blog/2006/04/04/synchronous-v-asynchronous/ Asynchronous programming model slightly more complicated. Need to lock all or part of the UI while the transaction is pending. Programmatically handle network timeouts. Solution: Use the YUI Connection Manager: var callback = { success: function () { /* Do something */ }, failure: function () { /* Do something */ }, timeout: 5000 }; YAHOO.util.Connect.asyncRequest( "GET" , url, callback);
39. Improving perceived network latency using the optimistic pattern If the data is validated locally (on the client, using JavaScript) before being sent to the server, the request will be successful in 99.9% of the cases. Therefore, in order to optimize the user experience, we should assume a successful outcome and adopt the following pattern: Update the UI when the request gets sent. Lock the UI/data structures with the finest possible granularity. Let the user know that something is happening. Let the user know why a UI object is locked. Unlock the UI/data structures when the outcome is successful. Handle error cases gracefully.
40. Miscellaneous tips... Be aware of the maximum number of concurrent HTTP/1.1 connections. Multiplex Ajax requests whenever possible, and if your backend supports it. Piggyback unsollicited notifications in a response to an Ajax request. Favor JSON over XML as your data exchange format Accessing a JSON data structure is easier and cheaper than accessing XML data. JSON has less overhead than XML. Push, don’t poll. Use COMET to send real-time notifications to the browser. Consider using local storage to cache data locally, request a diff from the server: Internet Explorer’s userData Flash local storage DOM:Storage (WhatWG persistent storage API, implemented in Firefox 2) Google Gears etc.