Efficient client-server interactions make or break a web application. This talk as about advanced techniques, which can be used with popular frameworks, to improve performance, and simplify data manipulations.
The document discusses Mito, an object-relational mapper (ORM) for Common Lisp that is a successor to Integral. Some key features of Mito include supporting PostgreSQL as well as MySQL and SQLite3, implicit columns for auto-generated primary keys and record timestamps, reference associations between database table classes, eager loading to reduce N+1 queries, inheritance of database table classes, and migrations and schema versioning.
- Groovy is a JVM language that compiles to Java bytecodes and interoperates seamlessly with Java.
- It simplifies Java development with features like optional semicolons, optional parentheses, and native collections.
- Groovy also includes closures, builders, metaprogramming capabilities, and tools like Spock for testing and Gradle for building.
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
- Go provides object-oriented capabilities through struct types and interfaces without classes or inheritance. Structs can have methods defined on them to provide behaviors.
- Go uses composition over inheritance by allowing structs to be embedded within other structs to reuse their fields and methods. This is how interfaces are implemented in Go through embedding.
- Interfaces in Go provide polymorphism by defining a set of common methods. Any type that implements those methods can be used as that interface. This allows for broad interoperability between different types.
- While Go does not have subtyping, embedded fields and methods can be "promoted" to outer structs to reuse functionality, providing some object-oriented capabilities without classes or inheritance.
The document provides an introduction to Clojure by listing various resources about Clojure including websites, videos, papers and books. It discusses key aspects of Clojure such as its Lisp heritage, functional programming principles, namespaces, polymorphism using protocols and multimethods, and concurrency features using Software Transactional Memory. The document also compares Clojure to other Lisps and outlines Clojure's basic syntax where code is represented as data structures.
Given at GopherFest 2015. This is an updated version of the talk I gave in NYC Nov 14 at GothamGo.
“We need to think about failure differently. Most people think mistakes are a necessary evil. Mistakes aren't a necessary evil, they aren't evil at all. They are an inevitable consequence of doing something new and as such should be seen as valuable. “ - Ed Catmull
As Go is a "new" programming language we are all experimenting and learning how to write better Go. While most presentations focus on the destination, this presentation focuses on the journey of learning Go and the mistakes I personally made while developing Hugo, Cobra, Viper, Afero & Docker.
7 Common mistakes in Go and when to avoid themSteven Francia
I've spent the past two years developing some of the most popular libraries and applications written in Go. I've also made a lot of mistakes along the way. Recognizing that "The only real mistake is the one from which we learn nothing. -John Powell", I would like to share with you the mistakes that I have made over my journey with Go and how you can avoid them.
This document discusses using JRuby to run Ruby code on the Java Virtual Machine (JVM). Some key points:
- JRuby runs nearly all pure Ruby code and 92% of the Ruby spec suite by compiling Ruby code to JVM bytecode.
- Performance of JRuby has improved significantly with Java 7 and the HotSpot JIT compiler. Benchmarks show a 3-4x speedup over MRI Ruby for some algorithms.
- Using the JVM gives JRuby features like real threads, memory management without garbage collection pauses, and the ability to directly call Java libraries from Ruby.
- The JRuby compiler compiles Ruby code to JVM bytecode which is further optimized by the HotSpot
The document introduces SD, a peer-to-peer bug tracking tool developed by Best Practical to allow tracking bugs offline and syncing work across devices. SD uses a decentralized model where each installation can pull changes from any other replica. It supports syncing with other bug trackers like RT, Trac and Google Code. The author argues that cloud services make users dependent while SD empowers fully offline and distributed work by syncing like users naturally share files.
The document discusses Mito, an object-relational mapper (ORM) for Common Lisp that is a successor to Integral. Some key features of Mito include supporting PostgreSQL as well as MySQL and SQLite3, implicit columns for auto-generated primary keys and record timestamps, reference associations between database table classes, eager loading to reduce N+1 queries, inheritance of database table classes, and migrations and schema versioning.
- Groovy is a JVM language that compiles to Java bytecodes and interoperates seamlessly with Java.
- It simplifies Java development with features like optional semicolons, optional parentheses, and native collections.
- Groovy also includes closures, builders, metaprogramming capabilities, and tools like Spock for testing and Gradle for building.
Go for Object Oriented Programmers or Object Oriented Programming without Obj...Steven Francia
- Go provides object-oriented capabilities through struct types and interfaces without classes or inheritance. Structs can have methods defined on them to provide behaviors.
- Go uses composition over inheritance by allowing structs to be embedded within other structs to reuse their fields and methods. This is how interfaces are implemented in Go through embedding.
- Interfaces in Go provide polymorphism by defining a set of common methods. Any type that implements those methods can be used as that interface. This allows for broad interoperability between different types.
- While Go does not have subtyping, embedded fields and methods can be "promoted" to outer structs to reuse functionality, providing some object-oriented capabilities without classes or inheritance.
The document provides an introduction to Clojure by listing various resources about Clojure including websites, videos, papers and books. It discusses key aspects of Clojure such as its Lisp heritage, functional programming principles, namespaces, polymorphism using protocols and multimethods, and concurrency features using Software Transactional Memory. The document also compares Clojure to other Lisps and outlines Clojure's basic syntax where code is represented as data structures.
Given at GopherFest 2015. This is an updated version of the talk I gave in NYC Nov 14 at GothamGo.
“We need to think about failure differently. Most people think mistakes are a necessary evil. Mistakes aren't a necessary evil, they aren't evil at all. They are an inevitable consequence of doing something new and as such should be seen as valuable. “ - Ed Catmull
As Go is a "new" programming language we are all experimenting and learning how to write better Go. While most presentations focus on the destination, this presentation focuses on the journey of learning Go and the mistakes I personally made while developing Hugo, Cobra, Viper, Afero & Docker.
7 Common mistakes in Go and when to avoid themSteven Francia
I've spent the past two years developing some of the most popular libraries and applications written in Go. I've also made a lot of mistakes along the way. Recognizing that "The only real mistake is the one from which we learn nothing. -John Powell", I would like to share with you the mistakes that I have made over my journey with Go and how you can avoid them.
This document discusses using JRuby to run Ruby code on the Java Virtual Machine (JVM). Some key points:
- JRuby runs nearly all pure Ruby code and 92% of the Ruby spec suite by compiling Ruby code to JVM bytecode.
- Performance of JRuby has improved significantly with Java 7 and the HotSpot JIT compiler. Benchmarks show a 3-4x speedup over MRI Ruby for some algorithms.
- Using the JVM gives JRuby features like real threads, memory management without garbage collection pauses, and the ability to directly call Java libraries from Ruby.
- The JRuby compiler compiles Ruby code to JVM bytecode which is further optimized by the HotSpot
The document introduces SD, a peer-to-peer bug tracking tool developed by Best Practical to allow tracking bugs offline and syncing work across devices. SD uses a decentralized model where each installation can pull changes from any other replica. It supports syncing with other bug trackers like RT, Trac and Google Code. The author argues that cloud services make users dependent while SD empowers fully offline and distributed work by syncing like users naturally share files.
The document discusses strategies for improving the startup performance of JRuby. It describes how the JRuby team optimized startup by using a Java-heavy JDK instead of native code, tweaking JVM flags, and implementing Drip - a technique that pre-boots the JVM and caches runtime configurations between runs. Drip reduced JRuby startup times from over 10 seconds to under 1 second for many common tasks. Later, it discusses challenges with JNI and how the Java Native Runtime (JNR) provides a better alternative for interfacing Java with native code and libraries.
The document discusses practical web scraping using the Web::Scraper module in Perl. It provides an example of scraping the current UTC time from a website using regular expressions, then refactors it to use Web::Scraper for a more robust and maintainable approach. Key advantages of Web::Scraper include using CSS selectors and XPath to be less fragile, and proper handling of HTML encoding.
Nick Sieger JRuby Concurrency EMRubyConf 2011Nick Sieger
This document discusses concurrency in JRuby and presents several approaches for managing concurrent operations, including Java's java.util.concurrent utilities, Jetlang fibers and channels, and the Akka actor framework. It notes some challenges with using green threads in JRuby due to shared mutable state and provides examples demonstrating thread safety issues and solutions using these other concurrency models.
This document discusses object-relational mappers (ORMs) and several ORM libraries for Go. ORMs allow converting data between object-oriented programming languages and relational databases. While initially hailed, ORMs were later criticized for some assumptions that cost dearly. The document then outlines Go's philosophy regarding ORMs and duality between classes and types. Several popular Go ORM libraries are described, including Gorm, Gorp, and Sqlx, outlining their key features and support for operations like CRUD, relationships, and migrations. The document cautions to avoid opaque struct tags that can introduce semantic errors and to do application logic outside ORM objects.
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
This document provides an overview of CouchDB, a document-oriented database. It describes CouchDB's key features such as storing data as JSON documents with dynamic schemas, providing a RESTful HTTP API, using JavaScript for views and aggregations, and replicating data between databases. It also provides code examples for common operations like creating, retrieving, updating and deleting documents, as well as attaching files. The document recommends libraries for using CouchDB from different programming languages and shares the code for a simple CouchDB library created in an afternoon.
This document describes how to use the ELK (Elasticsearch, Logstash, Kibana) stack to centrally manage and analyze logs from multiple servers and applications. It discusses setting up Logstash to ship logs from files and servers to Redis, then having a separate Logstash process read from Redis and index the logs to Elasticsearch. Kibana is then used to visualize and analyze the logs indexed in Elasticsearch. The document provides configuration examples for Logstash to parse different log file types like Apache access/error logs and syslog.
Presentation by Haroon Meer, Roelof Tammingh at black hat USA in 2006.
This presentation is about Suru, the inline proxy tool developed by Roelof Tammingh. How it works and some of it's features are discussed.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
Presentation given at the Toulouse (FR) Java User Group.
Video (in french) at https://www.youtube.com/watch?v=rB0ElXf05nU
Slideshow with animations at https://docs.google.com/presentation/d/1eIcROfLpdTU2_Z_IKiMG-AwqZGZgbN1Bs2E0nGShpbk/pub?start=true&loop=false&delayms=60000
Golang Performance : microbenchmarks, profilers, and a war storyAerospike
Slides for Brian Bulkowski's talk about Golang performance:
microbenchmarks, profilers, and a war story about optimizing the Aerospike Database Go client.
http://www.meetup.com/Go-lang-Developers-NYC/events/216650022/
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
This document summarizes a presentation on using JRuby and Ruby on Rails for web application development. It discusses how JRuby allows Ruby code to drive Java, embed Ruby in Java applications, and compile Ruby to Java bytecode. Rails is presented as a dynamic web framework that uses conventions over configuration and opinionated defaults. The document provides examples of common Rails features like scaffolding, models, controllers and views. It also outlines how to deploy Rails applications as WAR files or to cloud platforms using JRuby.
The document provides an introduction to the Java Virtual Machine (JVM) bytecode and JIT compiler. It discusses how bytecode works, including inspection, generation and the bytecode instructions. It also covers how the JIT compiler works and is monitored. Examples of viewing bytecode with javap and generating bytecode with BiteScript are provided.
This document summarizes Rob Sanderson's presentation on Python libraries for web interaction. It discusses the top 10 libraries including urllib for opening URLs, urllib2 for adding headers and proxies, urlparse for parsing URLs, httplib for lower-level HTTP requests, lxml for XML/HTML parsing, rdflib for RDF, json/simplejson for JSON, mod_python/mod_wsgi for Python web servers, and bpython as a Python shell. Code examples are provided for each to demonstrate their usage.
Groovy is a dynamic language for the Java Virtual Machine that adds features from languages like Python, Ruby, and Smalltalk. It supports domain-specific languages and integrates with all Java objects. Groovy compiles to Java bytecode so it runs on the JVM and can be used anywhere Java is used, including J2EE, Swing, Spring, and Seam applications. Groovy allows writing JUnit tests and development in Eclipse with debugging support.
Code formatting is an opinionated beast. It always has been a matter of taste, and it always will be a matter of taste. This is the reason, why professional formatting tools, such as Eclipse JDT, offer a gazillion number of options. Which is still not sufficient enough. After all, you can override them inline with tag-comments to make the formatter shut up. Can't we do better than that? What if we could use machine learning techniques to detect the preferred code style that was use in a codebase so far? Turns out, we can.
The Antlr Codebuff project (https://github.com/antlr/codebuff) offers a generic formatter for pretty much any given language. As long as a grammar file exists, existing source can be analyzed to learn about the rules that have been applied while writing the code. Those can than be used to pretty print newly written code. No configuration required. And existing sources will stay as nicely formatted as they are. In the end, the primary purpose of code formatting is not to re-arrange all the keywords, but to make the source layout consistent.
In this talk, we will demonstrate the usage of the codebuff project and how it can be used to format the sources of your repo in a consistent way. We'll also show some other gems that have been revealed when toying around with the technology.
This document summarizes a presentation about using Perl for Lego programming and various Perl projects.
The presentation discusses Lorzy, a Scheme-like interpreter written in Perl that uses Moose and a type system. It also describes lcore, a 600 line sandbox written in Perl to safely run user-defined rules and actions for a request tracker system. Strong typing is emphasized as important for safety. Live demos and code links are provided.
Go debugging and troubleshooting tips - from real life lessons at SignalFxSignalFx
Exploring tips and advice on writing production Go systems that are easy to debug and troubleshoot. Jack Lindamood from SignalFx presents patterns that facilitate this process.
Jack addresses tools built into Go you can take advantage of, build process techniques they've learned over time, and open source tools and libraries you can use that help troubleshoot your production code when things go wrong.
Read more here: http://blog.signalfx.com/a-pattern-for-optimizing-go
JSON Fuzzing: New approach to old problemstitanlambda
The document describes a new approach to JSON fuzzing developed by the authors. It notes that existing fuzzing tools do not support JSON format testing. The authors extended an existing Firefox addon to add JSON parsing and fuzzing capabilities. This allows converting a JSON request to name-value pairs for fuzzing, fuzzing the values, converting back to JSON format and sending to the application. A demo is provided and future work discussed, such as supporting different JSON formats and integrating the technique into other tools.
The document discusses the future of server-side JavaScript. It covers various Node.js frameworks and libraries that support both synchronous and asynchronous programming styles. CommonJS aims to provide interoperability across platforms by implementing synchronous proposals using fibers. Examples demonstrate how CommonJS allows for synchronous-like code while maintaining asynchronous behavior under the hood. Benchmarks show it has comparable performance to Node.js. The author advocates for toolkits over frameworks and continuing development of common standards and packages.
The document discusses strategies for improving the startup performance of JRuby. It describes how the JRuby team optimized startup by using a Java-heavy JDK instead of native code, tweaking JVM flags, and implementing Drip - a technique that pre-boots the JVM and caches runtime configurations between runs. Drip reduced JRuby startup times from over 10 seconds to under 1 second for many common tasks. Later, it discusses challenges with JNI and how the Java Native Runtime (JNR) provides a better alternative for interfacing Java with native code and libraries.
The document discusses practical web scraping using the Web::Scraper module in Perl. It provides an example of scraping the current UTC time from a website using regular expressions, then refactors it to use Web::Scraper for a more robust and maintainable approach. Key advantages of Web::Scraper include using CSS selectors and XPath to be less fragile, and proper handling of HTML encoding.
Nick Sieger JRuby Concurrency EMRubyConf 2011Nick Sieger
This document discusses concurrency in JRuby and presents several approaches for managing concurrent operations, including Java's java.util.concurrent utilities, Jetlang fibers and channels, and the Akka actor framework. It notes some challenges with using green threads in JRuby due to shared mutable state and provides examples demonstrating thread safety issues and solutions using these other concurrency models.
This document discusses object-relational mappers (ORMs) and several ORM libraries for Go. ORMs allow converting data between object-oriented programming languages and relational databases. While initially hailed, ORMs were later criticized for some assumptions that cost dearly. The document then outlines Go's philosophy regarding ORMs and duality between classes and types. Several popular Go ORM libraries are described, including Gorm, Gorp, and Sqlx, outlining their key features and support for operations like CRUD, relationships, and migrations. The document cautions to avoid opaque struct tags that can introduce semantic errors and to do application logic outside ORM objects.
Fast as C: How to Write Really Terrible JavaCharles Nutter
For years we’ve been told that the JVM’s amazing optimizers can take your running code and make it “fast” or “as fast as C++” or “as fast as C”…or sometimes “faster than C”. And yet we don’t often see this happen in practice, due in large part to (good and bad) development patterns that have taken hold in the Java world.
In this talk, we’ll explore the main reasons why Java code rarely runs as fast as C or C++ and how you can write really bad Java code that the JVM will do a better job of optimizing. We’ll take some popular microbenchmarks and burn them to the ground, monitoring JIT logs and assembly dumps along the way.
This document provides an overview of CouchDB, a document-oriented database. It describes CouchDB's key features such as storing data as JSON documents with dynamic schemas, providing a RESTful HTTP API, using JavaScript for views and aggregations, and replicating data between databases. It also provides code examples for common operations like creating, retrieving, updating and deleting documents, as well as attaching files. The document recommends libraries for using CouchDB from different programming languages and shares the code for a simple CouchDB library created in an afternoon.
This document describes how to use the ELK (Elasticsearch, Logstash, Kibana) stack to centrally manage and analyze logs from multiple servers and applications. It discusses setting up Logstash to ship logs from files and servers to Redis, then having a separate Logstash process read from Redis and index the logs to Elasticsearch. Kibana is then used to visualize and analyze the logs indexed in Elasticsearch. The document provides configuration examples for Logstash to parse different log file types like Apache access/error logs and syslog.
Presentation by Haroon Meer, Roelof Tammingh at black hat USA in 2006.
This presentation is about Suru, the inline proxy tool developed by Roelof Tammingh. How it works and some of it's features are discussed.
How do we go from your Java code to the CPU assembly that actually runs it? Using high level constructs has made us forget what happens behind the scenes, which is however key to write efficient code.
Starting from a few lines of Java, we explore the different layers that constribute to running your code: JRE, byte code, structure of the OpenJDK virtual machine, HotSpot, intrinsic methds, benchmarking.
An introductory presentation to these low-level concerns, based on the practical use case of optimizing 6 lines of code, so that hopefully you to want to explore further!
Presentation given at the Toulouse (FR) Java User Group.
Video (in french) at https://www.youtube.com/watch?v=rB0ElXf05nU
Slideshow with animations at https://docs.google.com/presentation/d/1eIcROfLpdTU2_Z_IKiMG-AwqZGZgbN1Bs2E0nGShpbk/pub?start=true&loop=false&delayms=60000
Golang Performance : microbenchmarks, profilers, and a war storyAerospike
Slides for Brian Bulkowski's talk about Golang performance:
microbenchmarks, profilers, and a war story about optimizing the Aerospike Database Go client.
http://www.meetup.com/Go-lang-Developers-NYC/events/216650022/
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
This document summarizes a presentation on using JRuby and Ruby on Rails for web application development. It discusses how JRuby allows Ruby code to drive Java, embed Ruby in Java applications, and compile Ruby to Java bytecode. Rails is presented as a dynamic web framework that uses conventions over configuration and opinionated defaults. The document provides examples of common Rails features like scaffolding, models, controllers and views. It also outlines how to deploy Rails applications as WAR files or to cloud platforms using JRuby.
The document provides an introduction to the Java Virtual Machine (JVM) bytecode and JIT compiler. It discusses how bytecode works, including inspection, generation and the bytecode instructions. It also covers how the JIT compiler works and is monitored. Examples of viewing bytecode with javap and generating bytecode with BiteScript are provided.
This document summarizes Rob Sanderson's presentation on Python libraries for web interaction. It discusses the top 10 libraries including urllib for opening URLs, urllib2 for adding headers and proxies, urlparse for parsing URLs, httplib for lower-level HTTP requests, lxml for XML/HTML parsing, rdflib for RDF, json/simplejson for JSON, mod_python/mod_wsgi for Python web servers, and bpython as a Python shell. Code examples are provided for each to demonstrate their usage.
Groovy is a dynamic language for the Java Virtual Machine that adds features from languages like Python, Ruby, and Smalltalk. It supports domain-specific languages and integrates with all Java objects. Groovy compiles to Java bytecode so it runs on the JVM and can be used anywhere Java is used, including J2EE, Swing, Spring, and Seam applications. Groovy allows writing JUnit tests and development in Eclipse with debugging support.
Code formatting is an opinionated beast. It always has been a matter of taste, and it always will be a matter of taste. This is the reason, why professional formatting tools, such as Eclipse JDT, offer a gazillion number of options. Which is still not sufficient enough. After all, you can override them inline with tag-comments to make the formatter shut up. Can't we do better than that? What if we could use machine learning techniques to detect the preferred code style that was use in a codebase so far? Turns out, we can.
The Antlr Codebuff project (https://github.com/antlr/codebuff) offers a generic formatter for pretty much any given language. As long as a grammar file exists, existing source can be analyzed to learn about the rules that have been applied while writing the code. Those can than be used to pretty print newly written code. No configuration required. And existing sources will stay as nicely formatted as they are. In the end, the primary purpose of code formatting is not to re-arrange all the keywords, but to make the source layout consistent.
In this talk, we will demonstrate the usage of the codebuff project and how it can be used to format the sources of your repo in a consistent way. We'll also show some other gems that have been revealed when toying around with the technology.
This document summarizes a presentation about using Perl for Lego programming and various Perl projects.
The presentation discusses Lorzy, a Scheme-like interpreter written in Perl that uses Moose and a type system. It also describes lcore, a 600 line sandbox written in Perl to safely run user-defined rules and actions for a request tracker system. Strong typing is emphasized as important for safety. Live demos and code links are provided.
Go debugging and troubleshooting tips - from real life lessons at SignalFxSignalFx
Exploring tips and advice on writing production Go systems that are easy to debug and troubleshoot. Jack Lindamood from SignalFx presents patterns that facilitate this process.
Jack addresses tools built into Go you can take advantage of, build process techniques they've learned over time, and open source tools and libraries you can use that help troubleshoot your production code when things go wrong.
Read more here: http://blog.signalfx.com/a-pattern-for-optimizing-go
JSON Fuzzing: New approach to old problemstitanlambda
The document describes a new approach to JSON fuzzing developed by the authors. It notes that existing fuzzing tools do not support JSON format testing. The authors extended an existing Firefox addon to add JSON parsing and fuzzing capabilities. This allows converting a JSON request to name-value pairs for fuzzing, fuzzing the values, converting back to JSON format and sending to the application. A demo is provided and future work discussed, such as supporting different JSON formats and integrating the technique into other tools.
The document discusses the future of server-side JavaScript. It covers various Node.js frameworks and libraries that support both synchronous and asynchronous programming styles. CommonJS aims to provide interoperability across platforms by implementing synchronous proposals using fibers. Examples demonstrate how CommonJS allows for synchronous-like code while maintaining asynchronous behavior under the hood. Benchmarks show it has comparable performance to Node.js. The author advocates for toolkits over frameworks and continuing development of common standards and packages.
Streams of information - Chicago crystal language monthly meetupBrian Cardiff
* Let's review and compare a couple of scenarios where data flows in and out of the system.
* What should we look at for better resource utilization?
* What have Crystal std-lib done up until now?
* What are the open questions for future work?
The document provides an overview of Node.js, a JavaScript runtime environment for building scalable network applications. Some key points covered include:
- Node.js is built on Google's V8 JavaScript engine and is event-driven and non-blocking.
- It is well-suited for data-intensive real-time applications due to its lightweight and efficient nature.
- Node.js differs from other scripting languages by being non-blocking, single-threaded, and having an event-based approach built-in.
This document provides an introduction to node.js, Express, Jade, MongoDB, and mongoose. It discusses installing and using these technologies to build a web application with a backend server in JavaScript. Node.js is introduced as a way to develop server-side applications with JavaScript. Express is presented as a web application framework that can be used with Node.js. Jade is described as an HTML templating language. MongoDB is explained as a document-oriented NoSQL database, and mongoose is an ODM that provides an interface to work with MongoDB from Node.js applications.
The document discusses various techniques for optimizing web program performance, including improving data structures and algorithms, reducing network, disk, and memory I/O, using NoSQL databases, optimizing frontend resource loading and execution, and testing and refactoring code for performance. It also covers specific optimizations related to caching, content delivery networks, domain name resolution, module loading, code packaging, and handling slower users.
AJAX allows updating parts of a web page without reloading the entire page. It uses the XMLHttpRequest object to asynchronously send and receive data from a web server in the background. Common techniques include using JavaScript and DOM manipulation to update specific elements on a page based on the asynchronous response received in JSON, XML, HTML or plain text format from the server. Popular sites like Gmail, Google Maps, and YouTube use AJAX to provide dynamic and interactive experiences on the web.
The document discusses Node.js, which is a server-side JavaScript environment that uses an asynchronous event-driven model. Some key points:
- Node.js uses the V8 JavaScript engine and allows handling requests via JavaScript on the server-side rather than a separate language like PHP, Java, etc.
- It has non-blocking I/O to avoid blocking the entire process when waiting for slow resources like files or databases. Callbacks are used to handle asynchronous operations.
- The document discusses how Node.js could provide access to MUMPS databases to take advantage of the benefits of global storage while using the popular JavaScript language.
The document discusses work done by the International Press Telecommunications Council (IPTC) to develop a standardized JSON format for representing news and other media content. It describes considering existing XML standards, drafting candidate JSON structures, and testing representations of properties like places, subjects and text markup in JSON. Based on lessons learned, the IPTC plans to publish an initial News in JSON recommendation, seek feedback, and vote on a 1.0 specification at an upcoming meeting.
This document summarizes 10 upcoming features in JDK 7:
1. Switch statements can now use Strings as case values.
2. Automatic Resource Management (ARM) simplifies try-with-resources statements.
3. Dynamic method invocation allows calling methods only known at runtime.
4. ThreadLocalRandom provides thread-safe random number generation.
5. java.util.Objects contains utility methods for null checks and hashCode/equals.
6. Deep equals allows deep comparison of objects and arrays.
7. Exceptions can be caught by multiple exception types.
8. Static methods can now be overridden in interfaces.
9. The new File API improves file I/O exceptions and performance.
The document discusses the history and development of JSON (JavaScript Object Notation). It describes how Douglas Crockford discovered JSON in 2001, developed its specification with a simple one-page website, and then it was adopted widely without much promotion. JSON provided a useful format for browser/server communication and became very popular due to its simplicity, becoming a standard part of JavaScript.
Vert.x is a tool for building reactive applications on the JVM. It is polyglot, allowing applications to be written in Java, Groovy, JavaScript and other languages. It uses an asynchronous and non-blocking model with shared-nothing communication between components. Modules communicate through publish/subscribe messaging on an event bus or directly through request-response patterns. Vert.x provides horizontal scaling and allows efficient use of server resources. It can also integrate with SockJS to provide WebSocket-like capabilities in browsers that do not support WebSockets.
This document discusses using jQuery and Google App Engine to create cross-domain web mashups in 3 sentences or less:
The document introduces techniques for creating cross-domain web mashups using jQuery to make AJAX calls across domains and Google App Engine for hosting, discussing JSONP and proxies to overcome the same-origin policy limitation. It then provides an example mashup that displays tweets tagged with a hashtag on a map by geocoding hashtag names to locations and querying Twitter, Google Maps, and other domains.
This document summarizes a presentation on JavaScript performance myths. It debunks several common myths, including that for loops are always slower than while loops, avoiding the arguments object improves performance, and concatenating and deferring scripts is enough for good performance. It provides evidence from sites like jsPerf to show that many presumed optimizations do not actually improve performance or sometimes make it worse.
The document discusses implementing AJAX and JSON in ColdFusion 7 to dynamically load data when adding classes in an online training system. It describes how AJAX allows asynchronous retrieval of data from the server using JavaScript to avoid loading all data at page load. JSON is used to convert ColdFusion data structures to a lightweight format for transferring via AJAX calls. A case study demonstrates loading instructor, classroom and equipment details only when needed rather than on initial page load to improve performance.
Cross Domain Web Mashups with JQuery and Google App EngineAndy McKay
This document discusses cross-domain mashups using jQuery and Google App Engine. It describes common techniques for dealing with the same-origin policy, including proxies, JSONP, and building sample applications that mashup Twitter data, geotagged tweets, and maps. Examples include parsing RSS feeds from Twitter into JSONP and displaying tweets on a map based on their geotagged locations. The document concludes by noting issues with trust, failures, and limitations for enterprise use.
sbt, history of JSON libraries, microservices, and schema evolution (Tokyo ver)Eugene Yokota
Eugene Yokota presented an overview of the history and evolution of JSON libraries in Scala. Some of the earliest libraries included Dispatch JSON from 2009, which used parser combinators, and literaljson from the same year. Later libraries incorporated type classes for serialization and deserialization, such as sjson in 2010 and Spray JSON in 2011. Popular modern libraries discussed include Play JSON, Argonaut, json4s, Circe, and sjson-new. Yokota also described the contract-first approach of Contraband, which generates case classes and JSON serialization code from data schemas.
jQuery with javascript training by Technnovation LabsPrasad Shende
At TLabs, we respect the demand of time & love to go along with it. Acknowledging the trends we serve neatly designed syllabus that explores jQuery covering the thorough fundamentals of JavaScript. Having a basic knowledge of JavaScript will go a long way in understanding, structuring, and debugging your code. After the completion of this course, you will be able to create plug-ins on top of the JavaScript library to create abstractions for low-level interaction and animation, advanced effects and high-level, theme-able widgets. The modular approach to the jQuery library allows the creation of powerful dynamic web pages and web applications as well.
Asynchronous I/O in NodeJS - new standard or challenges?Dinh Pham
The document discusses asynchronous I/O in Node.js and compares processing models using processes, threads, and events. It explains how Node.js uses an event-driven and asynchronous model with callbacks to handle non-blocking I/O. It also discusses challenges with callbacks and introduces flow control libraries that can help address issues with readability and debugging of asynchronous code.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
Harper Reed, the keynote speaker, discussed his experience as CTO of Obama for America's 2012 campaign, noting the massive scale of building technology for a presidential campaign. Other speakers discussed emerging technologies like touch screens, CSS preprocessors, single-page applications, server-side tools for testing, Node.js streams and events, open source challenges, and crafting URLs independent of content management systems. Overall the conference covered front-end development, web applications, Node.js, and rethinking technologies.
My talking points for the presentation on optimization of modern web applications. It is a huge topic, and I concentrated mostly on technical aspects of it.
Server-side JavaScript (SSJS) is gaining popularity due to factors like the rise of NoSQL databases, asynchronous programming, and JavaScript's ubiquity. SSJS environments like Node.js, CommonJS, and AppEngineJS allow developers to use JavaScript beyond the browser by running it on the server. Google App Engine also provides a platform for hosting SSJS applications and automatically scaling them.
This document summarizes Eugene Lazutkin's talk on programmer's tools and how Dojo supports different programming paradigms in JavaScript. The talk discusses code structuring techniques like modules, object-oriented programming, mixins, and how Dojo implements these patterns through features like dojo.declare and dojo.require. It also mentions asynchronous programming tools in Dojo and other topics not covered in the talk like widgets and graphics.
This document discusses exciting features of JavaScript including how it can be used in browsers and non-browser environments. It covers how JavaScript supports object-oriented, functional, and aspect-oriented programming paradigms through its first-class functions, closures, and other language features. The document also discusses how code generation and introspection are possible in JavaScript and how this enables implementing domain-specific languages through techniques like lambda functions. In conclusion, the author expresses optimism about JavaScript's potential for large-scale development.
More details on the form manager, and advanced techniques. It was delivered at dojo.connect on 2/10/2010. Blog post: http://lazutkin.com/blog/2010/feb/10/rad-crud/
JavaScript and popular programming paradigms (OOP, AOP, FP, DSL). Overview of the language to see what tools we can leverage to reduce complexity of our projects.
This part goes over language features and looks at OOP and AOP with JavaScript.
The presentation was delivered at ClubAJAX on 2/2/2010.
Blog post: http://lazutkin.com/blog/2010/feb/5/exciting-js-1/
Continued in Part II: http://www.slideshare.net/elazutkin/exciting-javascript-part-ii
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
The document provides an overview of the Dojo Toolkit and its components for graphics and charting. It discusses the major objects in Dojo GFX for creating and manipulating shapes, as well as transformations and rendering. It also covers the major players in Dojo Charting, including plots, axes, data series, and actions for processing events. The document concludes with suggestions for building a simple image viewer and interactive chart as examples.
This document discusses Dojo GFX, a cross-browser graphics package for creating interactive graphics. It supports backends like SVG, VML, Canvas and Silverlight. The document outlines that SVG is used as a benchmark and recommended choice, and that Dojo GFX code is smallest for the SVG renderer. Real-world examples of Dojo GFX include engineering drawings, mapping, user interfaces and charts.
DojoX GFX Session Eugene Lazutkin SVG Open 2007Eugene Lazutkin
Eugene Lazutkin's course session on DojoX GFX at SVG Open 2007.
(The keynote is here: http://www.slideshare.net/elazutkin/dojox-gfx-keynote-eugene-lazutkin-svg-open-2007/)
DojoX GFX Keynote Eugene Lazutkin SVG Open 2007Eugene Lazutkin
Eugene Lazutkin's keynote on DojoX GFX at SVG Open 2007.
(The seminar notes are here: http://www.slideshare.net/elazutkin/dojox-gfx-session-eugene-lazutkin-svg-open-2007/)
UiPath Test Automation using UiPath Test Suite series, part 5DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 5. In this session, we will cover CI/CD with devops.
Topics covered:
CI/CD with in UiPath
End-to-end overview of CI/CD pipeline with Azure devops
Speaker:
Lyndsey Byblow, Test Suite Sales Engineer @ UiPath, Inc.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Building RAG with self-deployed Milvus vector database and Snowpark Container...Zilliz
This talk will give hands-on advice on building RAG applications with an open-source Milvus database deployed as a docker container. We will also introduce the integration of Milvus with Snowpark Container Services.
“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.
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
8. HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 18193
Date: Sun, 30 Apr 2017 23:52:36 GMT
...body, if needed...
9. Design decisions I
Return Promise.
Helps with composability.
A way from the callback hell.
Pack all request parameters together.
Use raw {} for simplicity.
We can manipulate it.
10. Design decisions II
Be smart about response
Users want to deal in terms of data:
Send data
Receive data
In most cases a response object is not
needed.
11. Design decisions III
Be smart about response
Sometimes we need a response:
To read status and headers.
Cater for most common cases:
JSON in/out should be simple.
The rest should be possible.
12. Design decisions IV
We interpret status code.
4XX and 5XX are bad statuses.
204 is good, but no response.
⇒ undefined.
13. Design decisions V
We interpret MIME.
If you don’t set:
Content-Type
Accept-Type
⇒ application/json
20. How we interpret result?
We know Content-Type.
application/json ⇒ JSON.
application/xml ⇒ XML.
MIME types are covered by RFCs.
We can map them to whatever.
Or return a string or a buffer.
21. Design: helpers I
We can provide helpers for verbs:
io.get (url, queryData);
io.head (url, queryData);
io.post (url, data);
io.put (url, data);
io.patch (url, data);
io.delete (url, data);
22. Design: helpers II
url is a string, or an object like for io().
queryData and data are optional.
A helper overrides a verb.
23. Design: helpers III
// url as an object? for REST:
var opts = {url: url, headers: headers};
io.get(opts);
io.put(opts, data);
io.patch(opts, data);
io.delete(opts);
29. Let’s POST JSON with XHR I
var xhr = new XMLHttpRequest();
xhr.open('POST', url, true);
// set up headers
xhr.setRequestHeader('Content-Type',
'application/json');
xhr.setRequestHeader('Accept-Type',
'application/json');
// continues on the next slide
30. Let’s POST JSON with XHR II
// optional
xhr.overrideMimeType(
'application/json');
// set up callbacks
xhr.onload = function (e) {};
xhr.onerror = function (e) {};
xhr.ontimeout = function (e) {};
// continues on the next slide
31. Let’s POST JSON with XHR III
// optional
xhr.onprogress = function (e) {};
xhr.upload.onprogress =
function (e) {};
// finally
xhr.send(JSON.stringify(data));
32. XHR: summary
Three slides of boilerplate.
Much more with actual code.
Callbacks are not composable.
A lot of repetitive code.
Realistically requires a wrapper.
33. JSONP: history
Formulated by Bob Ippolito.
Published in December 2005.
Uses existing facilities: <script>
Works in all browsers.
Works cross-origin.
35. December 2005
First Narnia came out.
SNL’s “Lazy Sunday” on selecting “the
dopest route” to see it:
– I prefer MapQuest!
– That’s a good one too!
– Google Maps is the best!
– True dat! Double true!
36. Let’s POST JSON with JSONP
We can’t. Limitations:
Only GET verb.
Only query parameters.
Only JSON as a returned value.
37. Let’s GET JSON with JSONP I
var script =
document.createElement('script');
script.onerror = function (e) {};
window.unique = function (data) {
delete window.unique;
script.parentNode.removeChild(script);
// do something with data
};
// continues on the next slide
38. Let’s GET JSON with JSONP II
// now we run it
script.src = url +
/* our parameters */ '?a=1' +
'&callback=' +
encodeURIComponent('unique');
document.documentElement.
appendChild(script);
39. JSONP: summary
Let’s face it: it is a hack.
Callbacks are not composable.
Repetitive code to encode parameters.
Realistically requires a wrapper.
40. Fetch: history
Started by WHATWG.
Status (April 2017):
Not available in IE11.
Available everywhere else.
Reasonable poly ll is available.
42. Fetch: more details
Simpli es Service Workers.
Currently can’t be canceled.
Supports streaming.
De nes numerous classes.
Can be heavy when poly lled.
43. Fetch: even more details
No cookies are sent by default.
CORS is disabled by default.
Any response from a server is success.
Even 4XX and 5XX ones.
44. Let’s POST JSON with Fetch I
The example is adapted from Shahal
Talmi’s article.
Angular core contributor.
var opts = {
method: 'POST',
mode: 'cors',
credentials: 'include' // cookies!
};
// continues on the next slide
45. Let’s POST JSON with Fetch II
// continue filling in opts
opts.headers = {
'Content-Type': 'application/json',
'Accept-Type': 'application/json'
};
opts.body = JSON.stringify(data);
// continues on the next slide
46. Let’s POST JSON with Fetch III
fetch(url, opts).then(response =>
response.ok ? response.json() :
Promise.reject(response.status)
)
// user's code for then() & catch()
47. Fetch: summary
Streaming is nice to have, but it is a rare
edge case.
Still a lot of repetitive code.
Due to selected defaults.
Realistically requires a wrapper.
64. heya/io II
Can be used with AMD and globals.
Works with native Promise or any
Promise-like object.
Can be used with heya/async.
Can cancel() I/O.
Supports progress.
65. POST JSON with heya/io
io.post(url, data).then(result => {
console.log(result);
}).catch(res => {
if (res instanceof io.BadStatus) {
console.log(res.xhr.status);
} else {
console.log(res);
}
});
67. Orchestrating I/O
I/O is much more than just a transport.
Caching is a big topic.
App-level cache.
Cache busting.
I/O testing is a must.
68. Cache issues
In HTTP world cache:
Controlled by a server.
Server cannot recall a response.
Client cannot evict a response.
69. App-level cache
App frequently knows:
When an object is modi ed.
Dependencies between objects.
We need an app-level cache.
The alternative: no HTTP cache.
70. Cache issues: servers
Server cache headers are frequently
miscon gured.
Evidence: cache-busting.
/url?bust=123456789
bust uses a random payload, so all
requests are unique.
71. heya/io is extendable I
The I/O pipeline is well-de ned.
All stages can be extended:
On per-request basis.
On per-app basis.
72. heya/io is extendable II
Pipeline extensions: services.
XHR replacements: transports.
All extensions should be included
explicitly.
Pay only for what you use.
74. heya/io: bust service I
var req = io.get({
url: 'abc',
bust: true
});
// abc?io-bust=1470185125354-507943
75. heya/io: bust service II
var req = io.get({
url: 'abc',
bust: 'xyz'
});
// abc?xyz=1470185125354-507943
76. heya/io: bust service III
By default: no bust.
Con gurable:
Bust key.
Bust value generating.
77. heya.io: cache service I
Storage-based:
Session storage (default).
Local storage (permanent).
Caches GET requests automatically.
To opt out:
cache: false
78. heya.io: cache service II
Main API (rarely used directly):
io.cache.save('/abc', {a: 1});
io.cache.remove('/abc');
Direct access to the underlying storage
object.
79. heya/io: mock service I
Simple way to intercept, replace, or
transform an I/O request.
A must for testing!
Trivial redirects.
Rapid prototyping.
80. heya/io: mock service II
// canned data for exact url
io.mock('/abc', () => 42);
io.get('/abc').then(data => {
console.log(data); // 42
});
81. heya/io: mock service III
// canned data for url prefix
io.mock('/abc*', () => 42);
io.get('/abc/1').then(data => {
console.log(data); // 42
});
82. heya/io: mock service IV
// redirect
io.mock('/abc', () => io.get('/xyz'));
io.get('/abc').then(data => {
console.log(data); // from /xyz
});
83. heya/io: mock service V
// timeout (uses heya/async)
io.mock('/abc', () =>
timeout.resolve(500).then(() => 42));
io.get('/abc').then(data => {
console.log(data); // 42 after 0.5s
});
84. heya/io: mock service VI
// timeout (uses setTimeout())
io.mock('/abc', () =>
new Promise(resolve => {
setTimeout(function () {
resolve(42);
}, 500);
}));
io.get('/abc').then(data => {
console.log(data); // 42 after 0.5s
});
85. heya/io: mock service VII
// cascaded calls
io.mock('/abc',
() => io.get('/a').then(
value => io.get('/b', {q: value.x})
).then(
value => io.get('/c', {q: value.y})
)
);
86. heya/io: mock service VIII
// server error
io.mock('/abc',
() => io.mock.makeXHR({status: 500})
);
88. heya/io: bundle service II
Problems with the tradition:
We may exceed number of HTTP
connections.
Potential stalling.
89. heya/io: bundle service III
Problems with the tradition:
Each payload is small, and
compressed separately.
Poor compression.
90. heya/io: bundle service IV
Bundle I/O
Client Server
HTTPconnections
HTTPconnections
bundle bundle
91. heya/io: bundle service V
Bundle’s narrative:
Client collects I/O requests.
Bundles them in one request.
Sends it to a well-known URL.
92. heya/io: bundle service VI
Bundle’s narrative:
Server acts as a proxy.
Runs all requests in parallel locally.
Sends back collected responses.
93. heya/io: bundle service VII
Bundle’s narrative:
Client unbundles responses.
Noti es requesters.
94. heya/io: bundle service VIII
Important points:
Bundling works transparently.
No code modi cations!
Usually GETs are bundled.
To opt out:
bundle: false
95. heya/io: bundle service IX
Assumes a server handler.
Reference: heya/bundler.
Local server connections are fast and low-
lag.
96. heya/io: bundle service X
Bundling helps with compression.
Bundling requires just one HTTP
connection.
97. heya/io: bundle service XI
HTTP/2 alleviates some problems.
Bundle as fast as the slowest request.
In a real app the speed gain was up to
30%.
98. heya/io: bundle service XII
Bundler can return responses for
unrequested requests.
Similar to HTTP/2 Server Push.
Cache will be populated.
99. heya/io: bundle service XIII
Behind the scenes:
Client collects requests.
Sends the array as JSON.
Server unpacks.
Runs them in parallel.
100. heya/io: bundle service XIV
Behind the scenes:
Server collects responses.
Including errors.
Sends the array as JSON back.
Client unpacks, saves to cache.
105. heya/io: prefetch V
It was 3.69s, now it is 3.22s.
We saved 470ms — whoopee do!
It was under ideal conditions.
Really fast 12 core 64G RAM rig.
How about mobile users?
108. heya/io: prefetch VII
It was 16.88s, now it is 15.36s.
We saved 1.52s!
We deducted almost all /api.
109. heya/io: prefetch VIII
bundle service has provisions for
prefetching.
It can be done transparently!
See “Cookbook: bundle” in Wiki of
https://github.com/heya/io