"/order/123"
{
"delivery": {
"type": "/data/delivery-types/123",
"fulfilmentMethod": "/data/fulfilment-methods/00005",
},
"nlc": "/data/stations/H123",
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 python3 | |
| import sys, struct, re, curses | |
| from pathlib import Path | |
| def find_title_location(b: bytes): | |
| """Find the save title using the length-prefixed UTF-16LE format.""" | |
| # Search for reasonable title patterns - length prefix followed by UTF-16LE text | |
| for i in range(len(b) - 20): | |
| # Check for a small length value (1-32 chars typical for titles) |
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
| function isReachable(results: Results, c: Connection): boolean { | |
| const interchangeTime = results.bestConnections[c.origin] ? interchangeTimeAt(c.origin) : 0; | |
| const reachableWithInterchange = results.earliestArrival[c.origin] | |
| && results.earliestArrival[c.origin] + interchangeTime <= c.departureTime; | |
| results.tripsReachable[c.trip.tripId] = reachableWithInterchange || results.tripsReachable[c.trip.tripId]; | |
| return results.tripsReachable[c.trip.tripId]; | |
| } |
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
| function isReachable(results: Results, c: Connection): boolean { | |
| const interchangeRequired = results.bestConnections[c.origin] | |
| && results.bestConnections[c.origin].tripId != c.tripId; | |
| const interchangeTime = interchangeRequired ? interchangeTimeAt(c.origin) : 0; | |
| return results.earliestArrival[c.origin] && results.earliestArrival[c.origin] + interchangeTime <= c.departureTime; | |
| } | |
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
| function isReachable(results: Results, c: Connection): boolean { | |
| return results.earliestArrival[c.origin] && results.earliestArrival[c.origin] <= c.departureTime; | |
| } | |
| function isBetter(results: Results, c: Connection): boolean { | |
| return !results.earliestArrival[c.destination] || results.earliestArrival[c.destination] > c.arrivalTime; | |
| } | |
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
| /** | |
| * Return an index of connections that achieve the earliest arrival time at each stop. | |
| */ | |
| function scan(origin: StopID, destination: Stop, date: number, dow: DayOfWeek, departureTime: number): ConnectionIndex { | |
| // set the arrival time at the origin so we have a basis for what is reachable | |
| const earliestArrivals = { [origin]: departureTime }; | |
| const bestConnections = {}; | |
| const results = { earliestArrivals, bestConnections }; | |
| scanTransfers(results, origin); |
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
| [server] | |
| # this is only for the mysqld standalone daemon | |
| [mysqld] | |
| skip-log-bin | |
| # | |
| # * Basic Settings | |
| # | |
| user = mysql |
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
| let destinationLines = this.getDestinationLines(destination); | |
| let queues = this.getReachableTripSegments(origin, departureTime); | |
| let numTransfers = 0; | |
| let earliestArrival = Infinity; | |
| let results = new QueryResults(); | |
| while (!queues.empty(numTransfers)) { | |
| // for each trip segment in the queue at this depth | |
| for (const tripSegment of queues.get(numTransfers)) { | |
| const {trip, b, e} = tripSegment; |
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
| const transfers = Map<Trip, Map<number, Transfer[]>>().asMutable(); | |
| // for each tripT | |
| for (const tripT of trips) { | |
| const tripLine = this.lineRepository.lineForTrip(tripT); | |
| // for each stopQ of tripT after the first stop | |
| for (let i = 1; i < tripT.stops.length; i++) { | |
| // get stopQ for all stations connected to tripT.stops[i] by footpath. |
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
| for (const [stoppingPattern, trips] of tripsByStoppingPattern) { | |
| const lines = linesByStoppingPattern.get(stoppingPattern, []); | |
| for (const trip of trips) { | |
| this.getLineForTrip(trip, lines).match({ | |
| some: line => line.add(trip), | |
| none: () => lines.push(new Line([trip])) | |
| }); |