JavaScript String:
The String object lets you work with a series of characters; it wraps Javascript's string primitive data type with a number of helper methods.
As JavaScript automatically converts between string primitives and String objects, you can call any of the helper methods of the String object on a string primitive.
JavaScript Arrays:
The Array object lets you store multiple values in a single variable. It stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
In JavaScript, almost "everything" is an object.
-Booleans can be objects (if defined with the new keyword)
-Numbers can be objects (if defined with the new keyword)
-Strings can be objects (if defined with the new keyword)
-Dates are always objects
-Maths are always objects
-Regular expressions are always objects
-Arrays are always objects
-Functions are always objects
-Objects are always objects
What is the DOM?
The DOM is a W3C (World Wide Web Consortium) standard.
The DOM defines a standard for accessing documents:
"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
The W3C DOM standard is separated into 3 different parts:
Core DOM - standard model for all document types
XML DOM - standard model for XML documents
HTML DOM - standard model for HTML documents
The HTML DOM (Document Object Model)
When a web page is loaded, the browser creates a Document Object Model of the page.
The HTML DOM model is constructed as a tree of Objects.
With the HTML DOM, JavaScript can access and change all the elements of an HTML document.
JavaScript - Chapter 4 - Types and StatementsWebStackAcademy
A computer program is a list of "instructions" to be "executed" by a computer.
In a programming language, these programming instructions are called statements.
A JavaScript program is a list of programming statements.
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
JavaScript Data Types
JavaScript variables can hold many data types: numbers, strings, objects and more.
In programming, data types is an important concept.
To be able to operate on variables, it is important to know something about the type.
A JavaScript function is a block of code designed to perform a particular task.
Why Functions?
You can reuse code: Define the code once, and use it many times. You can use the same code many times with different arguments, to produce different results.
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:
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
String Function
1. charAt():
This method returns the character from the specified index.Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1.
Syntax:
string.charAt(index);
Return Value:
Returns the character from the specified index.
Example:
<html>
<head>
<title>JavaScript String charAt() Method</title>
</head>
<body>
</body>
</html>
Output:
str.charAt(0) is:T
2. concat():
Description:
This method adds two or more strings and returns a new single string.
Syntax:
string.concat(string2, string3[, ..., stringN]);
parameters:
string2...stringN : These are the strings to be concatenated.
Return Value:
Returns a single concatenated string.
Example:
<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
</body>
</html>
Output:
Concatenated String :This is string oneThis is string two.
3. indexOf():
Description:
This method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.indexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScript String indexOf() Method</title>
</head>
<body>
<br />");
var index = str1.indexOf( "one" );
document.write("indexOf found String :" + index );
</body></html>
Oputput:
indexOf found String :8
indexOf found String :15
4. lastIndexOf():
Description:
This method returns the index within the calling String object of the last occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.lastIndexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the last found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScri
JavaScript - Chapter 9 - TypeConversion and Regular Expressions WebStackAcademy
Type Conversion:
JavaScript is loosely typed language and most of the time operators automatically convert a value to the right type but there are also cases when we need to explicitly do type conversions.
While JavaScript provides numerous ways to convert data from one type to another but there are two most common data conversions :
Converting Values to String
Converting Values to Numbers
Regular Expressions:
A regular expression is an object that describes a pattern of characters.
The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on text.
We are covering following topics:
If...Else...Elseif Statements: if statement executes some code if one condition is true.
Switch Statement: Switch Statement tests a variable against a series of values.
For Loop: For loop executes a block of code a specified number of times.
While Loop: While loop executes a block of code as long as the specified condition is true.
Do…While Loop: Do...While loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.
JavaScript - Chapter 4 - Types and StatementsWebStackAcademy
A computer program is a list of "instructions" to be "executed" by a computer.
In a programming language, these programming instructions are called statements.
A JavaScript program is a list of programming statements.
JavaScript statements are composed of:
Values, Operators, Expressions, Keywords, and Comments.
This statement tells the browser to write "Hello Dolly." inside an HTML element with id="demo":
JavaScript Data Types
JavaScript variables can hold many data types: numbers, strings, objects and more.
In programming, data types is an important concept.
To be able to operate on variables, it is important to know something about the type.
A JavaScript function is a block of code designed to perform a particular task.
Why Functions?
You can reuse code: Define the code once, and use it many times. You can use the same code many times with different arguments, to produce different results.
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:
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
String Function
1. charAt():
This method returns the character from the specified index.Characters in a string are indexed from left to right. The index of the first character is 0, and the index of the last character in a string called stringName is stringName.length - 1.
Syntax:
string.charAt(index);
Return Value:
Returns the character from the specified index.
Example:
<html>
<head>
<title>JavaScript String charAt() Method</title>
</head>
<body>
</body>
</html>
Output:
str.charAt(0) is:T
2. concat():
Description:
This method adds two or more strings and returns a new single string.
Syntax:
string.concat(string2, string3[, ..., stringN]);
parameters:
string2...stringN : These are the strings to be concatenated.
Return Value:
Returns a single concatenated string.
Example:
<html>
<head>
<title>JavaScript String concat() Method</title>
</head>
<body>
</body>
</html>
Output:
Concatenated String :This is string oneThis is string two.
3. indexOf():
Description:
This method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.indexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScript String indexOf() Method</title>
</head>
<body>
<br />");
var index = str1.indexOf( "one" );
document.write("indexOf found String :" + index );
</body></html>
Oputput:
indexOf found String :8
indexOf found String :15
4. lastIndexOf():
Description:
This method returns the index within the calling String object of the last occurrence of the specified value, starting the search at fromIndex or -1 if the value is not found.
Syntax:
string.lastIndexOf(searchValue[, fromIndex])
Parameters:
searchValue : A string representing the value to search for.
fromIndex : The location within the calling string to start the search from. It can be any integer between 0 and the length of the string. The default value is 0.
Return Value:
Returns the index of the last found occurrence otherwise -1 if not found.
Example:
<html>
<head>
<title>JavaScri
JavaScript - Chapter 9 - TypeConversion and Regular Expressions WebStackAcademy
Type Conversion:
JavaScript is loosely typed language and most of the time operators automatically convert a value to the right type but there are also cases when we need to explicitly do type conversions.
While JavaScript provides numerous ways to convert data from one type to another but there are two most common data conversions :
Converting Values to String
Converting Values to Numbers
Regular Expressions:
A regular expression is an object that describes a pattern of characters.
The JavaScript RegExp class represents regular expressions, and both String and RegExp define methods that use regular expressions to perform powerful pattern-matching and search-and-replace functions on text.
We are covering following topics:
If...Else...Elseif Statements: if statement executes some code if one condition is true.
Switch Statement: Switch Statement tests a variable against a series of values.
For Loop: For loop executes a block of code a specified number of times.
While Loop: While loop executes a block of code as long as the specified condition is true.
Do…While Loop: Do...While loop will always execute the block of code once, it will then check the condition, and repeat the loop while the specified condition is true.
In this chapter we will explore strings. We are going to explain how they are implemented in C# and in what way we can process text content. Additionally, we will go through different methods for manipulating a text: we will learn how to compare strings, how to search for substrings, how to extract substrings upon previously settled parameters and last but not least how to split a string by separator chars. We will demonstrate how to correctly build strings with the StringBuilder class. We will provide a short but very useful information for the most commonly used regular expressions. We will discuss some classes for efficient construction of strings. Finally, we will take a look at the methods and classes for achieving more elegant and stricter formatting of the text content.
Webstack Academy - Course Demo Webinar and Placement JourneyWebStackAcademy
At WebStack Academy, we understand the importance of providing valuable insights to aspiring professionals like yourself. That's why we host monthly webinars tailored to address the needs of ambitious individuals. Led by our esteemed experts - Mr. Jayakumar (Director, WebStack Academy) and Mr. Mubeen (Technology Head, WebStack Academy), the presentation will offer a firsthand understanding of industry trends, career pathways, and how our Full Stack course can be the catalyst to realizing your career aspirations.
WSA: Scaling Web Service to Handle Millions of Requests per SecondWebStackAcademy
In this presentation of Venkata Ramana Gollamudi, Principal Architect at Flipkart, as our esteemed speaker. With his expertise and experience, he'll guide us through the intricate process of “Scaling web service to handle millions of requests per second”.
Key Takeaways:
Understanding the specific challenges of scaling for Indian users
Strategies to ensure service availability, reduce latency, and maintain reliability
Leveraging tools like ELBs, K8s, message queues, and NoSQL databases effectively
Don't miss this unparalleled opportunity to gain invaluable insights and elevate your expertise in scaling web services to new heights.
We eagerly await your participation in this transformative webinar. Let's embark on the journey to mastering scalability together!
WSA: Course Demo Webinar - Full Stack Developer CourseWebStackAcademy
At WebStack Academy, we understand the importance of providing valuable insights to aspiring professionals like yourself. We host monthly webinars tailored to address the needs of ambitious individuals. Led by our esteemed experts - Mr. Jayakumar (Director, WebStack Academy) and Mr. Mubeen (Technology Head, WebStack Academy), these webinars presentation deck offer a firsthand understanding of industry trends, career pathways, and how our Full Stack course can be the catalyst to realizing your career aspirations.
Career Building in AI - Technologies, Trends and OpportunitiesWebStackAcademy
We from WSA always believe in sharing the right information and enabling you to make decisions for your long term career.
In this regard, Masterclass Webinar on "Career Building in AI - Technologies, Trends and Opportunities” by Renganathan Sekar - Product Manager, Artificial Intelligence - Samsung Research Institute.
Key takeaways from this slide deck:
*Gain a comprehensive overview of AI and its wide range of applications.
*Explore real-world use cases that exemplify the incredible potential of AI.
*Delve into the core technologies driving AI innovation.
*Stay ahead of recent trends in AI, including the intriguing concept of Gen AI.
*Uncover a wealth of opportunities in the AI landscape.
*Learn effective strategies to up skill and advance your career in the AI industry.
WSA Free online Internship for Web Development is an Online real-time experience for Engineering students. It will take you through a journey of skill building and project building experience. You will understand the various product development phases and skills required to work on any Web Application product in Industry.
A guide designed to help you master the art of web development. The roadmap provides a comprehensive step-by-step guide to learn foundational web technologies like HTML, CSS, & JavaScript, advanced frameworks, and concepts required for modern web development. It aims to equip aspiring developers with the necessary resources and tools to excel in the ever-evolving world of web development. 💡
Angular - Chapter 9 - Authentication and AuthorizationWebStackAcademy
Authentication is the process of validating a user on the credentials (username and password)
and provide access to the web application(ex: Email)
Authorization helps you to control access rights by granting or denying specific permissions
to an authenticated user (Ex: User / Manager / Admin).
Http Service will help us fetch external data, post to it, etc. We need to import the http module to make use of the http service. Let us consider an example to understand how to make use of the http service.
AngularFire is the officially supported AngularJS binding for Firebase. ... The focus of this library is to abstract much of the boilerplate involved in creating Angular bindings from Firebase to Angular, and to make it easy to create services that sync to your database.
A directive is a custom HTML element that is used to extend the power of HTML. Angular 2 has the following directives that get called as part of the BrowserModule module.
ngif
ngFor
If you view the app.module.ts file, you will see the following code and the BrowserModule module defined. By defining this module, you will have access to the 2 directives.
Angular - Chapter 4 - Data and Event HandlingWebStackAcademy
In Angular , events such as button click or any other sort of events can also be handled very easily. The events get triggered from the html page and are sent across to Angular JS class for further processing.
Data binding is a core concept in Angular and allows to define communication between a component and the DOM, making it very easy to define interactive applications without worrying about pushing and pulling data. There are four forms of data binding and they differ in the way the data is flowing.
Components are the most basic UI building block of an Angular app. An Angular app contains a tree of Angular components.
Angular components are a subset of directives, always associated with a template. Unlike other directives, only one component can be instantiated per an element in a template.
A component must belong to an NgModule in order for it to be available to another component or application. To make it a member of an NgModule, list it in the declarations field of the NgModule metadata.
TypeScript lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. TypeScript is pure object oriented with classes, interfaces and statically typed like C# or Java. The popular JavaScript framework Angular 2.0 is written in TypeScript. Mastering TypeScript can help programmers to write object-oriented programs and have them compiled to JavaScript, both on server side and client side.
AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. AngularJS's data binding and dependency injection eliminate much of the code you would otherwise have to write. And it all happens within the browser, making it an ideal partner with any server technology.
Debugging in JavaScript
It is common to have errors while writing codes and the errors can be due to syntax or logical. These errors create a lot of ambiguity in the logic and understanding of both users and programmers. There can also be errors in the code which can remain invisible to the programmer’s eye and can create havoc. To identify these errors we need Debuggers that can go through the entire code or program, identify the errors and also fix them.
-Debugger
The debugger keyword is used in the code to force stop the execution of the code at a breaking point and calls the debugging function. The debugger function is executed if any debugging is needed at all else no action is performed.
Form validation normally used to occur at the server, after the client had entered all the necessary data and then pressed the Submit button. If the data entered by a client was incorrect or was simply missing, the server would have to send all the data back to the client and request that the form be resubmitted with correct information. This was really a lengthy process which used to put a lot of burden on the server.
JavaScript provides a way to validate form's data on the client's computer before sending it to the web server. Form validation generally performs two functions.
Basic Validation − First of all, the form must be checked to make sure all the mandatory fields are filled in. It would require just a loop through each field in the form and check for data.
Data Format Validation − Secondly, the data that is entered must be checked for correct form and value. Your code must include appropriate logic to test correctness of data.
The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser.
BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.screen object to show the width and height of the screen.
JavaScript Events:
HTML events are "things" that happen to HTML elements. When JavaScript is used in HTML pages, JavaScript can "react" on these events.
What can JavaScript Do?
Event handlers can be used to handle, and verify, user input, user actions, and browser actions:
Things that should be done every time a page loads
Things that should be done when the page is closed
Action that should be performed when a user clicks a button
Content that should be verified when a user inputs data
Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function will return a value.
In JavaScript, functions are first-class objects, because they can have properties and methods just like any other object. What distinguishes them from other objects is that functions can be called. In brief, they are Function objects.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
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.
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
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
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.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
4. www.webstackacademy.com ‹#›
What is String?
• String is a sequence of Unicode characters.
• Unicode characters are encoding standard that has widespread acceptance.
• Some of the most commonly used character encodings are
Encoding Description
UTF - 8 Widely used in email systems and on the internet.
UTF - 16 Used in windows, Java and by JavaScript, and often for plain text
and for word-processing data files on Windows.
UTF - 32 The mainly used in internal APIs where the data is single code
points or glyphs, rather than strings of characters.
6. www.webstackacademy.com ‹#›
Strings - Immutable
Example:
<script>
var str = “Hello World”;
str[0] = “h”;
console.log(str); //will be “Hello World”
</script>
• In JavaScript strings are immutable or unchangeable.
• An immutable object is an object whose state cannot be modified after it is created.
8. www.webstackacademy.com ‹#›
Strings Methods
Method Description
length Returns the length of the string
concat() Joins the string with one or more strings
trim() Removes the white spaces from beginning and end of the string
replace() Replaces old string with the new string
substring() Returns the part of string
substr() Returns the part of string
9. www.webstackacademy.com ‹#›
Strings Methods
Method Description
indexOf() Returns the position of specified word
lastIndexOf() Returns the last occurrence of specified word
slice() Returns the part of the string
split() Converts string into array
includes() Returns true if string includes the specified word.
10. www.webstackacademy.com ‹#›
The length() Method
The length method returns the size of the string.
Example :
var str = “Hello World”;
var len = str.length;
document.write(“Length of the string ” + len);
Syntax :
var length = string.length;
11. www.webstackacademy.com ‹#›
The concat() Method
The concat() method will join the string with one or more strings.
Syntax :
var str1 = str.concat(“hello”,” “,”World”);
or
var str2 = str.concat(str1,str2,str3…..strN);
12. www.webstackacademy.com ‹#›
The concat() Method
Example :
var str1 = “Hello World”;
var str2 = “Welcome”;
var concatString = str1.concat(“ ”, str2, ” “, “to WSA”);
document.write(“Concatenation of string” + concatString);
13. www.webstackacademy.com ‹#›
The trim() Method
The trim() method will remove the spaces from beginning and end of the
strings.
Syntax :
var result = string.trim();
Example :
var str1 = “ Hello World ”;
var trimmedString = str1.trim();
console.log (“After trim” +trimmedString);
14. www.webstackacademy.com ‹#›
The trimStart() or trimLeft() Method
The trimStart() or trimLeft() methods will remove the spaces from the
beginning of the strings.
Syntax :
var result = string.trimLeft();
Or
var result = string.trimStart();
15. www.webstackacademy.com ‹#›
The trimStart() or trimLeft() Method
Example :
var str1 = “ Hello World ”;
var trimmedStart = str1.trimStart();
var trimmedLeft = str1.trimLeft();
console.log(“After trim” +trimmedStart);
console.log(“<br>After trim” +trimmedLeft);
16. www.webstackacademy.com ‹#›
The trimEnd() or trimRight() Method
The trimEnd() or trimRight() methods will remove the spaces from the
beginning of the strings.
Syntax :
var result = string.trimEnd();
Or
var result = string.trimRight();
17. www.webstackacademy.com ‹#›
The trimEnd() or trimRight() Method
Example :
var str1 = “ Hello World ”;
var trimmedEnd = str1.trimEnd();
var trimmedRight = str1.trimRight();
console.log(“After trim” +trimmedEnd);
console.log(“<br>After trim” +trimmedRight);
18. www.webstackacademy.com ‹#›
The replace() Method
The replace() method will replace the specified string into new string.
Syntax :
var replacedStr = str.replace(‘string to replace’,’new string’);
Or
var replacedStr = str.replace(RegularExpression, ’new string’);
19. www.webstackacademy.com ‹#›
The replace() Method
Example 1:
var str1 =“Welcome to JS World”;
var repStr = str1.replace(‘JS’,’JavaScript’);
console.log(“Replaced String” +repStr);
Example 2:
var str =“A blue bottle with a blur liquid is on a blue table Blue”;
var replacedStr = str.replace(/blue/g, ”green”);
document.write(“After replace” +replacedStr);
20. www.webstackacademy.com ‹#›
The substring() Method
The substring() method will return the part of the strings.
Syntax :
var subStr = str.substring(startIndex, EndIndex);
Example :
var str1 =“Javascript World”;
var subStr = str1.substring(0,10);
document.write(“Subtring is: ” +subStr);
21. www.webstackacademy.com ‹#›
The substr() Method
The substr() method will return the part of the strings.
Syntax :
var subStr = str.substr(startIndex, numberOfCharacters);
Example :
var str1 =“Javascript World”;
var subStr = str1.substr(0,10);
document.write(“Subtring is: ” +subStr);
22. www.webstackacademy.com ‹#›
The indexOf() Method
The indexOf() method will return the position of first occurrence of the specified string
Syntax :
var index = str.indexOf(“string”);
Example :
var str1 =“Javascript World”;
var indexStr = str1.indexOf(“World”);
document.write(“Index of world” +indexStr);
23. www.webstackacademy.com ‹#›
The lastIndexOf() Method
The lastIndexOf() method will return the position of last occurrence of the specified string
Syntax :
var lastIndex = str.lastIndexOf(“string”);
Example :
var str1 =“Javascript World! Welcome to World”;
var lastIndex = str1.lastIndexOf(“World”);
document.write(“Last Index of world” +lastIndex);
24. www.webstackacademy.com ‹#›
Exercise
Write a JavaScript program to extract the user name and domain name.
• Accept email address from the user, extract the user name and the domain name, for
• example,
Input: abc.xyz@gmail.com
Output: username: abc.xyz
domain : gmail.com
25. www.webstackacademy.com ‹#›
The slice() Method
The slice() method will return the part of the strings.
Syntax :
var slicedStr = str.slice(startIndex, EndIndex);
Example :
var str =“Javascript world”;
var slicedStr = str.slice(1,5);
document.write(“Sliced String” +slicedStr);
26. www.webstackacademy.com ‹#›
The split() Method
The split() method will convert string into array of strings.
Syntax :
var splitStr = str.split(separator,limit);
Example :
var str =“Javascript world. Welcome to WSA”;
var splitStr = str.split(“ “)
document.write(“Array of string” +splitStr);
var splitLimit = str.split(“ “,2);
document.write(“Array of string” +splitLimit);
27. www.webstackacademy.com ‹#›
The includes() Method
The includes() method will true if string includes the specified word else returns the false.
Syntax :
var includesStr = str.includes(searchString, position);
Example :
var str = 'To be, or not to be, that is the question.';
console.log(str.includes('To be'));
console.log(str.includes('question',0));
console.log(str.includes('nonexistent'));
28. www.webstackacademy.com ‹#›
Exercise
www.webstackacademy.com ‹#›
Convert the given string into title case with following rules:
• Capitalize the first letter of each word. Capitalize nouns, pronouns, adjectives, verbs,
adverbs, and subordinate conjunctions.
• Lowercase articles (a, an, the), coordinating conjunctions, and prepositions (under,
between, over, on, at).
• Lowercase the 'to' in an infinitive (I want to play guitar).
Examples:
• How Are You Doing Today?
• Our Office between Metro and Barton Centre
• What Is the Need of This Expensive Phone?
29. www.webstackacademy.com ‹#›
Exercise
www.webstackacademy.com ‹#›
1. Count number of palindromes in a given string:
2. Special Palindrome
• In English we call a particular string as palindrome if it reads the same way from left and
right (ex: Malayalam, mom etc..)
• However there are some special kind of palindromes are there which will have:
1. Upper case characters
2. Special characters
3. Spaces in-between.
Examples:
1. "Madam, I’m Adam“
2. "A nut for a jar of tuna.“
3. "Are we not pure? “No, sir!” Panama’s moody Noriega brags. It is garbage!”
Irony dooms a man—a prisoner up to new era."
31. www.webstackacademy.com ‹#›
What is an Array?
Array is a collection of similar or different data types
Each data in array is called an element
Each elements has a numeric position, known as its index / indices, in the array
The index numbers start from zero
In JavaScript, Array is also an object. The typeof operator will return the same
Array object has length property which returns the total number of elements
33. www.webstackacademy.com ‹#›
Array
(Syntax – Using constructor)
Syntax :
var array-name = new Array(item1, item2, item3);
Or
var array-name = Array(item1, item2, item3);
Or
var array-name = Array(array-length);
34. www.webstackacademy.com ‹#›
Array - Example
Example :
var array = [10, 20, 30, 40, 50];
Or
var array = new Array(10, 20, 30, 40, 50);
Or
var array = Array(3);
35. www.webstackacademy.com ‹#›
Array Access – Using loop
for ( let idx = 0; idx < 5; idx++ ) {
document.write(“Element at index ” + idx + “ is ” + myArray[idx]);
}
for ( let idx in myArray ) {
document.write(“Element at index ” + idx + “ is ” + myArray[idx]);
}
36. www.webstackacademy.com ‹#›
Array - Heterogeneous
Each element in an array can be of different types
var mixArray = [“Student”, 95, true];
for(let idx = 0; idx < 3; idx++) {
console.log (mixArray[idx]);
}
37. www.webstackacademy.com ‹#›
Exercise
WAP to create an array with 10 integers and find out the following:
Sum of all number
Average
Maximum value & Minimum value
WAP to reverse an array elements.
39. www.webstackacademy.com ‹#›
Array Methods
Method Description
join() Concatenates all the elements of array into string
pop() Deletes last element of an array
push() Appends new element in the last of array
sort() Sorts an array in alphabetical order
reverse() Reverses array elements order in the array
40. www.webstackacademy.com ‹#›
Array Methods
Method Description
shift() Removes first element from the array and shifts all other element
to a lower index
unshift() Unshift method adds elements to the beginning of an array and
return new length of array
slice() The array slice method returns part of an array
splice() The array splice method can be used for adding and/or removing
elements from an array
41. www.webstackacademy.com ‹#›
Array Methods
Method Description
Filter() Creates a new array with all elements that pass the test
implemented by the provided function.
map() Creates a new array with the results of calling a provided function
on each element in the calling array.
42. www.webstackacademy.com ‹#›
The join() Method
The join() method converts all the elements of an array to strings and
concatenates them, returning the resulting string
It behaves like toString(), but we can specify separator
Example :
var fruits = ["Banana", "Orange","Apple", "Mango"];
var str = fruits.join(" + ");
document.write(str);
43. www.webstackacademy.com ‹#›
The push() and pop() methods
Stack operations – LIFO
var numStack = [10, 20, 30, 40, 50];
numStack.pop(); // Pop an element
for (let idx=0; idx <numStack.length; idx++) {
document.write(numStack[idx] + "<br>");
}
numStack.push(100); // Push an element
for (let idx=0; idx <numStack.length; idx++) {
document.write(numStack[idx] + "<br>");
}
44. www.webstackacademy.com ‹#›
The shift() methods
Example:
var array1 = [1, 2, 3];
var firstElement = array1.shift();
console.log(array1);// expected output: Array [2, 3]
console.log(firstElement);// expected output: 1
The shift() method removes the first element from an array and returns
that removed element.
Syntax
array.shift();
45. www.webstackacademy.com ‹#›
The unshift() methods
Example:
var array1 = [1, 2, 3];
array1.unshift(2);
console.log(array1);
array1.unshift(5,8);
console.log(array1);
The unshift() method adds one or more elements to the beginning of an
array and returns the new length of the array.
Syntax
array.unshift();
46. www.webstackacademy.com ‹#›
The sort() Method
The sort() method sorts an array in alphabetic order
var numList = [‘banana’, ‘apple’, ‘mango’, ‘grapes’];
numList.sort();
for (let idx = 0; idx < numList.length; idx++){
document.write(numList[idx] + "<br>");
}
47. www.webstackacademy.com ‹#›
The reverse() Method
The reverse() method reverses the elements in an array
var numList = [55, 3, 16, 21];
numList.reverse();
for(let idx = 0; idx < numList.length; idx++){
document.write(numList[idx] + "<br>");
}
48. www.webstackacademy.com ‹#›
Exercise
WAP to represent two sets of integers. Find out union and intersection of those two
sets (Ref – Set theory)
Assume there are duplicates in the array
Hint – Write a findElement() function to check if an element is present in an array or not
• WAP to find Nth largest element in a given array
• WAP to perform shift operations of a given element
Shift Nth element by right by M positions
Shift Nth element by left by M positions
50. www.webstackacademy.com ‹#›
Thesplice() Method
var ar = [1, 4, 9, 10, 11, 16];
ar.splice(1,3);// will remove the elements
console.log(ar);
ar.splice(1,0,5);// will insert the element 5 at index 1
console.log(ar);
www.webstackacademy.com ‹#›
53. www.webstackacademy.com ‹#›
Thefilter() Method
www.webstackacademy.com ‹#›
Filter() method creates a new array with all elements that pass the test implemented
by the provided function.
Syntax:
var new_array =
current_array.filter(function(currentItem,index,array)
{
//Application Logic to filter current array items
//return items for new array
});
54. www.webstackacademy.com ‹#›
Thefilter() Method
Example:
var words = ['limit', 'elite', 'exuberant', 'destruction‘];
function word(elem) {
return elem.length > 6;
}
var result = words.filter(word);
console.log(result);
// expected output: Array ["exuberant", "destruction“];
www.webstackacademy.com ‹#›
55. www.webstackacademy.com ‹#›
Exercise
www.webstackacademy.com ‹#›
Write a JavaScript program to squeeze a word in given sentence.
For example:
1. Input : what is what so what
Output: what is so
2. Input : I mean they can't be so mean
Output : I mean they can't be so
3. Input : Butler bought bitter butter but he made it as a better butter by adding
sweeter butter
Output : Butler bought bitter butter but he made it as a better by adding sweeter
56. www.webstackacademy.com ‹#›
Themap() Method
www.webstackacademy.com ‹#›
The map() method creates a new array with the results of calling a provided
function on each element in the calling array.
Syntax:
var new_array = current_array.map(function(currentItem, index, array) {
//Application Logic
//Return elements for new array
});
57. www.webstackacademy.com ‹#›
Themap() Method
Example:
var curArray = [1, 4, 9, 16];// pass a function to map
var doubleArray = curArray.map(doubleItem);
function doubleItem(currentItem) {
return 2 * currentItem;
}
console.log(doubleArray);
www.webstackacademy.com ‹#›
61. www.webstackacademy.com ‹#›
Exercise
WAP to find out sum of diagonal elements in a 2D array
WAP to find max and min value in a given row
WAP to multiply two matrix using 2D arrays