Questions tagged [search]

The tag has no usage guidance.

24 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
103 views

Why my code is always returning an empty array

Here is my code for application.py pset8 search route which always returns 0 or empty array, I can't figure out why, Kindly help @app.route("/search", methods=["GET", "POST"]) def search(): """Search ...
0
votes
0answers
13 views

How do I start project0 search?

Yes, I know that it shows the code to get it started but I personally do not know how to start it. Yes, I was told to start it on Scratch but other than playing with a sprite, I do not know where to ...
0
votes
0answers
35 views

TicTacToe task: PyGame display not rendering

For some reason, the PyGame TicTacToe display is not showing. It just hangs at this: This is the runner.py: import pygame import sys import time import tictactoe as ttt pygame.init() size = width, ...
0
votes
0answers
84 views

pokedex android search error

the code right and I re-write it more than one time and compiler without error but didn't make search public class PokedexAdapter extends RecyclerView.Adapter<PokedexAdapter.PokedexViewHolder> ...
0
votes
0answers
11 views

Why do the deepcopies in my minimax implementation (project 0b) look like they're getting altered?

The minimax function has a max function and a min function. The recursion takes place between them, where the max function calls the min function and the min, calls the max. While exploring a node, ...
0
votes
1answer
94 views

Struggling with logic on cs50 AI search

I completed CS50 intro to computer science a while back and I am starting the AI course now. I watched the lecture, and I understood how the logic worked for the maze and such, but I'm struggling on ...
0
votes
1answer
161 views

Search function - Pset8 - Mashup

I found the search query a little bit complicated, in the sense it can be difficult to adjust it to the user's input. For example, how do I permit the user to enter the parameters in different order ...
0
votes
1answer
295 views

pset8 - search function in application.py

My search function returns the correct results when I am using for example q=Cambri but when I try to search using for instance q=021 nothing is returned. In my database I have set postal_code field ...
0
votes
1answer
245 views

Search function do not work if several words entered

Both mine and stuff solutions do not work for examples like (where there is two of more words from different db fields): https://ide50-username.cs50.io/search?q=New+Haven,+Connecticut // http://pset8....
0
votes
1answer
28 views

Error with fifteen?

I am taking the Harvard ap cs5o class, and I just started the pset3's fifteen. I followed the directions to get the skeleton code from here: Problem scope After reading and following along I tried ...
0
votes
1answer
129 views

Staff's solution of search doesn't pass required tests. Mine does, but works much slower

As per specifications we are given links to test return of JSON data for our search requests. But staff's solution doesn't pass them. Check, only first one returns something. http://pset8.cs50.net/...
0
votes
1answer
48 views

Check 50 for find

I have gotten most of my code to work for the search and sort, but I still have a few issues. One is i my for loop, I have it set to less than 100, though I need to make it less than log n, but I ...
0
votes
2answers
104 views

Help finding segmentation fault

In my code, I get a segmentation fault some, but not all of the times that I run it. Sometimes, it sorts the code and finds the needle, sometimes it doesn't sort correctly and ends with a segmentation ...
0
votes
1answer
75 views

pset3 find, failing half the checks!

so currently doing pset3 & i think my sort function is all good (i've printf'd each value & it's all in the right order), but when trying to implement binary search it's failing half the tests ...
0
votes
1answer
524 views

CS50 Problem Set 3 Helpers.c PROBLEMS

I have been trying to solve Pset3 search and sort - looked at all possible online forums but I cannot solve it. Please help. Where am I going wrong? Is my binary search OK? What about my bubble sort? ...
0
votes
1answer
81 views

Guys,my code runs perfectly right with check 50 for binary search but doesn't show right output for ./generate 1000 50 | ./find 127.Please help

bool search(int value, int values[], int n) { int middle=(int)((n-1)/2); if(n<0) { return false; } else if(values[middle]==value) { return true; } else if(...
0
votes
2answers
76 views

PSET3 Binary search not yielding results

I can't seem to figure this out. here's my code bool Binarysearch(int key, int array[], int n){ int end = n-1; int start = 0; while(start<=end){ int midpoint = (((end+start)/2)); if (...
0
votes
1answer
33 views

pset3: linear search (strange behaviour)

My code is going through check50 okay, but when I try to check it manually it doesn't seem to be able to find the needle in the haystack. I can't figure out why that is happening that's why I'm hoping ...
0
votes
2answers
54 views

binary search pset 3 pointer to integer error

I am trying my hands on binary search. I get those pointer to integer errors :( Can sonmeone more experience give me a hand ? bool search(int value, int values[], int n) { int first=0; int last=n-1; ...
0
votes
1answer
46 views

Find Search Help (improved)

For pset3's findsearch, i saved the this code #include "helpers.h" bool search(int value, int values[], int n) { // removed implementation due to academic honesty rules } in helpers.c and ...
0
votes
0answers
88 views

search binary search

This code does not work. I tried everything. My sort function is working (I tested it with linear search, so it's fine). I am getting "Did not find haystack" even when the value is there. bool search(...
0
votes
0answers
207 views

in pset8 search I get mysql error

( ! ) Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''02421'' at line 1 in /home/jharvard/vhosts/...
0
votes
1answer
806 views

linear search compilation error

I've updated search function in helpers.c with code below. I had to remove reference to helpers.h since that was causing even more errors. #include <cs50.h> // #include "helpers.h" bool search ...
0
votes
1answer
732 views

Binary search question

I'm currently struggling with the binary search in pset 3 and I think I already found out how to implement it. I just really can't understand why, after return res;, the program does not leave the ...