8
votes
Runtime Error: API_KEY not set
This can be easily solved by noting which terminal the export command was executed in the same terminal window that flask is running in (will be prompted to run in after the export command). Otherwise,...
4
votes
Accepted
How to add labels to Markers?
There is an example of MarkerWithLabel here that should show you how to do that. It's the labelContent property. Transcript of an example from that link:
var latLng = new google.maps.LatLng(49.47805, ...
4
votes
pset8 infoWindow appearing with wrong marker
Had the same trouble. Fix it with 'var' before 'marker = new...'. Else you overwrite the same variable each time.
4
votes
Accepted
jsonify not working when I add this line of code <<db = SQL("sqlite:///mashup.db")>> to application.py
So it seems the workaround solution was to add
app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
somewhere after the
app = Flask(__name__)
The issue has been reported (https://github.com/pallets/...
4
votes
Accepted
Finance: How to check if input is valid in "quote"?
If lookup() doesn't find the requested symbol, it will return None. That is not explicitly stated in the spec, but that is what the try/except block does in the function.
None is not subscriptable, ...
3
votes
Accepted
Pset8: NoApiKeys error and the map does not display
Have you tried to clear Chromes's cache? https://support.google.com/accounts/answer/32050?hl=en
Another approach is to use the browser in incognito mode.
Chrome's incognito mode uses a fresh cache ...
3
votes
pset8 (Mashup) - Getting the geo value into /articles
Complete the implementation of /articles in such a way that it outputs
a JSON array of objects, each of which represents an article for geo,
whereby geo is passed into /articles as a GET parameter
...
3
votes
Accepted
Pset 8 search and configure functions
According to the spec [emphasis added]:
Complete the implementation of /search in such a way that it outputs a JSON array of objects, each of which represents a row from places that somehow matches ...
3
votes
Accepted
My articles do not match with the staff articles
That's old news. The staff's output, I mean. All the articles are a month old. It is reasonable to assume that the staff's solution has "features" that are unknown (and unknowable). As noted in the ...
3
votes
Pset8 This page can't load Google Maps correctly
If you got
You have exceeded your request quota for this API. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&...
3
votes
Accepted
SQL3 SUM troubles
You can't use the aggregated value in WHERE. WHERE is applied to the table data, and the aggregated values are created later.
There is the complementary HAVING clause, processed after aggregation. ...
3
votes
phpliteadmin is constatly loading and won't open pset8
If phpliteadmin will not open in preview, try phpliteadmin {dbname} at the command line. It will say "Running phpLiteAdmin at " followed by an address. Hover over the address, click, choose "Open". It ...
2
votes
Problem Set 8 Permissions
Based on the above from Matt Obert, I created the following bash script - bashPermsv2.sh - in the pset8 folder. Ran it from the terminal with:
'~/workspace/pset8/ $ sh bashPermsv2.sh'
and it ...
2
votes
Accepted
Is pset8 really very difficult
Congratulations on finishing Problem Set 7! :)
Problem Set 8 is a lot to learn all at once, but don't quit.
As with other Problem Sets, just break this one down into small steps and tackle each one ...
2
votes
Pset8 typeahead not working
Nothing wrong with your scripts.js from what I can see.
Try to clear your browser's cache or something.
If I paste your entire file in place of my scripts.js, your code works.
So maybe your ...
2
votes
Accepted
pset8, import. Only even row numbers from US.txt are being written to db
This while(fgetcsv($file, 500, "\t")) is reading the odd numbered lines. This $csvarray = fgetcsv($file, 500, "\t"); is reading the even numbered lines, which are then inserted into the db.
2
votes
pset8 addMarker click event opens info window on wrong marker
Man... you'll be so pissed off with this...
You should declare a NEW marker variable every time you call addMarker, but you don't do this here:
marker = new google.maps.Marker({......
When you do ...
2
votes
Accepted
Pset8: How to set label position and font?
You can assign anchor value for label so it does not overlap with the icon, like this
var marker = new MarkerWithLabel({
position: latLng,
map: map,
labelContent: place["place_name"],
...
2
votes
Accepted
pset8- AddMarkers, not even working to for a simple console.log() test
You told the program to "get" info from "articles" here $.getJSON(Flask.url_for("articles")) but you didn't tell it what to GET. Assuming your articles function returns data as per the examples (eg ...
2
votes
CS50 Mashup: addMarker clarification
You are always setting myLatLang here var myLatlng = new google.maps.LatLng(42.3770, -71.1256); // Cambridge, Massachussets, so all the markers will go "there". The argument place is the result of the ...
2
votes
Accepted
PSET8 Mashup.db Error (Places)
It looks like you are not in the same directory as when you ran phpliteadmin to create the table. If you sqlite3 mashup.db and mashup.db does not exist, it will be created. If that happened, then ...
2
votes
Accepted
Update function in pset8 is raising an error
A likely cause is the sql in the search function is not returning a column named latitude or longitude (or both). Spelling and case are critical.
2
votes
Accepted
CS50 Pset8: Info Window Not Showing
One problem is this syntax markers += marker;. That does not add an element to an array in js. The array method push adds elements to an array.
Another problem is here marker.addListener(map, "click"...
2
votes
Accepted
CS50 Pset8: Final Questions before Wrap-Up
How does the computer recognize that those few lines inside a JavaScript file is actually html and not JavaScript codes? It doesn't. It's not javascript or html to the function, it's data. When it is (...
2
votes
Accepted
2017 pset8 mashup: Slow search - how to improve search performance?
1: The more columns you are searching the more results you return. For example as you start to type the word "Boston" the search query takes 'B' and looks for every word in the column with a 'B' in it....
2
votes
What purpose does "eventData" serve in the pset8 source code "$("#q").focus(function(eventData)"?
.focus(handler) is short for .on("focus", handler), and installs an event listener, in your case, handler is an anonymous function declared with one parameter.
Those handlers, when called, receive an ...
2
votes
Accepted
Pset8 - mashup (2018 or 2017): Downloading distribution code does not include txt files
You only show the instructions from the spec, not what happened when you ran the commands, so this answer is only speculative. First, I followed the directions and it worked as expected. Some ...
2
votes
Accepted
Mashup: removeMarkers not removing markers? PLEASE HELP
The removeMarkers will get rid of one marker, the last one added. The problem is in addMarker. addMarker will be called for each "place" and should add one marker to the map and one marker to the ...
2
votes
Accepted
CS50 PSET 8 Finance 2019 - why does the length of a row queried from the database equal 1?
db.execute for a SELECT returns a list of dicts, a dict being some kind of key:value store. Each list entry corresponds to a database record.
So len(rows) represents the matching number of records (...
2
votes
Accepted
PSET 8: Finance /check
So, as it turns out - the error was in the Python code. I used "request.form.get()" when I should have used "request.args.get()" since its a GET request not a POST request. Using "request.args.get()"...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pset8 × 439mashup × 86
finance × 71
addmarker × 52
javascript × 34
search × 23
import × 22
cs50x × 17
python × 16
json × 15
google-maps-api × 15
search.php × 15
sql × 12
articles × 12
buy × 10
check × 9
google-earth × 9
google-maps-markers × 8
cs50-shuttle × 8
check50 × 7
html × 7
register × 7
infowindow × 7
pickup × 7
showinfo × 7