Hot answers tagged

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
  • 20.9k
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
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 :)
Belen's user avatar
  • 87
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!
peanutlover's user avatar
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" ...
plumsmugler's user avatar
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> ...
DFATPUNK's user avatar
  • 155
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.
Stef Joynson'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, 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
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 ...
hotwebmatter's user avatar
  • 3,050
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

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
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
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 ...
DinoCoderSaurus's user avatar
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)
Bogdan Nazare's user avatar
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 ...
DinoCoderSaurus's user avatar
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.
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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(...
DinoCoderSaurus's user avatar
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 ...
mimo31's user avatar
  • 146
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 ...
AdiKhajuria's user avatar
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 ...
kluvin's user avatar
  • 1,223
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 ...
Ibrahim's user avatar
  • 428
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-...
Peter Maquiné's user avatar
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: '/...
DinoCoderSaurus's user avatar
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
DinoCoderSaurus's user avatar
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 ...
DinoCoderSaurus's user avatar
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.
DinoCoderSaurus's user avatar

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