(Presented at JSConf US 2013. Be sure to check out the speaker notes!)
Frustration, a rant, a test suite, a gist. Then, community awesomeness. Boom! Promises/A+ was born.
Promise are an old idea for abstracting asynchronous code, but have only recently made their way into JavaScript. We'll look at the power they provide via two striking examples that go beyond the usual "escape from callback hell" snippets. First we'll show how, with ES6 generators, they can act as shallow coroutines to give us back code just as simple as its synchronous counterpart. Then we'll look at how they can be used as proxies for remote objects, across <iframe>, worker, or web socket boundaries.
However, the most interesting aspect of Promises/A+ is not just the code it enables, but how we worked to create it. We didn't join a standards body, but instead formed a GitHub organization. We had no mailing list, only an issue tracker. We submitted pull requests, made revisions, debated versions tags, etc.—all in the open, on GitHub. And, we succeeded! Promises/A+ is widely used and implemented today, with its extensible core forming the starting point of any discussions about promises. Indeed, this community-produced open standard has recently been informing the incorporation of promises into ECMAScript and the DOM. I'd like to share the story of how this happened, the lessons we learned along the way, and speculate on the role such ad-hoc, community-driven, and completely open specifications have for the future of the web.
Promise patterns provide an asynchronous programming model for JavaScript using promises. Promises allow separating business logic from asynchronous API providers by defining a standard asynchronous API. Common patterns are callbacks, events, and promises. Promises improve on callbacks and events by allowing parallel asynchronous operations, error handling, and progress tracking in a standardized way.
This document discusses callbacks, promises, and generators for handling asynchronous code in JavaScript. It begins by explaining callbacks and the issues they can cause like "callback hell". It then introduces promises as an alternative using libraries like Q that allow chaining asynchronous operations together. Generators are also covered as a way to write asynchronous code that looks synchronous when combined with promises through libraries like CO. Overall, it recommends using an asynchronous pattern supported by a library to manage complex asynchronous code.
Asynchronous programming done right - Node.jsPiotr Pelczar
This document discusses asynchronous programming and avoiding race conditions. It covers how asynchronous actions allow the main program flow to continue processing without blocking on I/O. It also discusses how asynchronous programming works with callbacks and promises rather than sequential execution. It provides examples of using libraries like Async to control asynchronous flows and common pitfalls to avoid like double callbacks and unexpected asynchronous behavior.
This document discusses JavaScript promises as an abstraction pattern for handling asynchronous code. It explains why promises are useful by describing some of the issues with callback-based asynchronous code, such as callback hell and lack of readability. The document then provides examples of how to create and use promises to handle sequential and parallel asynchronous tasks in a more maintainable way using chaining and batching. It also discusses how promises are supported in browsers, Node.js, and common promise libraries like Q, RSVP, when.js, and Bluebird.
The document discusses Javascript Promises and the Q library for handling asynchronous code. It explains what Promises are, how they avoid callback pyramids or "Pyramids of Doom", and how the Q library can be used to generate and control Promises. The Q library allows wrapping asynchronous functions in Promises and provides methods for chaining Promises together and handling errors across asynchronous operations.
This talk was given at JSSummit 2013. Entitled "Avoiding Callback Hell with Async.js", my talk focused on common pitfalls with asynchronous functions and callbacks in JavaScript, and using the async.js library and its advanced control flows to create cleaner, more manageable code.
Callbacks, Promises, and Coroutines (oh my!): Asynchronous Programming Patter...Domenic Denicola
This talk takes a deep dive into asynchronous programming patterns and practices, with an emphasis on the promise pattern.
We go through the basics of the event loop, highlighting the drawbacks of asynchronous programming in a naive callback style. Fortunately, we can use the magic of promises to escape from callback hell with a powerful and unified interface for async APIs. Finally, we take a quick look at the possibilities for using coroutines both in current and future (ECMAScript Harmony) JavaScript.
A few slides about asynchrnous programming in Node, from callback hell to control flows using promises, thunks and generators, providing the right amount of abstraction to write great code.
All examples available on https://github.com/troch/node-control-flow.
Javascript uses an event loop model to perform asynchronous operations even though it is single-threaded. Callbacks are used to handle asynchronous operations but can make code complex. Promises were introduced to simplify asynchronous code. A Promise represents the eventual completion (or failure) of an asynchronous operation, and allows consuming code to define callbacks instead of nesting callbacks. Promises are constructed by calling new Promise(), which takes a resolver function with resolve and reject parameters. The state of a Promise can be pending, fulfilled, or rejected.
This document discusses event loops and how they work. Event loops allow non-blocking operations by listening for events like network data or user input in parallel. They achieve this through callbacks, select(), threads, or other asynchronous programming techniques. Common examples of event loops include browser JavaScript, game engines, servers, and other applications that perform non-blocking IO operations. Event loops can be complex to work with correctly due to issues like race conditions, so abstractions like promises are recommended.
1) Promises are objects that represent the eventual completion (or failure) of an asynchronous operation, rather than using callbacks. They provide a cleaner way to handle asynchronous code than callbacks alone.
2) A promise has three possible states: pending, fulfilled, and rejected. Promises allow multiple handlers to be attached to an asynchronous operation via the .then() method. Handlers will be called even if attached after the promise is settled.
3) Common uses of promises include handling data retrieval from external sources, loading assets, and handling animations. Promises are well-suited for any potentially asynchronous operation.
This document discusses JavaScript promises and asynchronous programming. It covers how promises represent asynchronous operations as objects, how to chain promises together using .then(), and how promises can be created using the closure or deferred syntax. It also discusses promise terminology, states, error handling, and common promise patterns and use cases. High-order functions and promise utility functions provided by promise libraries are presented. Guidelines for testing promises are also included.
This document contains Swift code for testing a HTTP request to an API using the Alamofire and Mockingjay libraries. It defines a test spec class with a describe block for "hoge" and a context block for "fuga". Within the "fuga" context, a beforeEach stub is set up to mock API responses from the "hogefugapiyo.com" domain. The single "piyo" test makes a request, asserts the response is not nil, and prints the results.
- JavaScript has come a long way from its early days of form validation and image rollovers in 1995 to modern innovations like ES2015, Promises, async/await, and Web Assembly.
- Today, JavaScript features like classes, arrow functions, and template strings in ES2015 are widely adopted, and new standards like Promises, generators, and async programming have revolutionized asynchronous JavaScript.
- Emerging web platform technologies like Web Components, Service Workers, and CSS Paint enable new kinds of custom elements, offline/progressive web apps, and painting APIs, while proposals like decorators, value types, and module loading continue pushing the language forward.
This document provides a history of JavaScript and ECMAScript specifications from 1995 to the present. It discusses the standardization process and key people and organizations involved like B. Eich, TC39, and ECMA. Major versions and proposed features are summarized, including ES6/ES2015 additions like arrow functions, block scoping with let/const, classes, modules, iterators/generators, and proxies.
From ReactPHP to Facebook Hack's Async implementation and many more, asynchronous programming has been a 'hot' topic lately. But how well does async programming support work in PHP and what can you actually use it for in your projects ? Let's look at some real-world use cases and how they leverage the power of async to do things you didn't know PHP could do.
Two years ago I inherited jsdom, a project of breathtaking scope. In essence, it aims to simulate a browser in JavaScript, by implementing JavaScript versions of a wide variety of web standards (much more than just the DOM). While maintaining jsdom for the last two years, and eventually bringing it to a 1.0 release, I learned an incredible amount about the web. I want to share with you what I’ve learned: the history of the standards and implementations of them that make up the web; the interaction between seemingly-disparate parts of the platform; and all about the strange APIs we’ve come to know and love. You should walk away from this talk with a new appreciation for how browsers work—and how, through the ongoing effort of a community of contributors and package maintainers, we’ve been able to recreate one in pure JavaScript.
This document provides a history of ECMAScript (ES) and JavaScript standards. It discusses the origins of JavaScript in 1995 and its standardization by ECMA in 1997 as ECMAScript. New versions were released periodically, including ES5 in 2009 and ES6 in 2015. ES6 was also referred to as ES2015 since version names going forward would be based on the year of release.
The next version of JavaScript, ES6, is starting to arrive. Many of its features are simple enhancements to the language we already have: things like arrow functions, class syntax, and destructuring. But other features will change the way we program JavaScript, fundamentally expanding the capabilities of the language and reshaping our future codebases. In this talk we'll focus on two of these, discovering the the myriad possibilities of generators and the many tricks you can pull of with template strings.
A bit on JavaScript History
Learn how to program in the modern JavaScript i.e., ECMAScript 2015 (Version 6) / ECMAScript 6 / ES2015 / ES6 complied by BabelJS
Program with the best practices (Airbnb coding style) and style checking tools by ESLint
Let’s talk about what Microsoft has given us for building ambitious, real-world Windows 8 apps in HTML5 and JavaScript—but also what’s missing, and how we can fill in the gaps.
This document discusses best practices for creating RESTful APIs. It covers three main topics: representing resources with URLs and HTTP verbs, using the HTTP protocol machinery like status codes and caching, and linking resources together through hypermedia. URLs should represent resources, verbs should represent actions, and standard HTTP features like status codes and conditional requests should be used. Well-designed REST APIs represent application state through linked resources and relationships rather than embedding actions in URLs.
In 2010, a photo-sharing startup launched—on a single, closed platform. Over the next two years, it gained over 100 million active users, before being acquired by Facebook for one. billion. dollars.
Only half a year after *that* did they finally release a web app.
Instagram's main purpose was sharing photos and commenting on them. If this isn't a perfect fit for the open web platform, I don't know what is. And yet the app was planted neatly within Apple's walled garden, without even an API to speak of. How did things go so wrong?
The web needs to catch up, and fast. If we want to preserve all the virtues of the web—shareable URLs, indexable content, open standards, instantly deployed updates, and so on—then we need to make the web platform more attractive, both to developers and users. We need to explore the final frontier of web development: *true* web apps, of the kind that will delight our users (and our investors). But we're not quite there … yet.
In this talk, I want to explore the efforts underway to bring the web platform up to speed as a genuine competitor. We have the most momentum of any platform in history, but there are still many unanswered questions. What are the major functionality gaps, and how are we closing them? Can we make app development as easy for web as it is for native? How do we fix mobile performance? Can you even use a web app while you're offline? I want to tell you about that not-too-distant future where these problems have been solved. Editors are speccing up new APIs; implementers are leveling up their browsers; and the community is building new frameworks. Together, we're slowly but surely pushing into that final frontier. And once we're past it, the mobile web will be a natural choice for the next big content-sharing app, enabling us to share by simply sending a URL—from any browser, to any device, on any platform.
This document discusses client-side JavaScript packages and module systems. It begins by describing CommonJS and AMD module systems, noting problems with AMD including configuration complexity and inability to easily consume third-party code. It then introduces the concept of packages as a better unit of code reuse than modules alone. NPM is presented as a package manager that solves problems of downloading, installing dependencies, and accessing other packages' code. Key aspects of NPM packages like directory structure and package.json are outlined. The document concludes by briefly covering NPM features like dependency hierarchies, Git dependencies, and using NPM without publishing to the public registry.
Introducing Razor - A new view engine for ASP.NET Shiju Varghese
This document introduces Razor, a new view engine for ASP.NET that provides a simplified syntax for generating HTML from code. It discusses how Razor can be used in ASP.NET Web Pages and MVC 3 views, and demonstrates some Razor syntax including the @ character, loops, inline code expressions, layout pages, and helpers. The presenter is then introduced as a Microsoft MVP on ASP.NET who will demonstrate Razor syntax in an ASP.NET MVC 3 application.
The document discusses Razor syntax in MVC views. It covers the basics of Razor syntax including inline code and blocks, comments, master pages, partial views, and HTML helpers. It also compares Razor to ASPX syntax and describes how to pass data between views and layouts using sections and the PageData collection.
This document discusses new features coming to JavaScript in ECMAScript 6, including:
1) Block scope keywords "let" and "const" that allow for block-level scoping of variables.
2) Shorthand syntax for object literals and method definitions.
3) Destructuring assignments for extracting values from objects and arrays.
4) Default parameter values, rest parameters, and spread syntax for working with functions and arrays.
5) New features like modules, classes, and imports for better organizing code.
Although Web and mobile apps are getting more capable every day, often your application makes the most sense on the desktop. In this talk, we’ll look at some recent technologies that have allowed significant desktop apps — like Barnes & Noble’s NOOK Study e-textbook reader, or Adobe’s Brackets IDE — to be written in HTML5 and JavaScript. Projects like the Chromium Embedded Framework, node-webkit, and AppJS provide an excellent native-to-JS bridge. With them in hand, you can bring the full power of the Node.js and front-end ecosystems to bear, while still gaining the advantages of running as a native app.
This document discusses the importance of making and keeping promises to customers. It defines what a customer promise is and explains that promises set expectations, help build credibility, and demonstrate a company's values. The document outlines key characteristics of effective promises and different types of promises companies can make. It also provides examples of promises and discusses common problems when promises are not delivered consistently. The document concludes by providing recommendations for developing sound promises and meeting customer expectations.
The document discusses Angular modules and NgModules. It shows different types of NgModule declarations including components, directives, and pipes. It also shows the different NgModule metadata properties like imports, exports, declarations, and providers. It demonstrates how modules can import and export declarations and how modules are loaded within the application injector.
This document contains code snippets that demonstrate different Angular data binding syntax and features, including property, event, two-way, attribute, class, and style bindings. It also shows structural directives like *ngIf, *ngFor, and ngSwitch, as well as template references and local variables.
Upgrading from Angular 1.x to Angular 2.xEyal Vardi
Having an existing Angular 1 application doesn't mean that we can't begin enjoying everything Angular 2 has to offer. That's because Angular 2 comes with built-in tools for migrating Angular 1 projects over to the Angular 2 platform.
Component lifecycle hooks in Angular 2.0Eyal Vardi
The document discusses Angular change detection and lifecycle hooks. It provides examples of using change detection strategies like OnPush, examples of implementing DoCheck to watch for changes, and summaries of the different lifecycle hooks and when they are called.
Asynchronous JavaScript development allows long-running operations like network requests or file access to occur without blocking the main thread through an event-driven programming model and callback functions. The browser uses an event loop to queue and execute events. While JavaScript can only execute one task at a time, asynchronous functions expose callbacks to handle completed operations. This can lead to "callback hell" where code becomes nested and difficult to follow. Promises and async/await were introduced to simplify asynchronous code by handling callbacks in a cleaner way similar to synchronous code. Web workers also allow true concurrency by running scripts on a separate thread.
The document summarizes key features of ECMAScript 2015 (ES6). It discusses classes, modules, arrow functions, default parameters, template literals, and block scoping with let and const. Classes provide clearer syntax for object creation and inheritance compared to ES5. Modules allow importing and exporting bindings. Arrow functions provide a concise syntax, preserve this binding, and cannot be called with new. Default parameters and template literals also introduce new functionality.
4Developers 2015: Programowanie synchroniczne i asynchroniczne - dwa światy k...PROIDEA
This document discusses asynchronous and synchronous programming in Java. It covers several key aspects:
1. Java supports both multi-threading for synchronous programming as well as asynchronous programming using non-blocking I/O and libraries like RxJava.
2. Asynchronous programming can be difficult due to issues like complex error handling, lack of readability, and difficulty debugging.
3. Many open-source libraries have been created to help with asynchronous programming using approaches like futures, callbacks, and promises.
4. Reactive programming libraries like RxJava, Reactor, and Vert.x use approaches like asynchronous streams to simplify asynchronous code.
The document discusses different patterns for handling asynchronous code in JavaScript: callbacks, promises, and AMD (Asynchronous Module Definition). It outlines issues with nested callbacks and inflexible APIs. Promises and AMD aim to address these by allowing composition of asynchronous operations and defining module dependencies. The document provides examples of implementing PubSub with events, making and piping promises, and using AMD to load dependencies asynchronously. It concludes that callbacks should generally be avoided in favor of promises or AMD for asynchronous code.
This document discusses rethinking web app development with React.js and Flux. It outlines some of the challenges with traditional MVC frameworks in scaling to support features like real-time updates. It then introduces React.js as a component-based view library and Flux as an architecture that uses unidirectional data flow to address these challenges through composable and reusable components. Specific implementations discussed include Fluxible for building isomorphic apps and Webpack as a module bundler.
Building Powerful WebSocket, Comet, and RESTful Applications Using Atmosphere
This document discusses the Atmosphere framework for building asynchronous web applications. It introduces key concepts like suspending responses, broadcasting events, scheduling broadcasts, and clustering. It also provides an example of building a real-time Twitter search application with Atmosphere and discusses how Atmosphere allows writing applications once that can run anywhere across different transports without browser workarounds. The document encourages developers to use the simple Atmosphere APIs to build powerful asynchronous applications and to join the Atmosphere community.
This document summarizes the key new features being introduced in ECMAScript 6 (ES6), also known as Harmony. Some of the major additions include block scope with let and const, classes and modules, iterators and generators, arrow functions, and parameter handling improvements with rest/spread. ES6 is designed to be backwards compatible with ES5 while adding new functionality. Many new features are already being implemented in modern browsers and Node.js using flags or alternative syntax like --harmony for testing purposes today.
Event-driven IO server-side JavaScript environment based on V8 EngineRicardo Silva
This document contains information about Ricardo Silva's background and areas of expertise. It includes his degree in Computer Science from ISTEC and MSc in Computation and Medical Instrumentation from ISEP. It also notes that he works as a Software Developer at Shortcut, Lda and maintains a blog and email contact for Node.js topics. The document then covers several JavaScript, Node.js and Websockets topics through examples and explanations in 3 sentences or less each.
This document discusses using CouchDB on Android applications. It provides instructions on adding CouchDB functionality to an Android project using Couchbase Mobile for Android. It also describes how to access a CouchDB instance from an Android device using Futon and the Couchbase Service. The document contains code examples for creating, reading, updating and deleting CouchDB documents from an Android app.
JavaScript is evolving with the addition of modules, platform consistency, and harmony features. Modules allow JavaScript code to be organized and avoid naming collisions. CommonJS and AMD module formats are used widely. Platform consistency is improved through polyfills that mimic future APIs for older browsers. Harmony brings language-level modules and features like destructuring assignment, default parameters, and promises to JavaScript. Traceur compiles Harmony code to existing JavaScript.
This document provides an introduction and overview of a Node.js tutorial presented by Tom Hughes-Croucher. The tutorial covers topics such as building scalable server-side code with JavaScript using Node.js, debugging Node.js applications, using frameworks like Express.js, and best practices for deploying Node.js applications in production environments. The tutorial includes exercises for hands-on learning and demonstrates tools and techniques like Socket.io, clustering, error handling and using Redis with Node.js applications.
ES6 introduced many new features to JavaScript including let and const block scoping, arrow functions, classes, promises, and modules. Tooling like Babel is currently needed to use new features by transpiling code to older JavaScript versions. Future releases will continue enhancing JavaScript with new syntax and capabilities under an annual release cycle. ES7 proposals include concurrency, streams, math enhancements, and better metaprogramming with classes.
Столпы функционального программирования для адептов ООП, Николай МозговойSigma Software
This document provides an overview of functional programming concepts for object-oriented programmers. It discusses the fundamentals of FP including immutability, purity, first-class and higher-order functions, closures, and recursion. It provides examples of these concepts in languages like Lisp, F#, C#, and JavaScript. The document also compares OO and FP concepts and discusses derived FP concepts like partial application, lazy evaluation, and pattern matching.
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.
EcmaScript 6 introduces many new features to JavaScript including let and const block-scoped variables, arrow functions, classes, promises, and modules. Tooling like transpilers are currently needed to use ES6 in older browsers. Future versions will continue to evolve the language with proposals for ES7 including concurrency, streams, and better support for classes and metaprogramming. Overall ES6 and future versions aim to modernize JavaScript and better support object-oriented and asynchronous programming patterns.
The document discusses JavaFX Mobile and provides an overview of its features and current status. It summarizes a speaker's presentation on designing a JavaFX Mobile application and examples shown, including calling JME code, posting content via HTTP requests, and loading resources via binding. While JavaFX Mobile was promising in 2009-2010, its future is uncertain given the dominance of Android and iOS. The speaker plans to research porting their application to Android and JME to catch platforms not adopting newer technologies.
What can be done with Java, but should better be done with Erlang (@pavlobaron)Pavlo Baron
Erlang excels at building distributed, fault-tolerant, concurrent applications due to its lightweight process model and built-in support for distribution. However, Java is more full-featured and is generally a better choice for applications that require more traditional object-oriented capabilities or need to interface with existing Java libraries and frameworks. Both languages have their appropriate uses depending on the requirements of the specific application being developed.
This document provides a summary of an introduction to the Clojure programming language. It discusses what Clojure is, its timeline and adoption, functional programming concepts, concurrency features using Software Transactional Memory, the Lisp ideology it is based on including homoiconicity and its macro system. It also provides an overview of getting started with Clojure including using the REPL, basic syntax like symbols and keywords, data types, sequences, functions, and Java interoperability. Resources for learning more about Clojure are also listed.
This document provides an overview of promises and deferred objects. It discusses the history of promises, including early use in 1976 and implementations in Dojo, Node.js, Q.js and Futures.js. The document defines a promise as an object representing a value that is not yet known, and a deferred as representing work that is not yet finished. It outlines the CommonJS Promises/A specification and details the states a promise can be in. The document then examines jQuery's implementation of promises and deferreds and provides examples of how to use deferreds and promises to manage asynchronous code.
The document discusses using ES6 features in real-world applications. It provides examples of using arrow functions, classes, destructuring, template literals, and default parameters to write cleaner code. It also discusses tools for enabling ES6 features that are not yet fully supported, such as transpilers, and flags in Node.js and Chrome to enable more experimental features. Overall, the document advocates adopting ES6 features that make code more concise and readable.
Streams are a fundamental programming primitive for representing the flow of data through your system. It's time we brought this powerful tool to the web. What if we could stream data from a HTTP request, through a web worker that transforms it, and then into a <video> tag? Over the last year, I've been working on the WHATWG streams specification, which builds upon the lessons learned in Node.js, to provide a suitable abstraction for needs of the extensible web.
I'll discuss briefly why streams are important, what they enable, and the role we envision them playing in the future of the web platform. Mostly, though, I want to help you understand streams, at a deep level. In the course of writing this specification, I've learned a lot about streams, and I want to share that knowledge with you. At the core, they are a very simple and beautiful abstraction. I think we've done a good job capturing that abstraction, and producing an API the web can be proud of. I'd love to tell you all about it.
Our favorite language is now powering everything from event-driven servers to robots to Git clients to 3D games. The JavaScript package ecosystem has quickly outpaced past that of most other languages, allowing our vibrant community to showcase their talent. The front-end framework war has been taken to the next level, with heavy-hitters like Ember and Angular ushering in the new generation of long-lived, component-based web apps. The extensible web movement, spearheaded by the newly-reformed W3C Technical Architecture Group, has promised to place JavaScript squarely at the foundation of the web platform. Now, the language improvements of ES6 are slowly but surely making their way into the mainstream— witness the recent interest in using generators for async programming. And all the while, whispers of ES7 features are starting to circulate…
JavaScript has grown up. Now it's time to see how far it can go.
How to Win Friends and Influence Standards BodiesDomenic Denicola
# How to Make Friends and Influence Standards Bodies
The greatest strength of the web is its openness. But not everyone appreciates how we arrived at the open web of today. A recent trend has cast standards bodies as bureaucracies that never accomplish anything of substance, while the heroic community innovates and implements “from scratch.”
Reality is much less black-and-white: sandboxes like Node.js have received much from the web platform and language that spawned them, and have a lot to contribute back. Standards bodies are composed of implementers and community members willing to engage, not ivory tower philosophers handing down bad, never-tested APIs from on high. And real gains could be made for both sides—with some effort.
This talk is part stories, and part lessons; it’s meant both to teach, and to open the floodgates for collaboration. You’ll hear about ways in which community input has had great impact on the standards process for the better, as in the case of web audio or adding promises to ES6. But you’ll also be taught communication and coalition-building skills that, from what I see, are sorely needed by many community members. How can you get involved and shape the future of the web and JavaScript platforms in a direction that will help everyone? Who are the key players and processes that they follow?
Finally, together we’ll brainstorm on and identify some key areas where your expertise and hard-learned lessons could help the web platform toward future solutions for problems it’s encountered.
In June 2013, we published the Extensible Web Manifesto, declaring that the web platform should be built a series of extensible layers. Low-level capabilities, like hardware access, cryptography, or the parser, should be exposed to web developers through JavaScript, and higher-level features, like HTML tags or animations, should be explained in terms of those primitives. This allows JavaScript developers to extend the web platform without rewriting it from scratch in JavaScript, customizing it for the needs of their applications and creating a virtuous cycle wherein web developers prototype higher-level features that implementers can later pull in.
In this talk, I want to explore the concrete meaning of the extensible web. What initiatives already under way can we see through this lens? What ideas are still gestating, and need your input as a web developer? How will this new philosophy end up impacting you? I want to show you the future of the web platform, where developers like you are involved from the beginning in designing and prototyping APIs, and have enough low-level tools at your fingertips to solve any problem you face. And I want to bring it all back to our favorite language, JavaScript, which is the glue that makes this all work together.
In text format at http://domenic.me/2013/10/07/the-extensible-web/
The discovery of unit testing and test-driven development was one of the most important parts of my growth as a developer. The ability to write simple, small pieces of code that could verify the behavior of my application was in itself quite useful. And the ability to refactor without fear, just by running the test suite, changed how I program. But the real benefits come in how unit tests shape your application code: more testable code is often more well thought-out, more decoupled, and more extensible.
In this talk, I'll give a whirlwind introduction to unit testing as a concept and as a practice. I want you fully convinced it's the best thing to happen to software development, if you aren't already. Once we're on the same page there, I'll take a deep dive into what makes a good unit test. This involves testing tools such as spies, stubs, and mocks, concepts like code coverage, and practices like dependency injection that shape your application code. The most important lesson will be on how to focus on singular, isolated units of code in your testing, as this guides you toward building modular, flexible, and comprehensible applications.
Node.js is an exciting new platform for building web applications in JavaScript. With its unique I/O model, it excels at the sort of scalable and real-time situations we are increasingly demanding of our servers. And the ability to use JavaScript for both the client and server opens up many possibilities for code sharing, expertise reuse, and rapid development.
This class is intended for those with some basic knowledge of JavaScript, interested in an introduction to the Node.js ecosystem and development platform. We'll discuss how to get started with Node, and why you would want to. We'll then explore Node's module and package system, demonstrating several of the more popular and impressive packages that exemplify the type of tasks Node excels at. These include low-level HTTP streaming with the http module, high-level bidirectional websocket communication with socket.io, and server-browser code sharing with browserify, jsdom, and node-canvas.
Video traffic on the Internet is constantly growing; networked multimedia applications consume a predominant share of the available Internet bandwidth. A major technical breakthrough and enabler in multimedia systems research and of industrial networked multimedia services certainly was the HTTP Adaptive Streaming (HAS) technique. This resulted in the standardization of MPEG Dynamic Adaptive Streaming over HTTP (MPEG-DASH) which, together with HTTP Live Streaming (HLS), is widely used for multimedia delivery in today’s networks. Existing challenges in multimedia systems research deal with the trade-off between (i) the ever-increasing content complexity, (ii) various requirements with respect to time (most importantly, latency), and (iii) quality of experience (QoE). Optimizing towards one aspect usually negatively impacts at least one of the other two aspects if not both. This situation sets the stage for our research work in the ATHENA Christian Doppler (CD) Laboratory (Adaptive Streaming over HTTP and Emerging Networked Multimedia Services; https://athena.itec.aau.at/), jointly funded by public sources and industry. In this talk, we will present selected novel approaches and research results of the first year of the ATHENA CD Lab’s operation. We will highlight HAS-related research on (i) multimedia content provisioning (machine learning for video encoding); (ii) multimedia content delivery (support of edge processing and virtualized network functions for video networking); (iii) multimedia content consumption and end-to-end aspects (player-triggered segment retransmissions to improve video playout quality); and (iv) novel QoE investigations (adaptive point cloud streaming). We will also put the work into the context of international multimedia systems research.
Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data.
The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs.
Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution!
Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.
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.
What's Next Web Development Trends to Watch.pdfSeasiaInfotech2
Explore the latest advancements and upcoming innovations in web development with our guide to the trends shaping the future of digital experiences. Read our article today for more information.
AC Atlassian Coimbatore Session Slides( 22/06/2024)apoorva2579
This is the combined Sessions of ACE Atlassian Coimbatore event happened on 22nd June 2024
The session order is as follows:
1.AI and future of help desk by Rajesh Shanmugam
2. Harnessing the power of GenAI for your business by Siddharth
3. Fallacies of GenAI by Raju Kandaswamy
GDG Cloud Southlake #34: Neatsun Ziv: Automating AppsecJames Anderson
The lecture titled "Automating AppSec" delves into the critical challenges associated with manual application security (AppSec) processes and outlines strategic approaches for incorporating automation to enhance efficiency, accuracy, and scalability. The lecture is structured to highlight the inherent difficulties in traditional AppSec practices, emphasizing the labor-intensive triage of issues, the complexity of identifying responsible owners for security flaws, and the challenges of implementing security checks within CI/CD pipelines. Furthermore, it provides actionable insights on automating these processes to not only mitigate these pains but also to enable a more proactive and scalable security posture within development cycles.
The Pains of Manual AppSec:
This section will explore the time-consuming and error-prone nature of manually triaging security issues, including the difficulty of prioritizing vulnerabilities based on their actual risk to the organization. It will also discuss the challenges in determining ownership for remediation tasks, a process often complicated by cross-functional teams and microservices architectures. Additionally, the inefficiencies of manual checks within CI/CD gates will be examined, highlighting how they can delay deployments and introduce security risks.
Automating CI/CD Gates:
Here, the focus shifts to the automation of security within the CI/CD pipelines. The lecture will cover methods to seamlessly integrate security tools that automatically scan for vulnerabilities as part of the build process, thereby ensuring that security is a core component of the development lifecycle. Strategies for configuring automated gates that can block or flag builds based on the severity of detected issues will be discussed, ensuring that only secure code progresses through the pipeline.
Triaging Issues with Automation:
This segment addresses how automation can be leveraged to intelligently triage and prioritize security issues. It will cover technologies and methodologies for automatically assessing the context and potential impact of vulnerabilities, facilitating quicker and more accurate decision-making. The use of automated alerting and reporting mechanisms to ensure the right stakeholders are informed in a timely manner will also be discussed.
Identifying Ownership Automatically:
Automating the process of identifying who owns the responsibility for fixing specific security issues is critical for efficient remediation. This part of the lecture will explore tools and practices for mapping vulnerabilities to code owners, leveraging version control and project management tools.
Three Tips to Scale the Shift Left Program:
Finally, the lecture will offer three practical tips for organizations looking to scale their Shift Left security programs. These will include recommendations on fostering a security culture within development teams, employing DevSecOps principles to integrate security throughout the development
How Social Media Hackers Help You to See Your Wife's Message.pdfHackersList
In the modern digital era, social media platforms have become integral to our daily lives. These platforms, including Facebook, Instagram, WhatsApp, and Snapchat, offer countless ways to connect, share, and communicate.
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsLinda Zhang
This brochure gives introduction of MYIR Electronics company and MYIR's products and services.
MYIR Electronics Limited (MYIR for short), established in 2011, is a global provider of embedded System-On-Modules (SOMs) and
comprehensive solutions based on various architectures such as ARM, FPGA, RISC-V, and AI. We cater to customers' needs for large-scale production, offering customized design, industry-specific application solutions, and one-stop OEM services.
MYIR, recognized as a national high-tech enterprise, is also listed among the "Specialized
and Special new" Enterprises in Shenzhen, China. Our core belief is that "Our success stems from our customers' success" and embraces the philosophy
of "Make Your Idea Real, then My Idea Realizing!"
7 Most Powerful Solar Storms in the History of Earth.pdfEnterprise Wired
Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).
Transcript: Details of description part II: Describing images in practice - T...BookNet Canada
This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator.
Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/
Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.
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.
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsMydbops
This presentation, delivered at the Postgres Bangalore (PGBLR) Meetup-2 on June 29th, 2024, dives deep into connection pooling for PostgreSQL databases. Aakash M, a PostgreSQL Tech Lead at Mydbops, explores the challenges of managing numerous connections and explains how connection pooling optimizes performance and resource utilization.
Key Takeaways:
* Understand why connection pooling is essential for high-traffic applications
* Explore various connection poolers available for PostgreSQL, including pgbouncer
* Learn the configuration options and functionalities of pgbouncer
* Discover best practices for monitoring and troubleshooting connection pooling setups
* Gain insights into real-world use cases and considerations for production environments
This presentation is ideal for:
* Database administrators (DBAs)
* Developers working with PostgreSQL
* DevOps engineers
* Anyone interested in optimizing PostgreSQL performance
Contact info@mydbops.com for PostgreSQL Managed, Consulting and Remote DBA Services
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.
In this follow-up session on knowledge and prompt engineering, we will explore structured prompting, chain of thought prompting, iterative prompting, prompt optimization, emotional language prompts, and the inclusion of user signals and industry-specific data to enhance LLM performance.
Join EIS Founder & CEO Seth Earley and special guest Nick Usborne, Copywriter, Trainer, and Speaker, as they delve into these methodologies to improve AI-driven knowledge processes for employees and customers alike.
14. As a bonus, we get time travel:
promises are objects representing
objects from a different time.
expect(promise).to.eventually.deep.equal(["zomg", "jsconf!"]);
19. var Connection = require("q-connection");
var remote = Connection(port);
// a promise for the remote user object!
var userPromise = remote.invoke("getUser", "domenic");
Web Socket
Web Worker
Message Port
https://github.com/kriskowal/q-connection/
The most amazing example of this is ES5 module systems.But we see this over and over, from modules to classes to callbacks to streams to events to something as small as chainable APIs…We use function and object to cobble together amazing applications and propagate the wisdom we used to create them.Sure, it’s a a bunch of hacks, but they’re practical ones: and that’s what JavaScript’s always about.
We become prideful in our ability to shape worlds out of the primordial stardust of functionWe get stuck in our patterns, saying that because a certain thing is easiest to express in terms of function, it is therefore bestMore generally, we assume that the best ideas are those that express naturally in JS, and refuse to learn from other languages.
The async programming revolution has been brewing for a while.While JS made it popular, because JS is popular, it’s not the first place these ideas have been explored.Unfortunately, JS’s initial async APIs were designed as part of the DOM, and we all know how …. pleasant …. DOM APIs are.
Even Node.js was not able to escape the DOM’s legacy.It did decide on a common signature for its callbacks---mostly.But it never took a step back and surveyed the landscape of design options for asynchronous programming.It fell into the “moar functions” trap, and did literally the simplest thing.
CPS is the easiest thing to do in JavaScript, where function is your favorite tool. You reach out and it’s right there.You need to do an async operation? Just stuff the rest of your code into a function! Everyone can do that! Anyone who can’t is clearly a JavaScript noob (not kidding!)But it is not simple. What do I mean by that…
Why is CPS complex? Because it traps you into the Turing Tarpit. The idea that yes, indeed, JS is Turing complete, so we can build whatever system we want in it.This is usually applied to things like reinventing large parts of the web platform using JS, because HTML and CSS aren’t flexible enough. But when you end up using CPS, this is exactly what happens to async programming.It forces you to reinvent the basic features of the language, features like returning a value or throwing an error, in terms of function conventions.If you think about it, you have essentially reinvented the call stack!You end up using combinator functions tying together these callback functions just to express what was already in your language!And sure, it’s not “hard”---it is, in fact, easy. Everyone can do this, and everyone does. But it’s not simple.This kind of complexity has all kind of cognitive and maintenance burdens, as you try to understand the gymnastics your intertwined function combinators are forcing you through. Did someone accidentally call the callback twice? What’s the value of that counter I use for doing things in parallel? Did I remember to pass up any errors to my caller? I don’t know, and I don’t want to know! I just want an asynchronous function call; I don’t care how!
An asynchronous function call.When you see something like this, generally it means one of two things:An idea so good that everyone had to copy itConvergent evolution on a natural solutionPromises are a bit of both.I don’t really want to show you how to use promises in JavaScript. Read some blogs for that. Instead I want to make you understand why you should use promises in JavaScript.
Instead of thrashing wildly in the Turing Tarpit, only to sink further, we turn our attention toward an abstraction that can bring us back into the semantics of JavaScript.We create an async call stack, regaining all the semantics from our language and integrating well with synchronous return/throw.In this way promises are fundamentally simple, allowing composability in the same way our normal language constructs do. You can compose asynchronous functions without gymnastics, without having to entangle your concern of calling the function with the function’s concern of doing asynchronous work.There’s a rather drastic demonstration of this available to you behind some V8 flags. Let me introduce you to generators…
The other major thing about promises is…
Not only do we get back our language semantics of try/throw, we also get as a bonus these first-class objects representing asynchronous operations, i.e. representing objects from a different time.You can see an example of how powerful this is, where we do unit test assertions on our promise, about what its value will eventually be. This is implemented today in a library I’ve created.
Here’s some code the that uses promises.Note that this is beyond Promises/A+’s `then` interface. But the basic idea is that we have a promise for a user, then we call this method to get a promise for its “repos” property. (Etc.)Just pointing out that with ES6 proxies, we can make this a lot nicer.So that’s kind of cool, it’s some nice sugar over a bunch of traditional promise code. And of course with ES6 it’s delightful. But…
Everything here takes on a whole new meaning!Consider this in light of traditional “remote object” systems. They usually fall down in various ways, for example:They would translate this into a series of requests, e.g. first for the repos, then for the 0th property, etc.Or they would try to maintain a local copy of the remote object, which leads to synchronization problems and complex serialization and rehydration approaches, deciding when to do things locally and when remotely, and how to synchronize them.But with promises as the abstraction, just like we normally use them to co-locate our operations in time, we can also use them to co-locate in space. We can “pipeline” these messages from one side to the other, retrieving only the ultimately-desired result (in this case some server-rendered HTML).
How do you get a userPromise? Use Q-ConnectionQ-Connection has the whole promise pipelining thing. Other approaches to promises representing remote objects can be found in a framework like OasisJS.
That brings us to the end of our “promises are really cool” portion. Now I want to talk about that story I promised you earlier, where as a community we overcame our greatest weakness in order to push promises to the level they’re at today.
Actually, it all started with Dojo, as did pretty much everything apparently.Promises/A captured the core idea of promises from other languagesBut: it was underspecified, missing key features, and written in prose that was easy to misinterpretOne of the consequences of this was… jQuery $.Deferred.
… yeah. They missed the whole async/sync parallel thing. They failed Promises/A reading comprehension.
Whatever. I can do my own thing. I tried.But I swore a solemn vow on the grave of the dead callbacks I replaced … I’M NOT GOING TO LET THIS HAPPEN AGAIN!
At the bottom of the gist, I wanted to end on a positive note, so I said I would produce a Promises/A test suite, and a few hours later I did.At this point Yehuda got in touch, RSVP.js
And this time, we made a test suite!
It turns out that when you write a clear and thoughtful specification of something people have been implementing haphazardly for a while, and accompany it with a thorough test suite, people really like to implement that spec.
We’ve ended up with over thirty implementations, with new ones streaming in every day.Indeed, we’ve ended up with ones in ActionScript 3, Python, and Objective C! O_oWhat’s wonderful is that, because Promises/A+ only specifies the core unit of interoperability---each implementation’s `then` method---anyone can build libraries that consume promises from any implementation. This is key!
Even the DOM spec authors wanted to get in on this Promises/A+-implementing action! And now we have… “DOM Futures”. O_o.But seriously, promises are now in the DOM! And there’s been major work throughout the WHATWG and W3C to encourage the use of “futures” in upcoming APIs. In fact…
So that’s that…
Somehow, Promises/A+ has become the starting point for any conversation about promises in JavaScript.How did Promises/A+ end up supplanting Promises/A in mindshare so drastically?Why am I getting weekly queries about whether jQuery will fix their promises implementation to conform to us? (jQuery! Think of how many users that has!)How did we go from some nerd rage over a pull request, to a specification that ended up influencing the DOM and possibly even ES7?How did a bunch of implementers congregating on GitHub, just doing our own thing, end up influencing the WHATWG and TC39?
The answer to this question, of “What made the Promises/A+ effort work so well?” boils down to a few principles of what I like to call “open specification development.”
This is the stuff we talked about earlier.You can’t build a specification like this around things nobody cares about. You need to solve real problems, and you need to solve them with coherent solutions.
Led by Brian CavalierWe all cared deeply about these issues, but were not too far apart in our goalsWe were willing to compromise (Brian notably enforcing asynchronicity in When.js 2.0)
The biggest reason harks back to what I was saying at the beginning. We harnessed JS developers greatest strength, how we had already built promises from the fundamental primitives available to us. We’d been doing this for literally years before banding together. Implementations like Q and when were in widespread use, and Yehuda’s RSVP.js was starting to make ripples. We all had the experience and knowledge to know what worked and what didn’t. In short, code before prose.
All we specified was the `then` method---because that was enough!In contrast, we could have been fighting over which library’s API, with all its glorious surface area and helper methods, became “standard.”Heck, we didn’t even specify how to create a promise!This is why I like to say that DOMFuture is a Promises/A+ promise implementation, even though it itself is a spec: it, like Q or when, builds on the core interoperable `then` method in order to create a larger surface area for its consumers to adopt (in this case the browsers).
GitHub is where we work and play, as a communityIt encourages easy forking, pull requests, and discussionIt has great Markdown integration, which is notable since Markdown diffs are very easy to readRevision history and past discussions are easily viewable and searchable, allowing new participants to jump in to the standards process just like they would with a code projectExperimental spikes can take place in branchesEven the W3C and WHATWG are starting to see this, but they haven’t made the complete transition, with their high reliance on archaic mailing lists and their hard-to-read HTML diffs
At this point I want to stop and reflect on the Promises/A+ tagline. We spent some time on this, but in the end I think it’s perfect: we mean every word.We’re open: we do everything on GitHub, out in the open.We’re sound: that’s our cause. We’re interoperable: that’s our contract. And it’s by implementers and for implementers, reflecting our commitment to build on existing code and to leverage the strength of the promise community.So if you have all these “open specification development” ingredients…
With this phrase, I’m referring to a specific philosophy which has recently been championed by the W3C’s newly-reformed Technical Architecture Group, most prominently by the efforts of Yehuda Katz, Alex Russell, and Brian Kardell.The essential idea is to build the web platform, not on magic browser APIs, but on composable JavaScript primitives.This leads to exactly the kind of virtuous cycle that Promises/A+ has exhibited: the community creates an API, competes and refines it together, reaches a convergence, and eventually the common primitives get incorporated into the web platform itself.