EE 355 Preparation
Welcome to EE 355. EE 355 is a fairly rigorous C++ programming class. While I will try to convince you of the importance of programming in a language like C++ when the semester begins, I thought I'd offer a few preparation exercises that you can do over the break. I realize many of you have seen only limited amounts of C in EE 150. So for you it will be important to read and program some in advance.
Installing the VM and Tools
If you want to get a headstart in your preparation for the fall you can consider performing the following actions:
- Order the textbook: Cay Horstmann. C++ for Everyone, 2nd Ed.. ISBN: 978-047092713-7
- So that we have a common coding environment and software toolchain we will use a Linux Virtual Machine. To run this virtual machine you will need to download Oracle Virtual Box. Start by trying to download version 4.3.18
- Install Oracle Virtual Box and follow the default instructions
- Next Download the virtual machine image. We recommend using 'curl' which is already installed on Mac and Linux machines. A Windows version is available here...you can install the 32- or 64-bit MSI installer. 'curl' is a command line utility to download files from the Internet. Go to a folder where you want to download the file and start a command prompt (Windows) or Terminal there. Then run the command
curl http://ee-classes.usc.edu/cs101/course-vm-2014.ova -o course-vm-2014.ova
(The actual URL link is available here.)
- [Optional]Download an MD5 hash verfication program (here's one). Compute the MD5 of the .ova file you downloaded (with such a big file sometimes bits get corrupted that will cause the VM to be unable to install). Verify the MD5 has matches the original MD5 value: c045938159ce49f6bccc969bbce63df0
- Start Virtual Box and choose File..Import. Then select the Ubuntu Virtual Machine (course-vm.ova) you downloaded. Use the default import options
- Click on the Course VM option that now appears in VirtualBox's list and select Start/Run. This will start the VM and bring you to a logon message. (Answer yes or default answer to any dialog box that appears).
- If you encounter errors starting your VM go to the Troubleshooting Section and then resume these directions.
- Finishing the setup
- Login with the username: student and password: developer
- Hit Ctrl-Alt-T to start a terminal window where you can type in commands
- Install the Virtual Box Guest Additions as detailed in the Do's and Dont's Section
- Pick and setup a method to backup your files as detailed in the Do's and Dont's Section
- If you haven't worked with Linux, check out a Linux tutorial such as this one (Tutorials 1-6) or possibly this one.
- For starters, work through this tutorial. Start from the beginning and continuing through pointers. Write down any questions or unclear statements. We can discuss them at the beginning of the semester. Also, I have made lecture videos on most of these topics available at this CS Modules Site. Please be sure you know the material covered in the first 3 modules (C++ Introduction and Control Structure and Functions) before coming to class. See the next section for details
Learn C before the Semester
From the CS Modules Site watch:
- C++ Introduction (A whirlwind tour) (Watch before the 1st day of class)
- Control Structures (Watch before the 1st day of class)
- Functions (Watch before the 2nd week of class)
- Arrays and C-Strings (Watch before the 2nd week of class)
I expect that EE 150 should have at least helped you understand the majority of these topics (Chapters 1-4 in the textbook..peruse and actually read these as a refresher).
When you have reviewed, please complete the following Assessments on Blackboard. Log-in, go to EE 355's page, click on Assignments then HW's. You should take the following assessments:
- HW - Expressions & Data Types (Due 2nd Wednesday [1/21] before class)
- HW - Conditionals and Loops (Due 2nd Wednesday [1/21] before class)
- HW - Functions (Due 3rd Monday [1/26] before class)
While these are due in the 2nd and 3rd week of the semester, I would highly recommend you complete these over winter break and come into class having done these (you may take them as many times as you like).
As another source, I also recommend Learn C the Hard Way which sounds bad but is a nice step-by-step tutorial. Only go through Exercise 16 at most and then stop. While this tutorial is C based (and we're learning C++ in this class) a large percentage is common between C and C++ and thus will be useful to you.
As practice you can also complete the following programming exercises specified in the book. We may go over some of these in the first week or two of class. So having done these beforehand will be EXTREMELY beneficial (I won't say you have to, but I think you should do as much as you can before coming to class and then we'll review).
Looking forward to spring
Prof. Redekopp
- When you shutdown your VM NEVER "Save the State" of the machine but instead "Power off" the machine or send the "Shutdown Signal"
- In your Linux VM do NOT install any updates or upgrades to the OS or other source if it prompts you. Just use the VM as it is.
- DO install the “Guest Additions” to your Linux VM. This will allow you resize the resolution/window and also support shared folders between your Host and Guest OSs. To do this, start your VM and click the Devices Menu..Install Guest Additions. You may have to enter your password (“developer”) or hit ‘Enter’ once or twice, but other than that it will just run and take a few minutes. When complete it will say “Hit Enter to close the window”. At this point restart your VM and everything should be working.
- DO find a way to back up your code on the VM.
- You can install Dropbox on the Linux VM and in that way your files will automatically be copied and sync’ed with that service.
- The installation instructions are given here. As of Oct 27 2014, they say to enter the following commands one after the other in a command prompt:
- cd ~
- wget -O - https://www.dropbox.com/download?plat=lnx.x86_64 | tar xzf -
- ~/.dropbox-dist/dropboxd &
- Follow the default options in the installer.
- This will create a folder /home/student/Dropbox (a.k.a. ~/Dropbox). If you keep all of your work in there, it will all be synced. Don’t move or rename the Dropbox folder.
- Alternatively, you can use the shared folders feature that is part of the VirtualBox service. Follow these steps to create a shared folder in VirtualBox (NOTE: “guest” or “VM” means the Linux box that you run your code on, while “host” means the system that you normally run.)
- Make a folder called “csshare” or “ee355_files” somewhere on your host machine.
- Open VirtualBox and open the settings for the VM.
- Click on the “shared folders” button.
- Click the somewhat-obscure folder with a green + on it to add a shared folder to the list choosing . In the Folder Path box browse to the folder on the host that you want to share/make available (i.e. the “eeshare” or “ee355_files” you just created). The Folder Name will automatically populate with the folder you just chose. Make sure “Auto-mount” is checked.
- Press OK.
- Open up the VM.
- Open a Terminal window.
- Type
mkdir ee355
to make the directory share in your root directory.
- Type
sudo mount -t vboxsf eeshare ee355
to make the connection between “eeshare” on the Host and “ee355″ on your VM. You can then “cd” into the “ee355″ folder on your VM and view or create new files which will actually be updating the “eeshare” folder on your host OS.
- From here you can treat share just like any other folder on your linux guest.
- Note: The initial steps need only be done once. However, to access your shared folder you will need to run the
sudo mount -t vboxsf csshare ee355
command each time you start your VM.
In this section, we briefly go over common problems with VirtualBox and Ubuntu.
- In the “Settings” menu, if there is a sign at the bottom of the window that reads “non-optimal”, it means you have chosen a wrong setting. Hover your mouse over the warning message to get the details.
- The error “Failed to install NtCreateSection monitor” on Windows can be due to a known bug. Try downloading the test build here.
- Error “VT-x features locked or unavailable in MSR”: You need to enable Virtualization for your laptop. If you don’t do this, Ubuntu won’t be able to take advantage of all your CPU power. Usually virtualization is disabled by default on PC laptops and enabled by default on Mac laptops. Here is how to enable it on Windows:
- Enter the bios settings. This is different from laptop to laptop so you have to Google it and find the instruction for your make and model. For example something like this “Laptop HP dv6 bios virtualization”. Usually, you have to keep pressing F2, F10, or something similar at the very beginning of your laptop power on. This is before Windows starts.
- Find the “Virtualization” setting in the sub menus and set it to “ON” or “Enable”.

- Save and Exit.
- Older laptops might not have a virtualization option. In that case switch back to single-core VM.
- If problems still persist, try uninstalling VirtualBox 4.3.18 in favor of an older version 4.3.12 or 4.3.14 (start with 4.3.12) available at the Older Build Site. Once you've uninstalled 4.3.18 and reinstalled 4.3.12 or 14, then re-import the VM image (course-vm-2014.ova)
- If you can't connect to the Internet from your VM, simply try rebooting the VM (not your whole PC). When the wireless connection changes the VM seems to be unable to pick up the new connection w/o a reboot.