Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Calling a function on POST

I am doing Project 1 for CS50 Web. I have successfully managed to implement all search functions, but now I want to be able to call this search function from any page, up to now it was hard-coded to ...
0
votes
1answer
125 views

cs50w Project 1 Wiki Search: layout.html failing to submit POST to views.py

currently working on the search function for project 1. I've updated layout.html, urls.py, and views.py, but when I input anything into the search bar layout.html does not pass the POST information to ...
0
votes
2answers
36 views

Header links won't align to the right (P2)

In the work of search, I wanted to deal with the header links (Image Search and Advanced Search links) not aligning to the right. As I looked into my CSS file, everything works properly except text-...
0
votes
0answers
118 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
99 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
153 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
13 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
138 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
28 views

PSet3 helpers.c fails one of the checks

I'm working on the PSet3 Find problem. Here's my code for the sort and search functions: bool search(int value, int values[], int n) { if (value < 0) return false; else { ...
0
votes
1answer
237 views

intersection of a list of arrays, python

I have two arrays that have dictionaries within them (these dictionaries objects in both arrays contain identical keys): a = [{1:"a", 2:"b"},{1:"c", 2:"d"}] b = [{1:"e", 2:"f"},{1:"c", 2:"d"}] I ...
0
votes
1answer
69 views

Specify Multiple Search Conditions for SQL

this is a question about search() in pset8 Mashup. How does one select rows given multiple characteristics(for example in pseudo code, SELECT * THAT CONTAIN KEYWORDS "New Haven" AND "Connecticut" AND ...
0
votes
1answer
163 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
291 views

pset8 2018 mashup search

I have changed nothing in the pset8 distribution code and only implemented search function and formatted configure in script.js, but no suggestion shows up from the search box 'q'. This worked ...
2
votes
1answer
385 views

2017 pset8 mashup: Slow search - how to improve search performance?

I have successfully implemented search in application.py. Though ss I was testing through the app, I noticed that every search was really slow. It's turns out that every search request was from 63KB ...
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
29 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
568 views

CS50 Helpers.C Find Less, No Idea What's Going On

Final Code: /** * helpers.c * * Helper functions for Problem Set 3. */ #include <cs50.h> #include "helpers.h" /** * Returns true if value is in array of n values, else false. */ bool ...
0
votes
2answers
43 views

PSET 3, there is nothing happening

My code is not working at all and I am not able to find a proper solution. UPDATE: So I just now came to know that I am not able to use ^d if needle is not found otherwise it is working. /** * ...
0
votes
1answer
345 views

pset8 search function not working like supposed to

I'm trying to implement search in pset8 so that it can narrow down searches based on whether a comma followed by a state name or symbol is included. For example, the standard search would output many ...
0
votes
1answer
132 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
108 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
46 views

cs50 pset3 binary search

im not sure if my binary search code is correct, when I try to compile it I get the following message: /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has ...
0
votes
1answer
78 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 ...
1
vote
0answers
109 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
1answer
94 views

pset8-Search error,doesn't work when a place is a parameter

Given below is the code for search , it works fine and outputs correct json object when a postal code is then parameter but fails for places if not request.args.get("q"): raise ...
0
votes
2answers
125 views

Binary Search for helpers.c

so as the title suggests I am having some trouble with my implementation of binary search. So based on the logic shown in the lecture, I think my implementation is fine, indeed it works for the cases ...
0
votes
1answer
511 views

Pset 8 search and configure functions

templates: { suggestion: Handlebars.compile( "<div>" + "{{place_name}}, {{admin_name1}}, {{postal_code}}" + "</div>" ) } In my ...
0
votes
1answer
126 views

pset3 helpers.c (help)

:( finds 42 in {39,40,41,42} \ expected an exit code of 0, not 1 ( it meaning I missing or have a return error??? ) bool search(int value, int values[], int n) {// ...
0
votes
1answer
75 views

pset3: search (am I in the right track??)

bool search(int value, int values[], int n) //search for middle lists if (value == values [n / 2]) { return 1; } //number greater search left else if ( value > values[n / 2 ]) { search(int ...
0
votes
1answer
99 views

Pset 3 Recursive Binary Search problems - Always returns true

I have tried almost everything and edited my code a hundred times in search of an answer. It seems that whenever I run the program (find.c) the result always resolves to true. Not sure where the ...
0
votes
1answer
206 views

Query for postal code as well as place and admin name in Search route in application.py mashup

I'm almost done with pset8. Just cant find any documentation that would help me in implementing postal code search in addition to place and admin_name1 search. db.execute returns a string and so ...
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
20 views

pset3 Search - 2 equal ints not triggering if

I'm perplexed by an issue I'm having. i've got printfs in here as I was having an argument with gdb earlier on with it not stopping at breakpoints. bool search(int value, int values[], int n) { ...
0
votes
1answer
22 views

working with pset3

why isnt the compiler returning the false if the needle is not in the haystack.This is my modified code with the SESE method. /** * helpers.c * * Computer Science 50 * Problem Set 3 * * Helper ...
0
votes
2answers
745 views

Recursive binary function returns error: control reaches end of non-void function

Working on pset3 and tried to write a separate binary search function in helpers.c so I can just call it later in the main search function. Here's my code for the binary search: bool binarysearch(int ...
0
votes
1answer
120 views

Pset8 search add fulltext error

I am trying to add latitude and longitude to my search function. However, when I try to add fulltext in phpmyadmin, I receive the following error: #1283 - Column 'latitude' cannot be part of FULLTEXT ...
0
votes
1answer
84 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
1answer
439 views

pset3 binary search won't find values when at end of array

As the title says, the program doesn't pass the check when 42 is the last element of the array. I've seen a related post about this issue but it did not give me enough to fix the problem. The code is ...
0
votes
1answer
222 views

pset8 search: FULLTEXT error on including longitude and latitude

If I search for 02138 in the search box of my mashup I do get a match but when I click on that match the map just go blank. Can anyone please tell me why I ma having this problem? EDIT ok have ...
1
vote
1answer
70 views

pset8 search: Which column represents State?

as per specification of pset8's search value of geo, passed into search.php as a GET parameter, meanwhile, might be a city, state, and/or postal code I am not from US so Dont know how the names of ...
0
votes
1answer
67 views

binary search code showing segmentation fault

this is my code. bool search(int value, int values[], int n) { int max = n -1; int min = 0; int mid; while(n > 0) { mid = ((min = max)/2); if(values[mid] == ...
0
votes
1answer
59 views

pset3 binary search code is not compiling

this is my code for binary search. bool binary(int key, int array[], int min, int max); bool search(int value, int values[], int n) { if( n< 0) { return false; } ...
0
votes
2answers
78 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 (...
1
vote
1answer
277 views

pset3 search: expected an exit code of 0 not 1

I keep returning an exit code of 1 instead of 0 even if I manage to find the value inside the array. I suspect something is wrong with my while loop but I can't exactly pinpoint it. Any help is ...
1
vote
1answer
429 views

PSet 8 Search Method

I have been working on Pset 8 Mashup, and have so far completed the first two parts of the eight-part assignment, but I have come to the Search part, and do not understand. Firstly, what am I ...
0
votes
1answer
35 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
1answer
148 views

pset3: linear search problem

So I was trying to figure out what the code for the linear search function should be and I can't understand where the "false" output should be implemented. The code: bool search(int value, int ...
0
votes
1answer
350 views

pset 3 Binary search

I'm stuck on implementing the binary search function in pset3. I am trying to do the recursion method but I am stuck and have been for hours. It seemed easy enough but I am discovering that it's more ...