Hot answers tagged

9 votes
Accepted

Pset8, modified value of suggestion, still not working

Nevermind, just had to clear the cache.
user avatar
7 votes
Accepted

Pset8 Mashup Map Not loading

if anyone has run into the issues i have stated above there is a simple fix. Doing some searching around and trying to access urls using https showed me my appliance was not ‘secure’. By going into ...
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.
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/...
user avatar
  • 20.7k
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 :)
user avatar
  • 87
3 votes

$.getJSON in PSET8 mashup's addMarker function in scripts.js

Replaced with: $.getJSON("articles.php?geo="+place.postal_code) .done(function(data, textStatus, jqXHR) { more code } and now call is returning data. Still not sure why previous code ...
user avatar
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!
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 ...
user avatar
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.
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" ...
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> ...
user avatar
  • 155
2 votes
Accepted

$.getJSON difficulties with infoWindow

I thought the problem was in the $.getJSON part, but instead, it was putting showInfo(marker, content); OUTSIDE $.getJSON.done. As @ChrisG helped me discover (see comments above), it returns at the ...
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 ...
user avatar
  • 3,035
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.
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 ...
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 ...
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....
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 ...
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 ...
user avatar
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 ...
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 ...
user avatar
  • 1,223
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 ...
user avatar
  • 146
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 ...
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-...
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: '/...
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
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 ...
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.
user avatar
1 vote

PHP Fatal error: Column 'country_code' cannot be nullPHP Fatal error: Column 'country_code' cannot be null

You will get this error PHP Fatal error: Column 'country_code' cannot be null in /home/jharvard /vhosts/pset8/includes/functions.php on line 57 if you use while(!feof($yourfile)) to iterate ...
user avatar
1 vote

PHP Fatal error: Column 'country_code' cannot be nullPHP Fatal error: Column 'country_code' cannot be null

How are you getting the data from the csv file and populating $file and, by extension, $row? I would start by doing a dump of $row just before the query. I suspect that there is no $row[COUNTRY_CODE],...
user avatar
  • 63.1k

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