Autolab

Details on Autolab, which will be used for all homework submissions in CSE 331.

The main link

We will be using the UB CSE extension to Autolab for submission and (auto)grading of CSE 331 homeworks. You can access Autolab via https://autolab.cse.buffalo.edu/ .

Autolab location has changed!

If you had used Autolab in a previous semester then you had used the previous version, which is still available at https://autograder.cse.buffalo.edu/ . You can access your old classes there but from Fall 2023 semester onwards, please use the updated location: https://autolab.cse.buffalo.edu/ .

Signing up

Follow these steps to setup an account on Autolab (unless you already have one in which case you'll use your existing account):

  1. Go to this page and click on the Sign in with MyUB link . If you do not already have an account (which will be true for everyone in Fall 2023), a new account will automatically be created for you (and you might have to fill in some details).
  2. I believe Autolab should now be using your preferred name instead of your official UB first and last name. If this is not the case, please let us know ASAP.
  3. We will have leader boards for all the programming assignments. For anonymity, all students are identified by their chosen nicknames. So please make sure you pick an appropriate one (you can change your nickname at any point in time).
  4. After you have done the above steps, you wait.

What happens next

Here are the steps that we need to take on our end:

  1. We will upload a list of UB emails of students registered in the course (students cannot register themselves in a course). After that, you can just login into Autolab using your UB login credentials and you should see the CSE 331 course.
  2. If you successfully completed your syllabus quiz, you will be added to the Y section. Otherwise you will be added to the N section.
  3. Once you have successfully completed your syllabus quiz, you should be moved to the Y section: if this does not happen within one week of you completing the syllabus quiz, you should send us a reminder.
  4. We will only release the grades for section Y.

In the steady state

Here are the various things to keep in mind once you are successfully added to the course on Autolab:

  1. Once you log in to the system (after creating your account), you will see all the courses for which you have been registered. CSE 331 should appear with the description CSE331: Algorithms and Complexity (f23).
  2. Once you go to the course web page for CSE 331, you will see a list of pending homeworks. To begin with, you should see one box for Quiz and one link for Syllabus Quiz. As you move along in the semester, you will also see completed assignments/homeworks.
  3. There will be five submissions/questions for each homework (except Homework 0, which is optional).
  4. The interface is reasonably intuitive but make sure to explore and get yourself comfortable with the interface - you will be spending quality time with it this semester!
  5. For the autograded questions, you will need to click on any one of your scores to see the feedback.

Autolab Walkthrough

Thanks to Caleb Levine for the walkthrough video on how to submit your HW solutions to Autolab:

Version of programming languages on Autolab

Java

openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.1, mixed mode)

Python

Python 3.6.5

C++

g++ (Ubuntu 7.3.0-16ubuntu3) 7.3.0

If you plan to use C++

Use Java or Python if you can

We recommend that you use Java or Python if you are as comfortable with any of those languages as C++ (or if you have time to pick up learning a new language in which case we recommend Python since it is easier to pickup than Java). We are not passing any judgment on the merits or demerits of any of the languages here but our recommendation is based on the fact that the compilers/interpreters of Java and Python are standardized across various platforms. In particular, if your Java or Python code runs fine on your machine, then it should work fine on Autolab as well, as long as the version on your machine is compatible with the versions used on Autolab (see above). Unfortunately, there is no such guarantee with C++.

If on the other hand, you have a very strong preference for C++, then read on!

What is the issue with C++ compilers?

The main issue as alluded to above is that there is no notion of a standardized C++ compiler across all platforms: i.e. two different C++ compilers can behave completely differently on the same code (e.g. in one case it won't compile but in the other it will compile and run without any issues). This issue is compounded by the fact that even if one is using g++, which is what we recommend, you might not get what you want. E.g. if you run g++ on mac, it will actually run clang, which is a different compiler.

What this means unfortunately is that we cannot really provide support for C++ across all compilers. You can use your own C++ compiler, but then you have to deal with making sure your code runs fine on Autolab too.

Our recommendation

If you do not follow our recommended C++ setup, you are on your own

Starting Fall 2023, we have one recommended option (see below). You are of course welcome to use your own system but if you do so, we will not be able to provide ANY help.

We present two additional options for you to code in C++ that have worked reasonably well in the past years but unfortunately, we will not be able to provide support for these options either-- sorry!.

In previous years students have reported that our C++ template code (as is) would not run on their own C++ setup (typically an IDE). If this happens we cannot help you figure out how to modify the template code on your machine.

A Clarification

Since the above can come off as too negative, I should clarify that students in the past offerings of CSE 331 have done fine using C++ for their submissions. And we are more than happy to look at your C++ code in your favorite IDE in case it is not working there and help debug algorithmic issues with your code!

The issue is we won't be able to give support if

  1. Your C++ code works perfectly fine in your own setup but say fails to even compile on Autolab. This can happen (as mentioned above) since C++ compilers in different environments unfortunately tend to work pretty differently and since this is not a programming course we want to give preference to help with algorithmic issues.
  2. The template code does not compile in your C++ setup. Again, here we won't be able to help you modify the template so that it can load/compile in your C++ setup. In previous years some students have been able to modify the template code a little bit (sometimes as simple as moving some lines of code around) to make it work. Of course you are more than welcome to figure this out on your own (and if you are able to do so, feel free to share your hacks on piazza).

Finally, any extra work that you have to do with C++ you should only have to do once-- if you are able to say submit HW 0 in C++ using your setup you should be OK with the rest of the assignments (though this has tended to happen in most cases we cannot guarantee this for everyone, again, because different C++ compilers tend to work differently).

We recommend the following to go about coding in C++ for CSE 331:

  1. We recommend that you use a departmental server by sshing into it:

    Use a departmental server

    Login to one of the departmental servers accessible by students and then run your code in there. Pick one of the servers that are described as General compute server for short, interactive timeshare jobs. timberlake.cse.buffalo.edu is one commonly used by students.

    Unlike the VM options, you will need Internet to access the servers. Also unlike our first recommended option, the environment on departmental servers will not match the one on Autolab exactly but we do not expect this is to an issue.

    If you still prefer to use your own system, we would recommend that you still test your code on a departmental server above before submitting to Autolab.

Use the VM options at your own risk!

Again, a reminder that we unfortunately cannot provide support for the VM options below. We are mentioning these just in case you already have used Linux VMs on your machine.

Here are couple of options that used to work until Fall 2022. As mentioned earlier, we unfortunately cannot provide support for these options but in case you are already familiar with either of these options, then you can try your luck!

  1. This option is the best option until Fall 2021 since the Virtual Machine (VM) image matched the system being run on Autolab:

    Use the VM image used in CSE 220

    We recommend that you use the Fall 2021 VM image used in CSE 220 that was maintained by Ethan Blanton .

    If you have questions on Ethan's setup, as mentioned earlier, we cannot provide help. Please do NOT contact Ethan either: since he no longer maintains the VM.

    One big drawback is that virtual machines might not work well on the latest Apple machines. If this is true for you, please use the next option.

    Using VM image on Windows

    If plan to run the VM on Windows then Fall 2022 onwards, we recommend that you run it using Virtual Box (and not VMWare). Here is a walkthrough video by Nick Minor on installing the VM on Windows using VirtualBox:

    Using VM image on MacOS

    Unfortunately, it looks like VirtualBox does not work that well on MacOS.

    Using VMWare on MacOS might be the only option. Unfortunately the department cannot provide you a VMWare license-- if you want to use VMWare, then you'll have to pay for the license yourself.

    Some comments on the VMWare option

    The comments below are based on testing in Fall 21 on a Mac machine (Big Sur OS), though most of the comments below should be OK for installation on a Windows machine as well:

    • The ova that you need to download is big and depending on your Internet speed might take time. Also the initial setup of the VM takes time -- this is because you are basically setting up a new Linux machine on your machine! Be prepared for the overall process to take a couple of hours. (It's mostly idle time waiting for things to happen, so you can safely multiplex the deployment with other work.)
    • Do not try to share folders

      If possible, use the VM as if it were an independent machine: i.e. download the coding templates using the browser in the virtual machine, create and test your code in the VM and then submit to Autolab using the browser in the VM.

      If for some reason you really want to share folders/files between your machine and your VM, it might mean extra work. Here are some starting points (again based on testing on mac):

      1. You need to enable sharing folders:
      2. At least in our testing on Mac, the shared folder did not show up in /mnt/hgfs. To fix this, use these instructions .

  2. Until Fall 19, this was our main recommended option but this has not been updated for a while. We think it should be OK to use this option but your mileage might vary.

    Use a VM with g++ installed for Ubuntu

    You should install a VM that runs g++ on Ubuntu. In particular, we recommend that you use Jaric Zola's VM system that he created for his CSE 250 course . If you have questions on Jaric's setup, please do NOT contact him. Also as mentioned above, we cannot provide you support with this option either-- sorry!

    If you still prefer to use your own system, we would recommend that you still test your code in the VM system above before submitting to Autolab.

    Some comments on the instructions in Jaric's setup

    Below are some comments that are hopefully helpful:

    • He is not kidding about the time it takes for the initial deployment. Make sure you have a good hour or two dedicated for this. (It's mostly idle time waiting for things to happen, so you can safely multiplex the deployment with other work.)
    • A clarification about the files in the /vagrant directory: in the VM, the /vagrant directory will have exactly the same contents as the directory where you clone the git repo.

Running HW C++ template code on Linux

Running C++ HW template code on Linux

Here is a walkthrough video by Nick Minor on on running HW 0 C++ template code on Linux:

If you plan to use Java

Use the terminal

We recommend you use the instructions for compiling and running your program in the terminal. If you would like to use an IDE, setup instructions for IntelliJ IDEA (from Fall 19-- so your mileage might vary) are given below. In addition, there is some information about Eclipse in the FAQs.

Instructions for setting up your project for IntelliJ: (If you are on a mobile device you may have to scroll right, down, or both on the images)

  1. Select Add Configuration.

  2. Press the tiny + on the top left to add a new configuration. Select Application from the dropdown.

  3. Select the Project SDK in Project Structure and make sure it is version 12.

  4. Select the output path, ideally the same as your root source directory.

  5. In Modules, mark your working directory as a source.

  6. Select the ... in the Choose Main Class field, and double click on the presumably auto-detected main Driver class.

  7. Don't forget to add the testcases/inputx.txt in the program arguments field.

  8. Happy coding!

Dealing with Errors

Description of Thresholds

Your solution times out if it crosses a certain threshold, as noted in the Autolab feedback. The way it works is as follows: we run our code and multiply our time with the corresponding threshold factor for the input to get the final threshold. Thus, your solution will be within the threshold if it is slower relative to the optimal solution by at most the corresponding factor. For example, a threshold factor of 40 for input 1 means your code can be at most 40 times slower than our optimal solution. These threshold factors tend to be used for pretty much all the programming questions, although sometimes we end up changing them depending on the problem etc.

Frequently Asked Questions

Java Specific