cs50 / cs50.readthedocs.io Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://cs50.readthedocs.io
Home Page: https://cs50.readthedocs.io
Hello folks,
I've been trying to complete my pset6 cash assignment in python, but my code is not displaying the correct answer when I enter 4.2: Here is the code for anyone could help me spot the bug:
from cs50 import get_float
count = 0
while True:
amount = get_float("Change owed: ")
if amount > 0:
break
denomination = round(amount * 100)
difference = denomination
while (difference >= 25):
count += 1
difference -= 25
if difference <= 25:
break
difference1 = difference
while (difference1 >= 10):
count += 1
difference1 -= 10
if difference1 <= 10:
break
difference2 = difference1
while (difference2 >= 5):
count += 1
difference2 -= 5
if difference2 <= 5:
break
difference3 = difference2
while (difference3 >= 1):
count += 1
difference3 -= 1
if difference3 <= 1:
break
print(f"{count}")
Going on a camping trip* so decided to download the next couple of CS50 sessions and set up my laptop for offline coding. Googled 'cs50 offline' then spent an hour and several GBs of my 256GB HD downloading everything here:
https://cs50.readthedocs.io/ide/offline/
Only to discover (once I'd set up Docker and tried to run the container) that this is all yesterday's news, and doesn't integrate with VS Code, and that I should actually be following the instructions here:
https://cs50.readthedocs.io/code/#using-vs-code-locally
to get VS Code / cs50 container goodness (now installing, having deleted the previous).
Can / could / should the details at the first link direct the unwary to the second link?
Loving the course (40 years programmer, now a CS teacher, have coded in 10 languages [including Assembly] but never learned C - what's that about???)
/mnt/library/c.rst:66: WARNING: Unparseable C cross-reference: 'char *'
It seems that following our current tutorial on Heroku deployment will fail because of missing 3 packages in requirement.txt. To resolve this, consider adding these three packages in requirements:
gunicorn
werkzeug==0.16.1
psycopg2-binary
/mnt/cli50.md:3: WARNING: None:any reference target not found: /ide
/mnt/cs50/check.md:3: WARNING: None:any reference target not found: ../../check50
/mnt/cs50/ide.md:3: WARNING: None:any reference target not found: ../../ide
/mnt/docker.md:3: WARNING: None:any reference target not found: /ide
/mnt/lab.md:10: WARNING: None:any reference target not found: /ide
style50
will complain about a long line length (around the 110 char threshold), but there is no mention in the Style Guide about line lengths. Can we update the style guide to match style50
?
The main repo: https://github.com/cs50/ap isn't founded + are you planning to update the ap site with the new content?
I am beginner cs50 and start use github today.
So i don't know how to do anything
I need from you some help
Be my mentor
Please😍😍
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
char *
----^
/mnt/library/c.rst:76: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
char
----^
/mnt/library/c.rst:78: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
char
----^
/mnt/library/c.rst:112: WARNING: Unparseable C cross-reference: 'double'
Invalid C declaration: Expected identifier in nested name, got keyword: double [error at 6]
double
------^
/mnt/library/c.rst:114: WARNING: Unparseable C cross-reference: 'double'
Invalid C declaration: Expected identifier in nested name, got keyword: double [error at 6]
double
------^
/mnt/library/c.rst:146: WARNING: Unparseable C cross-reference: 'int'
Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 3]
int
---^
/mnt/library/c.rst:148: WARNING: Unparseable C cross-reference: 'int'
Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 3]
int
---^
/mnt/library/c.rst:184: WARNING: Unparseable C cross-reference: 'float'
Invalid C declaration: Expected identifier in nested name, got keyword: float [error at 5]
float
-----^
/mnt/library/c.rst:218: WARNING: Unparseable C cross-reference: 'long'
Invalid C declaration: Expected identifier in nested name, got keyword: long [error at 4]
long
----^
/mnt/library/c.rst:220: WARNING: Unparseable C cross-reference: 'long'
Invalid C declaration: Expected identifier in nested name, got keyword: long [error at 4]
long
----^
/mnt/library/c.rst:257: WARNING: Unparseable C cross-reference: 'char *'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
char *
----^
We should link to PEP8 for python and document the modifications we've made (max line length relaxed to 132 characters and we require padding around operands, although maybe we shouldn't do this latter bit since PEP8 disagrees with us here).
/mnt/library/python.rst:85: WARNING: Inline emphasis start-string without end-string.
/mnt/library/python.rst:86: WARNING: Inline strong start-string without end-string.
On cli50.md, the links for IDE, Docker, Python, and pip, all lead to 404s.
... terminal window on CS50 IDE.
Installation
Install Docker, if you haven’t already.
Install Python 3.6 or later, if you haven’t already.
Install pip, if you haven’t already.
Same issue for similar links on render50.md and submit50.md pages.
This codespace is currently running in recovery mode due to a configuration error. Please review the creation logs, update your devcontainer configuration as needed, and run the "Rebuild Container" command to rectify.
I followed the Heroku documentation to deploy my CS50 Finance app on Heroku.
I was able to get the app to build successfully and it looks like the website functions. The portfolio information I had on my local database is also present on the Heroku postgres version.
But it appears there is an issue with session manager. I can login and even click on another tab as the right logged in user but after approx. 5 seconds I am logged out and redirected to the login screen again.
Do I need to edit my local application as relates to sessions before deploying?
/mnt/ide/faqs.md: WARNING: document isn't included in any toctree
/mnt/ide/migrate.md: WARNING: document isn't included in any toctree
/mnt/ide/offline.md: WARNING: document isn't included in any toctree
/mnt/ide/online.md: WARNING: document isn't included in any toctree
/mnt/library/cpp.md: WARNING: document isn't included in any toctree
/mnt/library/java.md: WARNING: document isn't included in any toctree
i mistakenly close the first terminal that has the pset1 and i don't know what to do please help me
Checks <https://cs50.readthedocs.io/projects/check50/>
should become
Checks <api/checks>
once latter is deployed.
Make sure your username and/or password are valid and submit50 is enabled for your account. To enable submit50, please go to https://submit.cs50.io in your
web browser and try again. If you're using GitHub two-factor authentication, you'll need to create and use a personal access token with the "repo" scope
instead of your password. See https://cs50.ly/github-2fa for more information!
Submission cancelled.
This warning keep appearing and I don't know what to do. I clicked on the link and followed instructions and it still didn't work
There is wrong documentation for offline ide. I can't open Cloud9 on localhost:5050
with the new layout, the links to the individual questions are in the right "sidebar". On my Macbook, I don't have enough height to see the entire sidebar, and there's no way to scroll it up/down. As such, I cannot access the links to the last 2 questions unless I go into entirely full screen mode.
Was trying to follow instructions to get SSH working but failed with a lot of tries. The frailer could relate to the new update of github codespace.
First, executed step 1-9 and the terminal prompt permission denied
Then, switched to use github personal authentication, the personal authetication setup is like a loophole, creating two factor code, personal token .....and then towards end warning you that if you lose the 50 random letters token, you won't be able to acces.
I feel I am using 10 minutes to finish my first python code indoor.py and it takes me an hour trying to figure out how to submit my homework. This is crazy and inefficient way to submit a homework. And even after an hour, I couldn't get it work.
Very frustrated. I hope somebody could help me on this.
Here is my indoor.py anyway
def main():
name=input("Input some text and this program converts the uppercase letters to lower case letters: ")
#print(name)
lname=A2a(name)
print(lname)
def A2a(word):
i=0
w1=''
while(i < len(word)):
if(word[i] >= 'A' and word[i] <= 'Z'):
w1 = w1 + chr((ord(word[i]) + 32))
else:
w1 = w1 + word[i]
i = i + 1
return w1
main()
The get_string
function is missing from the examples.
/home/ubuntu/.local/lib/python3.9/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document
warn("Container node skipped: type={0}".format(mdnode.t))
In the instructions for the "running out of space" FAQ in the IDE, should we mention somewhere that the final step after uploading your zip file to the new workspace is to run unzip <filename.zip> in the terminal? I wasn't sure if that should go into that FAQ or into the "Uploading Files" FAQ, although it is fairly specific to this current problem of old workspaces.
This repo is 404: https://github.com/cs50/ap
ap-2020 exists but no 2021 version
In the page documenting the CS50 library for python, in the section documenting the sql module, in the sentence that describes the return values of the execute
method for different sql queries, the word INSERT should be in code
tags, but it is not.
In the section for setting the Environment Variables, the options should have double quotes around them.
Currently they read like this:
CC=clang
CFLAGS=-fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow
LDLIBS=-lcrypt -lcs50 -lm
...which causes the bash session to not recognize any of the options after the first i.e. -fsanitize=undefined
is unrecognized, as is -lcs50
.
The test should read like this:
CC=clang
CFLAGS="-fsanitize=signed-integer-overflow -fsanitize=undefined -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow"
LDLIBS="-lcrypt -lcs50 -lm"
command not found; python not installed
https://cs50.readthedocs.io/style50/#character
So that {\n
is more readable.
When I run check50 cs50/problems/2021/x/hello
, I receive the following error:
Make sure your username and/or personal access token are valid and check50 is enabled for your account. To enable check50, please go to https://submit.cs50.io in your web browser and try again. For instructions on how to set up a personal access token, please visit https://cs50.ly/github
I've already enabled check50
and produced an ssh key.
The command style50
works fine.
I can't access check50 on cs50. take access token but the error comes out repeatedly.
The pgloader command seems to be failing, when running
pgloader finance.fb URI?sslmode=require
we will get this error:
2021-01-05T04:44:52.101000Z LOG pgloader version "3.6.1"
KABOOM!
2021-01-05T04:44:52.401000Z ERROR Connecting to PostgreSQL ec2-3-214-4-151.compute-1.amazonaws.com: SSL verify error: 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
2021-01-05T04:44:52.401000Z LOG You may try --no-ssl-cert-verification
FATAL error: Failed to connect to pgsql at "ec2-3-214-4-151.compute-1.amazonaws.com" (port 5432) as user "lwoutppahmhfyu": SSL verify error: 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
An unhandled error condition has been signalled:
Failed to connect to pgsql at "ec2-3-214-4-151.compute-1.amazonaws.com" (port 5432) as user "lwoutppahmhfyu": SSL verify error: 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
What I am doing here?
Failed to connect to pgsql at "ec2-3-214-4-151.compute-1.amazonaws.com" (port 5432) as user "lwoutppahmhfyu": SSL verify error: 18 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT
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.