cs50 / codespace Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://cs50.readthedocs.io/cs50/codespace
License: GNU General Public License v3.0
Home Page: https://cs50.readthedocs.io/cs50/codespace
License: GNU General Public License v3.0
My directory and files for project 10 are missing. I was in recovery mode and after restarting and updating it is all gone.
Not sure what sets BROWSER
, but perhaps that would help if a user disables the Git extension?
Right now my students have to manually install doxygen each time we use it (it doesn't persist in the image). It's fast to install and takes only a little memory, but it's still kind of a hassle. Right now in my classes I use your .devcontainer.json file as part of the student's codespace repo, so it seems to be built from the CS50 image. Reading the docs, I haven't found a way to modify that to actually add doxygen. I think it needs to be done at the DockerFile stage.
Hello,
I am trying to check the code I have developed for Exercise 6, Scarify. I am accessing CodeSpace via the web. Unfortunately, the cursor is not available on the screen and I can't write anything in the box. At the same time, the $ prompt is visible. I have been prompted to rebuild the container multiple time in vain. Appreciate your support to provide a solution. Looking forward to your response and thank you in advance.
Best Regards,
Rania.
$ make hello
clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow hello.c -lcrypt -lcs50 -lm -o hello
Since most of the switches aren't that enlightening, and output itself is overwhelming early on.
$ http-server
/opt/cs50/bin/http-server:22: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if sys.argv[1] is not '--help' or sys.argv[1] is not '-h':
/opt/cs50/bin/http-server:22: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if sys.argv[1] is not '--help' or sys.argv[1] is not '-h':
Traceback (most recent call last):
File "/opt/cs50/bin/http-server", line 59, in <module>
main()
File "/opt/cs50/bin/http-server", line 22, in main
if sys.argv[1] is not '--help' or sys.argv[1] is not '-h':
IndexError: list index out of range
Unfortunately, this couldn't have happened at a worse time for me. Our classes start on Monday. We have been using CodeSpaces but I have used your CS50 devcontainer.json file so it looks like the CS50 IDE. Everything worked fine until we were prompted to update. When that happened, git stopped authenticating. This dialog pops up when it tries to automatically update the repo.
When you go to the Github logs, this error message appears:
2023-01-27 22:44:46.704 [info] > git cat-file -s 66ba7cbbbf34af3f81c6850e635b9b6846f7afae [1ms]
2023-01-27 22:44:46.792 [info] > git show --textconv :cpp-hello.cpp [2ms]
2023-01-27 22:44:47.084 [info] > git push --force origin main [1270ms]
2023-01-27 22:44:47.084 [info] remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/occ-cs150/cs150-s23-sgilbert-student/'
2023-01-27 22:49:30.024 [info] > git log --oneline --cherry main...main@{upstream} -- [2ms]
Before the update, this is what happened in the github log.
git cat-file -s 2db30975169a6164ca90766435576e4d7f34cb28 [1ms]
2023-01-27 22:35:21.416 [info] > git show --textconv :cs150/hw/h01/h01.cpp [3ms]
2023-01-27 22:35:22.268 [info] > git push --force origin main [1766ms]
2023-01-27 22:35:22.268 [info] To https://github.com/occ-cs150/cs150-s23-steveandkathyg
9f1606d..2501985 main -> main
2023-01-27 22:35:22.289 [info] > git config --get commit.template [9ms]
Do you have any hints for me that would help me get going on Monday?
After launching a fresh environment is CS50, the .devcontainer settings that are deployed do not actually affect the environment itself once launched.
.vscode/settings.json is an empty object (ie {})
Redeploying did not seem to have an effect.
Is this the desired behavior?
I was experiencing some issues with my codespace not syncing the extensions correctly and communicating with github after accidentally removing the .devcontainer.json file.
Tried a few things to fix it:
Eventually I thought perhaps if I leave the code50 organisation and try to start fresh with the same github account (this one) it would fix it.
I have left the code50 organisation but now when I try to create a new codespace from code.cs50.io it gives me a Bad Gateway error.
I'm guessing it's probably regarding the organisation status since it's failing before it allows me to connect my github to the organisation.
When using a new github account it works fine but I would love to not have to change github accounts.
Any assistance would be appreciated.
I tested code50 in OperaGX browser and it works completely fine. The html code can be updated to not show the red alert while opened in OperaGX browser.
Hi there!
I am a 2021 student, trying to login to code.cs50.io, following the steps to migrate my files from the IDE to VS Code. I am unable to login, as I get a 502 Bad Gateway error.
GET https://code.cs50.io/open?code=********* 502 (Bad Gateway)
From reading past issues on GitHub, I see that I probably need to be invited to the CS50 org? If so, this is my GitHub account!
Thanks!
It says Error "CodespaceStateWatcher' not found
Trying to access code.cs50.io on Safari, Chrome or Firefox always gives out "Bad Gateway Could not create codespace" error after clicking on "Login via github" even if you check "Open in VS Code Desktop".
It makes it impossible to do any work if not locally.
Hello again...
Although the C/C++ extension is enabled in code.cs50.io, intelli-sense does not seem to work to propose methods after the dot .
I am getting ...no suggestions even with ctrl-space.
I have tried using all different versions of compilers and intelli-sense options....
I am doing something wrong? or it is disabled from the container?
Thank you for reading this!
Maira K.
08/05/22 around 11:30 PM GMT, CS50 codespace no longer pushes file changes automatically to the dedicated repo, in this case, the code50/{id} repo.
update50
or deleting the codespace along with the ssh key and re-configuring everything didn't solved the problem
Git command cannot be used to commit and push to the repo, instead what seems to work is the source control panel on the left sidebar.
When running code
command I get the following error:
$ code
/opt/cs50/bin/code: line 52: /vscode/bin/linux-x64/5554b12acf27056905806867f251c859323ff7e9/bin/code: No such file or directory
I can reproduce the issue on fresh instances of codespace.
This patch should fix it:
diff --git a/opt/cs50/bin/code b/opt/cs50/bin/code
index 04d5acb..bb9a4fe 100755
--- a/opt/cs50/bin/code
+++ b/opt/cs50/bin/code
@@ -49,4 +49,4 @@ if [ "$options" = false ]; then
done
fi
-$(dirname "$VSCODE_GIT_ASKPASS_NODE")/bin/code "$@"
+$(dirname "$VSCODE_GIT_ASKPASS_NODE")/bin/remote-cli/code "$@"
E.g., mcr.microsoft.com/vscode/devcontainers/universal:1-focal
, per https://github.com/microsoft/vscode-dev-containers/tree/main/containers/codespaces-linux#description, to benefit from more pre-installed (and cached) tools.
E.g., Format Document currently converts:
{% extends "layout.html" %}
{% block body %}
<h1>Register</h1>
<form action="/register" method="post">
<input autocomplete="off" autofocus name="name" placeholder="Name" type="text">
<select name="sport">
<option disabled selected>Sport</option>
{% for sport in sports %}
<option value="{{ sport }}">{{ sport }}</option>
{% endfor %}
</select>
<button type="submit">Register</button>
</form>
{% endblock %}
to:
{% extends "layout.html" %}
{% block body %}
<h1>Register</h1>
<form action="/register" method="post">
<input autocomplete="off" autofocus name="name" placeholder="Name" type="text">
<select name="sport">
<option disabled selected>Sport</option>
{% for sport in sports %}
<option value="{{ sport }}">{{ sport }}</option>
{% endfor %}
</select>
<button type="submit">Register</button>
</form>
{% endblock %}
I was just thinking, whether the GitHub repo (where the code in the codespace is located)
could have the option to be made public?
As such students could copy/clone the code demonstrated in class by the instructor...
Just an idea as a teaching modality
I'm trying to customize the build to add a package. I forked the project and tried to open a CodeSpace on both main and on dev. I believe I've done this in the past. Currently, the build gets to the following step and dies.
#9 [internal] load metadata for docker.io/cs50/cli:amd64-minimized
2023-07-01 18:00:12.607Z: ERROR: failed to receive status: rpc error: code = Unavailable desc = error reading from server: EOF
2023-07-01 18:00:12.706Z: {"outcome":"error","message":"Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.43.0-1688234121503/Dockerfile-with-features -t vsc-codespace-0a6a6053f944d4952cd697988e6e34637e8d4aaf4431fd12cb2810b18e18ae9b --target dev_containers_target_stage --build-arg VCS_REF= --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.43.0-1688234121503 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=ubuntu --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/lib/docker/codespacemount/workspace/codespace","description":"An error occurred building the image."}
2023-07-01 18:00:12.711Z: Stop: Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.43.0-1688234121503/Dockerfile-with-features -t vsc-codespace-0a6a6053f944d4952cd697988e6e34637e8d4aaf4431fd12cb2810b18e18ae9b --target dev_containers_target_stage --build-arg VCS_REF= --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.43.0-1688234121503 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=ubuntu --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/lib/docker/codespacemount/workspace/codespace
2023-07-01 18:00:12.725Z: Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.43.0-1688234121503/Dockerfile-with-features -t vsc-codespace-0a6a6053f944d4952cd697988e6e34637e8d4aaf4431fd12cb2810b18e18ae9b --target dev_containers_target_stage --build-arg VCS_REF= --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.43.0-1688234121503 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=ubuntu --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/lib/docker/codespacemount/workspace/codespace
2023-07-01 18:00:12.727Z: at xte (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2005:1698)
2023-07-01 18:00:12.728Z: at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2023-07-01 18:00:12.730Z: at async zw (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2004:1691)
2023-07-01 18:00:12.731Z: at async TN (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2004:610)
2023-07-01 18:00:12.733Z: at async Lte (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2021:3660)
2023-07-01 18:00:12.736Z: at async Hf (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2021:4775)
2023-07-01 18:00:12.737Z: at async rne (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2152:10371)
2023-07-01 18:00:12.738Z: at async tne (/usr/lib/node_modules/@devcontainers/cli/dist/spec-node/devContainersSpecCLI.js:2152:10112)
2023-07-01 18:00:12.740Z: devcontainer process exited with exit code 1
= = ==================================== ERROR ====================================
2023-07-01 18:00:12.745Z: Failed to create container.
= = ===============================================================================
2023-07-01 18:00:12.750Z: Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /tmp/devcontainercli-root/container-features/0.43.0-1688234121503/Dockerfile-with-features -t vsc-codespace-0a6a6053f944d4952cd697988e6e34637e8d4aaf4431fd12cb2810b18e18ae9b --target dev_containers_target_stage --build-arg VCS_REF= --build-context dev_containers_feature_content_source=/tmp/devcontainercli-root/container-features/0.43.0-1688234121503 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label --build-arg _DEV_CONTAINERS_IMAGE_USER=ubuntu --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp /var/lib/docker/codespacemount/workspace/codespace
2023-07-01 18:00:12.752Z: Error Code: 1302
I do not know if this is an issue or a misconfiguration from my part,
but .cpp, .java, or .ipynb files created in the online workspace (code.cs50.io) are not pushed to github.com/code50/UserRepoNumber
although are successfully saved in the workspace...
alias cd="HOME=/workspaces/$RepositoryName cd"
To save a step, shall we eliminate
which is already a bit confusing since the next dialog has a Rebuild button:
But the toast has a Rebuild Now button:
So our own advice to Click "Rebuild"
is a bit confusing anyway?
cs50/hf18
codespace/etc/profile.d/codespace.sh
Lines 37 to 39 in e3e85ce
/opt/cs50/bin
already seems to have higher precedence in PATH
?which -a code
to get path to code
Re #42.
import tkinter as tk
# Create the main window
root = tk.Tk()
root.title("My GUI")
# Create label
label = tk.Label(root, text="Hello, World!")
# Lay out label
label.pack()
# Run forever!
root.mainloop()
$ sudo apt-get install python3-tk
$ pip install tk
$ python hello.py
Traceback (most recent call last):
File "hello.py", line 4, in <module>
root = tk.Tk()
File "/usr/lib/python3.8/tkinter/__init__.py", line 2270, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.