This document discusses statement-level control structures in programming languages. It covers the evolution of control statements from FORTRAN to modern languages. Key topics include compound statements, selection statements like if/else and switch/case, and iterative statements like for, while, and do-while loops. The document analyzes design choices for these structures and provides examples from languages like ALGOL, Pascal, C, Java and others. It also discusses unconditional branching, guarded commands, and iteration based on data structures.
Decision making:
In CSharp, various types of decision making statements are available such as if..else, if..else..if, switch etc. Each statement is used to evaluate the specific test. If tests are determined to be true, specific statement will be execued for example : if(a > b) statement1 else statement2. Sometimes when develpoing program that requires to take the decision to execute specific part of program, decision making statement helps to do so.
Switch Case
In CSharp switch acts like a multiple if / else if / else chain. Checks a value against a list of cases, and executes the first case that is true. If no matching case found, it executes the default case. The break(optional) statements with case indicate to the interpreter to end the particular case.
n this presentation, Manoj K. has talked about “Regular Expression”. Here he has explained how Regular Expressions are used. He has covered all of the codes and what they are used for. The goal is to teach you how to use regular expressions once and for all.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: https://twitter.com/valuebound
Decision making:
In CSharp, various types of decision making statements are available such as if..else, if..else..if, switch etc. Each statement is used to evaluate the specific test. If tests are determined to be true, specific statement will be execued for example : if(a > b) statement1 else statement2. Sometimes when develpoing program that requires to take the decision to execute specific part of program, decision making statement helps to do so.
Switch Case
In CSharp switch acts like a multiple if / else if / else chain. Checks a value against a list of cases, and executes the first case that is true. If no matching case found, it executes the default case. The break(optional) statements with case indicate to the interpreter to end the particular case.
n this presentation, Manoj K. has talked about “Regular Expression”. Here he has explained how Regular Expressions are used. He has covered all of the codes and what they are used for. The goal is to teach you how to use regular expressions once and for all.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: https://twitter.com/valuebound
A grammar is said to be regular, if the production is in the form -
A → αB,
A -> a,
A → ε,
for A, B ∈ N, a ∈ Σ, and ε the empty string
A regular grammar is a 4 tuple -
G = (V, Σ, P, S)
V - It is non-empty, finite set of non-terminal symbols,
Σ - finite set of terminal symbols, (Σ ∈ V),
P - a finite set of productions or rules,
S - start symbol, S ∈ (V - Σ)
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
A grammar is said to be regular, if the production is in the form -
A → αB,
A -> a,
A → ε,
for A, B ∈ N, a ∈ Σ, and ε the empty string
A regular grammar is a 4 tuple -
G = (V, Σ, P, S)
V - It is non-empty, finite set of non-terminal symbols,
Σ - finite set of terminal symbols, (Σ ∈ V),
P - a finite set of productions or rules,
S - start symbol, S ∈ (V - Σ)
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
Java is a high-level programming language developed by Sun Microsystems. ... Instead, Java programs are interpreted by the Java Virtual Machine, or JVM, which runs on multiple platforms. This means all Java programs are multiplatform and can run on different platforms, including Macintosh, Windows, and Unix computers.
Types of Statements in Python Programming LanguageExplore Skilled
The slide describes the types of flow control statements in Python including conditional statement , loop statement , control statement such as break and continue .
Introduction to Annotations.
What are Annotations➔ Annotations are structured information added to program source code➔ Annotations associated meta-information with definitions➔ They can be attached to any variable, method, expression, or another program element Like comments, they can be sprinkled throughout a program➔ Unlike comments, they have structure, thus making them easier to machine process.
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/
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.
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.
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.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
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.
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
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
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.
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.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
8 statement-level control structure
1. ICS 313 - Fundamentals of Programming Languages 1
8. Statement-Level Control Structure
8.1 Introduction
Levels of Control Flow
Within expressions
Among program units
Among program statements
Evolution
FORTRAN I control statements were based directly on IBM 704 hardware
Much research and argument in the1960s about the issue
One important result: It was proven that all flowcharts can be coded with
only two-way selection and pretest logical loops
A control structure is a control statement and the statements whose
execution it controls
Overall Design Question
What control statements should a language have, beyond selection and
pretest logical loops?
2. ICS 313 - Fundamentals of Programming Languages 2
8.2 Compound statements
Introduced by ALGOL 60
A block is a compound statement that can define a
new scope (with local variables)
8.3 Selection Statements
Design Issues
What is the form and type of the control expression?
What is the selectable segment form (single statement, statement
sequence, compound statement)?
How should the meaning of nested selectors be specified?
Single-Way Examples
FORTRAN IF: IF (boolean_expr) statement
Problem: can select only a single statement; to select more, a GOTO must
be used, as in the following example
IF (.NOT. condition) GOTO 20
...
...
20 CONTINUE
Negative logic is bad for readability
This problem was solved in FORTRAN 77
Most later languages allow compounds for the selectable segment of their
single-way selectors
3. ICS 313 - Fundamentals of Programming Languages 3
8.3 Selection Statements (continued)
Two-way Selector Examples
ALGOL 60 if:
if (boolean_expr)
then statement (the then clause)
else statement (the else clause)
The statements could be single or compound
Nested Selectors
e.g. (Java)
if ...
if ...
...
else ...
Which if gets the else?
Java's static semantics rule: else goes with the nearest if
8.3 Selection Statements (continued)
ALGOL 60's solution - disallow direct nesting
if ... then if ... then
begin begin
if ... if ... then ...
then ... end
else ... else ...
end
FORTRAN 90 and Ada solution - closing special words
e.g. (Ada)
if ... then if ... then
if ... then if ... then
... ...
else end if
... else
end if ...
end if end if
Advantage: flexibility and readability
4. ICS 313 - Fundamentals of Programming Languages 4
8.3 Selection Statements (continued)
Multiple Selection Constructs
Design Issues
What is the form and type of the control expression?
What segments are selectable (single, compound, sequences)?
Is the entire construct encapsulated?
Is execution flow through the structure restricted to include just a
single selectable segment?
What is done about unrepresented expression values?
Early Multiple Selectors
FORTRAN arithmetic IF (a three-way selector) IF (arithmetic
expression) N1, N2, N3
Bad aspects
Not encapsulated (selectable segments could be anywhere)
Segments require GOTOs
FORTRAN computed GOTO and assigned GOTO
8.3 Selection Statements (continued)
Modern Multiple Selectors
Pascal case (from Hoare's contribution to ALGOL W)
case expression of
constant_list_1 : statement_1;
...
constant_list_n : statement_n
end
Design choices
Expression is any ordinal type (int, boolean, char, enum)
Segments can be single or compound
Construct is encapsulated
Only one segment can be executed per execution of the construct
In Wirth's Pascal, result of an unrepresented control expression value is undefined
(In 1984 ISO Standard, it is a runtime error)
Many dialects now have otherwise or else clause
5. ICS 313 - Fundamentals of Programming Languages 5
8.3 Selection Statements (continued)
The C, C++, and Java switch
switch (expression) {
constant_expression_1 : statement_1;
...
constant_expression_n : statement_n;
[default: statement_n+1]
}
Design Choices: (for switch)
Control expression can be only an integer type
Selectable segments can be statement sequences, blocks, or compound
statements
Construct is encapsulated
Any number of segments can be executed in one execution of the construct (there is
no implicit branch at the end of selectable segments) (a trade-off between reliability
and flexibility -- convenience)
To avoid it, the programmer must supply a break statement for each segment
default clause is for unrepresented values (if there is no default, the whole
statement does nothing)
8.3 Selection Statements (continued)
Ada's case is similar to Pascal's case, except:
Constant lists can include:
Subranges e.g., 10..15
Boolean OR operators
e.g., 1..5 | 7 | 15..20
Lists of constants must be exhaustive
Often accomplished with others clause
This makes it more reliable
Multiple Selectors can appear as direct extensions to two-way selectors, using
else-if clauses (ALGOL 68, FORTRAN 90, Ada)
Ada:
if ...
then ...
elsif ...
then ...
elsif ...
then ...
else ...
end if
Far more readable than deeply nested if's
Allows a Boolean gate on every selectable group
6. ICS 313 - Fundamentals of Programming Languages 6
8.4 Iterative Statements
The repeated execution of a statement or compound statement is
accomplished either by iteration or recursion; here we look at
iteration, because recursion is unit-level control
General design Issues for iteration control statements
How is iteration controlled?
Where is the control mechanism in the loop?
Counter-Controlled Loops
Design Issues
What are the type and scope of the loop var?
What is the value of the loop var at loop termination?
Should it be legal for the loop var or loop parameters to be changed in
the loop body, and if so, does the change affect loop control?
Should the loop parameters be evaluated only once, or once for every
iteration?
8.4 Iterative Statements (continued)
FORTRAN 90
Syntax: DO label var = start, finish [, stepsize]
Stepsize can be any value but zero
Parameters can be expressions
Design choices:
Loop var must be INTEGER
Loop var always has its last value
The loop var cannot be changed in the loop, but the parameters can;
because they are evaluated only once, it does not affect loop control
Loop parameters are evaluated only once
FORTRAN 90’s Other DO
Syntax
[name:] DO variable = initial, terminal [, stepsize]
…
END DO [name]
Loop var must be an INTEGER
7. ICS 313 - Fundamentals of Programming Languages 7
8.4 Iterative Statements (continued)
ALGOL 60
Syntax: for var := <list_of_stuff> do statement,
where <list_of_stuff> can have
list of expressions
expression step expression until expression
expression while boolean_expression
for index := 1 step 2 until 50,
60, 70, 80,
index + 1 until 100 do
(index = 1, 3, 5, 7, ..., 49, 60, 70, 80, 81, 82,
...,100)
ALGOL 60 Design choices
Control expression can be int or real; its scope is whatever it is
declared to be
Control var has its last assigned value after loop termination
The loop var cannot be changed in the loop, but the parameters can,
and when they are, it affects loop control
Parameters are evaluated with every iteration, making it very complex
and difficult to read
8.4 Iterative Statements (continued)
Pascal
Syntax:
for variable := initial (to | downto) final do statement
Design Choices
Loop var must be an ordinal type of usual scope
After normal termination, loop var is undefined
The loop var cannot be changed in the loop; the loop parameters can be changed, but they are
evaluated just once, so it does not affect loop control
Ada
Syntax:
for var in [reverse] discrete_range loop
...
end loop
Design choices
Type of the loop var is that of the discrete range; its scope is the loop body (it is implicitly
declared)
The loop var does not exist outside the loop
The loop var cannot be changed in the loop, but the discrete range can; it does not affect
loop control
The discrete range is evaluated just once
8. ICS 313 - Fundamentals of Programming Languages 8
8.4 Iterative Statements (continued)
C
Syntax
for ([expr_1] ; [expr_2] ; [expr_3]) statement
The expressions can be whole statements, or even statement
sequences, with the statements separated by commas
The value of a multiple-statement expression is the value of the last
statement in the expression e.g.,
for (i = 0, j = 10; j == i; i++) …
If the second expression is absent, it is an infinite loop
Design Choices:
There is no explicit loop var
Irrelevant
Everything can be changed in the loop
The first expression is evaluated once, but the other two are evaluated with each iteration
This loop statement is the most flexible
8.4 Iterative Statements (continued)
C++
Differs from C in two ways:
The control expression can also be Boolean
The initial expression can include variable definitions (scope is from the
definition to the end of the loop body)
Java
Differs from C++ in that the control expression must be
Boolean
9. ICS 313 - Fundamentals of Programming Languages 9
8.4 Iterative Statements (continued)
Logically-Controlled Loops
Design Issues
Pretest or postest?
Should this be a special case of the counting loop statement (or a separate
statement)?
Language Examples
Pascal has separate pretest and posttest logical loop statements (while-do and
repeat-until)
C and C++ also have both, but the control expression for the posttest version is
treated just like in the pretest case (while - do and do - while)
Java is like C, except the control expression must be Boolean (and the body can
only be entered at the beginning -- Java has no goto)
Ada has a pretest version, but no posttest
FORTRAN 77 and 90 have neither
Perl has two pretest logical loops, while and until, but no posttest logical loop
8.4 Iterative Statements (continued)
User-Located Loop Control Mechanisms
Design issues:
Should the conditional be part of the exit?
Should the mechanism be allowed in an already controlled loop?
Should control be transferable out of more than one loop?
Examples
Ada - conditional or unconditional; for any loop; any number of levels
for ... loop LOOP1:
... while ... loop
exit when ... ...
... LOOP2:
end loop for ... loop
...
exit LOOP1 when ..
...
end loop LOOP2;
...
end loop LOOP1;
10. ICS 313 - Fundamentals of Programming Languages 10
8.4 Iterative Statements (continued)
C , C++, and Java - break
Unconditional; for any loop or switch; one level only (except Java’s can have a
label)
There is also has a continue statement for loops; it skips the remainder of this
iteration, but does not exit the loop
FORTRAN 90 - EXIT
Unconditional; for any loop, any number of levels
FORTRAN 90 also has CYCLE, which has the same semantics as C's continue
Iteration Based on Data Structures
Concept: use order and number of elements of some data
structure to control iteration
Control mechanism is a call to a function that returns the next
element in some chosen order, if there is one; else exit loop
C's for can be used to build a user-defined iterator
e.g. for (p=hdr; p; p=next(p)) { ... }
Perl has a built-in iterator for arrays and hashes
e.g., foreach $name (@names) { print $name }
8.5 Unconditional Branching
Problem: readability
Some languages do not have them: e.g., Java
Loop exit statements are restricted and somewhat
camouflaged goto’s
Label forms
Unsigned int constants: Pascal (with colon)
FORTRAN (no colon)
Identifiers with colons: ALGOL 60, C
Identifiers in << ... >>: Ada
Variables as labels: PL/I
Can be assigned values and passed as parameters
Highly flexible, but make programs impossible to read and difficult to implement
11. ICS 313 - Fundamentals of Programming Languages 11
8.6 Guarded Commands
Dijkstra, 1975
Purpose: to support a new programming methodology (verification
during program development)
Selection: if <boolean> -> <statement>
[] <boolean> -> <statement>
...
[] <boolean> -> <statement>
fi
Semantics: when this construct is reached,
Evaluate all boolean expressions
If more than one are true, choose one nondeterministically
If none are true, it is a runtime error
Idea: if the order of evaluation is not important, the program should not
specify one
See book examples (pp. 339, 340)
8.6 Guarded Commands (continued)
Loops do <boolean> -> <statement>
[] <boolean> -> <statement>
...
[] <boolean> -> <statement>
od
Semantics: For each iteration
Evaluate all boolean expressions
If more than one are true, choose one nondeterministically; then start loop again
If none are true, exit loop
--> See book example (p. 340)
Connection between control statements and program verification is intimate
Verification is impossible with gotos
Verification is possible with only selection and logical pretest loops
Verification is relatively simple with only guarded commands
Chapter Conclusion: Choice of control statements beyond selection and logical
pretest loops is a trade-off between language size and writability