This document discusses code optimization and performance tuning. It covers identifying the time and space complexity of algorithms, examining programming constructs like loops and branches, and using performance libraries. The objectives are to learn how to optimize code by reducing complexity, tuning programming constructs, and leveraging performance libraries.
The document discusses variables, constants, data types, operators, and representing decisions in flowcharts. It provides examples of flowcharts that accept input values, perform calculations using variables and operators, and make decisions based on conditional logic. The key concepts covered include declaring variables, numeric and character data types, arithmetic, relational and logical operators, and using decision boxes in flowcharts to represent conditional statements. Exercises are included to apply these concepts in drawing flowcharts to solve problems involving decisions and calculations.
The document discusses using dry run tables and iteration in programming logic and techniques. It provides examples of using dry run tables to step through sample data and evaluate program output. It also provides examples of using iteration and loops to repeatedly perform steps, such as summing a series of numbers or collecting details from a list of employees. The document demonstrates creating flowcharts to represent iterative logic and using dry run tables to test sample data.
The document discusses iterations, modular programming, and flowcharts. It explains how to use dry run tables to evaluate a program's logic and output. It also describes how to represent repetitive processes and complex conditions using loops and modular structures in flowcharts. Breaking problems into smaller modules is an important part of the structured programming technique.
This document discusses representing the logic of programs with conditions using flowcharts. It covers variables, constants, data types, operators, and decision structures. Examples are provided to demonstrate how to represent accepting input, performing calculations, and making conditional decisions in a flowchart. Key topics include declaring variables, arithmetic, relational and logical operators, and using decision boxes to apply conditions.
This document introduces flowcharts and their components. It explains that a computer system involves input, processing, and output phases. A program is a set of instructions to perform a task, and flowcharts use symbols to represent the steps graphically. Common flowchart symbols are introduced for inputs, outputs, decisions, and other elements. Simple examples of flowcharts are provided for making tea, manipulating numbers, and calculating sales.
(chapter 3) A Concise and Practical Introduction to Programming Algorithms in...Frank Nielsen
These are the slides accompanying the textbook:
A Concise and Practical Introduction to Programming Algorithms in Java
by Frank Nielsen
Published by Springer-Verlag (2009), Undergraduate textbook in computer science (UTiCS series)
ISBN: 978-1-84882-338-9
http://www.lix.polytechnique.fr/~nielsen/JavaProgramming/
http://link.springer.com/book/10.1007%2F978-1-84882-339-6
This document provides an overview of various scientific programming models for distributed computing. It introduces reference parallel programming models like MPI and OpenMP, and discusses their strengths and weaknesses. Novel programming models are also covered, such as Microsoft Dryad, MapReduce, and COMP Superscalar (COMPSs). The document concludes that while scientific problems are complex, reference models are often unsuitable, leading to new flexible models that aim to simplify programming workflows for distributed systems.
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
The document introduces Dao, a new programming language for bioinformatics. It discusses Dao's key features like optional typing, native support for concurrent programming, an LLVM-based JIT compiler, simple C interfaces, and the ClangDao tool for wrapping C/C++ libraries. An example demonstrates using thread tasks and futures for concurrent programming. The document outlines future plans to develop BioDao, an open source project providing bioinformatics modules to the Dao language.
The document discusses variables, constants, data types, operators, and representing decisions in flowcharts. It provides examples of flowcharts that accept input values, perform calculations using variables and operators, and make decisions based on conditional logic. The key concepts covered include declaring variables, numeric and character data types, arithmetic, relational and logical operators, and using decision boxes in flowcharts to represent conditional statements. Exercises are included to apply these concepts in drawing flowcharts to solve problems involving decisions and calculations.
The document discusses using dry run tables and iteration in programming logic and techniques. It provides examples of using dry run tables to step through sample data and evaluate program output. It also provides examples of using iteration and loops to repeatedly perform steps, such as summing a series of numbers or collecting details from a list of employees. The document demonstrates creating flowcharts to represent iterative logic and using dry run tables to test sample data.
The document discusses iterations, modular programming, and flowcharts. It explains how to use dry run tables to evaluate a program's logic and output. It also describes how to represent repetitive processes and complex conditions using loops and modular structures in flowcharts. Breaking problems into smaller modules is an important part of the structured programming technique.
This document discusses representing the logic of programs with conditions using flowcharts. It covers variables, constants, data types, operators, and decision structures. Examples are provided to demonstrate how to represent accepting input, performing calculations, and making conditional decisions in a flowchart. Key topics include declaring variables, arithmetic, relational and logical operators, and using decision boxes to apply conditions.
This document introduces flowcharts and their components. It explains that a computer system involves input, processing, and output phases. A program is a set of instructions to perform a task, and flowcharts use symbols to represent the steps graphically. Common flowchart symbols are introduced for inputs, outputs, decisions, and other elements. Simple examples of flowcharts are provided for making tea, manipulating numbers, and calculating sales.
(chapter 3) A Concise and Practical Introduction to Programming Algorithms in...Frank Nielsen
These are the slides accompanying the textbook:
A Concise and Practical Introduction to Programming Algorithms in Java
by Frank Nielsen
Published by Springer-Verlag (2009), Undergraduate textbook in computer science (UTiCS series)
ISBN: 978-1-84882-338-9
http://www.lix.polytechnique.fr/~nielsen/JavaProgramming/
http://link.springer.com/book/10.1007%2F978-1-84882-339-6
This document provides an overview of various scientific programming models for distributed computing. It introduces reference parallel programming models like MPI and OpenMP, and discusses their strengths and weaknesses. Novel programming models are also covered, such as Microsoft Dryad, MapReduce, and COMP Superscalar (COMPSs). The document concludes that while scientific problems are complex, reference models are often unsuitable, leading to new flexible models that aim to simplify programming workflows for distributed systems.
L Fu - Dao: a novel programming language for bioinformaticsJan Aerts
The document introduces Dao, a new programming language for bioinformatics. It discusses Dao's key features like optional typing, native support for concurrent programming, an LLVM-based JIT compiler, simple C interfaces, and the ClangDao tool for wrapping C/C++ libraries. An example demonstrates using thread tasks and futures for concurrent programming. The document outlines future plans to develop BioDao, an open source project providing bioinformatics modules to the Dao language.
This document is a laboratory manual for digital signal processing experiments using MATLAB and a DSP chip. It contains an introduction to MATLAB and lists 16 experiments using MATLAB and 11 experiments using a DSP chip. The experiments cover topics like DFT, convolution, filtering, sampling, and impulse responses. The manual was prepared by faculty of the electronics and communication engineering department to help students learn and apply DSP concepts.
Algorithm and C code related to data structureSelf-Employed
Everything lies inside an algorithm in the world of coding and algorithm formation which is the basis of data structure and manipulation of the algorithm in computer science and information technology which is ultimately used to find a particular problems solution
Inter thread communication & runnable interfacekeval_thummar
Inter-thread communication allows threads to pause execution in critical sections and allow other threads to enter those sections. It uses the wait(), notify(), and notifyAll() methods of the Object class. wait() pauses a thread until another calls notify() or notifyAll(), notify() wakes one waiting thread, and notifyAll() wakes all waiting threads. The Runnable interface provides a common protocol for objects to execute code while active. To create a thread using Runnable, a class implements Runnable and defines a run() method, a Thread object is created passing the Runnable, and start() is called to execute run().
IJERA (International journal of Engineering Research and Applications) is International online, ... peer reviewed journal. For more detail or submit your article, please visit www.ijera.com
Use of an Oscilloscope - maXbox Starter33Max Kleiner
This is an oscilloscope introduction that uses several sources for input. My hope is that it encourages a few future scientists to experiment and get into touch with new waves ~.
Oscilloscopes are one of the few pieces of electronic equipment that plays multiple roles and can be used in the place of other electronics equipment.
This document discusses intentional software and its goal of separating domain knowledge (A) from implementation (B) to reduce complexity. It provides context on the history of software development from the 1950s to present. Key figures discussed include John von Neumann, John Backus, Grace Hopper, John McCarthy, and Peter Naur who developed early domain-specific languages and programming concepts. The founder of Intentional Software, Charles Simonyi, is also introduced for his work developing early graphical editors and research on intentional programming.
Multivariable Control System Design for Quadruple Tank Process using Quantita...IDES Editor
This paper focus on design of multivariable
controller for Quadruple Tank Process, a two input two
output system with large plant uncertainty using QFT
methodology. In the present work, a new approach using
Quantitative Feedback Theory (QFT) is formulated for
design of a robust two degree of freedom controller for
Quadruple Tank Process. The design is done in frequency
domain. This paper presents a design method for a 2 x 2
multiple input multiple output system. The plant
uncertainties are transformed into equivalent external
disturbance sets, and the design problem becomes one of
the external disturbance attenuation. The objective is to
find compensator functions which guarantee that the
system performance bounds are satisfied over the range
of plant uncertainty. The methodology is successfully
applied to design a two degree of freedom compensator
Quadruple Tank Process.
1) The presentation discusses Caffeine, a tool for dynamic analysis of Java programs that uses Prolog predicates to model execution events and perform analyses.
2) Caffeine models execution events like field accesses, method calls, and class loads. Queries can be written in Prolog to analyze program behavior, like counting method calls.
3) The implementation has performance issues due to overhead from event generation, requiring instrumentation tricks. Analyzing complex relationships like composition is discussed.
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...Frank Nielsen
This document discusses classes and objects in Java. It introduces the concept of constructors, which are used to initialize objects when they are created using the new keyword. Constructors do not return a value but instead assign values to the object's fields using the this keyword. The document provides examples of Date and Student classes that define fields to represent date and student data, and constructors to initialize those fields. It also discusses multiple constructors, static vs non-static variables, and memory management related to objects and arrays.
This document discusses Java methods and provides examples of method declarations and usage. Key points include:
- Methods allow programmers to modularize programs into reusable pieces of code.
- The general format for declaring a method includes specifying the return type, method name, and parameters.
- Methods can return values using the return statement.
- The Math class contains commonly used methods like sqrt() and max() for mathematical operations.
- Examples demonstrate declaring and calling methods to calculate squares of integers, find the maximum of three numbers, and generate random numbers.
This presentation discusses code optimization and performance tuning. It covers identifying time and space complexity of algorithms, examining programming constructs like loops and functions, and using performance libraries. Some key points include defining time complexity as the time taken by algorithm steps, optimizing loops by techniques like unrolling and reducing work inside loops, and the advantages of using pre-existing performance libraries like reducing errors and development time.
The document discusses algorithm analysis and complexity analysis. It introduces big-O notation to classify algorithms based on how their runtime scales with input size. Common complexity classes include constant, logarithmic, linear, quadratic, and exponential time. The document explains how to determine the time complexity of algorithms by analyzing basic operations and ignoring constant factors. Loops are particularly important, as their runtime is determined by the number of iterations.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
The document discusses using Intel VTune to analyze application performance through event-based sampling and call graphs. It provides guidance on configuring and using these VTune features to identify inefficient functions and critical paths. Specifically, it describes helping Jim use event-based sampling to analyze why a list deletion operation is slow and use call graphs to find high cost functions in a number sorting application.
This document discusses various operators in C programming, including:
- Relational, logical, unary, binary, ternary, and compound assignment operators
- Examples of using logical, unary, binary, and ternary operators
- Practice questions and answers about using different operators
- Compound assignment operators can make code more concise by combining operations like addition with assignment
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
This document provides an overview of programming in C and functions. It discusses implementing modular approaches using functions, parameters and return values of functions, passing arrays and command line arguments to functions, and using library functions for string manipulation and converting data types. Examples and practice problems are provided relating to defining and calling functions, passing arguments by value and reference, and using standard string and numeric conversion functions. The overall aim is to teach how to work with functions and data types in C programming.
CSCE 509 – Spring 2019
Assignment 3 // updated 01May19
DUE: May 11, 2019 at 5 p.m.
• Two data sets available on Moodle
o {concaveData.npy, concaveTarget.npy}
o {testData.npy, testTarget.npy}
• Write TensorFlow code to perform DNN classification with three (3) classes
• Use concave*.npy for training
• Use test*.npy for test
• Data is the data matrix; Target is the labeled targets from {0, 1, 2}
• Do each of the following steps. For each step: Note the accuracy of the classification using
the test data set. Discuss the results.
1. Write TensorFlow code to perform DNN classification using default settings. Define your
own architecture with two hidden layers. Calculate the number of parameters in your
network. Do not let the number of parameters exceed the number of input samples in
concave*.npy
2. Use one or two additional layers compared to (1) but be sure that the number of
parameters do not exceed the number of input samples. Which has better accuracy
performance? Or are they about the same?
3. Write Python code to read in the data sets. Add a large constant (such as “509” or “5090”)
to each input feature. Write the data sets as files, to be read in as input sets. Repeat the
classification using the new input files with the architecture that has better performance
in (1) or (2). What is the accuracy performance for the same number of epochs? If the
accuracy performance is about the same, does it converge faster or slower or about the
same?
4. Use the given data sets as used in (1) and (2). Use either of the two architectures. Change
the tf.layers.dense() function initlialization to He initialization by using the
variance_scaling_initializer() function:
he_init = tf.contrib.layers.variance_scaling_initializer(factor=2.0)
hidden1 = tf.layers.dense(X, n_hidden1, activation=tf.nn.relu,
kernel_initializer=he_init, name=”hidden1”)
# do the same for other hidden layers
What is the accuracy performance? Compare to either (1) or (2).
5. Take the architecture from either (1) or (2). Replace the relu activation function by the
exponential linear unit (ELU). In the tf.layers.dense function, use
activation=tf.nn.elu
What is the accuracy performance? Compare to either (1) or (2) and to (4).
6. Perform batch normalization on either (1) or (2) as follows. We want to zero-center and
normalize the inputs to the activation function of each layer by learning the mean and
scales of the inputs for each layer. Modify the Python code as follows:
X = tf.placeholder(tf.float32, shape=(None, n_inputs), name=”X”)
training = tf.placeholder_with_default(False, shape=(), name=”training”)
Then in defining the hidden layers:
hidden1 = tf.layers.dense(X, n_hidden1, name=”hidden1”)
batchnorm1 = tf.layers.batch_normalization(hidden1, training=training,
momentum=0.9)
bn1_act = tf.nn.elu(batchnorm1)
hidden2 = tf.layers.dense(bn1_act, n_hidden2, name=”hidden2”)
batchnorm2 = tf.layers.batch_normalization.
This document is a laboratory manual for digital signal processing experiments using MATLAB and a DSP chip. It contains an introduction to MATLAB and lists 16 experiments using MATLAB and 11 experiments using a DSP chip. The experiments cover topics like DFT, convolution, filtering, sampling, and impulse responses. The manual was prepared by faculty of the electronics and communication engineering department to help students learn and apply DSP concepts.
Algorithm and C code related to data structureSelf-Employed
Everything lies inside an algorithm in the world of coding and algorithm formation which is the basis of data structure and manipulation of the algorithm in computer science and information technology which is ultimately used to find a particular problems solution
Inter thread communication & runnable interfacekeval_thummar
Inter-thread communication allows threads to pause execution in critical sections and allow other threads to enter those sections. It uses the wait(), notify(), and notifyAll() methods of the Object class. wait() pauses a thread until another calls notify() or notifyAll(), notify() wakes one waiting thread, and notifyAll() wakes all waiting threads. The Runnable interface provides a common protocol for objects to execute code while active. To create a thread using Runnable, a class implements Runnable and defines a run() method, a Thread object is created passing the Runnable, and start() is called to execute run().
IJERA (International journal of Engineering Research and Applications) is International online, ... peer reviewed journal. For more detail or submit your article, please visit www.ijera.com
Use of an Oscilloscope - maXbox Starter33Max Kleiner
This is an oscilloscope introduction that uses several sources for input. My hope is that it encourages a few future scientists to experiment and get into touch with new waves ~.
Oscilloscopes are one of the few pieces of electronic equipment that plays multiple roles and can be used in the place of other electronics equipment.
This document discusses intentional software and its goal of separating domain knowledge (A) from implementation (B) to reduce complexity. It provides context on the history of software development from the 1950s to present. Key figures discussed include John von Neumann, John Backus, Grace Hopper, John McCarthy, and Peter Naur who developed early domain-specific languages and programming concepts. The founder of Intentional Software, Charles Simonyi, is also introduced for his work developing early graphical editors and research on intentional programming.
Multivariable Control System Design for Quadruple Tank Process using Quantita...IDES Editor
This paper focus on design of multivariable
controller for Quadruple Tank Process, a two input two
output system with large plant uncertainty using QFT
methodology. In the present work, a new approach using
Quantitative Feedback Theory (QFT) is formulated for
design of a robust two degree of freedom controller for
Quadruple Tank Process. The design is done in frequency
domain. This paper presents a design method for a 2 x 2
multiple input multiple output system. The plant
uncertainties are transformed into equivalent external
disturbance sets, and the design problem becomes one of
the external disturbance attenuation. The objective is to
find compensator functions which guarantee that the
system performance bounds are satisfied over the range
of plant uncertainty. The methodology is successfully
applied to design a two degree of freedom compensator
Quadruple Tank Process.
1) The presentation discusses Caffeine, a tool for dynamic analysis of Java programs that uses Prolog predicates to model execution events and perform analyses.
2) Caffeine models execution events like field accesses, method calls, and class loads. Queries can be written in Prolog to analyze program behavior, like counting method calls.
3) The implementation has performance issues due to overhead from event generation, requiring instrumentation tricks. Analyzing complex relationships like composition is discussed.
(chapter 5) A Concise and Practical Introduction to Programming Algorithms in...Frank Nielsen
This document discusses classes and objects in Java. It introduces the concept of constructors, which are used to initialize objects when they are created using the new keyword. Constructors do not return a value but instead assign values to the object's fields using the this keyword. The document provides examples of Date and Student classes that define fields to represent date and student data, and constructors to initialize those fields. It also discusses multiple constructors, static vs non-static variables, and memory management related to objects and arrays.
This document discusses Java methods and provides examples of method declarations and usage. Key points include:
- Methods allow programmers to modularize programs into reusable pieces of code.
- The general format for declaring a method includes specifying the return type, method name, and parameters.
- Methods can return values using the return statement.
- The Math class contains commonly used methods like sqrt() and max() for mathematical operations.
- Examples demonstrate declaring and calling methods to calculate squares of integers, find the maximum of three numbers, and generate random numbers.
This presentation discusses code optimization and performance tuning. It covers identifying time and space complexity of algorithms, examining programming constructs like loops and functions, and using performance libraries. Some key points include defining time complexity as the time taken by algorithm steps, optimizing loops by techniques like unrolling and reducing work inside loops, and the advantages of using pre-existing performance libraries like reducing errors and development time.
The document discusses algorithm analysis and complexity analysis. It introduces big-O notation to classify algorithms based on how their runtime scales with input size. Common complexity classes include constant, logarithmic, linear, quadratic, and exponential time. The document explains how to determine the time complexity of algorithms by analyzing basic operations and ignoring constant factors. Loops are particularly important, as their runtime is determined by the number of iterations.
This presentation is part of training session delivered during Train The Trainer (TOT) program on Embedded Software Engineer job role supported by ESSCI.
The document discusses using Intel VTune to analyze application performance through event-based sampling and call graphs. It provides guidance on configuring and using these VTune features to identify inefficient functions and critical paths. Specifically, it describes helping Jim use event-based sampling to analyze why a list deletion operation is slow and use call graphs to find high cost functions in a number sorting application.
This document discusses various operators in C programming, including:
- Relational, logical, unary, binary, ternary, and compound assignment operators
- Examples of using logical, unary, binary, and ternary operators
- Practice questions and answers about using different operators
- Compound assignment operators can make code more concise by combining operations like addition with assignment
Building High-Performance Language Implementations With Low EffortStefan Marr
This talk shows how languages can be implemented as self-optimizing interpreters, and how Truffle or RPython go about to just-in-time compile these interpreters to efficient native code.
Programming languages are never perfect, so people start building domain-specific languages to be able to solve their problems more easily. However, custom languages are often slow, or take enormous amounts of effort to be made fast by building custom compilers or virtual machines.
With the notion of self-optimizing interpreters, researchers proposed a way to implement languages easily and generate a JIT compiler from a simple interpreter. We explore the idea and experiment with it on top of RPython (of PyPy fame) with its meta-tracing JIT compiler, as well as Truffle, the JVM framework of Oracle Labs for self-optimizing interpreters.
In this talk, we show how a simple interpreter can reach the same order of magnitude of performance as the highly optimizing JVM for Java. We discuss the implementation on top of RPython as well as on top of Java with Truffle so that you can start right away, independent of whether you prefer the Python or JVM ecosystem.
While our own experiments focus on SOM, a little Smalltalk variant to keep things simple, other people have used this approach to improve peek performance of JRuby, or build languages such as JavaScript, R, and Python 3.
This document provides an overview of programming in C and functions. It discusses implementing modular approaches using functions, parameters and return values of functions, passing arrays and command line arguments to functions, and using library functions for string manipulation and converting data types. Examples and practice problems are provided relating to defining and calling functions, passing arguments by value and reference, and using standard string and numeric conversion functions. The overall aim is to teach how to work with functions and data types in C programming.
CSCE 509 – Spring 2019
Assignment 3 // updated 01May19
DUE: May 11, 2019 at 5 p.m.
• Two data sets available on Moodle
o {concaveData.npy, concaveTarget.npy}
o {testData.npy, testTarget.npy}
• Write TensorFlow code to perform DNN classification with three (3) classes
• Use concave*.npy for training
• Use test*.npy for test
• Data is the data matrix; Target is the labeled targets from {0, 1, 2}
• Do each of the following steps. For each step: Note the accuracy of the classification using
the test data set. Discuss the results.
1. Write TensorFlow code to perform DNN classification using default settings. Define your
own architecture with two hidden layers. Calculate the number of parameters in your
network. Do not let the number of parameters exceed the number of input samples in
concave*.npy
2. Use one or two additional layers compared to (1) but be sure that the number of
parameters do not exceed the number of input samples. Which has better accuracy
performance? Or are they about the same?
3. Write Python code to read in the data sets. Add a large constant (such as “509” or “5090”)
to each input feature. Write the data sets as files, to be read in as input sets. Repeat the
classification using the new input files with the architecture that has better performance
in (1) or (2). What is the accuracy performance for the same number of epochs? If the
accuracy performance is about the same, does it converge faster or slower or about the
same?
4. Use the given data sets as used in (1) and (2). Use either of the two architectures. Change
the tf.layers.dense() function initlialization to He initialization by using the
variance_scaling_initializer() function:
he_init = tf.contrib.layers.variance_scaling_initializer(factor=2.0)
hidden1 = tf.layers.dense(X, n_hidden1, activation=tf.nn.relu,
kernel_initializer=he_init, name=”hidden1”)
# do the same for other hidden layers
What is the accuracy performance? Compare to either (1) or (2).
5. Take the architecture from either (1) or (2). Replace the relu activation function by the
exponential linear unit (ELU). In the tf.layers.dense function, use
activation=tf.nn.elu
What is the accuracy performance? Compare to either (1) or (2) and to (4).
6. Perform batch normalization on either (1) or (2) as follows. We want to zero-center and
normalize the inputs to the activation function of each layer by learning the mean and
scales of the inputs for each layer. Modify the Python code as follows:
X = tf.placeholder(tf.float32, shape=(None, n_inputs), name=”X”)
training = tf.placeholder_with_default(False, shape=(), name=”training”)
Then in defining the hidden layers:
hidden1 = tf.layers.dense(X, n_hidden1, name=”hidden1”)
batchnorm1 = tf.layers.batch_normalization(hidden1, training=training,
momentum=0.9)
bn1_act = tf.nn.elu(batchnorm1)
hidden2 = tf.layers.dense(bn1_act, n_hidden2, name=”hidden2”)
batchnorm2 = tf.layers.batch_normalization.
Teasing talk for Flow-based programming made easy with PyF 2.0Jonathan Schemoul
The document discusses PyF, a Python dataflow processing framework. It describes dataflow programming as a paradigm where data items pass through a network of processing blocks from one to the next. With PyF, these blocks can be defined as Python generators, allowing lazy execution and low memory usage. The document outlines PyF's architecture, plugins system, and visual programming interface. It promotes an upcoming training session on PyF to be held the next day.
A fast-paced introduction to Deep Learning concepts, such as activation functions, cost functions, back propagation, and then a quick dive into CNNs. Basic knowledge of vectors, matrices, and derivatives is helpful in order to derive the maximum benefit from this session. Then we'll see a short introduction to TensorFlow and TensorBoard.
The document discusses identifying the benefits of multithreading, which includes performing multiple tasks in parallel, better utilization of system resources, and increasing application speed. It also covers designing applications using threads by assigning different threads to different functions to improve functionality and performance. Finally, it discusses complexities that can arise with multithreaded applications like race conditions, critical regions, mutual exclusion, synchronization, and deadlocks.
1. The document discusses installing Windows Logic and Techniques programming using attended installation. It covers input, process, output cycles, flowcharts, and drawing simple flowcharts.
2. Flowcharts use symbols to represent activities like input, processing, output, decisions, and subroutines. Examples show flowcharts for making tea, manipulating numbers, and calculating sales.
3. Exercises provide practice drawing flowcharts for student admission, adding numbers, summing entered numbers, and multiplying a number.
This document provides an overview of running an image classification workload using IBM PowerAI and the MNIST dataset. It discusses deep learning concepts like neural networks and training flows. It then demonstrates how to set up TensorFlow on an IBM PowerAI trial server, load the MNIST dataset, build and train a basic neural network model for image classification, and evaluate the trained model's accuracy on test data.
The document discusses process synchronization and concurrency control techniques in operating systems, including classical problems like the bounded buffer problem, readers-writers problem, and dining philosophers problem. It covers synchronization primitives like semaphores, mutexes, and monitors that allow processes to synchronize access to shared resources and coordinate their activities to prevent race conditions and deadlocks. The key challenges of mutual exclusion, progress, and bounded waiting in solving the critical section problem are also summarized.
This document presents an implementation and analysis of parallelizing the training of a multilayer perceptron neural network. It describes distributing the calculations across processor nodes by assigning each processor responsibility for a fraction of nodes in each layer. Theoretical speedups of 1-16x are estimated and experimental speedups of 2-10x are observed for networks with over 60,000 nodes trained on up to 16 processors. Node parallelization provides near linear speedup for training multilayer perceptrons.
The main variable types supported by VB.NET are:
- Integer (Byte, Short, Integer, Long) - Stores whole numbers ranging from 0 to 2,147,483,647
- Floating point (Single, Double) - Stores fractional numbers ranging from ±5.0 × 10-324 to ±1.7 × 10308
- Decimal - Stores fractional numbers with greater precision than floating point types ranging from ±1.0 × 10-28 to ±7.9 × 1028
- Char - Stores a single character ranging from 0 to 65535
- String - Stores text data with no fixed limit on size
- Date/Time - Stores date and time values
- Object - Stores a reference
Here are 3 examples of using the Clng() function in VB.NET:
1. Convert a string to a Long:
Dim strNumber As String = "12345"
Dim lng As Long = CLng(strNumber)
2. Convert a double to a Long by rounding:
Dim dbl As Double = 12.34
Dim lng As Long = CLng(dbl)
3. Convert an integer to a Long:
Dim int As Integer = 10000
Dim lng As Long = CLng(int)
The Clng() function converts its argument to a Long data type. Any fractional portions are truncated. It can convert from strings, doubles, integers, or other
The document discusses legacy connectivity and protocols. It describes legacy integration as integrating J2EE components with legacy systems. The key approaches to legacy integration are data level integration, application interface integration, method level integration, and user interface level integration. Legacy connectivity can be achieved using Java Native Interface (JNI), J2EE Connector Architecture, and web services. JNI allows Java code to call native methods written in other languages like C/C++. The J2EE Connector Architecture standardizes connectivity through resource adapters. Web services provide a platform-independent approach through XML protocols.
The document discusses messaging and internationalization. It covers messaging using Java Message Service (JMS), including the need for messaging, messaging architecture, types of messaging, messaging models, messaging servers, components of a JMS application, developing effective messaging solutions, and implementing JMS. It also discusses internationalizing J2EE applications.
The document discusses Java 2 Enterprise Edition (J2EE) application security. It covers security threat assessment, the Java 2 security model, and Java security APIs. The Java 2 security model provides access controls and allows downloading and running applications securely. It uses techniques like cryptography, digital signatures, and SSL. The Java Cryptography Extensions API provides methods for encrypting data, generating keys, and authentication.
The document discusses various security tools in Java including keytool, jarsigner, and policytool. Keytool is used to manage keystores containing private keys and certificates. It can generate key pairs, import/export certificates, and list keystore contents. Jarsigner signs JAR files using certificates from a keystore. Policytool creates and edits security policy files specifying user permissions. The document provides details on using each tool's commands and options.
This document discusses EJB technology and provides summaries of key concepts:
1. It defines the EJB container model and describes features like security, distributed access, and lifecycle management.
2. It compares the lifecycles of stateless session beans, stateful session beans, entity beans, and message-driven beans.
3. It contrasts stateful and stateless session beans and discusses differences in client state, pooling, lifecycles, and more. It also compares session beans and entity beans in terms of representing processes versus data.
This document discusses behavioral design patterns and J2EE design patterns. It provides descriptions and class diagrams for several behavioral patterns, including Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, and Visitor. It also defines what a J2EE design pattern is and notes that J2EE patterns are categorized into the presentation, business, and integration tiers of an enterprise application.
This document provides an overview of EJB in J2EE architecture and EJB design patterns. It discusses the key characteristics of using EJB in J2EE architecture, including supporting multiple clients, improving reliability and productivity, supporting large scale deployment, developing transactional applications, and implementing security. It also outlines several EJB design patterns, such as client-side interaction patterns, EJB layer architectural patterns, inter-tier data transfer patterns, and transaction/persistence patterns.
This document discusses design patterns and provides examples of structural and behavioral design patterns. It describes the adapter, bridge, composite, decorator, facade, flyweight, proxy, chain of responsibility, and command patterns. Structural patterns are concerned with relationships and responsibilities between objects, while behavioral patterns focus on communication between objects. Examples of UML diagrams are provided to illustrate how each pattern can be modeled.
The document discusses UML diagrams that can be used to model J2EE applications, including use case diagrams, class diagrams, package diagrams, sequence diagrams, collaboration diagrams, state diagrams, activity diagrams, component diagrams, and deployment diagrams. It provides examples of each diagram type using a case study of an online bookstore system. The use case diagram shows use cases and actors, the class diagram shows classes and relationships, and other diagrams demonstrate how specific interactions, workflows, and system configurations can be modeled through different UML diagrams.
This document discusses design patterns and selecting appropriate patterns based on business requirements. It provides an overview of design patterns available in TheServerSide.com pattern catalog, which are organized into categories like EJB layer architectural patterns, inter-tier data transfer patterns, transaction and persistence patterns, and client-side EJB interaction patterns. Examples of patterns in each category are described. Best practices for developing class diagrams and using proven design patterns are also mentioned.
This document provides an overview of J2EE architecture. It defines architecture as the study of designing J2EE applications and discusses architectural concepts like attributes, models, and terminology. It describes the role of an architect and phases of architectural design. The document outlines the various components of J2EE like clients, web components, business components and containers. It also discusses key aspects of J2EE architecture like application areas, issues, technologies and available application servers.
The document discusses various topics related to collaboration and distributed systems including network communication in distributed environments, application integration using XML, and legacy integration technologies. Specifically, it covers factors that affect network performance like bandwidth and latency. It also describes using XML for data mapping between applications and data stores. Finally, it discusses different legacy integration methods like screen scraping, object mapping tools, and using off-board servers.
The document discusses JavaBean properties, property editors, and the classes used to implement them in Java. It describes the PropertyEditorSupport class and its methods for creating customized property editors. The PropertyDescriptor class and BeanInfo interface provide information about JavaBean properties, events, and methods. The document also provides tips on using sample JavaBeans from BDK1.1 in Java 2 SDK and creating a manifest file for multiple JavaBeans. Common questions about JavaBeans are answered.
The document discusses JavaBean properties and custom events. It defines different types of JavaBean properties like simple, boolean, indexed, bound, and constrained properties. It also explains how to create custom events by defining an event class, event listener interface, and event handler. The event handler notifies listeners when an event occurs. Finally, it demonstrates creating a login JavaBean that uses a custom event to validate that a username and password are not the same.
The document introduces JavaBeans, which are reusable software components created using Java. It discusses JavaBean concepts like properties, methods, and events. It also describes the Beans Development Kit (BDK) environment for creating, configuring, and testing JavaBeans. BDK includes components like the ToolBox, BeanBox, Properties window, and Method Tracer window. The document provides demonstrations of creating a sample JavaBean applet and user-defined JavaBean using BDK. It also covers topics like creating manifest and JAR files for packaging JavaBeans.
The document provides information on working with joins, the JDBC API, and isolation levels in Java database applications. It discusses different types of joins like inner joins, cross joins, and outer joins. It describes the key interfaces in the JDBC API like Statement, PreparedStatement, ResultSet, Connection, and DatabaseMetaData. It also covers isolation levels and how they prevent issues with concurrently running transactions accessing a database.
The document discusses various advanced features of JDBC including using prepared statements, managing transactions, performing batch updates, and calling stored procedures. Prepared statements improve performance by compiling SQL statements only once. Transactions allow grouping statements to execute atomically through commit and rollback. Batch updates reduce network calls by executing multiple statements as a single unit. Stored procedures are called using a CallableStatement object which can accept input parameters and return output parameters.
The document introduces JDBC and its key concepts. It discusses the JDBC architecture with two layers - the application layer and driver layer. It describes the four types of JDBC drivers and how they work. The document outlines the classes and interfaces that make up the JDBC API and the basic steps to create a JDBC application, including loading a driver, connecting to a database, executing statements, and handling exceptions. It provides examples of using JDBC to perform common database operations like querying, inserting, updating, and deleting data.
The document discusses classes and objects in Java, including defining classes with data members and methods, creating objects, using constructors, and the structure of a Java application. It also covers access specifiers, modifiers, compiling Java files, and provides a summary of key points about classes and objects in Java.
The document discusses casting and conversion in Java. It covers implicit and explicit type conversions, including widening, narrowing, and casting conversions. It also discusses overloading constructors in Java by defining multiple constructor methods with the same name but different parameters. The document provides examples of casting integer and double values to byte type, as well as overloading the Cuboid constructor to calculate volumes for rectangles and squares.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
1. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Objectives
In this session, you will learn to:
Identify time and space complexity
Optimize programming constructs
Identify performance libraries for optimization
Ver. 1.0 Slide 1 of 24
2. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Examining Algorithms
An algorithm is a set of finite steps that accomplish a
specific task.
The efficiency of an algorithm is measured in terms of the
processor time and the memory space that the algorithm
utilizes.
It is necessary to tune the algorithm to make optimal use of
available resources, such as processor time and memory.
To analyze algorithmic complexity, it is important to
understand the time and space aspects of complexity.
Ver. 1.0 Slide 2 of 24
3. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Time Complexity
The time taken to compute the steps involved in an
algorithm is called the time complexity of that algorithm.
The time taken to execute all the steps for a worst-case
scenario is the time complexity of the entire algorithm.
The execution of steps in an algorithm depends on the
conditions specified in it. As a result, the time complexity of
an algorithm is measurable with reference to the conditions
involved in the algorithm.
Ver. 1.0 Slide 3 of 24
4. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Time Complexity (Contd.)
Computing the nth number of the fibonacci series:
Step 1: start
Step 2: input the value of n
Step 3: if (n < = 1) then go to step 14
Step 4: x = 0
Step 5: y = 1
Step 6: write (x + “ “ + y)
Step 7: for (i = 0 to n-1)
Step 8: {f = y + x
Step 9: x = y
Step 10: y = f
Step 11: i = i + 1
Step 12: write (f) }
Step 13: go to step 15
Step 14: write (n)
Step 15: stop
Ver. 1.0 Slide 4 of 24
5. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Time Complexity (Contd.)
Based on the value of n, two cases can exist in the
preceding algorithm.
If the value of n is less than or equal to 1, time complexity is
constant and does not depend on input, which is n, as
shown in the following table.
Statements Frequency of Execution
Step 2: input the value of n 1
Step 3: if (n < = 1) then go to step 14 1
Step 14: write (n) 1
Total Number of instructions executed 3
Ver. 1.0 Slide 5 of 24
6. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Time Complexity (Contd.)
If the value of n is greater than 1, time complexity is 4n-2.
This is shown in the following table.
Statements Frequency of Execution
Step 2: input the value of n 1
Step 3: if (n < = 1) then go to step 13 1
Step 4: x = 0 1
Step 5: y = 1 1
Step 6: for i= 2 to n-1 repeat steps 7 to 10 1
Step 7: f = y + x n-2
Step 8: x = y n-2
Step 9: y = f n-2
Step 10: i = i + 1 n-2
Step 11: write (f) 1
Total number of instructions executed 4n-2
Ver. 1.0 Slide 6 of 24
7. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Just a minute
What do you mean by the time complexity of an algorithm?
Answer:
The time taken to compute the steps involved in an algorithm
is called the time complexity of that algorithm.
Ver. 1.0 Slide 7 of 24
8. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Space Complexity
Space complexity is the amount of memory that a program
requires to accomplish a task.
Space complexity is a criterion to measure the efficiency of
a program.
For example, consider the following expression:
Return [a + b + b * c + (a +b – c) / (a + b) + 4.0]
If variables b and c are each of 2 bits, the storage requirements
for the preceding instruction will be constant.
If the values of a, b, and c are taken from user input, the
storage space required will vary.
Ver. 1.0 Slide 8 of 24
9. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying Space Complexity (Contd.)
Refer to the following algorithm:
Step 1: start
Step 2: function Add (k, m)
Step 3: l = 0
Step 4: for j= 1 to m repeat step 5
Step 5: l = l + k[j]
Step 6: return the value of l
Step 7: stop
For the preceding algorithm:
The space taken by the k array is m units.
The other variables, m, j, and l will take only one unit of space
each.
As a result, you can obtain the space complexity of this
algorithm by adding the space utilized by all the variables.
Ver. 1.0 Slide 9 of 24
10. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Examining Programming Constructs
An application developed in any programming language,
such as C, C++, C#, or Java, is based on an algorithm.
Each algorithm consists of several programming constructs,
such as loops, decisions, and functions.
The performance of an application is related to the
programming constructs used in the application.
To achieve the desired level of optimization, it is important
to examine the loops, branching statements, and function
calls used in the program.
Ver. 1.0 Slide 10 of 24
11. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Examining Loops
Loops can be optimized by:
► Removing unwanted parts of loops In this technique, you need to
first identify the
► Combining loops When multiple loops work on
decision-making steps present
the same variables, you may
► Using unrolling inside a loop. to the
Unrolling refers
combine the loops.
Aftervaluesbreaking compact
process of
► Reducing work inside loops The identifying these steps,
of some
This helpssimpler statements.
loops into reduce
you need to decide whether the
expressions, time because
computation variables, or
► Using sentinel values loop affects the steps in any
A sentinel do notis a value
constants value of
the total number change
way.is the loop and end of a
that placed at the
► Looking at the order of loops inside improve the
You can
instructions executed
search range. not affect
If the loop of a consumeby the
reduces. does
unnecessarily program
efficiency
► Looking at operators steps, remove prevents you
Sentinel value the unaffected
In terms oftime.
processor efficiency,
changing the order of loops.
stepsperforming theapproach
from from a better additional
Therefore, the loop.
operations such as
task of checkingoutside the
is to bring them the end of
multiplication and division are
the input search than
more expensive string.
loop.
operations such as addition.
You should try to convert all
expensive operations with
cheaper ones.
Ver. 1.0 Slide 11 of 24
12. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Examining Functions
As the frequency of calling a function increases, program
execution time increases.
Examining functions is important for performance
optimization.
Functions can be optimized by:
► Using faster functions Try to use only fast functions.
► Identifying mathematical functions You need identify fast
You can to be selective
about mathematical the time
functions by knowing
► Identifying standard functions complexity associated with
Use standard mathematical
functions, such as square
root, function.a program.
the used in
approaches to compute a
► Declaring local functions as static Using static functions,
result that uses complex
You can sequence and
evaluation is faster
calculations. functions based
mathematical
efficiency is improved.
This enables you to solve a
on execution time.
problem more efficiently.
Ver. 1.0 Slide 12 of 24
13. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Examining Branching
Transferring control from one part of code to another is
achieved through branching.
Various techniques can be adopted to make the process of
branching effective and improve the efficiency of code.
Branches can be examined by:
► Removing the else clause Using an else clause with
every if loop leads to
► Using effective case statements You should use effective
ineffective branching.
case statements in such a
► Replacing conditional computations Therefore, youcomputational
You can save should try to
way so the order of options is
remove replacingclause, if
time by the else conditional
defined based on the
possible.
computation with equivalent
frequency of using the
arithmetic expressions.
options.
Ver. 1.0 Slide 13 of 24
14. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
General Guidelines for Optimization
Some guidelines to follow when writing code are:
Identify optimization areas
Identify the depth of optimization
Identify correct alternatives
Identify what is being asked
Ver. 1.0 Slide 14 of 24
15. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Common Misconceptions About Optimization
Some of the common misconceptions about code and their
optimization are:
To think a program doesn’t require optimization because it
appears to be quite fast.
To think that only the optimization performed by the compiler is
enough.
To believe that short code is efficient.
To think a specific solution will be effective without verifying
performance results.
To think optimizing while programming is good practice.
Ver. 1.0 Slide 15 of 24
16. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Just a minute
What is unrolling?
What is sentinel value?
Answer:
Breaking compact loops into simpler statements is called
unrolling.
A sentinel value is a value that is placed at the end of a search
range. This assures the termination of the search.
Ver. 1.0 Slide 16 of 24
17. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Using Performance Libraries For Applications
Each software developer has an individualistic style of
writing code. It is possible that the written code will not be
efficient.
Sections of software, such as the menu bar, remain
common in most software.
Writing these sections of codes repeatedly makes the
process time-consuming and error-prone.
In such situations, you might prefer to use existing code,
which is called a performance library.
This piece of code is already checked for errors. In addition,
this code attains a high level of optimization over a period.
Ver. 1.0 Slide 17 of 24
18. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Using Performance Libraries For Applications (Contd.)
The advantages of using performance libraries are the
following:
Enable programmers to develop code in less time
Offer error free codes
Enables best use of resources
Help in performance improvement
Add to stability of the functioning software application
Ver. 1.0 Slide 18 of 24
19. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Identifying the Types of Performance Libraries
Based on these tasks, performance libraries can be
categorized as:
► Engineering and science libraries These libraries are mainly
used in scientific and
► Math libraries These libraries deal with the
engineering applications.
evaluation of complex
► Graphic libraries These libraries help draw
may include
mathematical functions, such
graphics, pie for searching,
functionalitiescharts, graphs,
► Audio/Video libraries as vector and matrixoptimize
These libraries help
and bar diagrams correctly
sorting, and evaluating
calculations.
► Image processing libraries various functions related to
and accurately.
variouslibraries help process
These expressions.
audio-visual data.
images faster. may include
► Other libraries Other libraries
functionalities for performing
various tasks, such as
speech recognition, signal
processing, and
cryptography.
Ver. 1.0 Slide 19 of 24
20. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Just a minute
Which libraries may include functionalities for searching,
sorting, and evaluating various expressions?
Answer:
Engineering and science libraries
Ver. 1.0 Slide 20 of 24
21. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Summary
In this session, you learned that:
Time complexity is the time taken by the steps of an algorithm
to execute.
Space complexity is the measurement of the space utilized by
the components of an algorithm.
Identifying the data structures used in an algorithm and then
adding them can measure space complexity.
Loops are generally the most time-consuming constructs of a
program.
Some of the techniques to optimize loops are:
Removing unwanted parts of loops
Combining loops
Using Unrolling
Reducing work inside loops
Ver. 1.0 Slide 21 of 24
22. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Summary (Contd.)
Using Sentinel Values
Looking at the order of loops
Looking at operators
– Some of the techniques to optimize functions are:
Using faster functions
Identifying mathematical functions
Identifying standard functions
Declaring local functions as static
Transferring control from one part of a code to another is
achieved through branching.
Ver. 1.0 Slide 22 of 24
23. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Summary (Contd.)
Some of the techniques to make the process of branching
effective are:
– Removing the else clause
– Using Effective Case Statements
– Replacing Conditional Computation
You should keep the following optimization guidelines in mind
when writing codes:
– Identify optimization areas
– Identify the depth of optimization
– Identify correct alternatives
– Identify what is being asked
Ver. 1.0 Slide 23 of 24
24. Code Optimization and Performance Tuning Using Intel VTune
Installing Windows XP Professional Using Attended Installation
Summary (Contd.)
Some of the common misconceptions about optimization are:
– A fast program does not require optimization
– Optimization performed by the compiler is enough
– A short code is efficient
– Optimizing while programming is good practice
– Performance libraries can improve the performance of an
application to a large extent.
– A variety of performance libraries are available for different
purposes, such as mathematical, graphical, and task-based
functions.
Ver. 1.0 Slide 24 of 24
Editor's Notes
Initiate the discussion by asking the students the components of a program, such as loops, branches constituting application design. Also ask the students how the application design affects performance issues. Explain why design of an application is crucial for determining its performance. Sometimes, even minor mistakes in application design might cause serious performance issues. Therefore, it is important to know, analyze, identify, and fix application-design issues to obtain optimal application performance.
Ask the students what is algorithm. Collate the answers and initiate a discussion on how same task can be performed using different algorithms. Algorithm is a formula or set of steps for solving a particular problem. The set of rules must be unambiguous and have a clear stopping point. Algorithms can be expressed in any language , from natural languages like English or French to programming languages like FORTRAN . Most programs , exception some artificial intelligence applications , consist of algorithms. Creating algorithms that are simple and efficient is one of the principal challenges in programming .
Ask students what is time complexity? Explain that time complexity is an indication of time taken for execution... Sometimes the time taken by a particular algorithm can depend on a set of conditions. For example, in case of linear search of n values, if the required data is found at first location the execution will be faster as compared to the case when the required data is found at nth location. Ask the following questions: What is the time complexity of a linear search algorithm Ans: For N values the time complexity is N What is the time complexity of binary search algorithm Ans: For N values the time complexity is log N. Thus explain that binary search is better than linear search. Note that binary search can only be performed with sorted data. After explaining these concepts ask the students to find time complexity for the following algorithm: Float * loop ( float * date 1, float * date 2 ) { float Pi = 3.14, * ans; ans = ( float * ) malloc ( Max * size of (float)); for (I = 1, I < MAX, I++) { ans [I] = date 1 [I] + Pi * date 2 []; } return ans; } Ans: The time complexity is of the order of MAX. Note that in terms of time complexity MAX is same as MAX +1 or MAX-3 or MAX +/- any constant number. But, MAX *MAX is different from MAX.
Ask the students the time complexity of this algorithm. Discuss the result and ensure that students are familiar with the method of calculating time complexity. Again note that the solution is 4n-2, which is same as 4n.
Explain that If the value of n<= 1 the time complexity is constant.
Explain that If the value of n> 1 the time complexity is 4n-2. Next, ask the students to find the time complexity for an algorithm that computes the sum of two m*n matrices. Encourage the students to solve on their own without referring to the SG. Explain how interchanging the loops improve the time complexity of the algorithm.
Ask students what is meant by space complexity. Explain that space complexity is the measurement of space utilized by the components of an algorithm.
Explain the concept of space complexity. Also explain how space complexity can affect the performance of an application. Explain the steps to calculate space complexity.
Explain that an algorithm has a very significant role in application performance. Most of the times an n inefficient algorithm can retard the application performance. For example, you can ask the students to write an algorithm that prints all the prime numbers from 1 to n. Enable the stude4nts to appreciate how different algorithm have different performance
Explain the difference between optimized and unoptimized code and how optimized code performs better than the unoptimized code. Explain that loops are the most time consuming techniques to optimize loops. Ask the students the various techniques that can be used to optimize loops in an algorithm. Explain in detail the various techniques, such as removing unwanted parts of loops, combining loops, unrolling, reducing work inside loops, using sentinel values with the help of examples.
Ask students the need to optimize functions in a program. Also, ask them various techniques that can be used to optimize functions. Explain in detail the optimization techniques, such as identifying Mathematical functions and using faster functions to speed up the execution of a program. Explain the need to use standard mathematical approach for complex calculations instead of using long unwanted steps. State the example of using exponent functions to compute nth Fibonacci number instead of using n Fibonacci number and then printing the desired number. Explain the need to declare local functions as static for faster evaluation. Explain using an example of an optimized and unoptimized code.
Ask students the various techniques that can be used to make the process of branching in a program effective. Explain using the example of codes the affect on the performance after the techniques, such as removing the else clause and using effective case statements.
Ask students to identify the certain guidelines that they can follow for optimization when writing a code.
Explain in detail the various misconceptions that lead to ineffective optimization of programs.
Explain that unrolling refers to breaking compact loops into simpler statements. Sentinel value is a value placed at the end of a search range to assure the rumination of search.
Tell the students that p erformance libraries are: 1. Code snippets that serve a definite purpose, such as matrix operations. 2. Functions written to increase application performance for a specific platform. Ask students what they understand by the term Performance Library. Explain that while writing a code it is possible that the code written is time consuming and error prone. The code which is already checked for errors is called as a performance library. Explain that unrolling refers to breaking compact loops into simpler statements.
Tell the students that performance libraries enable programmers to focus on the areas of coding. Ask students the advantages of using Performance Libraries Explain the advantages that performance libraries, such as less time needed to develop a code, best possible utilization of resources and increase in the efficiency and stability of the software application.
Ask students to identify the various tasks where you can use the performance libraries. Also, ask students to categorize the performance libraries based on the various software tasks.
Engineering and Science Libraries are used to include functionalities for searching, sorting, and evaluating expressions.