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/...
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
Accepted
InfoWindow doesn't load in map when clicking label - Uncaught Type Error
I think the problem may be that your add listener is outside the addmarker function scope.
If you need more help, i'll be glad to help :)
3
votes
Pset8 Mashup Map Not loading
USE A DIFFERENT BROWSER.
I tried using Mozilla instead of chrome to load the page, and it worked wonders for me!
2
votes
pset8 (mashup) - Inserting $places variable into configure function in scripts.js
I figured it out. <%= ... %> is indeed the way you pass in arguments to _.template. When I watched the video in the problem set again the prof mentioned how this code operates similarly to the "%i" ...
2
votes
Accepted
PSET8 - MASHUP : Can't find FULLTEXT indexes when using WITH QUERY EXPANSION
It is very weird but I advice you to follow these steps:
Use ALTER TABLE <table> ENABLE KEYS to make sure that your keys are active.
If nothing's still working, use ALTER TABLE <table> ...
2
votes
Pset8 Mashup Map Not loading
I also had this issue. The Date/Time adjustment didn't help but an Update50 and a reboot sorted it for me.
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, 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
Accepted
pset8: infowindow and $.getJSON difficulties
You are on the right track!
For example, you are definitely not putting the $.getJSON statement in the right place.
But that's easy to fix. Your real problem is with variable scope.
One of the most ...
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
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
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 ...
1
vote
Accepted
pset8 search function not working like supposed to
Here's a way to see what the problem is using command line python:
Python 3.4.3 (default, Nov 17 2016, 01:08:31)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more ...
1
vote
pset8, mashup: Please, I'm I doing wrong here
In case anyone else is looking for solutions that don't seem to work: make sure you named your table 'places', not 'places ' like I did... (notice the whitespace at the end)
1
vote
pset8, mashup: Please, I'm I doing wrong here
From the FAQ section of the spec:
CREATE TABLE places(…) failed: duplicate column name
If you see this message upon running .import in sqlite3, odds are you haven’t run sqlite3 in the same ...
1
vote
Accepted
pset8 mashup - markers not showing up in map
This can happen if latitude and/or longitude are TEXT columns. They need to be NUMERIC columns, otherwise the select SQL in the update route returns no rows and addMarker doesn't get called.
1
vote
Accepted
search doesn't work when zip code is full
Remember the array is 0 indexed. When it "searches" for '02138', the query returns 1 row, which is place[0]. Therefore it is not included in return jsonify(place[1:8]) (because place[1:8] is the 2nd ...
1
vote
Accepted
pset8 addMarker undefined in info window
I incorporated this addMarker function into my app and it showed the list of articles in the info window (though the articles don't have "links"). So I "tweaked" articles; changed
return jsonify(...
1
vote
pset8 mashup addmarker
If you went to Developer Tools > Console, you would probably see something like
ReferenceError: myLatlng is not defined
on some of the lines there.
The issue is that you assign myLatlng (with ...
1
vote
Pset 8 Mashup Import Issue (fgetcsv returns empty array)
I figured it out! It turns out that the issue was not the commented code. The issue was actually the declaration of the while loop. I can confirm that's the case because when I go to PHPMyAdmin I can ...
1
vote
Pset8 search add fulltext error
Fulltext index is only supported on columns that are either of type varchar, text, or char, and some others you likely won't use. latitude and longitude are both of type decimal.
See this page, quote ...
1
vote
Accepted
Objects in javascript
Answers
1. Yes.
The following function
function addMarker(place)
{
// GPS coordinates for marker
var latLng = new google.maps.LatLng(place.latitude, place.longitude);
// Create ...
1
vote
How to successfully add marker in pset8 mashup?
first-off there is some change about EDX 2015 class. read this
https://courses.edx.org/courses/HarvardX/CS50x3/2015/info
Now Marker with label you have to read this
http://google-maps-utility-...
1
vote
change icon of marker problem in mashup
You need to use /img/news2.jpg (notice the preceding slash) since img is a subdirectory of public (assuming that news2.jpg is stored in img). You should be able to do it in one line this way:
icon: '/...
1
vote
Accepted
Error when importing too many rows of US.txt in PSET8
Assuming you get this error when viewing places table after import, check out this post: a problem with displaying the places table
1
vote
Accepted
help me understand GROUP BY in update.php
In a word: postal_code. If you run this query (I added place_name to get a more manageable result)
SELECT * FROM places
WHERE (40 <= latitude AND latitude <= 41)
AND (-74 <= longitude ...
1
vote
Accepted
Text Box for cs50 mashup
Have you seen this post?
Pset8, modified value of suggestion, still not working
It suggests clearing the browser cache. You can do that with a shift-reload or a ctrl-F5.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
mashup × 109pset8 × 86
addmarker × 19
search × 9
javascript × 8
python × 6
sql × 6
import × 6
json × 6
cs50x × 5
google-maps-markers × 5
articles × 4
query × 3
cs50x2018 × 3
infowindow × 3
removemarker × 3
final-project × 2
pset × 2
cs50x2017 × 2
sqlite × 2
google-maps-api × 2
search.php × 2
ajax × 2
import-error × 2
articles.php × 2