Campuswire 239 followers on LinkedIn. It’s time to bring course communication into the 21st century. Campuswire is a messaging platform for college classes. Conservative students are routinely bullied, heckled, silenced, marginalized, and even physically attacked on college campuses.They are told to keep their opinions to themselves, that their beliefs are unwelcome at the university level. This brazen assault on young conservatives for their principles must be stopped—but first, it must be exposed.
These installation instructions assume a basic working knowledge of the“command line” or “terminal”, which is used (e.g.) in CS 1110. If you need to brush up on the command line, it would be a good idea to google fora tutorial.
You need to have a Unix development environment with a workinginstallation of OPAM, the OCaml Package Manager, version 2.x. You havea choice: you can install these on your own operating system, or you candownload a Linux virtual machine (VM) that we provide.
- For Linux or Mac OS X, we suggest trying a native installation first.If that doesn’t work out, install the VM instead.
- For Windows, we suggest trying a semi-native installation first.This is a new and experimental possibility; we haven’t been able tosupport it before in 3110. It’s made possible this semester by someadvances that Microsoft has recently made with integration of Linuxand Windows. We hope it works out, but please bear in mind that it’snew to the course staff, so we might not have all the answers rightaway. If it doesn’t work out, you can still use the VM, which is whatwe’ve recommended in the past for Windows.
Regardless of what you choose, once you get an installation workingkeep it working throughout the semester by being cautious about any updatesyou apply to your system. Don’t perform any major OS upgrades just beforean assignment is due, for example.
Click on the installation method below that you want to use. If you get stuck,please follow the instructions under “Need help?”.
VM installation
WARNING: Do not use a VM from an old edition of CS 3110. Only the Fall 2019 VMwill be supported this semester.
With Virtual Machines, there are two operating systems involved: the host operating system (OS) and the guest OS. The host is your own native OS (probably Windows). The guest is the OS that runs “inside” the host.We provide a Linux guest OS in the 3110 VM.
- Download and install VirtualBox for your host OS. Or, if you already had it installed, make sure you update to the latest version of VirtualBox before proceeding.
- Go to the 3110 virtual machine download page (that hyperlink will becomeactive shortly before the semester starts). Don’t worry about the“We’re sorry, the preview didn’t load” message you see at that link. Click the Download button and save the
.ova
file wherever you like. It’s about a 4GB file, so the download might take awhile. - Import the virtual machine:
- Run VirtualBox.
- Select File → Import Appliance
- Choose the
.ova
file you just downloaded. Click Next, then Import.
- Run the virtual machine:
- Select vm3110-2019fa from the list of machines in VirtualBox.
- Click Start.
- If you get an error about “VT-x/AMD-V hardware acceleration”, you most likelyneed to enter your computer’s BIOS settings and enable virtualization. The detailsof that will vary depending on the model and manufacturer of your computer.If you get stuck, please see a consultant for help.
- Login with username
vagrant
and passwordvagrant
.(In case you’re curious, this is the standard username/password on a VM builtwith Vagrant, which is what we use to automate our production ofthe VM. In fact, you can see the scripts we use to build the VM in thisGitHub repo.If you’d rather have a user account on the VM with your own username ratherthanvagrant
, you are welcome to create a new account. But be aware that OPAMand VS Code won’t be configured for that user. The instructions to do thatinitialization can be found below under “OPAM configuration” and“VS Code configuration”.) - To launch the OCaml toplevel:
- Start a terminal by choosing the 2nd icon down from the top in the launcheron the left-hand side of the desktop.
- Run
utop
. Enter3110;;
followed by the Enter key to evaluate theinteger 3110. Stop to appreciate how good an integer it is. - Enter
#quit;;
or Control-D to exit the toplevel.
- You can use the guest OS’s own interface to safely shutdown or rebootthe VM. But more often you will likely use VirtualBox to close the VM byclick the VM window’s “X” icon in the host OS. Then you will bepresented with three choices:
- Save the machine state. This choice is what you normally want.It’s like closing the lid on your laptop: it puts it to sleep, andit can quickly wake.
- Send the shutdown signal. This choice is like shutting down a machineyou don’t intend to use for a long time, or before unplugging a desktopmachine from the wall. When you start the machine again later, it will have to boot from scratch, which takes longer.
- Power off the machine.This choice is dangerous. It is the equivalent ofpulling the power cord of a desktop machine from the wall while the machineis still running: it causes the operating system to suddenly quit without doing anycleanup. Doing this even just a handful of times could cause thefile system to become corrupted, which will cause you to lose yoursource code and have to reinstall the VM from scratch. You will be very unhappy.
- Now setup a shared folder between the host and guest OS. https://vwzzqc.weebly.com/zeroner-app-for-mac.html.
- With the VM shutdown (i.e., select “send the shutdown signal”),click Settings, then click Shared Folders.
- Click the little icon on the right that looks like a folder with a plus sign.
- In the dialog box, select a Folder Path. This is the folder on your hostOS that you want to share with the guest OS. Let’s assume youcreated a new folder named
vmshared
inside your Documentsfolder, or wherever you like to keep files. - The Folder Name in the dialog box will automatically be filled with
vmshared
. This is the name by which the guest OSwill know the folder. You can change it if you like. - Check Auto-mount and Make Permanent; do not check Read-only. Make the Mount Point
/home/vagrant
. Click OK, then click OK again. - Start the VM again.
- You should now have a subdirectory named
vmshared
in your home directory. Itis shared between the host OS and the guest OS. You can use it toeasily transfer files between the two.
- You’re done!
- If you wish, you can safely delete the
.ova
file you downloaded to free up some space. Mac disk space app. - You might be able to improve the performance of your VM by increasing the amountof memory or CPUs allocated to it, though it depends on how much youractual machine has available and what else you have running at the same time.With the VM shut down, try going in Virtual Box to Settings → System,and tinkering with the Base Memory slider on the Motherboard tab, andthe Processors slider on the Processor tab. Then bring up the VM againand see how it does. You might have to play around to find a sweet spot.
Semi-native installation: Windows
Overview: We’re going to install a Linux environment inside Windows 10.Microsoft calls it the “Windows Subsystem for Linux” (WSL). Thenwe’ll install inside OPAM inside WSL. Here is an (optional)introduction to what WSL is and why you need it.
- Don’t skip this first step:in beta testing of these instructions, mostproblems resulted from having older builds.Check your Windows build. To do that, click Start, type
winver
, andpress Enter. A dialog box will open. Look on the second line for “OSBuild XXXXX.YYY”. If the XXXXX part of that is a number smaller than17643, you must update Windows now: go to “Settings → Update &Security → Windows Update → Check for updates” and installupdates. When finished, runwinver
again to double check that thebuild is 17643 or greater.If you can’t get a recent build—perhaps because your hardwareis a bit older—you’ll need to install the VM. You could trythese instructions to install WSL on older builds. But,(i) we don’t know whether they will work, and (ii) you still mighthave unknown troubles installing OPAM.
- Open Windows PowerShell as Administrator. To do that, click Start,type PowerShell, right click on “Windows PowerShell” (which should be atthe top as the best match), and click “Run as administrator”. Click Yesto allow changes.
- At the prompt (which is probably something like
PS C:windowssystem32>
),enter the following command: - If you are prompted to restart, do so. Otherwise, close PowerShell.
- Click Start, type Microsoft Store, and open the Microsoft Store app. ClickSearch, and type Ubuntu. Scroll down to Apps, and choose Ubuntu,which should be the first result. (Make sure to chose “Ubuntu” not“Ubuntu 16.04 LTS”. In theory “Ubuntu 18.04 LTS” would be fine,because that’s what “Ubuntu” ought to install anyway.) From theUbuntu page, click Get. After the download finishes, click Launch. The install will then finish.
- You will be prompted to create a UNIX username and password. You can useany username and password you wish. It has no bearing on your Windowsusername and password (though you are free to re-use those). You willneed to remember the password for future use.
- You will now be inside a terminal at the Bash shell. The prompt will looksomething like You’ll want to make sure copy-and-paste into the terminal is enabled: Clickon the icon on the top left of the shell window, click Properties, andmake sure “Use Ctrl+Shift+C/V as Copy/Paste” is checked. (If youdon’t see that option, your Windows build is too old. Make sure youupdated Windows to a new enough build, as described above. Right-click might still work to paste even if you don’t have a newenough build.) Now Ctrl+Shift+C will copy and Ctrl+Shift+V will pasteinto the terminal. Note that you have to include Shift as part ofthat keystroke.
- Enter the following command into the shell: You will be prompted for the UNIX password you chose. The command that you arerunning is updating the APT package manager, which is what helps install softwareinside WSL. The prefix
sudo
means to run the command as the administrator,aka “super user”. In other words, do this command as super user,hence, “sudo”.Pro-tip:Running commands withsudo
is potentially dangerous and should not be donelightly. Do not get into the habit of puttingsudo
in front of commands. - Now run this command to upgrade all the APT software packages; it will take awhile.If you are prompted about configuring libssl, just hit Enter to accept the defaultchoices.
- Run this command to install some additional packages:
- WSL has its own filesystem that is distinct from the Windows filesystem.You can edit Windows files from WSL, but you cannot edit WSL files fromWindows. So we need to create a Windows directory in which you will store allyour 3110 work. Go ahead and do that with the Windows File Explorerwherever you like. For example, you might create a new folder inyour
Documents
called3110
. - Now from the WSL Bash shell, run this command to make your 3110 folder easilyaccessible from WSL: Replace
<windows user name>
with whatever your Windows user name is. If you’renot sure, go to the Windows Start Menu and typecmd
. A Windows shell will open,and the prompt should beC:Users<windows user name>
. If you chose a differentfolder name in the previous step, then replaceDocuments/3110
with whatever you chose. You 3110 Windows folder will now be accessible from your WSL homedirectory.For more information about the differences between the Windows and WSL filesystems,and how to work with them, see this guide.
Campuswire App For Macbook
- Install OPAM by running these commands: (You might wonder why we’re not installing OPAM through APT. The problem is thatAPT has OPAM version 1, not version 2. So we have to manually install OPAM insteadof using APT to do it automatically.)
- Continue with the instructions under “OPAM configuration” below.
Native installation: OS X
You need a Unix package manager. There are two popular managers on Mac,MacPorts and Homebrew. The instructions below assume MacPorts.Whatever you do, do not install both. They do not play nicelytogether.
If you previously installed one of them, make sure it is inworking order and fully up-to-date before proceeding. With MacPorts,that means running
sudo port selfupdate
followed by sudo port upgradeoutdated
. If there are any errors, you need to resolve them beforeproceeding. Often the easiest way to do that is to uninstall the packagemanager then reinstall it from scratch.If you’re starting from scratch, here’s what to do:
- Follow the MacPorts install instructions:
- First install Xcode, the Xcode command line tools, and accept the Xcode EULA.The instructions for that are given on the MacPorts install page linked above.
- Before proceeding with the MacPorts install, pause to install XQuartz.Technically this step is optional, but you can save yourself somepotential future trouble with OCaml graphics packages by doing it now.
- Finally, resume following the instructions on the MacPorts installpage, and install MacPorts itself.
- Open a Terminal. Run
sudo port install opam
. - Continue with the instructions under “OPAM configuration” below.
Native installation: Linux
- It’s best to use your distribution’s package manager to install OPAM.The OPAM installation page has detailed instructionsfor many popular package managers. Unfortunately, not alldistributions make the latest version of OPAM available. If you can’tget v2.0.5 through your package manager, we suggest that you insteadfollow the instructions at the top of the OPAM install page to installa binary.
- Note that in our testing this August, we discovered that OPAM v2.0.3on Ubuntu has a configuration bug that makes it impossibleto install OCaml 4.08.1. That’s why we recommend above getting OPAMv2.0.5 as a binary.
- Continue with the instructions under “OPAM configuration” below.
OPAM configuration
You do not need to follow these instructions if you are using the VM.We have already done them for you.
- Check your OPAM version by running
opam --version
. That ought toreport that you have OPAM version 2, e.g.,2.0.5
. If you instead haveversion 1, e.g.,1.2.2
, you have to fix that before proceeding.Follow the instructions under “Need help?” below. - If you have ever had OPAM installed before this semester, we highly recommendthat you start fresh instead of trying to upgrade an earlier install.To start fresh, all you have to do is delete the directory
~/.opam
, or, moveit to a different location—e.g.,mv ~/.opam ~/.opam.bak
. - This step varies depending on whether you are running on Windows, oron OS X or Linux.On Windows (WSL), run the following command to initialize OPAM:(We have to disable sandboxing because of an open OPAM issuerelated to WSL. Hopefully that will be fixed in the future.)On OS X or Linux, run this command:
- Enter the following commands to switch OPAM to the OCaml 4.08.1 compiler: If you get an error about 4.08.1 not being a known compiler version, try running
opam update
.Now check your compiler version by runningopam switch show
. If that reportsanything other than4.08.1
, then something has gone wrong; followthe instructions under “Need help?” below. Be aware that OCamlversion 4.08 is the only supported version of the OCaml compiler inCS 3110 this semester. All your code must compile under that version. - Enter the following commands to install some OPAM packagesthat will be needed for CS 3110. Make sure to grab the entiretyof the first line, which is quite long.
- Close the terminal you were in. Open a new terminal.Check that you can run OCaml: Run
utop
to launch the OCaml toplevel.Enter3110;;
followed by the Enter key to evaluate the integer 3110.Stop to appreciate how good an integer it is. Then enter#quit;;
or Control-D to exit the toplevel. - Double check your OPAM environment by downloading this scriptand running
bash checkenv.sh
from the terminal in the directory inwhich the script is saved. If it reports any errors, follow theinstructions under “Need help?” below. - Continue with the instructions below to configure the VS Code editor for OCaml.
VS Code configuration
You do not need to follow these instructions if you are using the VM.We have already done them for you.
The Visual Studio Code (VS Code) editor is our current recommendationfor the best OCaml experience in a modern editor. After installing OPAM,and after installing VS Code, you’ll need to install some packagesinside the editor itself.
- Download and install VS Code.
- Open VS Code. If you are on Windows (WSL), make sure to open VS Codeby running
code .
in a WSL terminal, not by double-clicking the desktopicon in Windows. VS Code should automatically recommend that you nowinstall the “Remote WSL” extension. Do that now. - Go to View → Extensions. Search for “OCaml and Reason IDE”. (Note: you do not want the extension simply named “OCaml”; it isobsolete.) Selection the extension, and click Install. If the “ReloadRequired” button then appears, click it.If you are on Windows (WSL), you may see that there is a “OCaml andReason IDE - for WSL”, but in our testing of these instructions, wefound that extension did not work: so, install the non-WSL version.Also if you are on Windows (WSL), make sure that you are installing the “OCaml and Reason IDE” extension remotely on WSL, not locally on Windows.
- We recommend tweaking a few editor settings. Open the user settings JSON fileby (i) going to View → Command Palette, (ii) typing “settings json”, and(iii) selecting Open Settings (JSON). Copy and paste these settings intothe window: Save the file and close the tab.Here is a brief explanation of what you just changed: A tab size of 2spaces is fairly standard in the OCaml community. The ruler at column80 will help you not go over the maximum column length, and you couldeven set it to 78 or 72 if you prefer. The
formatOnSave
settingwill cause your code to be run through a tool calledocp-indent
eachtime you save. That tool re-indents your code according to somefairly good standards, thus will help keep your code beautiful. Notethat you can run that tool anytime by right-clicking and selecting“Format Document”, and that there is a shortcut key for it too (whichyou will see next to “Format Document”). - Check that the OCaml integration is working. From the command line,type
code .
to open the current directory in VS Code. Create a newfile namedtest.ml
and save it. Try enteringlet x:string = 3110
.VS Code should then (i) suggest some completions while you are typing,(ii) colorize the syntax as you type, and (iii) indicate a type errorwith a squiggle under the3110
. Click on the “Problems” pane orhover over the squiggle to see the error. Put double quotes around3110
to fix the error.If you are on Windows (WSL) and get an error aboutocamlmerlin
,there’s a good chance that you have the file open through Windows,not through WSL. Make sure that you opened VS Code by typingcode .
in the WSL shell, not by double-clicking a.ml
file inthe Windows File Explorer. For other ways of opening files through WSL,read this documentation.
Need help?
The course staff is happy to help you out with any trouble you mighthave! You can come to office hours or post onCampuswire. Before posting, please read these tips onasking technical questions.
References
- CS 211 Style Manual—follow this!
- If you can’t find your answer in one of the above references, you should try our Campuswire discussion board
Software
In a few weeks, we will switch to a full-featured IDE (integrateddevelopment environment). For now, however, all you need is a terminal emulator and SSH client to login to your shell account.
- Mac: Your computer comes with Terminal.app and OpenSSH, so you have everything you need. (Your instructor uses iTerm2 instead of Terminal.app.)
- Windows: PuTTY is a free program that does both terminal emulation and SSH. The easiest way to install it is the MSI installer.
- Linux, UNIX, etc.: You need an SSH client (e.g., from Ubuntu’s openssh-client package) and probably a terminal emulator (e.g.,xterm or rxvt).
Books
Optional textbooks:
Campuswire App For Mac Os
- Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, Second Edition. Prentice Hall, 1988.
- The classic C book from the language’s inventors. The language has evolved somewhat in the 30+ years since the second (and most recent) edition was published, but it’s still the clearest introduction I know of.
- Bjarne Stroustrup, Programming: Principles and Practice,Second Edition. Addison-Wesley, 2014.
- Introductory programming book by the primary designer of C++. It’s a bit quirky, but a reasonably gentle introduction by the genius behind the madness.
- Paul Deitel & Harvey Deitel, C++ How to Program, 10th Edition. Pearson, 2017.
- Big, heavy, comprehensive textbook—likely overkill unless you like that sort of thing.
- Scott Meyers, Effective Modern C++. O’Reilly, 2014.
- For after the course, not during. If you want to continue using C++ and use it well, this book will teach you a lot.
Campuswire App For Mac Windows 10
January | ||
---|---|---|
Tu | W | Th |
7 Administrivia [slides]; the edit–compile–run cycle [slides] | 8 Lab 1: Unix shell | 9 Typed imperative programming [slides]; separate compilation [slides] |
14 Separate compilation, ctd. [slides]; arrays and iteration [slides]; | 15 Lab 2: Control Statments | 16 Pointers [slides] Homework 1 |
21 Dynamic memory allocation [slides] | 22 Lab 3: Strings | 23 Linked data structures [slides] Homework 2 |
28 Linked data structures (ctd.) [slides] | 29 Lab 4: Debugging | 30 Linked data structures (ctd.) [slides]; C Wrap Up [slides] Homework 3 |
February | ||
Tu | W | Th |
4 First exam | 5 – No labs — | 6 C++ for the C Programmer [slides] Homework 4 |
11 Intro to GE211: The Model [slides, code, listing] | 12 Lab 5: Welcome to C++ | 13 Intro to GE211: The UI [slides, code, listing] |
18 Access control [slides, code, listing] Homework 5 | 19 Lab 6: Key Racer | 20 RAII [slides, code, listing] Starting at 11:59 PM: Rolling submission of final project proposals |
25 Dynamic polymorphism [slides, code, listing] Homework 6 | 26 Lab 7: Bejewelled | 27 No class Final project proposal |
March | ||
Tu | W | Th |
3 Object-Oriented Design [slides, code, listing] | 4 Lab 8: Asteroids | 5 Object-Oriented Design, ctd. [code, listing] |
10 Second exam | 11 – No labs — | 12 Exam return / STL Final project |
W | 9 AM | Tech L168 | Mohini Gupta | MohiniGupta2022@u |
---|---|---|---|---|
10 AM | Tech L168 | Max Chapin | MaxwellChapin2022@u | |
12 PM | Tech M166 | Mohammad Kavousi | kavousi@u | |
1 PM | Tech L168 | Elise Lee | EliseLee2021@u | |
3 PM | Tech F280 | Naythen Farr | NaythenFarr2022@u | |
4 PM | Elder 032 | Margot Sobota | MargaretSobota2022@u | |
4 PM | Locy 314 | Ann Pigott | AnnPigott2021@u | |
5 PM | Tech LG72 | Priya Kini | PriyaKini2022@u | |
Th | 9 AM | Elder 032 | David Jin | DavidJin2022@u |
10 AM | Elder 032 | Brando Socarras | BrandoSocarras2022@u |
Collaboration and academic integrity
Campuswire App
You may not collaborate with anyone on any of the exams. Youmay not use any electronic tools, including phones, tablets,netbooks, laptops, desktop computers, etc. If in doubt, ask amember of the course staff.
Some homework assignments will be completed with an assigned partneror team. You must collaborate with your assigned partner or team, asspecified, on homework assignments. You may request help from any staffmember on homework. (When you are working with a partner, we stronglyrecommend that you request help with your partner.) You may use the Campuswire discussion board to ask questions regarding assignments, so long asyour questions (and answers) do not reveal information regardingsolutions. You may not get any help from anyone else on a homeworkassignment; all material submitted must be your own. If in doubt, ask amember of the course staff.
Providing illicit help to another student is also cheating, and aresubject to the same penalties as those who receive illicit help. It isyour responsibility to safeguard your own work.
Students who cheat will be reported to the appropriate dean.
If you are unclear on any of these policies, please ask amember of the course staff.
Homework
For each homework, we provide a TGZ or ZIP file containing starterfiles. You must download this TGZ or ZIP file to start your homework, asit has a Makefile or CMakeLists.txt with the correctcompiler settings and “starter” source files with the correct names thatthe grading tests will expect.
Code submission
TBA.Self evaluation
Each homework assignment will be followed by a 48-hour self evaluationperiod on GSC. The self evalution will account for a potentiallysignificant portion of your grade–possibly upwards of 50% some weeks.In other words, to get full credit for the code that you submit, youmust do self evaluation as well.Late work
Late code will not be accepted.
Late self evaluations may be accepted at the Grad TA’s orinstructor’s discretion; please email and ask.
Grades
![Mac Mac](/uploads/1/3/4/2/134204259/251064421.jpg)
What | Value | When | Count | Excused |
---|---|---|---|---|
Programming assignments | 50% | Thursdays | 6 | 1 |
In-class midterm exams | 30% | Tu 2/4 & Tu 3/10 | 2 | 0 |
Final project proposal | 5% | Fr 2/21 – Th 2/27 | 1 | 0 |
Two-week final project | 15% | Tu 3/12 | 1 | 0 |
Lab section attendance | * | weekly | 8 | 2 |
* Lab section attendance may be used for close calls or totweak weights in your favor.
The mapping of raw point totals to letter grades is TBD.