Questions tagged [pset6]

The problem set for Week 7

192 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
32 views

DNA: Excluding a column from my dict iteration

Logic: I'm trying to do this in such a way that I check the database first, then I check the DNA sequence to see if that information corresponds to any of the information in my database. I want to ...
1
vote
0answers
101 views

PSET 6 DNA ~ some STR count is above the correct value by 1?

I'm almost done with pset6 hopefully but I have one problem with my code When i run it with for example python dna.py databases/small.csv sequences/4.txt python dna.py databases/large.csv sequences/10....
1
vote
1answer
43 views

Unexpected error in homemade string search function

I am playing around with Python on the DNA problem. I realize there are some string methods that might make this problem easier but my gut instinct was to try and make an "search function" ...
1
vote
0answers
90 views

PSET6: dna.py, updating dictionary

I'm struggling with Python, specifically adding/updating keys and values in a dictionary. This is my code so far (I know it's probably far from perfect, this is my first time working with Python, ...
1
vote
1answer
663 views

PSET 6 DNA - PROBLEM COUNTING CONSECUTIVE STR SEQUENCES

Im struggling with the PSET6 DNA solution. So far I have opened the dna file and converted it into a dictionary as well as reading the text file. I'm trying to count the consecutive times an STR ...
1
vote
0answers
160 views

PSET6: Similarities: More: General Advice

Just looking for some general advice for pset6 similarities more. I went for more (rather than less) as I have had some experience with python and dynamic programming prior to CS50. However I have ...
1
vote
0answers
431 views

I don't understand the meta tag “shrink-to-fit=no”

I read so much about this tag, but I'm a little confuse still. This is one of the post and here is another when I read about the subject. What I understand is that the pages were written first with ...
1
vote
1answer
52 views

PSET 6 Similarities no display from log

I am working on the PSET6 more. My code passes the check50, and it displays the comparing table in the website. However, nothing is showing up for the log operations. I have around for answers but I ...
1
vote
1answer
285 views

How can I find pythons equivilant of C's crypt function?

I am current working on 'sentimental'. However, I am having trouble finding the equivalent function of crypt used with "crypt.h" in C? I already have an algorithm for enumerating all possible ...
1
vote
1answer
94 views

pset6: check50 weird output and I don't know exactly how to debug

here are all of my functions and the output I don't know exactly what's wrong but I am guessing it's something with either load or indexes cause server1 check50 works fine I tried using gdb to ...
1
vote
1answer
87 views

Help with parse

I'm getting two errors with check 50 and am struggling to understand how to go about this. :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 505 HTTP Version Not ...
1
vote
1answer
146 views

Parse wont pass check50

for some reason my code isnt passing: :( Two spaces after GET returns error code & :( Two spaces before HTTP/1.1 returns error code I cant see what would cause that. A previous question indicates ...
1
vote
0answers
100 views

pset6 grading cat2.html and other strange files

I have previously completed pset6 and submitted for a grade of 1.0, twice in fact. Now I have to submit it again (due to extension of course), however my grade is 0.42, despite passing the check50 ...
1
vote
0answers
73 views

What is offset pset6

I am going over the code for pset6. I want to understand every line of the code before I get started. I am up stuck on a few lines in the request function. The offset variable I do not understand what ...
1
vote
0answers
1k views

PSET 6 Server.c Parse Method

I am currently writing the parse method for pset6 server.c. I have rewritten it many times and I have never gotten it to work. I currently am getting 403 forbidden every time I try to run it. Here is ...
1
vote
0answers
462 views

No error messages but also no success when running SERVER from CS50 pset6. Help?

Hey so basically I've implemented code for lookup, load, and parse that compiles and (in my own eyes) should work logically. When I run it, the program tells me "Get HTML/1.1" but then nothing on my ...
1
vote
0answers
332 views

Pset6 server - 501 Not Implemented error

This is related to my earlier question, but as it turns out that I mistyped the error code in server.c and actually have a 501 Not Implemented error (instead of a 505), I made a new question because ...
1
vote
1answer
464 views

I am getting “HTTP/1.1 501 Not Implemented” when I run 192.#.#.#:port#/cat.jpg

@curiouskiwi, Thanks a lot....your response helped a lot. I wonder why I missed out such little detail. However guys, I have another problem which I believe am missing out something but can not seem ...
1
vote
0answers
974 views

How to run my copy of server.c

I am sure this is a stupid question, but I am struggling to workout how I actually run my version of server.c in pset6. Do I need to compile it? Whenever I try and "make" the file, terminal reports ...
1
vote
0answers
115 views

Check50 seg. faulting on speller, locally works fine

I've been trying to fix this for days, sadly, it's almost impossible for me to try and figure out what's going on when my speller works perfectly fine locally. I tested running my program on every ...
0
votes
0answers
12 views

Pset6 Readability Python: no output

from cs50 import get_string, get_int import sys def main(): statement = get_string("Text: ") count = len(statement) no_words = count_words(statement) no_letters = ...
0
votes
0answers
11 views

Problem with pset6 readability.py

It showing that one test failing. expected "Grade 8\n", not "Grade 7\n" After I'm going to results page, copy the text they use in test and manually testing it in my console, The ...
0
votes
0answers
18 views

PSET6 Credit Regex Error

I have attempted to use regex matching to solve the credit problem, but I am encountering the problem of syntax error when trying to run my code. The regex.match function I tried to use was found from ...
0
votes
1answer
40 views

PSET6 DNA Almost done - matching not working correctly

I have been stuck with last part of the code that is supposed to match the DNA sequence from sequence.txt with the one in database.csv. It passes most of the tests in check50 and fails only in ...
0
votes
1answer
46 views

pset6 - DNA - works for small.csv but not large.csv

import csv import sys with open(sys.argv[1], 'r') as file: # stores data from small.csv in both dict and list form dna_names_dict = csv.DictReader(file) ...
0
votes
1answer
17 views

get_string function not working on pset6 2020

here is the problem ~/ $ python hello.py Traceback (most recent call last): File "/home/ubuntu/hello.py", line 1, in <module> answer = Get_string("what is your name") ...
0
votes
1answer
20 views

Index to integer

How do i convert an index to an integer? I tried int(index), that didnt work. For example; S = [a,b,c,d] For index in S: n = int(index) print (n) break print ()
0
votes
0answers
85 views

pset6 dna question regarding searching string for substring, two types of code give different output

I am currently following along ayoutube tutorial for pset 6 DNA, and have a small question regarding a specific function. In this function, it basically takes a substring and a string, and counts the ...
0
votes
1answer
29 views

Pset6 Cs50 = Readability false output

I have been trying to complete readability python but on every result it is showing before Grade one from cs50 import get_string s = get_string("Text: ").strip() num_letters, num_sentences,...
0
votes
1answer
32 views

Pset 6 - Readability printing one grade off

I managed to translate readability from C to python, except it is printing one grade lower than what it is supposed to when testing. What am I missing here? """ 1) Ask user for phrase 2)...
0
votes
0answers
47 views

CS50 PSET 6 DNA Just Returns First Name

I've been working on DNA for a while now and thought I was done, but there's a problem with my code. Everytime I run it, the program just prints the first name on the database, so either 'Albus' or '...
0
votes
1answer
42 views

Print keys of CSV files in DNA pset6

I want to see what the keys of the reader dictionary are so I use the print(key) function. The result is all the lines of the dictionary. Why is that? import csv from sys import argv, exit # Check if ...
0
votes
1answer
119 views

pset6 count STR in the DNA sequence issues

so i m a bit confused...i have been testing my code using the small database and what i have so far produced what i expected .... more specifically the STRcounts (i marked that part #?????). it is ...
0
votes
0answers
70 views

PSet 6 DNA: Not able to match variables to dictreader names

I've mostly completed my code for PSet 6, except for the last part where I need to match up the values against the list of names. I know how to get the maximum occurances of the STRs and state the ...
0
votes
0answers
61 views

Can't figure out how to fix my code, any help please?

# open the CSV file and read its contents into memory with open(argv[1], newline = '') as csvfile: readCSV = list(csv.reader(csvfile)) for raw in readCSV: pass # Your program should ...
0
votes
0answers
122 views

pset6 DNA only getting “no match” SPOILER

I'm new to programming and have been stuck on the pset6 DNA assignment for a long time. The code outputs "no match" for everything, even though the output numbers from calculating the STR ...
0
votes
0answers
94 views

I'm stack with dna (pset6). can you please help me?

I have divided my code into three main pieces: 1- open the CSV file and read its contents into memory and open the DNA sequence and read its contents into memory 2- compute the longest run of ...
0
votes
1answer
186 views

PSET 6 DNA: How to get number of repeats for each value of STR's? [SPOILER: Full code]

I have written a code to count the highest number of consecutive repeats of specific DNA substring sequences in a long string of DNA...or so I thought. While my code can correctly count the longest ...
0
votes
0answers
41 views

DNA.py error: 'TypeError: unsupported operand type(s) for *: 'NoneType' and 'int''. It passes all but 2 of the tests

DNA.py is nearly finished, but it is failing the tests with sequence/15.txt and 16.txt. This is the error message: ~/pset6/dna/ $ python dna.py databases/large.csv sequences/16.txt Traceback (most ...
0
votes
1answer
204 views

Pset 6 DNA: improving efficiency

I've successfully submitted the below code on Pset6 for the DNA problem. But, I know my 'get_longest' function is a horror show as far as efficiency is concerned: I am doing a series of checks that I ...
0
votes
1answer
64 views

Issue with recording STRs in memory (PSET6 - DNA)

I'm trying to record the number of repetitions of each str in the sequence. I created a dictionary as below and another empty dict because i couldn't update a dict while iterating through it. But for ...
0
votes
1answer
239 views

Struggling with PSET6 DNA

I've been doing this for quite some time now, but I'm struggling to get the appropriate output. In the below code (which is incomplete as of now, but the main pieces are all on the board), I'm not ...
0
votes
0answers
46 views

Cs50 pset6 readability.py math

I'm trying to run this code and everything complies but when I enter the text in it is giving me the wrong grade level. I believe it might be something in the math, but am still unsure. Here's my code:...
0
votes
1answer
167 views

Pset6 DNA Not matching to names in the database

The print statements seem to turn out what I hoped for up until trying to compare the STR counts to the database STR counts. I would just appreciate any pointers of where I'm going wrong thanks. ...
0
votes
0answers
50 views

Almost Done… But substrings

// Returns true if word is in dictionary else false bool check(const char *word) { //Variables bool looping = true; int hashWord = hash(word); //Create a new pointers node *head = table[hashWord]; ...
0
votes
0answers
46 views

DNA Pset6 Can't run my program

I cant even run my program it keeps saying "list index out of range". I don't know whats wrong... Does anyone have any idea? import sys import csv def repeats(seq, part): rep = [0] * ...
0
votes
1answer
206 views

Pset6 DNA help - trouble calculating STR repeats with long database

I have really tried to just solve this one myself but after a few weeks this seems futile without guidance. I am having trouble getting a for loop to calculate the maximum consecutive occurrences of ...
0
votes
0answers
116 views

PSET6 DNA [SPOILER] Refactor

I have solved the problem however is there anyway to optimize this further? Also, how do I judge the time-space complexity of the same? import csv from sys import argv, exit from csv import reader, ...
0
votes
0answers
99 views

Confused about DNA in pset6

I've just started DNA, and I've got what seems to be a working algorithm to see if the count of the STRs in the database and sequence are the same, but it does not seem to be working. I've been a bit ...
0
votes
0answers
117 views

PSET 6 DNA! Stuck for so long

so the problem I face is when computing the greatest number of STR's in a sequence. I was able to hardcode "GATA" and compute the greatest sequence for a textfile using my sequencecount ...