This document discusses JavaScript module patterns, which help organize and limit the scope of code in projects. It covers different patterns for creating objects and modules, including using constructors, prototypes, the revealing module pattern, CommonJS, and AMD. The basic module pattern allows defining private and public members to encapsulate data and functions. Later patterns like CommonJS and AMD build on this to support asynchronous loading and use in different environments like the browser and Node.js.
Over 200 Pages of resources and code snippets to learn JavaScript and JavaScript DOM manipulation. JavaScript is the most popular web programming language and this eBook will help you learn more about JavaScript Coding
Over 200 Pages of resources and code snippets to learn JavaScript and JavaScript DOM manipulation. JavaScript is the most popular web programming language and this eBook will help you learn more about JavaScript Coding
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values.
JavaScript Assignment Operators
Assignment operators are used to assign values to JavaScript variables.
JavaScript String Operators
The + operator, and the += operator can also be used to concatenate (add) strings.
Comparison Operators
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Conditional (Ternary) Operator
The conditional operator assigns a value to a variable based on a condition.
Logical Operators
Logical operators are used to determine the logic between variables or values.
JavaScript Bitwise Operators
Bit operators work on 32 bits numbers. Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.
The delete Operator
The delete operator deletes a property from an object:
There are several JavaScript libraries available in the world of web programming. And, as the usage and complexity is increasing day by day, sometimes it becomes very difficult and confusing to understand and create modules using those libraries, especially for those having strong background of Object Oriented Languages.
So this one hour session will make an effort to go into the very basics of JavaScript and put a base for writing modular JavaScript code.
Version 6 of Adobe Experience Manager (AEM 6) is a major release that introduces significant innovations. Sightly is a new template system to be used in place of (or together with) JSP. Along with Sling Models, SIghtly strongly improves the separation between the logic and presentation. The development effort is reduced because a Sightly template is an HTML 5 document, easily maintainable even by front-end developers.
The presentation provides an overview of the basic features of Sightly and introduces the fundamentals of the new development model with the support of tools released release together with AEM 6.
JavaScript has some stunning features like Closures, Prototype etc. which can help to improve the readability and maintainability of the code. However, it is not easy for inexperienced developer to consume and apply those features in day to day coding. The purpose of the presentation ‘Advanced JavaScript’ is to help a reader easily understand the concept and implementation of some advanced JavaScript features.
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
- Talk from FrontConf Munich 2017
- https://frontconf.com/talks/09-12-2017/reactive-type-safe-webcomponents
Abstract:
You know the drill right? new cool framework/library appears... boom! new Datepicker in that framework follows and soon enough whole UI libraries, again and again....
It's 2017 and it's time to stop this madness once and for all! How you ask?
In this talk we will go through implementation of an app via vanilla web components and explore all the pain points with all these low level primitives that we have natively in the browser.
In the end we will build our custom super tiny reactive type-safe library which will allow us to build web components with a breeze
Write once, use everywhere by using the platform + abstraction for great Developer experience.
JavaScript Arithmetic Operators
Arithmetic operators are used to perform arithmetic between variables and/or values.
JavaScript Assignment Operators
Assignment operators are used to assign values to JavaScript variables.
JavaScript String Operators
The + operator, and the += operator can also be used to concatenate (add) strings.
Comparison Operators
Comparison operators are used in logical statements to determine equality or difference between variables or values.
Conditional (Ternary) Operator
The conditional operator assigns a value to a variable based on a condition.
Logical Operators
Logical operators are used to determine the logic between variables or values.
JavaScript Bitwise Operators
Bit operators work on 32 bits numbers. Any numeric operand in the operation is converted into a 32 bit number. The result is converted back to a JavaScript number.
The delete Operator
The delete operator deletes a property from an object:
There are several JavaScript libraries available in the world of web programming. And, as the usage and complexity is increasing day by day, sometimes it becomes very difficult and confusing to understand and create modules using those libraries, especially for those having strong background of Object Oriented Languages.
So this one hour session will make an effort to go into the very basics of JavaScript and put a base for writing modular JavaScript code.
Version 6 of Adobe Experience Manager (AEM 6) is a major release that introduces significant innovations. Sightly is a new template system to be used in place of (or together with) JSP. Along with Sling Models, SIghtly strongly improves the separation between the logic and presentation. The development effort is reduced because a Sightly template is an HTML 5 document, easily maintainable even by front-end developers.
The presentation provides an overview of the basic features of Sightly and introduces the fundamentals of the new development model with the support of tools released release together with AEM 6.
JavaScript has some stunning features like Closures, Prototype etc. which can help to improve the readability and maintainability of the code. However, it is not easy for inexperienced developer to consume and apply those features in day to day coding. The purpose of the presentation ‘Advanced JavaScript’ is to help a reader easily understand the concept and implementation of some advanced JavaScript features.
This year ECMA International will be ratifying the biggest update to the JavaScript language in its history. In this talk we'll look at key features already appearing in browsers as well as those coming in the near future. We'll also explore how you can begin leveraging the power of ES6 across all browsers today. If you haven't looked at JavaScript recently, you soon realize that a bigger, better world awaits.
- Talk from FrontConf Munich 2017
- https://frontconf.com/talks/09-12-2017/reactive-type-safe-webcomponents
Abstract:
You know the drill right? new cool framework/library appears... boom! new Datepicker in that framework follows and soon enough whole UI libraries, again and again....
It's 2017 and it's time to stop this madness once and for all! How you ask?
In this talk we will go through implementation of an app via vanilla web components and explore all the pain points with all these low level primitives that we have natively in the browser.
In the end we will build our custom super tiny reactive type-safe library which will allow us to build web components with a breeze
Write once, use everywhere by using the platform + abstraction for great Developer experience.
Building Reusable Custom Elements With AngularIlia Idakiev
What are Web Components and how we use them. What is Angular Elements and how can we package our angular components as custom elements and reuse them everywhere.
Demos: https://github.com/iliaidakiev/slides/
Is your web app drowning in a sea of JavaScript? Has your client-side codebase grown from "a snippet here and there" to "more JavaScript than HTML"? Do you find yourself writing one-off snippets instead of generalized components? You're not the only one. Learn about a handful of strategies you can use to keep your JavaScript codebase lean, modular, and flexible. We'll cover all the major pain points — MVC, templates, persisting state, namespacing, graceful error handling, client/server communication, and separation of concerns. And we'll cover how to do all this incrementally so that you don't have to redo everything from scratch.
This DrupalCon 2019 Amsterdam talk provides a look beyond the world of PHP and Javascript. It explores how other languages such as Ruby, Java, Rust and Perl handle things and highlights some interesting features of those languages. Not all the things that other languages can do can be done in PHP or Javascript but the concepts and ideas can still be used.
How to build to do app using vue composition api and vuex 4 with typescriptKaty Slemon
In this tutorial, we will build a to-do app using Vue Composition API & Vuex 4 with Typescript. We will learn and explore Composition API & Options API as well
What is a “modern” metric anyway? An exploration on how to measure and evaluate popular (and experimental) web performance metrics, and how they affect user happiness and business goals.
We'll talk about how data can be biased, and how best to interpret performance data given those biases. We'll look at a broad set of RUM data we've captured to see how the Core Web Vitals correlate (or not) to other performance and business metrics. Finally, we'll share a new way that others can research modern metrics and RUM data.
Check Yourself Before You Wreck Yourself: Auditing and Improving the Performa...Nicholas Jansma
Boomerang is an open-source Real User Monitoring (RUM) JavaScript library used by thousands of websites to measure their visitor's experiences. The developers behind Boomerang take pride in building a reliable and performant third-party library that everyone can use without being concerned about its measurements affecting their site. We recently performed and shared an audit of Boomerang's performance, to help communicate its "cost of doing business", and in doing so we found several areas of code that we wanted to improve. We'll discuss how we performed the audit, some of the improvements we've made, how we're testing and validating our changes, and the real-time telemetry we capture for our library to ensure we're having as little of an impact as possible on the sites we're included on.
Boomerang is an open-source Real User Monitoring (RUM) JavaScript library used by thousands of websites to measure their visitor's experiences.
Boomerang runs on billions of page loads a day, either via the open-source library or as part of Akamai's mPulse RUM service. The developers behind Boomerang take pride in building a reliable and performant third-party library that everyone can use without being concerned about its measurements affecting their site.
Recently, we performed and shared an audit of Boomerang's performance, to help communicate the "cost of doing business" of including Boomerang on a page while it takes its measurements. In doing the audit, we found several areas of code that we wanted to improve and have been making continuous improvements ever since. We've taken ideas and contributions from the OSS community, and have built a Performance Lab that helps "lock in" our improvements by continuously measuring the metrics that are important to us.
We'll discuss how we performed the audit, some of the improvements we've made, how we're testing and validating our changes, and the real-time telemetry we capture on our library to ensure we're having as little of an impact as possible on the sites we're included on.
When Third Parties Stop Being Polite... and Start Getting RealNicholas Jansma
By Nic Jansma and Charlie Vazac (Akamai)
Fluent 2018
Would you give the Amazon Prime delivery robot the key to your house, just because it stops by to deliver delicious packages every day? Even if you would, do you still have 100% confidence that it wouldn’t accidentally drag in some mud, let the neighbor in, steal your things, or burn your house down? Worst-case scenarios such as these are what you should be planning for when deciding whether or not to include third-party libraries and services on your website. While most libraries have good intentions, by including them on your site, you have given them complete control over the kingdom. Once on your site, they can provide all of the great services you want—or they can destroy everything you’ve worked so hard to build.
It’s prudent to be cautious: we’ve all heard stories about how third-party libraries have caused slowdowns, broken websites, and even led to downtime. But how do you evaluate the actual costs and potential risks of a third-party library so you can balance that against the service it provides? Every library requires nonzero overhead to provide the service it claims. In many cases, the overhead is minimal and justified, but we should quantify it to understand the real cost. In addition, libraries need to be carefully crafted so they can avoid causing additional pain when the stars don’t align and things go wrong.
Nic Jansma and Charles Vazac perform an honest audit of several popular third-party libraries to understand their true cost to your site, exploring loading patterns, SPOF avoidance, JavaScript parsing, long tasks, runtime overhead, polyfill headaches, security and privacy concerns, and more. From how the library is loaded, to the moment it phones home, you’ll see how third-parties can affect the host page and discover best practices you can follow to ensure they do the least potential harm.
With all of the great performance tools available to developers today, we’ve gained a lot of insight into just how much third-party libraries are impacting our websites. Nic and Charles detail tools to help you decide if a library’s risks and unseen costs are worth it. While you may not have the time to perform a deep dive into every third-party library you want to include on your site, you’ll leave with a checklist of the most important best practices third-parties should be following for you to have confidence in them.
Responsiveness to user interaction is crucial for users of web apps, and businesses need to be able to measure responsiveness so they can be confident that their users are happy. Unfortunately, users are regularly bogged down by frustrations such as a delayed "time to interactive” during page load, high or variable input latency on critical interaction events (tap, click, scroll, etc.), and janky animations or scrolling. These negative experiences turn away visitors, affecting the bottom line. Sites that include third-party content (ads, social plugins, etc.) are frequently the worst offenders.
The culprit behind all these responsiveness issues are “long tasks," which monopolize the UI thread for extended periods and block other critical tasks from executing. Developers lack the necessary APIs and tools to measure and gain insight into such problems in the wild and are essentially flying blind trying to figure out what the main offenders are. While developers are able to measure some aspects of responsiveness, it’s often not in a reliable, performant, or “good citizen” way, and it’s near impossible to correctly identify the perpetrators.
Shubhie Panicker and Nic Jansma share new web performance APIs that enable developers to reliably measure responsiveness and correctly identify first- and third-party culprits for bad experiences. Shubhie and Nic dive into real-user measurement (RUM) web performance APIs they have developed: standardized web platform APIs such as Long Tasks as well as JavaScript APIs that build atop platform APIs, such as Time To Interactive. Shubhie and Nic then compare these measurements to business metrics using real-world data and demonstrate how web developers can detect issues and reliably measure responsiveness in the wild—both at page load and postload—and thwart the culprits, showing you how to gather the data you need to hold your third-party scripts accountable.
Measuring Real User Performance in the BrowserNicholas Jansma
To people responsible for the health of web properties, monitoring, measurement, and analysis of real-user experiences is key to delivering a consistent and delightful experience. Drawing on their experience with the open source boomerang project, Philip Tellis and Nic Jansma explore various tools and methods available to measure real-user performance in the browser.
Topics include:
Available browser APIs: Navigation Timing, Resource Timing (Levels 1 and 2), User Timing, Error Logging, and more
Measuring full-page apps
Measuring single-page apps
RUM SpeedIndex
Measuring continuity
Hacks when an API isn’t available
Avoiding the observer effect
Filtering data to get rid of noise
Identifying outliers and treating them differently
By Philip Tellis and Nic Jansma
Whenever we speak of measuring web performance, we always refer to measuring static events, whether the old page-load model, the controversial above-the-fold time, or the product-specific “time to first tweet.” Each of these have their pros and cons ranging from ease of implementation to relevance to the actual user’s experience.
But a performant user experience is much more than these static events, and no methods measure the experience the user has interacting with the page after that initial event. We seldom measure the experience of the user when they spend the most time on the site (i.e., between load and unload, when they’re reading and interacting with content on the page, etc.) or ask questions like: Was scrolling smooth or janky? What about animations? Did the user click expecting something to happen but nothing did? Are too many reflows happening?
Drawing on their work on boomerang, Philip Tellis and Nic Jansma explore new methods of measuring web performance as it relates to continuous interactions between the user and a page.
Measuring the Performance of Single Page ApplicationsNicholas Jansma
Single page applications are a problem for RUM tools because there are no easy ways to tell when a new page component has been requested asynchronously as a result of an intentional user action. Many network requests are back-end service calls initiated periodically by the app – for example, a ping to check if content has been updated, or to check if the current user should still be signed in to their account.
Even with requests that are initiated by a user action, not all may fit into the definition of a “page view.” For example, a user typing into a search box that has auto-complete capabilities will often result in network requests, but these requests result in very small amounts of data transfer, happen very frequently, and do not count toward page views. The scene is further complicated by SPA frameworks like Angular, Backbone, and others.
In this talk, we’ll learn about some of the tricks used by boomerang to measure the performance of single page applications, going as far as capturing errors and waterfall information across browsers.
Make It Fast - Using Modern Browser Performance APIs to Monitor and Improve t...Nicholas Jansma
Make It Fast
Using Modern Browser Performance APIs to Monitor and Improve the Performance of your Web Apps.
Presented at CodeMash 2015.
Performance matters. How fast your site loads — not just on your development machine, but from your actual customers, across the globe — has a direct impact on your visitors’ happiness and conversion rate. Today’s browsers provide several new cutting-edge performance APIs that can give you Real User Metrics (RUM) of your live site’s performance. Whether you run a small blog or a top-1K site, monitoring and understanding your performance is the key to giving your visitors a better experience. We will be discussing the NavigationTiming, ResourceTiming and UserTiming performance APIs, which are available in the majority of modern browsers. You’ll walk away with a better understanding of what problem these APIs solve and how to start using them today. We’ll also go through both D.I.Y. and commercial options that utilize these APIs to help you better monitor and improve the performance of your websites.
Appcelerator Titanium is a cross-platform development environment where you can build iOS, Android, BlackBerry and Hybrid/HTML5 apps. This talk will discuss how it works, how to get started, code samples and pros/cons from experience.
Phing is a PHP build tool, similar to Apache's Ant. Phing can be used for everything from validating your build, running tests, combining/minifying resources to deploying.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
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
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
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.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
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.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
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.
3. {}:
A collection of properties
Each property has a value
A value can be a number, string, boolean, object or
function
4. WHAT ISN'T AN OBJECT
Only null and undefined are not objects
5. HOW DO YOU CREATE
OBJECTS? VERSION 1
Using an object initializer {}:
// create an empty object
var emptyObject = {};
// create an object with properties
var obj = {
stringProperty: "hello",
integerProperty: 123,
functionProperty: function() { return 0; },
"a property with spaces": false,
subObject: {
booleanProperty: true
}
};
6. HOW DO YOU CREATE
OBJECTS? VERSION 2
Using a constructor function (new keyword):
// create an empty object
var emptyObject = new Object();
// define an object constructor
function Keg(contains, amount) {
this.contains = contains;
this.amount = amount;
}
// create an object
var keg = new Keg("Soda", 100.0);
7. HOW DO YOU CREATE
OBJECTS? VERSION 3
Using Object.create():
// create an empty object
var emptyObject = Object.create(Object.prototype);
// define an object with default properties
var Keg = {
contains: "Unknown",
amount: 0.0
}
// create an object
var keg = Object.create(Keg);
// modify its properties
keg.contains = "Soda";
keg.abv = 100.0;
8. JAVASCRIPT MODULE
PATTERNS
A module helps keep units of code cleanly separated and
organized
A pattern is a common technique that can be re-used
and applied to every-day software design problems
JavaScript Module Patterns help us organize and limit
code scope in any project
9. JAVASCRIPT MODULES
The JavaScript language doesn't have classes, but we can
emulate what classes can do with modules
A module helps encapsulate data and functions into a
single component
A module limits scope so the variables you create in the
module only live within it
A module gives privacy by only allowing access to data
and functions that the module wants to expose
10. BASIC OBJECT
Let's build a module for a Keg that can be filled with soda. It
has two basic properties:
function Keg(contains, amount) {
this.contains = contains;
this.amount = amount;
}
11. BASIC OBJECT
We can add a fill() function so others can fill it with
something tasty:
function Keg(contains, amount) {
this.contains = contains;
this.amount = amount;
this.fill = function(beverage, amountAdded) {
this.contains = beverage;
this.amount = amountAdded;
};
}
12. BASIC OBJECT
Right now, all of the Keg's properties are public. The world
has full access to change our data:
var keg = new Keg();
keg.fill("Soda", 100.0);
keg.amount = 9999; // oh no! they accessed our internal data
13. BASIC MODULE PATTERN:
CONSTRUCTORS
Let's switch to the Module Pattern, which gives us the ability
to have public and private members:
// define the constructor
function Keg(_contains, _amount) {
// private members
var contains = _contains;
var amount = _amount;
// public methods
return {
fill: function(beverage, amountAdded) {
contains = beverage;
amount = amountAdded;
}
}
}
// create an instance of a Keg
var keg = new Keg("Soda", 100.0);
// modify its properties
keg.fill("Pop", 50.0); // this is the only public member
var amt = keg.amount; // undefined! hidden from us
14. BASIC MODULE PATTERN:
CONSTRUCTORS
We can add additional methods to give access to our private
variables without changing them:
function Keg(_contains, _amount) {
/* ... private members ... */
return {
fill: function() { ... },
getAmount: function() {
return amount;
},
getContents: function() {
return contains;
}
}
}
var keg = new Keg("Soda", 100.0);
var amt = keg.getAmount(); // 100.0
keg.fill("Pop", 50.0);
amt = keg.getAmount(); // 50.0
15. BASIC MODULE PATTERN:
CONSTRUCTORS
You can have private functions as well:
function Keg(_contains, _amount) {
// private members
var contains = _contains;
var amount = _amount;
// private function
function updateAmount(newAmount) {
if (newAmount < 0) { newAmount = 0; }
amount = newAmount;
}
// public methods
return {
fill: function(beverage, amountAdded) {
contains = beverage;
updateAmount(amountAdded);
}
/* ... */
}
}
17. DISADVANTAGES
The Basic Module Pattern for constructing objects has one
big disadvantage: you're not taking advantage of
prototypes
A prototype is a value (number, string, function, etc) that
you can assign to all instances of a class using
ClassName.prototype.
Instead of each instance having a copy of the member, the
single prototype member is shared
This gives you substantial memory savings if you have
many instances of the object
18. KEG USING PROTOTYPE
Instead of each instance having it's own version of the same
fill() function, there's one global Keg.prototype.fill:
function Keg(contains, amount) {
// these now need to be public members
this.contains = contains;
this.amount = amount;
}
Keg.prototype.fill = function(beverage, amountAdded) {
// because this doesn't have access to 'vars' in the Keg function
this.contains = beverage;
this.amount = amountAdded;
};
Keg.prototype.getAmount = function() {
return this.amount;
};
Keg.prototype.getContents = function() {
return this.contains;
};
19. KEG USING PROTOTYPE
The Keg's internal properties (contains and amount) need
to change from being defined within the Keg function's
closure (var contains = ...) to be public properties
(this.contains = ...)
This is because the Keg.prototype.fill function wasn't
defined within the Keg's function closure, so it would have
no visibility to vars defined within it
Thus the properties can be modified by anyone, outside
of the protection of your module
20. BASIC MODULE PATTERN:
NON-CONSTRUCTORS
If your module is a "global object" instead of a constructor
(i.e. jQuery), you can simplify the syntax a bit
Wrap it up in an immediately-invoked functional
expression (IIFE) to get closure for your private variables
22. IMPORTS
If you want to "import" other global variables or other
modules, they can be passed in as IIFE arguments:
var KegManager = (function($) {
var kegs = [];
// do something with $
// exports
return {
addKeg: function(keg) { kegs.push(keg); }
getKegs: function() { return kegs; }
}
})(jQuery);
var sodaKeg = new Keg("Soda", 100.0);
KegManager.addKeg(sodaKeg);
var kegs = KegManager.getKegs(); // a list of Keg objects
23. REVEALING MODULE
PATTERN
An update to the Module Pattern
Define everything first, then return an object that has
properties for the items you want to export (make public)
25. REVEALING MODULE
PATTERN
Pros:
All public and private members are defined in the same
way
All exports are listed in an easy-to-read list at the end
If someone were to "patch" (overwrite) an export, your
internal functions still refer to your own implementation
26. COMMONJS
A module standard
Commonly used on the server (NodeJS)
Each file is a (single) module, each module is a (separate)
file
A global exports variable is available that you can assign
your exports to
27. COMMONJS MODULE
DEFINITION
A file contains a single module:
keg.js
// imports
var KegManager = require("kegmanager");
// constructor we'll export
function Keg(_contains, _amount) {
// ... same as before
// tell the KegManager about this new keg
KegManager.add(this);
}
// some other private vars
var foo = false;
// exports
exports.Keg = Keg;
29. AMD
Asynchronous Module Definition
Commonly used in the browser (Dojo, MooTools, jQuery)
Allows for modules and their dependencies to be loaded
asynchronously
Need to use a "loader", such as RequireJS
(http://requirejs.org/)
30. AMD MODULE
DEFINITION: DEFINE
Defines a module, its dependencies, and the initialization
function that runs once all dependencies are loaded:
define(
"Keg", // module name, optional but suggested
["KegManager"], // list of dependencies
function(KegManager) { // initialization function
// constructor we'll export
function Keg(_contains, _amount) {
// ... same as before
// tell the KegManager about this new keg
KegManager.add(this);
}
// some other private vars
var foo = false;
// exports
return {
Keg: Keg
}
});
31. AMD MODULE USAGE:
REQUIRE
Load the modules you need
require(
["Keg"],
function(Keg) {
// will only run once Keg (and its dependency, KegManager) is loaded
var keg = new Keg.Keg("Soda", 100);
});
32. REQUIREJS
AMD specifies a format for how to define a module and
its dependencies
It's up to a loader to figure out how to fetch and run the
modules in the correct load order
RequireJS (and its little sister almond) are the best loader
options today
34. REQUIREJS OPTIMIZER
Builds all of your modules into a single file (great for
deployment)
Install requirejs:
> npm install ‐g requirejs
Optimize your JavaScript:
> node r.js ‐o baseUrl=. name=main out=main‐built.js
36. UMD
Universal Module Definition
Code templates for defining a module that works in
multiple environments, such as AMD, CommonJS and the
browser
https://github.com/umdjs/umd
37. UMD
Defines a module that works in Node, AMD and browser
globals
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['b'], factory);
} else if (typeof exports === 'object') {
// Node. Does not work with strict CommonJS, but
// only CommonJS‐like environments that support module.exports,
// like Node.
module.exports = factory(require('b'));
} else {
// Browser globals (root is window)
root.returnExports = factory(root.b);
}
}(this, function (b) {
//use b in some fashion.
// Just return a value to define the module export.
// This example returns an object, but the module
// can return a function as the exported value.
return {};
}));
https://github.com/umdjs/umd/blob/master/returnExports.js