CS 204 Lectures Overview This document gives an itemized topic list and points to some (concrete) items that students should know by the end of the course. Note that this is not intended to replace your studying of the lecture slides. There are certain topics I indicate that you will for sure receive questions from; if nothing is said, it means you mayo r may not get a question. Lect1a-intro-style-debugging: This slide gave course information, as well as an introduction to style requirements, including naming conventions, different styles and levels of commenting. It also presented some good programming practices. You should certainly know: Preprocessor, compile and link steps – what they do and what their outputs are Preprocessor directives o Use as header guards (guards to prevent multiple inclusion of header (.h) files) o Predefined preprocessor directives – NDEBUG, _DEBUG o Use of preprocessor directives/variables for debugging o How to set your own preprocessor variables. Debug/Release code: o Differences between debug and release versions of a code o Assert statement – its meaning, where used, how it works in release mode o Other debugging methods (if/else, preprocessor directives…) Macros o How to define o Potential problems o Beter alternatives (inline functions) Libraries o What static and dynamic libraries are Advanteges, disadvantages o How to create a static library Lect1b-arrays: How to declare and initialize fixe size built-in arrays How to pass as parameter Potential problems (index out of bounds, resizing needs) Lect1c-WritingEfficientCode: Space/Time trade-off o How you can save run time by precomputing and saving calculations Difference between algorithmic and program efficiency o Use the best algorithm and code it right so that there is no inefficiency in the program o Both are also different than how efficiently you program! How to improve program efficiency o You should be able to improve a given piece of code o Concept of sentinel and how it reduces run time o Avoid unnecessary statements o Look-Up-tables (LUT) The sigmoid example is general, you do not need to know sigmoid function etc., but how the general idea works. Static vs Global variables o How to define o Scope (where you can access them) and lifetime Profiling o Its purpose and what it outputs – not further details You will be asked a 10-15 pt question from here. Lect2-pointers….: Pointer basics o How to define a pointer variable o How to dereference (*p) o How to access individual elements pointed by a pointer (p->) Dynamic memory allocation o Use of new o Memory and pointers Stack and heap delete returning a pointer o Defining 2D arrays using pointers Linked data structures using pointers o Use of struct as a node Using pointers to traverse arrays (static or dynamic) for efficiency o When and how You will be asked a 10-15 pt question from here. You should be able to implement a linked structure using pointers, or modify a given code… Lect3-templated: Function overloading o Purpose and how to Templated functions o Purpose and how to When to select each option, pros and cons Templated classes o Purpose and how to o Issues - compiler needing Function objects (after slide 19) are NOT covered Lect4-adv-classes: Sharing a variable between different instances of a class o Using pointers or reference variables Iterator class o You should be able to define one over a container class – also shows understanding of classes Constructor, destructor o You should very well know when these are called, when they need to be provided by the programmer Copy constructor o When is it called (linkedlist newlist (myprevlist) o Deep versus shallow copy – meaning Operator overloading o Purpose (user convenience…) o How to You will be asked a 10-15 pt question from here. Lect5-number representation: You should know about different ways to represent an integer o Sign/magnitude, 1s complement, 2s complement formats o How to represent a negative or positive number in each format o You shd be able to calculate the range of a given format and size (i.e. 2s coml, 8 bit numbers) Advantages of 2s complement format Converting a given format to another (you must know the size – how any bits you have for this) o E.g. decimal to 8bit 2s complement and back You should know what overflow means (number does not fit in allocated bits) o How it is detected (hardware level) Built-in types o int – 2-4 bytes (most often 4) o short: 2bytes, long: 4 bytes Bit operations o Bitwise AND, OR, complement (does NOT mean 2s complement) o Shift (for signed and unsigned) and that it works as a fast multiplication when applicable o Packing 8 bits into 1 byte (char) variable How to set and read off the bytes Hexadecimal values o Converting to binary/decimal and back Initializing a variable giving a hexadecimal value (e.g. unsigned char c = 0x80;) o Interpretations according to variable type Floating point representation o Converting a real number to binary format o IEEE Float. Point representation Standard – as much as I have asked in Mt2 o Rougly knowing the ranges You will be asked a 10-15 pt question from here. Lect6-bitops: Binary versus ASCII files o You should recognize them if you see one. o Default output types for char, int, float… o How to change the default and output ASCII or Binary No need to memorize the command but roughly know o What is output for a given data type in either file type I have put some 2007 materials which showed the use of bit operations for packing data, in a homeowork, into a separate folder. You do not need to study those. Lect7-inheritance: Deriving a new class from a base class o Why and how (you should be able to do this without any cheat sheet) Inheritance capabilities (adding new functions or members, inheriting, overriding) Private and Protected keyword in the context of inheritance o Can subclasses acces private/public members of the base class directly? How about indirectly? Constructors and destructors of derived classes o Implementing them using the most suitable base class constructor Copy constructor o Remember this is a constructor – so most/all of the same rules apply o Implementing them using the most suitable base class copy constructor o What happens if you do not write a constructor, destructor, copy constructor in general and in derived classes Virtual keyword o What it means o What problems may ocur if you do not use Not proper behavior even if we use pointers Polymorphism o You should be able to create and use an array of pointers to a base class to hold elements of derived classes to achieve polymorphic behavior Pure virtual functions and abstract classes o What is an abstract class and what is its purpose? o Can you instantiate an object from an abstract class? You will be asked a 10-15 pt question from here. Lect8-9-visualprogramming: How to add menu buttons (not exact steps but the general idea) How to connect menu buttons to functions Windows messaging: what is it? How it works? You will be asked a 5-10pt question from here, things that you would certainly know if you did your homework. Lect10-exceptionHandling: How the try/catch code works. Know about: o exception types o exception hierarchies o uncaught exceptions o catch(…) o scope and destruction of local variables You will be asked a 5-10pt question from here. You will need to write some code and/or answer question such as the one in mt2 about which catch blocks would be executed in a given code. Lect13-UNIX: Basic UNIX commands Makefiles o Dependency line o Command line to build the target Lect11-threads: Understand the need for multi-threaded programs Differentiate a process and a thread o What do the threads within a process share in common o What do they have per thread o What is the main thread How to create, wait for, suspend/resume a thread What waitfor… functions do Critical sections o You should be able to identify these areas o Synchronization using mutexes How to call the thread function of a class object You will be asked a 15-20 question from here. You may be asked to create coule of threads but you will be given the signatures of functions as reminders (MFC or WINAPI) or you will be asked to just fill in the blank or the output of a given code… You should play with the given code samples since you have not done a homework using threads. Reminder: You do not need to know anything in slides marked as ADVANCED. Lect12-sockets: Internet Protocol Suite and the TCP, IP, UDB protocols o Their basic role and functionalities Defining a socket Binding a socket to an IP Address Client and Server functions o Connect, bind, listen, accept, send, recv, close You will be asked a 10-15pt question from here. Since you have not yet done your homework on this topic, the question may give you some code and ask what it is doing (specifically, in each line) or give some reminders about socket API and ask you to fill-in-the-blank OR ask more general things (like the order of socket operations or what a given socket function (e.g. bind) does). In other words, you wont be asked to write code from scratch, without any reminders/hints. You should be aware that we have not done week15-webprogramming this year!