Frequently Asked Questions

Answers to common questions

Unanswered Questions

If you have a question that is not answered here, please let me know by sending me an e-mail to tobias.vlcek@uni-hamburg.de.

Contribution and Mistakes

If you have found a mistake in the course material or if you have any suggestion on how to improve the course, please let me know by sending me an e-mail to tobias.vlcek@uni-hamburg.de.

FAQs

Is the course difficult?

In terms of difficulty, this is of course somehow complicated for me to assess. However, I have tried to make all the content as comprehensible as possible and really do ask you many questions in the lectures. If I have the impression that something has not been understood at all, then I take longer at that point. This semester is the first time I think the course is truly finished. I have adapted the slides based on feedback from the last two years and made all the examples as simple as possible. In a nutshell: If you are interested in the subject and equations do not scare you, you will likely do great in the course.

How can I download PDF slides from the lecture?

Open the lecture and click on Slides (PDF) in the top right corner: the slides are there as a finished PDF to download. The PDF button next to it gives you the lecture as a text document instead.

How does the calculation of the bonus points work?

Each assignment gives up to 5 points in Moodle, depending on how much of it you solved correctly. Divided by 10, that is up to 0.5 bonus points per assignment for the exam. In total, you can earn at most 6.0 bonus points, and they only count if the exam is passed.

How do the groups for the assignments work?

You hand in the assignments as a group of up to three; working alone is fine too. The groups are formed in the second lecture and stay the same for the whole semester. If you missed it or have no group yet, send me a short email.

Are the solutions to the tutorials published?

No. Instead, I give you feedback on your group’s submission.

Can I take a sheet with me to the exam?

Yes, you can take a DIN A4 sheet with notes on both sides to the exam. Please note, that it should be one sheet of paper.

How does the chatbot work?

The course AI is a chatbot that uses the Mistral and some custom code hosted on Hetzner in Germany. If you have any questions about the course, feel free to ask the AI. Note, that the AI is not perfect and sometimes the answers might be incorrect. For more information about how the data is processed, please refer to the privacy policy.

My Julia code does not run in Zed. What can I do?

The commands in bold are in Zed’s command palette (Ctrl+Shift+P, macOS Cmd+Shift+P).

  • Nothing happens when I press Ctrl+Shift+Enter. Save the file with the ending .jl and press the shortcut a second time: right after Zed starts, the first press can get lost while Zed looks for its kernels. Each cell has to start with # %% at the very beginning of a line.
  • Zed does not list the kernel applied-optimization-1.13. Run repl: refresh kernelspecs. If it is still missing, repeat steps 3 to 5 of the first tutorial and look for error messages after installkernel.
  • ArgumentError: Package JuMP not found in current path (or any other package) in the output below a cell. Zed started another kernel, for example julia-1.13, which does not use the course environment. Check the kernel selector at the top right of the editor and choose applied-optimization-1.13. If the kernel is right, the package is not installed yet: run using Pkg; Pkg.add("JuMP") in a cell.
  • UndefVarError: ... not defined. The cell uses a variable from a cell that has not run yet. Run the cells above it first. After repl: restart, all variables are gone and you start again from the top.
  • Plots do not appear. Your kernel was installed without the zed_plots part of step 5 in the first tutorial: close Zed and run steps 3 and 5 again. Interactive plots made with plotly() cannot be shown in Zed; leave that line out.
  • A model keeps solving and does not stop. repl: interrupt cannot stop a running solver. Use repl: restart instead and run your cells again from the top.
  • The kernel does not start after a Julia update. The kernel still points to the old Julia version, which the update removed. Close Zed and run steps 3 and 5 of the first tutorial again.
  • The first cell takes minutes. Julia compiles each package once on your computer, so the first using JuMP or using Plots is slow, on Windows even slower because Microsoft Defender scans the new files. Let it finish: afterwards, the same commands are fast.
  • An exclamation mark appears in Zed’s title bar, and code completion does not work. Zed opened your folder in Restricted Mode. Click the exclamation mark and trust your course folder (only that folder, not your whole user folder).
  • Ctrl+C does not copy in Zed’s terminal (Windows, Linux). In the terminal, Ctrl+C stops the running program; copy with Ctrl+Shift+C.
  • Code is all one color, the bottom right of Zed says “Plain Text”, and Ctrl+Shift+Enter does nothing. The Julia extension is missing. Open zed: extensions, search for “Julia”, install the extension called Julia and open the file again.
  • The status bar shows “Downloading jetls…” or “Checking for updates to jetls…” for minutes. The Julia extension installs its language server, JETLS, with your Julia: the first time, and again after some extension updates. This can take several minutes. Wait until the message disappears; running cells works in the meantime.
  • “Failed to run jetls”. Click the message to see why. JETLS needs Julia 1.12.2 to 1.13: if the message names an older version such as 1.10, remove that version (see the entries on old Julia versions below). If Zed cannot find julia, restart Zed. If it still fails, switch the language server off.
  • Red underlines in the editor, such as “Package JuMP not found in current path” or “DataFrame is not defined”, although the cell runs fine. The language server checks your file without the course environment, so it does not know the course packages. Trust the output below the cell, ignore the underline and do not follow its Pkg.add hint. To get rid of the underlines, switch the language server off.
  • Zed or your laptop gets slow after a while, and a julia process uses gigabytes of memory. The language server keeps growing while you edit. Run editor: restart language server; if it happens again, switch the language server off.
  • How do I switch the language server off? Run zed: open settings file, add "languages": { "Julia": { "enable_language_server": false } } inside the outer curly braces (with a comma after the entry before it) and restart Zed. If the file already has a "languages" entry, add only "Julia": { "enable_language_server": false } inside it. Colors and running cells keep working; only completions and the underlines go away.

If Zed itself does not run on your computer, use the VS Code fallback described in the first tutorial.

Packages do not install or load. What can I do?

  • could not download https://pkg.julialang.org/registries, failed to clone from https://github.com/JuliaRegistries/General.git or Unable to automatically download/install artifact. Julia cannot reach its package servers. Check that the internet works in your browser and try again, or switch to another network such as a phone hotspot. If it still fails, run ENV["JULIA_PKG_SERVER"] = "" in Julia before Pkg.add(...): Pkg then downloads from GitHub instead.
  • The following 1 package failed to precompile or Failed to precompile Plots. A package cache is broken, often after an interrupted first using. Close Zed and any other Julia window, delete the folder .julia/compiled/v1.13 in your user folder (Windows: %USERPROFILE%\.julia\compiled\v1.13), start Julia with julia --project=applied-optimization and run using Pkg; Pkg.precompile().
  • Package JuMP [...] is required but does not seem to be installed. The course environment lists the package, but its files are missing, for example after you copied your course folder to another laptop. Start Julia with julia --project=applied-optimization and run using Pkg; Pkg.instantiate().
  • The active manifest file has dependencies that were resolved with a different julia version. You set up the course environment with another Julia version. Close Zed and check that julia --version shows 1.13. Then run steps 3 and 5 of the first tutorial again, with using Pkg; Pkg.resolve() in between.
  • Unsatisfiable requirements detected for package. The package versions do not fit together, often because the package list on your laptop is out of date. Run using Pkg; Pkg.update() in the course environment. If the error names a package the course does not use, remove it with Pkg.rm("Name").
  • No space left on device. The .julia folder in your user folder grows by several GB over time. Run using Pkg; Pkg.gc() and delete the compiled folders of Julia versions you no longer use, such as .julia/compiled/v1.10.

Julia or Zed does not work on my Windows laptop. What can I do?

  • The terminal does not find julia. Open a new terminal; if you use the terminal inside Zed, restart Zed. If that does not help, open Settings → Apps → Advanced app settings → App execution aliases and switch on julia.exe and juliaup.exe. If the Microsoft Store is blocked on your laptop, use the MSI installer instead.
  • “Program ‘julia.exe’ failed to run: The file cannot be accessed by the system”. An installation through the Microsoft Store, winget or the MSIX App Installer did not finish and left a broken alias for julia.exe behind. The same alias makes ;julia inside Julia fail with permission denied (EACCES). Uninstall Julia under Settings → Apps → Installed apps. If you also installed a standalone version such as the 1.10 LTS, uninstall it too: the course runs Julia 1.13 through juliaup. If julia still shows the error, switch off julia.exe and juliaup.exe under Settings → Apps → Advanced app settings → App execution aliases. Then install Julia with the MSI installer and open a new terminal; if you use the terminal inside Zed, restart Zed. If you had already installed the course kernel, run steps 3 and 5 of the first tutorial again.
  • Access is denied. (os error 5) or Failed to move extracted archive while Julia installs itself. Your antivirus scans the freshly unpacked files and blocks juliaup. Run the same command again (julia or juliaup add release): it usually works on the second or third try. Delete leftover julia-temp-... folders in %USERPROFILE%\.julia\juliaup. If you use an antivirus other than Microsoft Defender, add %USERPROFILE%\.julia as an exception.
  • julia --version shows an old version such as 1.10, or Zed offers the kernel applied-optimization-1.10. Another Julia comes first, usually a standalone installation. Run where.exe julia in PowerShell to see all of them. Uninstall every “Julia 1.x.y” entry under Settings → Apps → Installed apps and keep the one called “Julia” (juliaup). Then run juliaup add release and juliaup default release, open a new terminal or restart Zed, and run steps 3 and 5 of the first tutorial again.
  • Installing from the Microsoft Store or with winget fails with an error code. 0x80073D01 or “blocked by policy”: your laptop does not allow the Store, so use the MSI installer. 0x80073CF4: drive C: is full; free some space. 0x80073CF3 or 0x80073CFB: an older Julia is in the way; uninstall Julia under Settings → Apps → Installed apps and try again.
  • The Julia launcher failed to figure out which juliaup channel to use or Io error. Look inside err_kind for more details. Julia is installed, but no Julia version inside it, often because the laptop was offline at the first start. Check your internet connection and run juliaup add release and juliaup default release. If that fails, uninstall Julia, delete the folder %USERPROFILE%\.julia\juliaup, restart Windows and install Julia again.
  • “An Application Control policy has blocked this file”, “Smart App Control has blocked part of this app” or error 0xc0e90002. Windows Smart App Control blocks the package files that Julia compiles on your laptop. Switch it off under Windows Security → App & browser control → Smart App Control and keep it off during the course: switched on again, it can block every package Julia compiles later. Then delete the folder %USERPROFILE%\.julia\compiled\v1.13 and run using Pkg; Pkg.precompile() in the course environment. On a laptop managed by your university or employer, only the IT department can allow these files; until then, start Julia with julia --pkgimages=no --project=applied-optimization in the first tutorial and add "--pkgimages=no" right after the --project argument of its installkernel call. Packages then load more slowly, but they load.
  • Precompiling IJulia fails with an EPIPE error. Run using IJulia again: the error is known on Windows and usually disappears on the second attempt.
  • The Git panel in Zed reports “dubious ownership” or cannot initialize a repository. Zed needs Git itself: install Git for Windows and restart Zed.
  • Your laptop has a Snapdragon (ARM) processor. Julia runs there in x64 emulation: the course setup should work the same way, only slower.
  • Your course folder lies in OneDrive. Synced folders can block Julia from replacing files. Use a plain folder such as C:\Users\<name>\ao.

Julia does not work on my Mac or Linux laptop. What can I do?

  • zsh: command not found: julia or bash: julia: command not found right after the install. The terminal was open before the install and has not read the new settings. Close all terminal windows and Zed, then open a new terminal. If that does not help, run . ~/.zshrc (macOS) or . ~/.bashrc (Linux). If juliaup works but julia does not, run juliaup self update; if that does not help, run the install command again.
  • julia --version shows another version than 1.13. An older Julia from Homebrew or a .dmg download comes first. Run which -a julia to see all of them. Keep juliaup’s: ~/.juliaup/bin/julia, or /opt/homebrew/bin/julia if you installed juliaup with brew install juliaup. Remove the others, for example with brew uninstall julia, by moving Julia-1.x.app from Applications to the Trash, or with sudo rm /usr/local/bin/julia if that path is listed. Then open a new terminal and run steps 3 and 5 of the first tutorial again.
  • Ubuntu suggests sudo snap install julia or sudo apt install julia. Don’t: these packages are outdated. Use the install command from julialang.org/downloads. If it stops with curl: (23) Failure writing output to destination, your curl comes from snap: run sudo snap remove curl and sudo apt install curl, then run the install command again.
  • Permission denied (os error 13) while installing or starting Julia. Files in your user folder belong to the administrator, usually because Julia once ran with sudo. Run sudo chown -R "$(whoami)" ~/.julia ~/.juliaup, then start Julia without sudo. Never use sudo for julia or Pkg.

Still stuck? Bring your laptop to the tutorial and we’ll fix it together.