This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Incarnate the graph database created earlier | |
# with the graph compiler tools | |
from graphserver.core import Graph, State, Link | |
from graphserver.graphdb import GraphDatabase | |
gdb = GraphDatabase('trimet_13sep2009.linked.gsdb') | |
g = gdb.incarnate() | |
# Board-alight graphs contain many vertices which do not | |
# correspond to stations – print a list of only the stations | |
# Is there a better way to do this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphserver.core import * | |
from graphserver.graphdb import GraphDatabase | |
import time | |
import random | |
gdb = GraphDatabase('trimet_13sep2009.linked.gsdb') | |
g = gdb.incarnate() | |
t0 = 1253730000 | |
time.ctime(t0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean eDominates(State s0, State s1) { | |
final double EPSILON1 = 0.05; | |
final double EPSILON2 = 0.25; | |
if (s0.similarTripSeq(s1)) { | |
return s0.getWeight() <= s1.getWeight() * (1 + EPSILON1) && | |
s0.getElapsedTime() <= s1.getElapsedTime() * (1 + EPSILON1) && | |
s0.getWalkDistance() <= s1.getWalkDistance() * (1 + EPSILON1) && | |
s0.getNumBoardings() <= s1.getNumBoardings(); | |
} else if (s0.getTripId() != null && s0.getTripId() == s1.getTripId()) { | |
return s0.getNumBoardings() < s1.getNumBoardings() && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.opentripplanner.api.servlet; | |
import org.eclipse.jetty.server.Connector; | |
import org.eclipse.jetty.server.Server; | |
import org.eclipse.jetty.server.bio.SocketConnector; | |
import org.eclipse.jetty.webapp.WebAppContext; | |
import org.eclipse.jetty.webapp.WebInfConfiguration; | |
import org.eclipse.jetty.webapp.WebXmlConfiguration; | |
public class JettyServer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Helps create Gradle dependency lists by processing output of: | |
# mvn dependency:list -DexcludeTransitive=true | cut -c11- > deps.txt | |
# Note: Install gradle manually, the package is broken on Ubuntu. | |
with open("deps.txt") as f: | |
deps = [] | |
for line in f.readlines() : | |
fields = [x.strip() for x in line.split(':')] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.conveyal.datatools.common.persistence; | |
import com.conveyal.datatools.manager.DataManager; | |
import com.conveyal.datatools.manager.models.FeedSource; | |
import com.conveyal.datatools.manager.models.Project; | |
import com.mongodb.BasicDBObject; | |
import com.mongodb.DB; | |
import com.mongodb.DBCollection; | |
import com.mongodb.MongoClient; | |
import com.mongodb.MongoClientOptions; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.conveyal.datatools.manager.persistence; | |
import com.mongodb.MongoClient; | |
import com.mongodb.MongoClientOptions; | |
import com.mongodb.client.MongoCollection; | |
import com.mongodb.client.MongoDatabase; | |
import org.bson.Document; | |
import org.bson.codecs.configuration.CodecRegistry; | |
import org.bson.codecs.pojo.PojoCodecProvider; | |
import org.bson.types.ObjectId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.conveyal.datatools.manager.persistence; | |
import com.j256.ormlite.dao.Dao; | |
import com.j256.ormlite.dao.DaoManager; | |
import com.j256.ormlite.field.DatabaseField; | |
import com.j256.ormlite.jdbc.DataSourceConnectionSource; | |
import com.j256.ormlite.table.DatabaseTable; | |
import com.j256.ormlite.table.TableUtils; | |
import org.apache.commons.dbcp2.ConnectionFactory; | |
import org.apache.commons.dbcp2.DriverManagerConnectionFactory; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer