Skip to main content
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,...
Karthik Krishnan's user avatar
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, ...
Yuri Laguardia's user avatar
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.
Yury's user avatar
  • 41
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/...
Blauelf's user avatar
  • 21k
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, ...
DinoCoderSaurus's user avatar
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 ...
Yuri Laguardia's user avatar
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 ...
wingedRuslan's user avatar
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 ...
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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&...
DinoCoderSaurus's user avatar
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. ...
Blauelf's user avatar
  • 21k
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 ...
DinoCoderSaurus's user avatar
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 ...
rl777's user avatar
  • 39
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 ...
hotwebmatter's user avatar
  • 3,050
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 ...
Yuri Laguardia's user avatar
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.
DinoCoderSaurus's user avatar
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 ...
Yuri Laguardia's user avatar
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"], ...
t.m.'s user avatar
  • 158
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 ...
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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.
DinoCoderSaurus's user avatar
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"...
DinoCoderSaurus's user avatar
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 (...
DinoCoderSaurus's user avatar
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....
Shauny's user avatar
  • 96
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 ...
Blauelf's user avatar
  • 21k
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 ...
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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 (...
Blauelf's user avatar
  • 21k
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()"...
Adam DeCaria's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible