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 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.
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.
Promises are a popular pattern for asynchronous operations in JavaScript, existing in some form in every client-side framework in widespread use today. We'll give a conceptual and practical intro to promises in general, before moving on to talking about how they fit into Angular. If you've ever wondered what exactly $q was about, this is the place to learn!
Presentation I gave to the node.dc meetup group March 13, 2013 on using Promises and the Q library to make flow of control easier to reason about in Javascript code using async and callbacks
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.
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.
Promises are a popular pattern for asynchronous operations in JavaScript, existing in some form in every client-side framework in widespread use today. We'll give a conceptual and practical intro to promises in general, before moving on to talking about how they fit into Angular. If you've ever wondered what exactly $q was about, this is the place to learn!
Presentation I gave to the node.dc meetup group March 13, 2013 on using Promises and the Q library to make flow of control easier to reason about in Javascript code using async and callbacks
An introduction to promises from the ground up; an overview of the recent history of promises; and some guidance on using promises in your real-world code.
Video at http://www.youtube.com/watch?v=MNxnHbyzhuo, and article at http://open.blogs.nytimes.com/2013/05/29/promises-promises/.
(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.
Slowly but surely, promises have spread throughout the JavaScript ecosystem, standardized by ES 2015 and embraced by the web platform. But the world of asynchronous programming contains more patterns than the simple single-valued async function call that promises represent. What about things like streams, observables, async iterators—or even just cancelable promises? How do they fit, both in the conceptual landscape and in your day-to-day programming?
For the last year, I've been working to bring an implementation of I/O streams to the browser. Meanwhile, designs for a cancelable promise type (sometimes called "tasks") are starting to form, driven by the needs of web platform APIs. And TC39 has several proposals floating around for more general asynchronous iteration. We'll learn about these efforts and more, as I guide you through the frontiers of popular libraries, language design, and web standards.
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
Ember applications are built around an MVC model that prescribes Models, Views, Controllers, and Routes for managing persistence, DOM, application state, and URLs. In an ambitious enough app, that model may fail to cover the whole problem space. Fear not, for in this presentation you will learn how to use Ember’s container and dependency features to move beyond MVC, as well as learning how they tie Ember internals together.
Video: http://www.youtube.com/watch?v=iCZUKFNXA0k&feature=youtu.be&t=1h45m59s
Most AWS APIs will have limits on the amount of data you can send in one request and sometimes you really need to send a lot of data! To try to maximise the amount of data you can send, while still staying within the limits, some APIs support sending gzip-compressed payloads. But how can you send a gzipped request when using the Python SDK for AWS (boto3)? Well, I needed to answer this question recently and it turned out not to be as easy as I anticipated… Let’s jump into this rabbit hole together and let’s find out the answer!
An introduction to promises from the ground up; an overview of the recent history of promises; and some guidance on using promises in your real-world code.
Video at http://www.youtube.com/watch?v=MNxnHbyzhuo, and article at http://open.blogs.nytimes.com/2013/05/29/promises-promises/.
(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.
Slowly but surely, promises have spread throughout the JavaScript ecosystem, standardized by ES 2015 and embraced by the web platform. But the world of asynchronous programming contains more patterns than the simple single-valued async function call that promises represent. What about things like streams, observables, async iterators—or even just cancelable promises? How do they fit, both in the conceptual landscape and in your day-to-day programming?
For the last year, I've been working to bring an implementation of I/O streams to the browser. Meanwhile, designs for a cancelable promise type (sometimes called "tasks") are starting to form, driven by the needs of web platform APIs. And TC39 has several proposals floating around for more general asynchronous iteration. We'll learn about these efforts and more, as I guide you through the frontiers of popular libraries, language design, and web standards.
A presentation of what are JavaScript Promises, what problems they solve and how to use them. Dissects some Bluebird features, the most complete Promise library available for NodeJS and browser.
Ember applications are built around an MVC model that prescribes Models, Views, Controllers, and Routes for managing persistence, DOM, application state, and URLs. In an ambitious enough app, that model may fail to cover the whole problem space. Fear not, for in this presentation you will learn how to use Ember’s container and dependency features to move beyond MVC, as well as learning how they tie Ember internals together.
Video: http://www.youtube.com/watch?v=iCZUKFNXA0k&feature=youtu.be&t=1h45m59s
Most AWS APIs will have limits on the amount of data you can send in one request and sometimes you really need to send a lot of data! To try to maximise the amount of data you can send, while still staying within the limits, some APIs support sending gzip-compressed payloads. But how can you send a gzipped request when using the Python SDK for AWS (boto3)? Well, I needed to answer this question recently and it turned out not to be as easy as I anticipated… Let’s jump into this rabbit hole together and let’s find out the answer!
Here at MRM, we are delivering new and exciting work with
HTML5, CSS3, responsive web and cross platform solutions, but what does that really entail?
Hear the tech team explain recent work, current trends and future capabilities.
Presentacion MoodleMoot 2014 Colombia - Integración Moodle con un Repositorio...Paola Amadeo
Comunicando Moodle con un repositorio digital de objetos de aprendizaje abiertos.Una experiencia en la Facultad de Informática de la Universidad Nacional de La Plata. Argentina.
Autores: Javier Díaz, Alejandra Schiavoni, Alejandra Osorio, Paola Amadeo, M. Emilia Charnelli, José Schultz, Alex Humar, Agustina Reynoso
Stack Overflow - It's all about performance / Marco Cecconi (Stack Overflow)Ontico
Stack Overflow, and its Q&A network Stack Exchange, have been growing exponentially for the last five years. They now encompass
~150 Q&A sites
~9 million users
~13 million questions
~22 million answers
In this talk, I will describe:
+ The physical architecture of Stack Overflow. How many servers are there? What is their purpose and what are their specs?
+ The logical architecture of the software. How do we scale up? What are the main building blocks of our software?
+ The tooling system. What supports our extreme optimization philosophy?
+ The development team. What are our core values? What footprint do we want to leave as developers?
NodeJS: the good parts? A skeptic’s view (oredev, oredev2013)Chris Richardson
JavaScript used to be confined to the browser. But these days, it becoming increasingly popular in server-side applications in the form of NodeJS. NodeJS provides event-driven, non-blocking I/O model that supposedly makes it easy to build scalable network application. In this talk you will learn about the consequences of combining the event-driven programming model with a prototype-based, weakly typed, dynamic language. We will share our perspective as a server-side Java developer who wasn’t entirely happy about JavaScript in the browser, let alone on the server. You will learn how to use NodeJS effectively in modern, polyglot applications.
OpenSource API Server based on Node.js API framework built on supported Node.js platform with Tooling and DevOps. Use cases are Omni-channel API Server, Mobile Backend as a Service (mBaaS) or Next Generation Enterprise Service Bus. Key functionality include built in enterprise connectors, ORM, Offline Sync, Mobile and JS SDKs, Isomorphic JavaScript and Graphical API creation tool.
Objeto de conferencia
Curso de capacitación (Alerta)
Contenidos del curso:
<b>Aspectos técnicos de DSpace</b>
- Arquitectura
- Modelo de datos
- Estructura del proyecto
- Maven como gestor de dependencias
- Comando <i>dspace</i>
- Introducción a XMLUI
<b>Descripción de DSpace</b>
- Introducción
- Servicios básicos
- Gestión de usuarios
- Envío de items y proceso de revisión
- Menú contextual
- Menú administrativo
Curso de capacitación avanzada en DSpace brindado para miembros del Consorcio de Universidades <a>Alerta al Conocimiento</a> (Chile).
Ver registro completo en: http://sedici.unlp.edu.ar/handle/10915/25304
Introducing the New DSpace User InterfaceTim Donohue
Introduction of the DSpace UI Initiative, the process of selecting a new UI platform and the new Angular 2 UI proof-of-concept demo. This presentation was given at the Open Repositories 2016 conference on Wednesday, June 15, 2016 in Dublin, Ireland.
Analysis of StackOverflow posts/user data trend analysis. Predicting time to answer (classification) using Weka. CSCI599 final project on Social media data analytics
Think Async: Asynchronous Patterns in NodeJSAdam L Barrett
JavaScript is single threaded, so understanding the async patterns available in the language is critical to creating maintainable NodeJS applications with good performance. In order to master “thinking in async”, we’ll explore the async patterns available in node and JavaScript including standard callbacks, promises, thunks/tasks, the new async/await, the upcoming asynchronous iteration features, streams, CSP and ES Observables.
Why do we need promises? How does promises compare to a simple callback approach or modules like async? Are promises just a hype or a new standard for asynchronous code?
JavaScript Multithread or Single Thread.pptxRAHITNATH
The most functional yet intricately constructed programming language is JavaScript. Understanding how the syntax is used in engines, such as V8 engines for chromium, is challenging. We are successfully completing tasks in Chrome at the same time. This PPT will assist you in learning about the most crucial aspects and use of JavaScript, which will help you comprehend when and where the language is required. Java provides a superior platform by using multi-threading ways to optimize the process, but how can JavaScript manage to achieve the same thing even in a better way to compile and provide us a real-time user interface on webpages even after a significant amount of time has passed.
JavaScript's non-blocking approaches offer a better method of process resolution and execution with regard to load and priority to improve user experience. Even better are the non-blocking approaches and some browser architecture. The topic focuses on JavaScript's end-to-end workflow in Chrome's V8 engine and how it distributes its load and processes with the aid of queues made available by Chrome's architectural design.
Node has captured the attention of early adopters by clearly differentiating itself as being asynchronous from the ground up while remaining accessible. Now that server side JavaScript is at the cutting edge of the asynchronous, real time web, it is in a much better position to establish itself as the go to language for also making synchronous, CRUD webapps and gain a stronger foothold on the server.
This talk covers the current state of server side JavaScript beyond Node. It introduces Common Node, a synchronous CommonJS compatibility layer using node-fibers which bridges the gap between the different platforms. We look into Common Node's internals, compare its performance to that of other implementations such as RingoJS and go through some ideal use cases.
Workshop JavaScript Testing. Frameworks. Client vs Server Testing. Jasmine. Chai. Nock. Sinon. Spec Runners: Karma. TDD. Code coverage. Building a testable JS app.
Presentado por ing: Raúl Delgado y Mario García
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.
Pragmatic Monolith-First, easy to decompose, clean architecturePiotr Pelczar
Designing systems architecture corresponding to business needs in long future is like a reading tea leaves. There is no common way to design systems. Making decision to start project with microservices may make refactoring much harder and introduce too much complexity in the infrastructure layer and finally slow down development. However maintaining a monolith is a tough nut to crack.
Let’s see how to build a system starting from well organized monolith with well marked technical and business scopes that enables to make a decision in with way it should be decomposed and how to deliver it. Strategic and tactical techniques from Domain-Driven Design and Hexagonal Architecture will be used. I will show you how to monitor accidential complexity using different tools during CI.
I invite you if you are interested in building systems with complex business domains.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™UiPathCommunity
In questo evento online gratuito, organizzato dalla Community Italiana di UiPath, potrai esplorare le nuove funzionalità di Autopilot, il tool che integra l'Intelligenza Artificiale nei processi di sviluppo e utilizzo delle Automazioni.
📕 Vedremo insieme alcuni esempi dell'utilizzo di Autopilot in diversi tool della Suite UiPath:
Autopilot per Studio Web
Autopilot per Studio
Autopilot per Apps
Clipboard AI
GenAI applicata alla Document Understanding
👨🏫👨💻 Speakers:
Stefano Negro, UiPath MVPx3, RPA Tech Lead @ BSP Consultant
Flavio Martinelli, UiPath MVP 2023, Technical Account Manager @UiPath
Andrei Tasca, RPA Solutions Team Lead @NTT Data
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
16. Single-threaded, event loop
model
Imagine a man, who has a task:
Walk around
When bucket is full of water, just pour another bucket
Go to next bucket
17. There is no sequences
In async programming, results appears in no sequences
operation1(); // will output "operation1 finished."
operation2(); // will output "operation2 finished."
operation3(); // will output "operation3 finished."
18. There is no sequences
operation1() would be
var amqp = require("amqp")
var eventbus = amqp.createConnection();
console.log("AMQP connecting...");
eventbus.on("ready", function() {
console.log("AMQP connected...");
callback();
return;
});
19. There is no sequences
operation2() would be
var redis = require("redis")
var conn = redis.createClient(port, host, options);
console.log("Redis connecting...");
conn.auth(pass, function(err) {
if(err)
console.log("Redis failed...");
else
console.log("Redis connected...");
callback();
return;
});
20. There is no sequences
operation3() would be
var mongojs = require("mongojs");
console.log("Mongo connecting...");
var conn = mongojs.connect(connectionString); // blocking operation
console.log("Mongo connected...");
callback();
return;
25. So... what functions
returns?
You can perform future tasks in function, so what will be
returned?
value123 will be returned,
function my_function() {
operation1();
operation2();
operation3();
return "value123";
}
just after blocking code, without waiting for non-blocking.
26. Assume: Functions does
NOT returns values
The function block is executed immedietally from top to bottom.
You cannot rely to return value, because it is useless.
27. Callbacks
Callback is the reference to function.
var callbackFunction = function(result) {
console.log("Result: %s", result)
}
When operation is done, the callback function is executed.
callbackFunction("test1") // "Result: test1" will be printed out
28. Callbacks
If callbackFunction is a variable (value = reference),
so can be passed it via function argument.
var callbackFunction = function() { ... }
someOtherFunction(callbackFunction);
function someOtherFunction(callback) {
callback(); // execute function from argument
}
29. Callbacks
Functions can be defined as anonymous (closures)
function someOtherFunction(callback) {
var arg1 = "test";
callback(arg1); // execute function from argument
}
someOtherFunction(function(arg1) {
console.log('done... %s', arg1);
})
30. Callbacks can be nested
Nesting callbacks makes code unreadeable:
var amqp = require('amqp');
var connection = amqp.createConnection();
connection.on('ready', function() {
connection.exchange("ex1", function(exchange) {
connection.queue('queue1', function(q) {
q.bind(exchange, 'r1');
q.subscribe(function(json, headers, info, m) {
console.log("msg: " + JSON.stringify(json));
});
});
});
});
31. Callbacks can be nested
Nesting callbacks makes code unreadeable:
var amqp = require('amqp');
var connection = amqp.createConnection();
connection.on('ready', function() {
connection.exchange("ex1", function(exchange) {
connection.queue('queue1', function(q) {
q.bind(exchange, 'r1');
q.subscribe(function(json, headers, info, m) {
console.log("msg: " + JSON.stringify(json));
table.update(select, data, function() {
table.find(select, function(err, rows) {
// inserted rows...
}
});
});
});
});
});
33. Promise design pattern
1. Client fires function that will return result in the future
in the future, so it is a promise
2. Function returns promise object immedietaly
before non-blocking operations
3. Client registers callbacks
4. Callbacks will be fired in the future, when task is done
var resultPromise = loader.loadData(sourceFile)
resultPromise(function success(data) {
// this function will be called while operation will succeed
}, function error(err) {
// on fail
})
34. Promise design pattern
1. Create deferred object
2. Return def.promise
3. Call resolve() or reject()
var loadData = function(sourceFile) {
var def = deferred()
, proc = process.spawn('java', ['-jar', 'loadData.jar', sourceFile])
var commandProcessBuff = null
, commandProcessBuffError = null;
proc.stdout.on('data', function (data) { commandProcessBuff += data })
proc.stderr.on('data', function (data) { commandProcessBuffError += data })
proc.on('close', function (code) {
if(null !== commandProcessBuffError)
def.reject(commandProcessBuffError)
else
def.resolve(commandProcessBuff)
})
return def.promise
}
47. Unnamed callbacks
Instead of this, name your callbacks
function doSomething(done) {
doAnotherThing(function(doneFetchingFromApi) {
doYetAnotherThing(function(doneWritingToDatabase) {
return done();
})
})
}
48. Double callbacks
function doSomething(done) {
doAnotherThing(function (err) {
if (err) done(err);
done(null, result);
});
}
Callback is fired twice!
49. Double callbacks
Fix: Always prepend callback execution with return statement.
function doSomething(done) {
doAnotherThing(function (err) {
if (err)
return done(err);
return done(null, result);
});
}
Normally, return ends function execution, why do not keep this
rule while async.
50. Double callbacks
Double callbacks are very hard to debug.
The callback wrapper can be written and execute it only once.
setTimeout(function() {
done('a')
}, 200)
setTimeout(function() {
done('b')
}, 500)
52. Double callbacks
obj1 = new CallbackOnce(done)
// decorate callback
safeDone = obj1.create() // safeDone() is proxy function that passes arguments
setTimeout(function() {
safeDone('a') // safe now...
}, 200)
setTimeout(function() {
safeDone('b') // safe now...
}, 500)
53. Unexpected callbacks
Never fire callback until task is done.
function doSomething(done) {
doAnotherThing(function () {
if (condition) {
var result = null
// prepare result...
return done(result);
}
return done(null);
});
}
The ending return will be fired even if condition pass.
54. Unexpected callbacks
Never fire callback until task is done.
function doSomething(done) {
doAnotherThing(function () {
if (condition) {
var result = null
// prepare result...
return done(result);
}
else {
return done(null);
}
});
}
55. Unexpected callbacks
Never use callback in try clause!
function (callback) {
another_function(function (err, some_data) {
if (err)
return callback(err);
try {
callback(null, JSON.parse(some_data)); // error here
} catch(err) {
callback(new Error(some_data + ' is not a valid JSON'));
}
});
}
If callback throws an exception, then it is executed exactly twice!
56. Unexpected callbacks
Never use callback in try clause!
function (callback) {
another_function(function (err, some_data) {
if (err)
return callback(err);
try {
var parsed = JSON.parse(some_data)
} catch(err) {
return callback(new Error(some_data + ' is not a valid JSON'));
}
callback(null, parsed);
});
}
62. Unreadable and logs
Logs without use context are useless...
function getResults(keyword, done) {
http.request(url, function(response) {
console.log('Fetching from API')
response.on('error', function(err) {
console.log('API error')
})
});
}
63. Unreadable and logs
function getResults(keyword, done) {
var logContext = { keyword: keyword }
http.request(url, function(response) {
console.log(logContext, 'Fetching from API')
response.on('error', function(err) {
console.log(logContext, 'API error')
})
});
}
64. Unreadable and logs
Centralize your logs - use logstash
And make them searcheable - Elasticsearch + Kibana
65. Too many opened
background-tasks
While running parallel in order to satisfy first-better algorithm,
others should be aborted
66. Too many opened
background-tasks
Provide cancellation API:
var events = require('events')
function getResults(keyword) {
var def = deferred()
var eventbus = new events.EventEmitter()
var req = http.request(url, function(response) {
var err = null
, content = null
res.on('data', function(chunk) {
content += chunk;
});
response.on('close', function() {
if(err)
return def.reject(err)
else
return def.resolve(content)
})
response.on('error', function(err) {
err += err
})
});
67. Too many opened
background-tasks
Provide cancellation API:
var response = getResults('test')
response.result(function success() {
// ...
}, function error() {
// ...
})
// if we need
response.events.emit('abort')
68. Everything runs in parallel except your code.
When currently code is running, (not waiting for I/O descriptors)
whole event loop is blocked.