Fix European trip return heuristic for weekend location tracking
Adjust European short trip heuristic from >3 days to >1 day to correctly detect when user has returned home from European trips. This fixes the April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg" instead of "Bristol" when the user was free (no events scheduled) after the foss-north trip ended on April 27. The previous logic required more than 3 days to pass before assuming return home from European countries, but for short European trips by rail/ferry, users typically return within 1-2 days. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
663dc479c2
commit
ea4980a5d7
6407 changed files with 1072847 additions and 18 deletions
52
node_modules/@webassemblyjs/ieee754/lib/index.js
generated
vendored
Normal file
52
node_modules/@webassemblyjs/ieee754/lib/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.encodeF32 = encodeF32;
|
||||
exports.encodeF64 = encodeF64;
|
||||
exports.decodeF32 = decodeF32;
|
||||
exports.decodeF64 = decodeF64;
|
||||
exports.DOUBLE_PRECISION_MANTISSA = exports.SINGLE_PRECISION_MANTISSA = exports.NUMBER_OF_BYTE_F64 = exports.NUMBER_OF_BYTE_F32 = void 0;
|
||||
|
||||
var _ieee = require("@xtuc/ieee754");
|
||||
|
||||
/**
|
||||
* According to https://webassembly.github.io/spec/binary/values.html#binary-float
|
||||
* n = 32/8
|
||||
*/
|
||||
var NUMBER_OF_BYTE_F32 = 4;
|
||||
/**
|
||||
* According to https://webassembly.github.io/spec/binary/values.html#binary-float
|
||||
* n = 64/8
|
||||
*/
|
||||
|
||||
exports.NUMBER_OF_BYTE_F32 = NUMBER_OF_BYTE_F32;
|
||||
var NUMBER_OF_BYTE_F64 = 8;
|
||||
exports.NUMBER_OF_BYTE_F64 = NUMBER_OF_BYTE_F64;
|
||||
var SINGLE_PRECISION_MANTISSA = 23;
|
||||
exports.SINGLE_PRECISION_MANTISSA = SINGLE_PRECISION_MANTISSA;
|
||||
var DOUBLE_PRECISION_MANTISSA = 52;
|
||||
exports.DOUBLE_PRECISION_MANTISSA = DOUBLE_PRECISION_MANTISSA;
|
||||
|
||||
function encodeF32(v) {
|
||||
var buffer = [];
|
||||
(0, _ieee.write)(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
function encodeF64(v) {
|
||||
var buffer = [];
|
||||
(0, _ieee.write)(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
function decodeF32(bytes) {
|
||||
var buffer = Buffer.from(bytes);
|
||||
return (0, _ieee.read)(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32);
|
||||
}
|
||||
|
||||
function decodeF64(bytes) {
|
||||
var buffer = Buffer.from(bytes);
|
||||
return (0, _ieee.read)(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64);
|
||||
}
|
||||
22
node_modules/@webassemblyjs/ieee754/package.json
generated
vendored
Normal file
22
node_modules/@webassemblyjs/ieee754/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "@webassemblyjs/ieee754",
|
||||
"version": "1.11.6",
|
||||
"description": "IEEE754 decoder and encoder",
|
||||
"license": "MIT",
|
||||
"main": "lib/index.js",
|
||||
"module": "esm/index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/xtuc/webassemblyjs.git",
|
||||
"directory": "packages/ieee754"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xtuc/ieee754": "^1.2.0"
|
||||
}
|
||||
}
|
||||
47
node_modules/@webassemblyjs/ieee754/src/index.js
generated
vendored
Normal file
47
node_modules/@webassemblyjs/ieee754/src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
// @flow
|
||||
|
||||
import { write, read } from "@xtuc/ieee754";
|
||||
|
||||
/**
|
||||
* According to https://webassembly.github.io/spec/binary/values.html#binary-float
|
||||
* n = 32/8
|
||||
*/
|
||||
export const NUMBER_OF_BYTE_F32 = 4;
|
||||
|
||||
/**
|
||||
* According to https://webassembly.github.io/spec/binary/values.html#binary-float
|
||||
* n = 64/8
|
||||
*/
|
||||
export const NUMBER_OF_BYTE_F64 = 8;
|
||||
|
||||
export const SINGLE_PRECISION_MANTISSA = 23;
|
||||
|
||||
export const DOUBLE_PRECISION_MANTISSA = 52;
|
||||
|
||||
export function encodeF32(v: number): Array<number> {
|
||||
const buffer = [];
|
||||
|
||||
write(buffer, v, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
export function encodeF64(v: number): Array<number> {
|
||||
const buffer = [];
|
||||
|
||||
write(buffer, v, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
export function decodeF32(bytes: Array<Byte>): number {
|
||||
const buffer = Buffer.from(bytes);
|
||||
|
||||
return read(buffer, 0, true, SINGLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F32);
|
||||
}
|
||||
|
||||
export function decodeF64(bytes: Array<Byte>): number {
|
||||
const buffer = Buffer.from(bytes);
|
||||
|
||||
return read(buffer, 0, true, DOUBLE_PRECISION_MANTISSA, NUMBER_OF_BYTE_F64);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue