Introduction to the Course
|
|
- Myrtle Butler
- 5 years ago
- Views:
Transcription
1 Introduction to the Course Nick Maclaren courses/cplusplus Some of the slides in this lecture are the copyright of Bjarne Stroustrup, but they are not marked specially
2 Acknowledgement We are grateful for Bjarne Stroustrup for making his source materials available, and this course is based on them. Their copyright remains with Bjarne Stroustrup. You may use them only when doing this course; for other purposes, the originals are available from his Web site, under his (liberal) conditions. 2
3 This lecture This first lecture is mostly my (nmm's) material, because this course is intended for a very different audience and a somewhat different purpose, but I have included some of Bjarne Stroustrup's slides, which remain his copyright. I have tried to not misrepresent Bjarne Stroustrup's views when editing those slides, but may have made a mistake and done so. You must look at his original first lecture slides to see what he really said. Additional material in subsequent lectures has been marked (nmm) to distinguish it. 3
4 Abstract Here, we ll outline the aims for this course and present a rough course plan. Finally, we ll present the simplest possible C++ program and outline how it can be made into running code. 4
5 Overview Course aims and outline Programming Hello, world! Compilation 5
6 This is a course In Programming For beginners in C++ who want to become professionals i.e., people who can produce reliable and portable software who are assumed to be bright Though not (necessarily) geniuses who are willing to work hard Though do need sleep occasionally Using the C++ programming language 6
7 The Original Aims Teach/learn Fundamental programming concepts Key useful techniques Basic Standard C++ facilities After the course, you ll be able to Write small colloquial C++ programs Read much larger programs Learn the basics of many other languages by yourself Proceed with an advanced C++ programming course After the course, you will not (yet) be An expert programmer A C++ language expert An expert user of advanced libraries 7
8 The Aims (Cambridge) Very much the same, but also very different The target audience is graduates who have done some programming (say, in Python), not undergraduates who have done none It is assumed to be academics who want to program, not people who want to become programming professionals It is being given in half the time the book recommends for newcomers to programming But not just physical scientists, or even engineers Equally relevant to biologists, social scientists, and the scientific work of the arts and humanities The mathematics is elementary but, for example, you do need to know what matrices are 8
9 The Aims (cont) After the course, you ll also be able to Write serious and efficient scientific and other programs using simplistic but functional C++ Know something about the difficult areas around what you are using and why not to go there After the course, you will not (yet) be Someone who knows how to optimise C++ for HPC (high performance programming) Someone who knows how to use C++ for parallel programming (except perhaps for very simple MPI) An expert on C++ :-) 9
10 What This Course is NOT It is not C++ for CVs or Simple Recipes in C++ Simple Recipes in C++ Such courses teach you just enough to get into trouble You often need to unlearn them before going further The C Subset of C++ It is not C C with a C++ Flavour or The C Subset of C++ You then get all of the disadvantages of C C is a high-level, semi-portable assembler It is not C++ for C Programmers or C++ for Computer Scientists C++ for Computer Scientists Knowing C is not an advantage It teaches practical use, not programming for its own sake C++ for Microsoft Windows It is not C++ under Linux or C++ for Microsoft Windows Most of it will work on any system 10
11 Why this course? It ain't what you don't know that causes the trouble; it's what you know for sure that ain't so. Probably first said by either Josh Billings or Samuel Clemens (Mark Twain) This is the cause of 80% of hard-to-solve problems when using C and C++ - that figure is based on experience with user's problems Most books, Web pages and courses teach you how to use the facilities but not how to avoid problems Bjarne Stroustrup's course is much better Often things work fine when you are following recipes, but blow up when you need to do something very slightly different this course teaches understanding not recipes 11
12 Why this course? (cont) Scientific programmers aren't computer scientists This book and course are better oriented for scientists than most many others are useful only for ''computer science'' purposes It has been selected and extended to help with that There were a lot of useful materials Including these lectures Also the author didn't impose impossible constraints on their use, as some commercial ones do I found this course fairly ''natural'' My own courses also concentrate on good programming practice and writing reliable and portable code 12
13 Key to Success The key to success is ''Thinking in C++ terms'' And not just in by using ''object orientation'' etc. The main way is in the choice of which way to write code And that is precisely what this course teaches It was also written by the designer of the language Not just someone who thinks he understands C++ I have learnt a huge amount from working through it 13
14 The Problem C++ is a huge language, by any standards ISO Fortran 90 is 253 pages; Fortran 2003 is 422 pages ISO C++98 is 680, and C++03 is 709, but that is deceptive They include a lot of C90 by reference (176 pages) The library section is underspecified, and has few examples, though you need only a little of it Realistically, C++ is over 3 times as complicated as Fortran, with over 10 times as many ambiguities and 'gotchas' gotchas' This makes it much harder to learn There is just no comparison with Pascal, Python etc. 14
15 So Just Learn a Subset? You can't learn every wrinkle of the whole language The same is true of every powerful language The first problem is selecting a subset to learn And the second is staying within that subset Every book and course uses its own preferred subset That also applies to every large program It makes it extremely hard to read other people's code It is easy to make errors when working on such code Not all constructs work in all circumstances 15
16 Other C++ Courses Several other people give C++ courses at Cambridge University They are all shorter, but not necessarily easier Your understanding will be pro rata to your effort Their focus is different, and they may not be open to everyone check first Computer Laboratory (8 lectures) Engineering There isn't a simple reference, and the courses are very specialised if relevant, check them out And others. 16
17 Beware of Recipes! C++ is not a good language to learn from recipes You rarely want to follow a recipe exactly,, and even a simple change may cause weird failures Worse, a recipe may work when you are testing it but not when you put it into actual use Even worse, an apparently unrelated change (possibly even in the standard library) can cause such failures There is no substitute for understanding the language And this course teaches understanding, not recipes! 17
18 Towards a Solution Learning C++ takes time there is no magic bullet The book advises 210 hours' work, for complete newcomers That might be whole days for the target audience We are aiming for 12 afternoons of lecturing Even a specially targetted course would be 10 days And I am not convinced that would be enough :-( No other CS course exceeds 3 whole days 18
19 Towards a Solution We are trying a different approach There will be 12 afternoons of lecturing These will be followed by a practical class There will also be some assistance by and (by arrangement) telephone We also hope to experiment with desktop conferencing for such assistance You will need to do a lot of practical work on your own This includes reading the book and doing the drills and exercises If you genuinely know the material, and can do the exercises, it is reasonable to skip a lecture and practical class 19
20 Prerequisites It is critical to know what this course covers ''Unix: Introduction to the Command Line Interface'' If you don't, you will have trouble even getting started And you must be able to use a Unix plain text editor (e.g. emacs, gedit, pico or vi) If you want to use a Microsoft or Macintosh system, you need the equivalent skills But you won't be able to get much help with them It may also make it trickier to get help in the practical classes 20
21 Prerequisites Unless you are already a programmer, you are very strongly advised to attend this first ''Python: Introduction for Absolute Beginners'' ''Programmer'' does not mean Visual Basic, Excel or even most uses of Matlab It means Python, Fortran, C, Pascal etc. There is more that you need, but not until Chapter 12 21
22 Corequisites Not needed before you start, though it helps You need to know them before you finish And you will need them for real programming ''Building, installing and running software'' ''How Computers Handle Numbers'' There are a lot more that will or may be useful Some are mentioned later, when relevant See See notes/unix courses 22
23 The Author Bjarne Stroustrup The Book Course Reference Programming Principles and Practice Using C++ Addison-Wesley 2009, ISBN The Web Site The known mistakes (fixed in the second printing) 23
24 The Local Site Local Materials notes/unix courses/cplusplus Modified versions of these lecture slides, containing important extra information (Slightly bug-fixed) sources of the FLTK toolkit and course headers The answers I wrote to many of the drills and exercises (incomplete and probably buggy) And possibly other relevant files 24
25 The Problem The biggest problem with teaching the use of C and C++ is correcting false beliefs (''unteaching'') Why? It ain't what you don't know that causes the trouble; it's what you know for sure that ain't so. The languages are solid with arcane 'gotchas' gotchas' Most people hit them, often, and hack around them They often make wrong deductions, and tell others They even write books and Web pages based on such false beliefs :-( I really do mean that such misbeliefs are the cause of the majority of the nastiest bugs in C and C++ 25
26 The Means Starting Buy the book you will need your own copy Start reading the book, in chapter order After each chapter, review all of the Terms, and check you know what they mean At least starting with chapter 3, do the TRY THIS sections and drills Use only the facilities taught up to that point to do them Why? The course teaches a particular approach to C++ that will lead to portable and reliable code 26
27 The Means (cont) But please be honest with yourself Do not skip the drills and exercises, even if you are sure that you don't need to do them Use only the facilities taught up to that point to do them they are intended to teach specific points Do at least a third of them 'for real', including all of them that you are even slightly unsure about Don't skip any exercises that look as if they might need something introduced in the chapter As soon as you start to have trouble, or even before, attend the practical classes 27
28 Moving on The Means (cont) Read the chapters and review the Terms ahead of the next lecture Do the drills, before starting the exercises Read the chapters again after each lecture Ask about any problems in the practical classes Then complete doing all of the drills and exercises that you are in the slightest doubt about Ask for any other advice on C++ or programming Feedback is welcome (typos, suggestions, etc.) 28
29 Using the MCS (a.k.a.( PWF) You need to apply for a MCS account for Linux Do that at Computing Service Reception You will need to download and build the materials There are full instructions and a script to do that You can log in remotely (that's what I do) ssh <MCSid>@linux.pwf.cam.ac.uk You can't use SSH keys to login, unfortunately I don't recommend using the Microsoft system There is no supported C++ system 29
30 Using Your Own Computer You do not n need d to use the MCS You can use a departmental system You can use your own desktop or laptop You will have to install the materials yourself They have build scripts for Linux (both the MCS and generic) The base course has them for Microsoft, but I have not tested them, and you may need to merge in my fixes For other systems, you may need help (but I can advise only in generic terms) 30
31 System and Compiler You can use anything plausible Linux, Macintosh and Microsoft are all suitable, and so are many other systems you won't have heard of gcc (g++ g++), Intel icpc,, Sun/Oracle Studio, Microsoft Visual Studio and any many other compilers are all fine But you will have to install them yourself! The practical classes will use g++ under Linux You will need an MCS account You will need to download and built the materials yourself (which should be trivial) 31
32 Beyond the Course The author has written several books, including: The C++ Programming Language Addison-Wesley 1997, ISBN It is in a similar style, but covers much more, is much more concise, but still covers nowhere near the whole language It is for experienced programmers only and, even so, doing its exercises are still essential to understanding it We give many other relevant courses I give several on practical program design, Fortran, parallel programming etc. 32
33 Beyond the Course C++ is the hardest language to learn that I have met I have used over a hundred, and been an expert on a dozen I usually learn from the language standard I don't find it hard to use it's avoiding the gotchas that is the problem It isn't always easy to distinguish between A simple bug in your program When you are using the wrong construct for a task A restriction of your compiler or a library Something that C++ doesn't make possible 33
34 Rough course outline Part I: The basics Types, variables, strings, console I/O, computations, errors Vectors, classes, functions, source files Part II: Input and Output File I/O, I/O streams Graphical output Graphical User Interface Part III: Data structures and algorithms Free store, pointers, and arrays Lists, maps, sorting and searching, vectors, templates String handling More details on scientific uses 34
35 Rough course outline (cont.) Throughout Program design and development techniques C++ language features Background and related fields, topics, and languages Practical points related to real scientific programming Information about portability, reliability etc. 35
36 Planned Schedule All of these use the programming tasks as a way of teaching C++ in a realistic context. Do not skip a lecture because you don't need the facility, but only if you can do all of the drills and exercises using only the facilities taught so far. Note that the first session is the only one that will be repeated and the only one that is not followed by a practical class There is no point in attending both repetitions Introduction and basics session 1 Chapters 1 and 2: Programming and ''Hello World'' Chapter 3: Objects, Types and Values 36
37 Planned Schedule (cont.) Computation and Errors session 2 Chapter 4: Computation Chapter 5: Errors It is very important to read these carefully, and do many of the drills and exercises 'for real', even if you think they are easy, as they teach the subset of C++ being used in this course Writing a program session 3 Chapter 6: Writing a program Chapter 7: Completing a program The techniques taught are also useful for decoding non-trivial data formats, as are commonly used as input to scientific programs; in the book, they are used as a way of introducing some more C++ concepts, and as getting practice in using the language as it is taught 37
38 Planned Schedule (cont.) Even if you know some C++, and can do the previous exercises, you are recommended to start attending lectures here, as there is a significant increase in complexity at this stage Functions and classes session 4 Chapter 8: Technicalities: Functions, etc. Chapter 9: Technicalities: Classes, etc. Existing C++ programmers need to pay special attention to the second lecture, as it teaches a particular way of using classes, but both lectures are important 38
39 Planned Schedule (cont.) Basics of C++ input/output session 5 Chapter 10: Input/Output streams Chapter 11: Customizing I/O 'Chapter 11a': Other Approaches to I/O These covers the basics of what most programmers need to know about text (i.e. human-readable) I/O in C++ I have extended it with warnings about what you can assume safely, once you start to need the non-trivial I/O usage and files needed for real scientific programming 39
40 Planned Schedule (cont.) Graphics - lectures 6 and 7 Chapter 12: A Display Model Chapter 13: Graphics Classes Chapter 14: Graphics Class Design Chapter 15: Graphing Functions and Data Graphics is useful in itself, but the book uses it mainly for how to use classes, so it is important to do these even if you will never use graphics Chapter 12 is mainly practice in using previous techniques, so can be covered fairly quickly Chapters 13 and 14 teach several major new class facilities, so read them and do the exercises thoroughly doing their exercises and drills is important,, especially in chapter 14 Chapter 15 introduces how to use function and default arguments, and I have extended it slightly to cover simple numerical coding 40
41 Planned Schedule (cont.) Graphical User Interfaces (omitted) Chapter 16 will be omitted, but the chapter is still worth reading as an introduction to GUIs There is no need to do the drills and exercises, unless you need to use GUI interfaces or callback functions in parallel code But please note that chapter 16 is an introduction only,, and does not describe any of the fundamental problems with modern GUI designs; understanding those is critical to writing even half-decent GUI interfaces. In particular, event delivery is seriously misdesigned at a fundamental level, leading to FOUL race conditions, even if you try to defend yourself against them. If you want to know the techno-political history that led to this sorry situation, please ask I was peripherally involved with several aspects of it, as well as knowing a few areas in depth 41
42 Planned Schedule (cont.) Memory, Arrays, Vectors and Matrices - lectures 8 and 9 Chapter 17: Vector and Free Store Chapter 18: Vectors and Arrays Chapter 19: Vector, Template and Exceptions Other libraries with array facilities This covers the basics of what most programmers need to know about using arrays and pointers in simple ways in C++ The STL and other libraries lecture 10 Chapter 20: Containers and Iterators Chapter 21: Algorithms and Maps Some more on other libraries This covers the basics of the design and use of the STL 42
43 Planned Schedule (cont.) Ideals and History (omitted) Chapter 22 will be omitted, but you are strongly advised to read it, especially what it says about ideals See also later remarks under Testing Text Manipulation (omitted) Chapter 23 will be omitted; if you need to do any non-trivial text manipulation, you are strongly advised to read it, and do the drills and exercises If you want to use regular expressions, I give a course on them, but do this chapter first Numerics etc. - lectures 11 and 12 I (nmm) haven't yet decided what to put here, as it will depend on how much I haven't covered earlier 43
44 Planned Schedule (cont.) Embedded System Programming (omitted) Chapter 25 will be omitted, but it is relevant to advanced HPC programming; you may want to read it later Testing (omitted) Chapter 26 will be omitted, but you are strongly advised to read it The CS course How to Help Programs Debug Themselves includes some more details on how to do this effectively The C Programming Language (omitted) Chapter 27 will be omitted Note that this is one area where I (nmm) disagree with Bjarne Stroustrup; there are much more serious problem areas in C than the ones he describes (which are still serious) You are strongly advised to be very cautious when using the C subset of C++, which includes any of the headers like <cstdlib>, <ctype>, <cmath> and so on 44
45 Promises Detail: : We will try to explain every construct used in this course in sufficient detail for real understanding There is no magic Utility: : We will try to explain only useful concepts, constructs, and techniques We will not try to explain every obscure detail Completeness: : The concepts, constructs, and techniques can be used in combination to construct useful programs There are, of course, many useful concepts, constructs, and techniques beyond what is taught here 45
46 More Promises Realism: : the concepts, constructs, and techniques can be used to build industrial strength programs i.e., they have been used to Simplicity: : The examples used are among the simplest realistic ones that illustrate the concepts, constructs, and techniques Your exercises and projects will provide more complex examples Scalability: : The concepts, constructs, and techniques can be used to construct large, reliable, and efficient programs i.e., they have been used to Reliability and portability: (nmm) I have added quite a lot of warnings about problems that you may encounter later when you write real applications (especially in HPC) Just note them and remember not to push the boundaries too far You won't (or shouldn't) encounter them while doing the exercises 46
47 Feedback request Please mail questions and constructive comments to scientific Please fill in a feedback form Other feedback would also be appreciated On style, contents, detail, examples, clarity, conceptual problems, exercises, missing information, depth, etc. Book support website ( Local site ( ( notes/unix courses/cplusplus) 47
48 A first program just the guts // int main() // main() is where a C++ program starts { cout << "Hello, world!\n"; // output the 13 characters Hello, world! // followed by a new line return 0; // return a value indicating success } // quotes delimit a string literal // NOTE: smart quotes // so make sure your quotes are of the style " " // \n is a notation for a new line quotes will cause compiler problems. 48
49 // a first program: A first program complete #include "std_lib_facilities.h" // get the library facilities needed for now int main() // main() is where a C++ program starts { cout << "Hello, world!\n"; // output the 13 characters Hello, world! // followed by a new line return 0; // return a value indicating success } // note the semicolons; they terminate statements // curly brackets { } group statements into a block // main( ) is a function that takes no arguments ( ) // and returns an int (integer value) to indicate success or failure 49
50 Hello, world! Hello world is a very important program Its purpose is to help you get used to your tools Compiler Program development environment Program execution environment Type in the program carefully After you get it to work, please make a few mistakes to see how the tools respond; for example Forget the header Forget to terminate the string Misspell return (e.g. retrun) Forget a semicolon Forget { or } 50
51 The next lecture Will talk about types, values, variables, declarations, simple input and output, very simple computations, and type safety. Now let's take a look at the local support site 51
Chapters 1 & 2 Programming and Programs
Chapters 1 & 2 Programming and Programs Instructor: Dr. Hyunyoung Lee Based on slides by Dr. Bjarne Stroustrup www.stroustrup.com/programming Abstract Today, we ll outline the aims for this course and
More informationChapters 1 & 2 Programming and Programs
Chapters 1 & 2 Programming and Programs Hartmut Kaiser hkaiser@cct.lsu.edu http://www.cct.lsu.edu/~hkaiser/fall_2010/csc1253.html Slides adapted from: Bjarne Stroustrup, Programming Principles and Practice
More informationChapter 21a Other Library Issues
Chapter 21a Other Library Issues Nick Maclaren http://www.ucs.cam.ac.uk/docs/course-notes/un ix-courses/cplusplus This was written by me, not Bjarne Stroustrup Function Objects These are not the only way
More informationChapter 5 Errors. Bjarne Stroustrup
Chapter 5 Errors Bjarne Stroustrup www.stroustrup.com/programming Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must deal with incomplete problem specifications,
More informationChapter 24a More Numerics and Parallelism
Chapter 24a More Numerics and Parallelism Nick Maclaren http://www.ucs.cam.ac.uk/docs/course-notes/un ix-courses/cplusplus This was written by me, not Bjarne Stroustrup Numeric Algorithms These are only
More informationChapter 17 vector and Free Store. Bjarne Stroustrup
Chapter 17 vector and Free Store Bjarne Stroustrup www.stroustrup.com/programming Overview Vector revisited How are they implemented? Pointers and free store Allocation (new) Access Arrays and subscripting:
More informationProgramming with MPI
Programming with MPI p. 1/?? Programming with MPI One-sided Communication Nick Maclaren nmm1@cam.ac.uk October 2010 Programming with MPI p. 2/?? What Is It? This corresponds to what is often called RDMA
More informationChapter 5 Errors. Hyunyoung Lee. Based on slides by Bjarne Stroustrup.
Chapter 5 Errors Hyunyoung Lee Based on slides by Bjarne Stroustrup www.stroustrup.com/programming 1 Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must
More informationWeek - 01 Lecture - 04 Downloading and installing Python
Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and
More informationChapter 4. Computation. Bjarne Stroustrup.
Chapter 4 Computation Bjarne Stroustrup www.stroustrup.com/programming Abstract Today, I ll present the basics of computation. In particular, we ll discuss expressions, how to iterate over a series of
More informationSkill 1: Multiplying Polynomials
CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need
More informationThese are notes for the third lecture; if statements and loops.
These are notes for the third lecture; if statements and loops. 1 Yeah, this is going to be the second slide in a lot of lectures. 2 - Dominant language for desktop application development - Most modern
More informationAdvanced Programming Concepts. CIS 15 : Spring 2007
Advanced Programming Concepts CIS 15 : Spring 2007 Mondays and Thursdays 12:15 pm to 1:30 pm 232 Ingersoll Extension Instructor: Chipp Jansen (not Tennenbaum as listed) E-mail: chipp@sci.brooklyn.cuny.edu
More informationPractical C Programming (Nutshell Handbooks) Ebooks Free
Practical C Programming (Nutshell Handbooks) Ebooks Free There are lots of introductory C books, but this is the first one that has the no-nonsense, practical approach that has made Nutshell HandbooksÂ
More informationProgramming. Dr Ben Dudson University of York
Programming Dr Ben Dudson University of York Outline Last lecture covered the basics of programming and IDL This lecture will cover More advanced IDL and plotting Fortran and C++ Programming techniques
More informationCSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN
What languages do you know? CSC 326H1F, Programming Languages The usual suspects: C, C++, Java fine languages nearly the same Perhaps you've also learned some others? assembler Basic, Visual Basic, Turing,
More informationHardware versus software
Logic 1 Hardware versus software 2 In hardware such as chip design or architecture, designs are usually proven to be correct using proof tools In software, a program is very rarely proved correct Why?
More informationChapter 18 Vectors and Arrays [and more on pointers (nmm) ] Bjarne Stroustrup
Chapter 18 Vectors and Arrays [and more on pointers (nmm) ] Bjarne Stroustrup www.stroustrup.com/programming Abstract arrays, pointers, copy semantics, elements access, references Next lecture: parameterization
More informationChapter 1 Getting Started
Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different
More informationCS103 Spring 2018 Mathematical Vocabulary
CS103 Spring 2018 Mathematical Vocabulary You keep using that word. I do not think it means what you think it means. - Inigo Montoya, from The Princess Bride Consider the humble while loop in most programming
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #29 Arrays in C
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #29 Arrays in C (Refer Slide Time: 00:08) This session will learn about arrays in C. Now, what is the word array
More informationFree Ebooks A Python Primer For ArcGISÂ
Free Ebooks A Python Primer For ArcGISÂ The automation of geoprocessing tasks is becoming a common practice among GIS professionals. Python is the standard programming language for ArcGIS and other fields
More informationC++ for Python Programmers
C++ for Python Programmers Adapted from a document by Rich Enbody & Bill Punch of Michigan State University Purpose of this document This document is a brief introduction to C++ for Python programmers
More informationHow to approach a computational problem
How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to
More informationProgramming. Introduction to the course
Programming Introduction to the course Motivation 2 What is Programming? } Some definitions: } Telling a very fast moron exactly what to do } A plan for solving a problem on a computer } The process of
More informationIntroduction to OpenMP. Tasks. N.M. Maclaren September 2017
2 OpenMP Tasks 2.1 Introduction Introduction to OpenMP Tasks N.M. Maclaren nmm1@cam.ac.uk September 2017 These were introduced by OpenMP 3.0 and use a slightly different parallelism model from the previous
More informationFree Downloads The C++ Programming Language: Special Edition (3rd Edition)
Free Downloads The C++ Programming Language: Special Edition (3rd Edition) More than three-quarters of a million programmers have benefited from this book in all of its editions Written by Bjarne Stroustrup,
More informationProgramming with MPI
Programming with MPI p. 1/?? Programming with MPI Composite Types and Language Standards Nick Maclaren Computing Service nmm1@cam.ac.uk, ext. 34761 March 2008 Programming with MPI p. 2/?? Composite Types
More informationMessage-Passing and MPI Programming
Message-Passing and MPI Programming More on Point-to-Point 6.1 Introduction N.M. Maclaren nmm1@cam.ac.uk July 2010 These facilities are the most complicated so far, but you may well want to use them. There
More informationChapter 3 Objects, types, and values. Bjarne Stroustrup
Chapter 3 Objects, types, and values Bjarne Stroustrup www.stroustrup.com/programming Overview Strings and string I/O Integers and integer I/O Types and objects Type safety 3 Input and output // read first
More informationVisual Basic Primer A. A. Cousins
Hard Wiring The first research computers of the late 1940s were programmed by hard wiring. Cables were plugged and unplugged into huge patch boards to physically alter the electrical circuitry. To program
More informationC++ Support Classes (Data and Variables)
C++ Support Classes (Data and Variables) School of Mathematics 2018 Today s lecture Topics: Computers and Programs; Syntax and Structure of a Program; Data and Variables; Aims: Understand the idea of programming
More informationTDDD38 - Advanced programming in C++
TDDD38 - Advanced programming in C++ Course introduction Eric Elfving Department of Computer and information science 1 What is TDDD38 Syllabus Organization Exam Literature Plan 2 What is C++? History Design
More informationCPS122 Lecture: From Python to Java last revised January 4, Objectives:
Objectives: CPS122 Lecture: From Python to Java last revised January 4, 2017 1. To introduce the notion of a compiled language 2. To introduce the notions of data type and a statically typed language 3.
More informationIntroduction to C ++
Introduction to C ++ Philip Blakely Laboratory for Scientific Computing, University of Cambridge Philip Blakely (LSC) C++ Introduction 1 / 370 Part I Getting Started Philip Blakely (LSC) C++ Introduction
More informationIntroduction to Modern Fortran
Introduction to Modern Fortran p. 1/?? Introduction to Modern Fortran Advanced I/O and Files Nick Maclaren Computing Service nmm1@cam.ac.uk, ext. 34761 November 2007 Introduction to Modern Fortran p. 2/??
More informationErrors. Lecture 6. Hartmut Kaiser hkaiser/fall_2011/csc1254.html
Hartmut Kaiser hkaiser@cct.lsu.edu http://www.cct.lsu.edu/ hkaiser/fall_2011/csc1254.html 2 Abstract When we program, we have to deal with errors. Our most basic aim is correctness, but we must deal with
More informationComputers and Computation. The Modern Computer. The Operating System. The Operating System
The Modern Computer Computers and Computation What is a computer? A machine that manipulates data according to instructions. Despite their apparent complexity, at the lowest level computers perform simple
More information10 Strategies for Effective Marketing Campaigns
10 Strategies for Effective Email Marketing Campaigns Most people do not send effective email messages. I know. I spend a lot of time analyzing email messages for our clients, and measuring and tracking
More informationMath Modeling in Java: An S-I Compartment Model
1 Math Modeling in Java: An S-I Compartment Model Basic Concepts What is a compartment model? A compartment model is one in which a population is modeled by treating its members as if they are separated
More informationBEGINNER PHP Table of Contents
Table of Contents 4 5 6 7 8 9 0 Introduction Getting Setup Your first PHP webpage Working with text Talking to the user Comparison & If statements If & Else Cleaning up the game Remembering values Finishing
More informationPYTHON PROGRAMMING FOR BEGINNERS: AN INTRODUCTION TO THE PYTHON COMPUTER LANGUAGE AND COMPUTER PROGRAMMING BY JASON CANNON
PYTHON PROGRAMMING FOR BEGINNERS: AN INTRODUCTION TO THE PYTHON COMPUTER LANGUAGE AND COMPUTER PROGRAMMING BY JASON CANNON DOWNLOAD EBOOK : PYTHON PROGRAMMING FOR BEGINNERS: AN AND COMPUTER PROGRAMMING
More informationintroduction week 1 Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 imperative programming about the course
week 1 introduction Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 class format 30 minutes (give or take a few) presentation 60 minutes (give or take a few) practice
More informationHigh Performance Computing Prof. Matthew Jacob Department of Computer Science and Automation Indian Institute of Science, Bangalore
High Performance Computing Prof. Matthew Jacob Department of Computer Science and Automation Indian Institute of Science, Bangalore Module No # 09 Lecture No # 40 This is lecture forty of the course on
More informationIntroduction to OpenMP
1.1 Minimal SPMD Introduction to OpenMP Simple SPMD etc. N.M. Maclaren Computing Service nmm1@cam.ac.uk ext. 34761 August 2011 SPMD proper is a superset of SIMD, and we are now going to cover some of the
More information1 of 5 3/28/2010 8:01 AM Unit Testing Notes Home Class Info Links Lectures Newsgroup Assignmen [Jump to Writing Clear Tests, What about Private Functions?] Testing The typical approach to testing code
More informationWindows Script Host Fundamentals
O N E Windows Script Host Fundamentals 1 The Windows Script Host, or WSH for short, is one of the most powerful and useful parts of the Windows operating system. Strangely enough, it is also one of least
More informationTOPIC 2 INTRODUCTION TO JAVA AND DR JAVA
1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared
More informationProgramming with MPI
Programming with MPI p. 1/?? Programming with MPI Miscellaneous Guidelines Nick Maclaren Computing Service nmm1@cam.ac.uk, ext. 34761 March 2010 Programming with MPI p. 2/?? Summary This is a miscellaneous
More informationChapter 11 Customizing I/O
Chapter 11 Customizing I/O Bjarne Stroustrup www.stroustup.com/programming Overview Input and output Numeric output Integer Floating point File modes Binary I/O Positioning String streams Line-oriented
More informationNotes By: Shailesh Bdr. Pandey, TA, Computer Engineering Department, Nepal Engineering College
Preparing to Program You should take certain steps when you're solving a problem. First, you must define the problem. If you don't know what the problem is, you can't find a solution! Once you know what
More informationIn our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.
Guide to and Hi everybody! In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology. This guide focuses on two of those symbols: and. These symbols represent concepts
More informationIntroduction to Programming
CHAPTER 1 Introduction to Programming Begin at the beginning, and go on till you come to the end: then stop. This method of telling a story is as good today as it was when the King of Hearts prescribed
More informationWho am I? I m a python developer who has been working on OpenStack since I currently work for Aptira, who do OpenStack, SDN, and orchestration
Who am I? I m a python developer who has been working on OpenStack since 2011. I currently work for Aptira, who do OpenStack, SDN, and orchestration consulting. I m here today to help you learn from my
More informationCS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007
CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007 Course Web Site http://www.nps.navy.mil/cs/facultypages/squire/cs2900 All course related materials will be posted
More informationProgramming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Programming in C++ Indian Institute of Technology, Kharagpur
Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Programming in C++ Indian Institute of Technology, Kharagpur Lecture 14 Default Parameters and Function Overloading
More information(Refer Slide Time 3:31)
Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions
More informationChapter 8: User-Friendly Programming
Chapter 8: User-Friendly Programming So far we've discussed the use of style to make your code clear and easy to read. But style doesn't stop at the printed page. A program is not only edited, debugged,
More informationCOPYRIGHTED MATERIAL. Starting Strong with Visual C# 2005 Express Edition
1 Starting Strong with Visual C# 2005 Express Edition Okay, so the title of this chapter may be a little over the top. But to be honest, the Visual C# 2005 Express Edition, from now on referred to as C#
More informationHigh Performance Computing MPI and C-Language Seminars 2009
High Performance Computing - Seminar Plan Welcome to the High Performance Computing seminars for 2009. Aims: Introduce the C Programming Language. Basic coverage of C and programming techniques needed
More informationSEER AKADEMI LINUX PROGRAMMING AND SCRIPTINGPERL 7
SEER AKADEMI LINUX PROGRAMMING AND SCRIPTINGPERL 7 Hi everyone once again welcome to this lecture we are actually the course is Linux programming and scripting we have been talking about the Perl, Perl
More informationIntroducing Computer Programming
ok4 01 f2 5/24/17 9:59 AM Page 3 Chapter 1 Introducing Computer Programming Intended Learning Outcomes After completing this chapter, you should be able to: Explain the difference between computers and
More informationLinked Lists. What is a Linked List?
Linked Lists Along with arrays, linked lists form the basis for pretty much every other data stucture out there. This makes learning and understand linked lists very important. They are also usually the
More informationFormal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5
Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they
More informationMITOCW watch?v=w_-sx4vr53m
MITOCW watch?v=w_-sx4vr53m The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To
More informationExercises: Instructions and Advice
Instructions Exercises: Instructions and Advice The exercises in this course are primarily practical programming tasks that are designed to help the student master the intellectual content of the subjects
More informationPROGRAMMING: PRINCIPLES AND PRACTICE USING C++ (2ND EDITION) BY BJARNE STROUSTRUP
Read Online and Download Ebook PROGRAMMING: PRINCIPLES AND PRACTICE USING C++ (2ND EDITION) BY BJARNE STROUSTRUP DOWNLOAD EBOOK : PROGRAMMING: PRINCIPLES AND PRACTICE USING C++ Click link bellow and free
More informationLesson 1: Hello, world! Line by line explanation
Lesson 1: Hello, world! Line by line explanation Pic 10A Ricardo Salazar El chapulín colorado. (No contaban con su astucia) What is a computer? Computers can handle repetitive chores without getting bored.
More informationSubscripts and sizes should be signed
Doc. No. P1428R0 Date: 2018-01-18 Programming Language C++ Audience LEWG and EWG Reply to: Bjarne Stroustrup (bs@ms.com) Subscripts and sizes should be signed Bjarne Stroustrup The problem I write this
More informationProgramming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras
Programming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras Module 12B Lecture - 41 Brief introduction to C++ Hello, welcome
More informationJava: The Complete Reference, J2SE 5 Edition PDF
Java: The Complete Reference, J2SE 5 Edition PDF In this completely up-to-date volume, Herb Schildt, the world's leading programming author, shows you everything you need to know to develop, compile, debug,
More information5. Control Statements
5. Control Statements This section of the course will introduce you to the major control statements in C++. These control statements are used to specify the branching in an algorithm/recipe. Control statements
More informationprintf( Please enter another number: ); scanf( %d, &num2);
CIT 593 Intro to Computer Systems Lecture #13 (11/1/12) Now that we've looked at how an assembly language program runs on a computer, we're ready to move up a level and start working with more powerful
More informationIntroduction to Programming in C Department of Computer Science and Engineering. Lecture No. #43. Multidimensional Arrays
Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #43 Multidimensional Arrays In this video will look at multi-dimensional arrays. (Refer Slide Time: 00:03) In
More informationRead & Download (PDF Kindle) Data Structures And Other Objects Using C++ (4th Edition)
Read & Download (PDF Kindle) Data Structures And Other Objects Using C++ (4th Edition) Data Structures and Other Objects Using C++ takes a gentle approach to the data structures course in C++. Providing
More informationIntroduction to OpenMP
Introduction to OpenMP p. 1/?? Introduction to OpenMP Simple SPMD etc. Nick Maclaren nmm1@cam.ac.uk September 2017 Introduction to OpenMP p. 2/?? Terminology I am badly abusing the term SPMD tough The
More informationWhile waiting for the lecture to begin, please complete. the initial course questionnaire.
SENG 475 & ECE 569A: Advanced Programming Techniques for Robust Efficient Computing (With C++) Michael Adams Department of Electrical and Computer Engineering University of Victoria Victoria, BC, Canada
More information3. Simple Types, Variables, and Constants
3. Simple Types, Variables, and Constants This section of the lectures will look at simple containers in which you can storing single values in the programming language C++. You might find it interesting
More informationMITOCW watch?v=0jljzrnhwoi
MITOCW watch?v=0jljzrnhwoi The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high quality educational resources for free. To
More informationWeek 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966?
Week 5: Background A few observations on learning new programming languages What's wrong with this (actual) protest from 1966? Programmer: "Switching to PL/I as our organization's standard programming
More informationScientific Computing
Scientific Computing Martin Lotz School of Mathematics The University of Manchester Lecture 1, September 22, 2014 Outline Course Overview Programming Basics The C++ Programming Language Outline Course
More informationEffective TCP/IP Programming: 44 Tips To Improve Your Network Programs: 44 Tips To Improve Your Network Programs Ebooks Free
Effective TCP/IP Programming: 44 Tips To Improve Your Network Programs: 44 Tips To Improve Your Network Programs Ebooks Free An excellent next-step for students who have read Stevens' TCP/IP Illustrated
More informationCMPT-101. CMPT-101-D2, Spring Course Web Page Course Mailing List. Exams. Assignments
CMPT-101 CMPT-101-D2, Spring 2000 Week 1, Introduction Instructor: Toby Donaldson An introduction to programming and computer science Covers the basic ideas used in (most) major general-purpose programming
More informationChapter 2, Part I Introduction to C Programming
Chapter 2, Part I Introduction to C Programming C How to Program, 8/e, GE 2016 Pearson Education, Ltd. All rights reserved. 1 2016 Pearson Education, Ltd. All rights reserved. 2 2016 Pearson Education,
More informationInstructor. Mehmet Zeki COSKUN Assistant Professor at the Geodesy & Photogrammetry, Civil Eng. (212)
Instructor Mehmet Zeki COSKUN Assistant Professor at the Geodesy & Photogrammetry, Civil Eng. (212) 285-6573 coskunmeh@itu.edu.tr http://atlas.cc.itu.edu.tr/~coskun Address Consultation of Students: Monday
More informationCOSC 2P95. Introduction. Week 1. Brock University. Brock University (Week 1) Introduction 1 / 18
COSC 2P95 Introduction Week 1 Brock University Brock University (Week 1) Introduction 1 / 18 Lectures and Labs Lectures are Thursdays, from 3pm 5pm (AS/STH 217) There are two lab sections Lab 1 is Mondays,
More informationRoom 3P16 Telephone: extension ~irjohnson/uqc146s1.html
UQC146S1 Introductory Image Processing in C Ian Johnson Room 3P16 Telephone: extension 3167 Email: Ian.Johnson@uwe.ac.uk http://www.csm.uwe.ac.uk/ ~irjohnson/uqc146s1.html Ian Johnson 1 UQC146S1 What is
More informationIf Statements, For Loops, Functions
Fundamentals of Programming If Statements, For Loops, Functions Table of Contents Hello World Types of Variables Integers and Floats String Boolean Relational Operators Lists Conditionals If and Else Statements
More informationIntroduction to Programming using C++
Introduction to Programming using C++ Lecture One: Getting Started Carl Gwilliam gwilliam@hep.ph.liv.ac.uk http://hep.ph.liv.ac.uk/~gwilliam/cppcourse Course Prerequisites What you should already know
More informationstatic CS106L Spring 2009 Handout #21 May 12, 2009 Introduction
CS106L Spring 2009 Handout #21 May 12, 2009 static Introduction Most of the time, you'll design classes so that any two instances of that class are independent. That is, if you have two objects one and
More informationRIS shading Series #2 Meet The Plugins
RIS shading Series #2 Meet The Plugins In this tutorial I will be going over what each type of plugin is, what their uses are, and the basic layout of each. By the end you should understand the three basic
More information6.001 Notes: Section 8.1
6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything
More informationCircuitPython 101: Working with Lists, Iterators and Generators
CircuitPython 101: Working with Lists, Iterators and Generators Created by Dave Astels Last updated on 2018-11-01 12:06:56 PM UTC Guide Contents Guide Contents Overview List Functions Slicing Filtering
More informationMITOCW watch?v=flgjisf3l78
MITOCW watch?v=flgjisf3l78 The following content is provided under a Creative Commons license. Your support will help MIT OpenCourseWare continue to offer high-quality educational resources for free. To
More informationGame keystrokes or Calculates how fast and moves a cartoon Joystick movements how far to move a cartoon figure on screen figure on screen
Computer Programming Computers can t do anything without being told what to do. To make the computer do something useful, you must give it instructions. You can give a computer instructions in two ways:
More informationIntroduction to OpenMP
Introduction to OpenMP p. 1/?? Introduction to OpenMP Synchronisation Nick Maclaren Computing Service nmm1@cam.ac.uk, ext. 34761 June 2011 Introduction to OpenMP p. 2/?? Summary Facilities here are relevant
More informationCSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York
CSc 10200! Introduction to Computing Lecture 1 Edgardo Molina Fall 2013 City College of New York 1 Introduction to Computing Lectures: Tuesday and Thursday s (2-2:50 pm) Location: NAC 1/202 Recitation:
More informationCOMP1917: Computing 1 1. Introduction
COMP1917: Computing 1 1. Introduction Reading: Moffat, Chapter 1. COMP1917 15s2 Introduction 1 Course Web Site http://www.cse.unsw.edu.au/~cs1917/15s2 Please check this Web Site regularly for updated information,
More informationRead & Download (PDF Kindle) Programming Python
Read & Download (PDF Kindle) Programming Python If you've mastered Python's fundamentals, you're ready to start using it to get real work done. Programming Python will show you how, with in-depth tutorials
More informationAbstract. Chapter 6 Writing a Program. Overview. Writing a program: Strategy. Building a program. Bjarne Stroustrup
Abstract Chapter 6 Writing a Program This lecture and the next describe the process of designing a program through the example of a simple desk calculator. Bjarne Stroustrup www.stroustrup.com/programming
More information