Questions tagged [search]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
0answers
305 views

Match TWO letters with SQL query [closed]

This is not really a question but I was struggling to match two letter words using MATCH AGAINST and other people might find this useful. MySQL is configured to take only words with a minimum length ...
2
votes
1answer
169 views

Pset3 search: can't seem to find the last number

Everything else in check50 works, but my program can't find 42 in {40, 41, 42} and {39, 40, 41, 42}. I don't think it's sort's fault, and I've implemented search in the correct way (I think, at ...
2
votes
1answer
365 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 ...
1
vote
1answer
276 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
1k views

(pset8) Search.php FULLTEXT minimum character length

Is there a way to alter the minimum character count using FULLTEXT indices in the places table for the mashup database? Adding a FULLTEXT index to the admin_code1 column, which holds abbreviations for ...
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 ...
1
vote
1answer
577 views

PSET8 - search.php, admin_code1

I've hit a snag in pset8 rather early on. My code, for some reason, does not seem to like admin_code1 in search.php. Here's the relevant code so far: if(strstr($loc, ",")) { if(strstr($loc, " "))...
1
vote
1answer
589 views

Search function always false, haystack doesn't print a value

I feel like I am close, but not sure why my haystack values are not printing. I am trying to write linear search code for the search() function in helpers.c, and this is what seems to me to be the ...
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 ...
1
vote
1answer
422 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 ...
1
vote
2answers
135 views

I'm on pset8 testing search.php but this is the result to every url [duplicate]

I'm on pset8. I finished implementing search.php and was now testing it with the urls given but this is the result to every url
1
vote
1answer
3k views

pset3 helpers c, linear search

bool search(int value, int values[], int n) { // TODO: implement a searching algorithm for (int i = 0; i < n; i++) { if(values[i] == value) { return i; ...
0
votes
1answer
3k views

pset3 search and sort

First, thank you for your time. I am working on pset3. I don't know why my code does not work. I also have some questions: 1. Do I need a main function? I mean, do i need main to call the functions? ...
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
579 views

Pset3 Search/Find problems

I have no idea what the problems are with this code, so any help would be appreciated. The code compiles, but the output is skewed. It only sorts after a certain amount of characters, and then sorts ...
0
votes
2answers
110 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
2answers
52 views

There is something wrong with my keyformula in vigenere cipher, and error message: expected expression

I red all the questions with the code about the same issue but I can't figure out what is wrong with my code. When I use the command ./generate 1000 50 | ./find 127 I get: Didn't find needle in ...
0
votes
1answer
75 views

Linear search true/false vs 0/1

I just have a quick question. while implementing linear search in pset3, why is it that when I use "return 0" instead of "return true", the search function acts weird. Like it'd sometimes only find ...
0
votes
1answer
292 views

Pset3 linear search. Please help me!

I'm doing pset3 and I seem to have a functioning linear search. But I can't find my "needle" if it's in a higher array position than 331, which is where 127 is (I've copied the output of "generate" to ...
0
votes
2answers
48 views

confused by search function in Week 7 “lecture, continued”

I didn't quite follow the lecture; maybe someone can help me. This is regarding Week 7's "Lecture, continued," about 12 minutes in, when Prof. Malan is going over the simple implementation of a search ...
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 ...
0
votes
1answer
513 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
42 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
45 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
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
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
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
657 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
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 ...
0
votes
1answer
145 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
316 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 ...
0
votes
1answer
98 views

Check50 is claiming that it's recieving an exit code of 0 rather than 1 (different scenario)

I know this question has been answered before (pset 3 "search": expected an exit code of 0, not 1), but I took a look at it, and it seems that the scenario in which the person asked the ...
0
votes
1answer
16 views

Why am I generating the following errors with this code if it says it's compiled correctly?

The code compiles, and based off what I've seen in the linear search video, this should work. Tad bit confused why with this code below this error, I'm getting this error. In function `_start': (....
0
votes
1answer
91 views

“make all” for linear search when changing helpers.c results in “error: control may reach end of non-void function”

Here's the problem. After adding to helpers.c a linear search that will return true if the value is found (per the pset3 spec), I "make all" in the terminal to update helpers.c before testing it, but ...
0
votes
1answer
87 views

Iterative binary search only returns false (may be because of sort)

I've just looked at every similar question in this forum and couldn't find one that helped me, so I'm posting my own. I've tried everything (except GDB because I don't quite understand find without ...
0
votes
1answer
164 views

Pset3 - Function returns both true and false in while loop

In my code, after successfully searching the element, the function is returning true and false both to the main function. I have questions as follows -> 1 - Why the sm() function is returning true ...
0
votes
1answer
286 views

PSET8 search empty JSON

I wrote a few lines of code just to detect any problems and I unfortunately did. The following code returns an empty JSON array, only two square brackets with no content between them. I tried using ...
0
votes
1answer
762 views

Pset8 Search.php

Something strange is happening here with my SQL. I created an index called search with collums like: place_name, postal_code, admin_name1, admin_name2, admin_code1 But when I use the SQL command to ...
0
votes
1answer
135 views

Please. I need some help. When I use Makefile (make) it wont work

#include <cs50.h> #include <math.h> #include "helpers.h" bool search(int needle, int haystack[], int size) { int min = 0; int max = size; while(max >= min) { ...
0
votes
1answer
49 views

Week 3 Binary Search Video Short question

I just watched the short for binary search and I'm having trouble understanding how making a conditional of (max < min) would mean that the number is not in your array (timestamp 04:05). I get ...
0
votes
1answer
45 views

Concatenation values to array

After diving into pset3 I have stumbled upon one particular problem. In 'Search' problem we are supposed to write program that will sort values and afterwards search for the requested one. As far as I ...
0
votes
1answer
1k views

Pset 3 Search what am i suppose to do?

I have just started Pset3. I was going well until as per specification I read this Re-write search in such a way that it uses linear search, returning true if value is in values and false if value ...
0
votes
2answers
256 views

Pset3 - Code sorts, but does not find the needle using generate

I have the following code for helpers.c. When I run find, if I input numbers by hand, it sorts them and finds/doesn't find the n correctly. However, when I use generate to input the numbers, I can see ...
0
votes
1answer
366 views

Cannot find the needle 127 in the haystack of 1000 random numbers using linear search . Any ideas on what I may have done wrong?

I'm having a bit of difficulty in compiling the helpers.c program. Specifically when I try to check the correctness of the program, it seems it cannot find the needle 127 in the haystack of 1000 ...
0
votes
3answers
148 views

pset3 fail right in the beginning with linear search, somehow "may reach end of non-void function@

I am a beginner wanted to get started on pset 3. After watching all the videos i started to implement search as follow : bool search(int value, int values[], int n) { int b = 0; for (b=0;b<n; ...
0
votes
1answer
29 views

How to search in effective manner?

As in Lecture video of finding a name in telephone directory we get to half and choose one half where we can find the name. But my question is when the names are random how to effectively find a name. ...
0
votes
1answer
168 views

How can I implement binary search without changing the search() declaration?

I am struggling to implement the recursive binary search function: We are not supposed to change the search() declaration, so I thought I will have to implement a separate recursive function for ...