Skip to content

Commit

Permalink
Replaced neighbour with neighbor in all files in the project. Hopeful…
Browse files Browse the repository at this point in the history
…ly no sneaky bugs were introduced.
  • Loading branch information
Nick King committed Mar 31, 2013
1 parent 85e7d5e commit 17dafa5
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 248 deletions.
2 changes: 1 addition & 1 deletion Docs/nodes-data-temp33013100106.rtf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Docs/nodes-data-temp3301375522.rtf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Docs/nodes-data-temp3301382222.rtf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Docs/nodes-data-temp3301385900.rtf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Docs/nodes-data-temp3301390845.rtf

Large diffs are not rendered by default.

462 changes: 231 additions & 231 deletions GuideAndroid/assets/nodes.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,17 @@ public void onCreate(Bundle savedInstanceState) {

GuideDBOpenHelper helper = new GuideDBOpenHelper(this);
SQLiteDatabase db = helper.getReadableDatabase();
/*
Cursor placeCursor = db.query(PlaceTable.PLACE_TABLE_NAME,
new String[] {PlaceTable.ID_COL, PlaceTable.LATITUDE_COL, PlaceTable.LONGITUDE_COL, PlaceTable.NAME_COL},
null, null, null, null, null);
null, null, null, null, null);*/
Cursor nodeCursor = db.query(NodeTable.NODE_TABLE_NAME,
new String[] {NodeTable.ID_COL, NodeTable.LAT_COL, NodeTable.LON_COL},
null, null, null, null, null);

mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.debug_graph_map)).getMap();

/*
if (placeCursor != null) {
int id_ix = placeCursor.getColumnIndex(PlaceTable.ID_COL);
int name_ix = placeCursor.getColumnIndex(PlaceTable.NAME_COL);
Expand All @@ -50,15 +52,17 @@ public void onCreate(Bundle savedInstanceState) {
.title(name)
.snippet("ID: " + id));
}
}
}*/

if (nodeCursor != null) {
int id_ix = nodeCursor.getColumnIndex(NodeTable.ID_COL);
int lat_ix = nodeCursor.getColumnIndex(NodeTable.LAT_COL);
int lon_ix = nodeCursor.getColumnIndex(NodeTable.LON_COL);
int neighbors_ix = nodeCursor.getColumnIndex(NodeTable.NEIGHBOR_COL);
while (nodeCursor.moveToNext()) {
double lat = nodeCursor.getDouble(lat_ix);
double lon = nodeCursor.getDouble(lon_ix);
String neighbors = nodeCursor.getString(neighbors_ix);
int id = nodeCursor.getInt(id_ix);
mMap.addMarker(new MarkerOptions().position(
new LatLng(lat, lon))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ private static void insertNodeTuple(SQLiteDatabase db, JsonReader reader) throws
} else if (propertyName.equals("longitude")) {
cv.put(NodeTable.LON_COL, reader.nextDouble());

} else if (propertyName.equals("neighbours")) {
} else if (propertyName.equals("neighbors")) {
reader.beginArray();
StringBuilder neighborIds = new StringBuilder();
while (reader.hasNext()) {
Expand Down
11 changes: 5 additions & 6 deletions GuideWebsite/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@
this.latitude = lat;
this.longitude = lon;

// Array of neighbour ids. Yes, the British spelling is used here
// intentionally.
this.neighbours = new Array();
// Array of neighbor ids
this.neighbors = new Array();
}

/*
Expand All @@ -135,8 +134,8 @@
return latitude;
} else if (key == "longitude") {
return longitude;
} else if (key == "neighbours") {
return neighbours;
} else if (key == "neighbors") {
return neighbors;
} else {
return undefined;
}
Expand All @@ -153,7 +152,7 @@
markerHolders[i].marker.position.lng());
for (var j=0; j<markerHolders[i].adjacency.length; j++) {
if (markerHolders[i].adjacency[j] != null) {
node.neighbours.push(markerHolders[i].adjacency[j]);
node.neighbors.push(markerHolders[i].adjacency[j]);
}
}
nodes.push(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class Register extends FragmentActivity implements OnClickListener {

private static final String ID = "id";

private static final String NEIGH = "neighbours";
private static final String NEIGH = "neighbors";

private static final int FIRST_ID = 10000;

Expand Down
4 changes: 2 additions & 2 deletions scripts/place_to_nodes_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
node["id"] = place["id"]
node["latitude"] = place["latitude"]
node["longitude"] = place["longitude"]
node["neighbours"] = []
node["neighbors"] = []
nodeslist.append(node)

# insert a place holder in preparation for the rest of the dataset
last = {}
last["id"] = 9999
last["latitude"] = 0
last["lomgitude"] = 0
last["neighbour"] = []
last["neighbor"] = []
nodeslist.append(last)

# Dump everything in a new file named nodes.json
Expand Down

0 comments on commit 17dafa5

Please sign in to comment.