Announcements
- To translate between a string and the proper C type of string needed
in example() you can use this code:
char *tempStr;
tempStr = new char (filepath.size() + 1);
strcpy(tempStr, filepath.c_str());
cout << "Image name is: " << tempStr;
example(tempStr);
To see a png image when running the LodePNG library on Rohan, you
have to ssh into Rohan using the -X flag:
ssh -X barr@rohan.ithaca.edu
Here's how to do conditional inclusions for .h file in C++:
#if !defined (NameH)
#include "Name.h"
#endif
You will need to have a line like
#define NameH "George"
in your
Name.h file.
Several people have had problems with lab 8 and their stack. The general
problem is that the pass a pointer to the top of their stack into the push() function
and change the value of this pointer. You should think of a pointer passed into a
function as a constant pointer (like an array name). You can use it as a pointer
and change what it points to, but you cannot change the pointer itself. This is not
exactly true; I'll talk about what's really happening in class
You will get lab 6 back in class on Monday, 7 Nov. You may re-submit
lab 7 after reading the comments on lab 6, but you must put this lab in
the Student/Turnin/lab7 folder by beginning of class on Wednesday, 9 Nov.
Some clarification on comments for classes:
-
for the .h file, put an overall comment like you do at the beginning of the file
containing the main() function. You should list the purpose (reason for existing)
of the class. You don't need an algorithm. You don't have to provide comments
before the functions in the .h file, but should provide comments before the
implementations of the functions in the .cpp file.
- In the implementation .cpp file for a class, you should provide a comment
at the beginning of the file (name, date, etc.) that tells me which class this
implements. You should have comments before every function just like in past projects.
Jonathan found a subtle g++ problem. If you have a file that ends in ".gch" in
your directory it could confuse g++. So make sure you delete all files ending in ".gch".
To delete a file from the command line, use the rm command:
rm name.h.gch
Exam 2 will be next Wednesday, 9 November,
from 5:309-7:00pm in a room TBA.
Due Dates. Here are the due dates that we
agreed on during class Wednesday:
- Lab 7: Due next Tuesday, end of class.
- Practicum 1: Due Tuesday, 8 November at
midnight. 12.5% penalty per day late, last
day to turn in is Friday, 13 November.
In addition, we talked about some restrictions on Practicum 1. You must use a class for your
list node and for your appointments. You may not use a struct for either (you may use a struct for
the list node on lab 7, however). There was something else, but I can't remember it now.
Note that what is labeled as "lab 7" in Salon will count as "practicum 1" due
to it's size and complexity.
The programming style guide has been updated (as of 22 Oct). Please take a look
at it before you complete lab 7.
As the computer revolution gets older, some of the founding people
are starting to pass away (see
wikipedia for a list of famous computer scientists). Some giants that have recently passed on include:
- Dennis Ritchie, one of the creators of the C programming lanauge (along
with
Ken Thompson). See
C|Net news and
wikipedia
- Steve Jobs, the person perhaps most directly responsible for the personal
computer revolution. See the
Wired article or the
wikipedia article.
Exam 1 will take place on Thursday, 5 Oct, in Williams 211 from 5:30 to 7:00pm. If you
have problems with that time, we can arrange a make-up time.
Everyone has Rohan accounts! Please log-in, change your password, and
try a simple compile.
Some notes on labs:
- Only turn in .cpp and .h files. Do not turn in
any visual studio files.
- Do not use non-standard C++ libraries in your code.
- You may re-turn-in labs 2 and 3 by putting (only the .cpp and .h)
your folders with your solutions back into Nova.
Exam 1 will take place
on Thursday, 5 October, at 5:30 or 6:00pm in a room TBA. Please let me
know if you have a conflict with this time.
The Ithaca College career center is having a "networking" night on
Tuesday, 27 Sept, from 6:00 - 8:00pm (check in by 5:30pm). There will be
several local IT professionals there, so it would be a good opportunity to
find an internship or summer job. See this
intercom article
I put another example IO program up. See the "Reference" -->
"C++ Program Examples" --> testIOString.cpp. I also put a file named
"names.txt" that you can use with this program. The program calls a
function that reads strings into an array, prints the array out in the
main function, then calls a function to store the strings into a file.
There are also assertions in this program.
I also added the same example but using pointers. See the file
"testIOStringPtr.cpp".
Don't forget to read "Ender's Game" and answer the questions on
Salon. It's due on Wednesday, 21 September.
Click here to see the image for lab 1:
If you have questions about the lab, please post them on Classroom
Salon. I'll keep checking that to post updated. If you know the answer to
a question that someone has asked, feel free to answer it as best you can.
I've added to tags to lab 1 in Classroom Salon, "syntax" and
"specifications". When you ask a question, please label the question
appropriately. It'll just help me figure things out more quickly.
Steve Jobs on running a company:
Apple is a $30 billion company [note: it now has almost $80 billion
in the bank], yet we've got less than 30 major
products. I don't know if that's ever been done before. Certainly the great
consumer electronics companies of the past had thousands of products. We
tend to focus much more. People think focus means saying yes to the thing
you've got to focus on. But that's not what it means at all. It means
saying no to the hundred other good ideas that there are. You have to pick
carefully.
About Comp 22000
Comp 22000, Introduction to Data Structures, is designed to provide you with
the conceptual framework to solve large problems using computers. To this
point in your education you have learned to solve problems using computers in
very small contexts. You have gained an important foundation in programming.
To solve significant problems, however, you need to understand how to effectively
store, access, and modify large amounts of data and how to process that data in
the most efficient manner. You also need to be able to communicate to other
people, computer scientists or not, how your solution works and how they can
use and modify your solution.
On a practical level, this course is taught in C++. You will learn this language
and how to use some of the standard libraries associated with it and how to
use C++ development environments.