unix = {
while(true) {
yield Date.now();
}
}
tick = {
let i = 0;
while (true) {
yield Promises.tick(864, ++i);
}
}
tickTime = tick % 1e5
// http://howardhinnant.github.io/date_algorithms.html#civil_from_days
function unix2dote(unix, zone) {
return [(unix ?? Date.now()) / 86400000 + 719467.6 + (zone = zone ?? 4 - Math.round((new Date).getTimezoneOffset() / 144)) / 10, zone]
}
function dote2doty(dote = 719468, zone = 0) {
const cykl = Math.floor((dote >= 0 ? dote : dote - 146096) / 146097), dotc = dote - cykl * 146097,
yotc = Math.floor((dotc - Math.floor(dotc / 1460) + Math.floor(dotc / 36524) - Math.floor(dotc / 146096)) / 365);
return [yotc + cykl * 400, dotc + Math.floor(yotc / 100) - yotc * 365 - Math.floor(yotc / 4), zone];
}
function doty2deco(year = 1969, doty = 306, zone = 0) {
return `${year.toString().padStart(4, "0")}+${Math.floor(doty).toString().padStart(3, "0")}${String(doty % 1).slice(1, 7)}.${zone}`
}
deco = doty2deco(...dote2doty(...unix2dote(unix)))
// https://observablehq.com/@observablehq/text-color-annotations-in-markdown#textcolor
function setStyle(content, style = {}) {
function yiq(color) {
const {r, g, b} = d3.rgb(color);
return (r * 299 + g * 587 + b * 114) / 1000 / 255; // returns values between 0 and 1
}
const {
background,
color = yiq(background) >= 0.6 ? "#111" : "white",
padding = "0 1px",
borderRadius = "4px",
fontWeight = 900,
fontSize = "1em",
...rest
} = typeof style === "string" ? {background: style} : style;
return htl.html`<span style=${{
background,
color,
padding,
borderRadius,
fontWeight,
...rest
}}>${content}</span>`;
}
decoYear = deco.slice(0, 4)
decoDate = deco.slice(5, 8)
decoTime = deco.slice(9, 14)
decoTimeZone = deco[15]
styledDecoYear0 = setStyle(decoYear, d3.schemePaired[10])
styledDecoYear1 = setStyle(decoYear, d3.schemePaired[10])
styledDecoDate0 = setStyle(decoDate, d3.schemePaired[1])
styledDecoDate1 = setStyle(decoDate, d3.schemePaired[1])
styledDecoTime0 = setStyle(decoTime, d3.schemePaired[2])
styledDecoTime1 = setStyle(decoTime, d3.schemePaired[2])
styledDecoTime2 = setStyle(decoTime, d3.schemePaired[2])
styledTimeZone0 = setStyle(decoTimeZone, d3.schemePaired[3])
styledTimeZone1 = setStyle(decoTimeZone, d3.schemePaired[3])
styledTimeZone2 = setStyle(decoTimeZone, d3.schemePaired[3])
styledTickTime = setStyle(tickTime, d3.schemePastel2[0])
Greetings! My name is Martin Laptev.
I am a data scientist and software engineer with a broad scientific background that ranges from biochemistry to epidemiology. I use the JavaScript, Python, and R programming languages along with the UNIX shell to build digital deliverables such as cloudinfrastructure, datadashboards, and machinelearning models.
You are currently on theAbout page of my site. The arrowat the bottom right of this page and the pencilicon in the navigation bar (navbar) will take you to my Blog. Similarly, the other navbar icons lead to myCurriculum Vitae (CV),GitHub, andLinkedIn.
The timestamp () in the navbar is based on Dec, a measurement system I created, which measurestime,position,orientation,angles, andcycles in units called turns. Dec timestamps show the years (), days (), and fractional days () since the Dec epoch: Year 0 Day 0 Dot 0.
In addition to time, Dec uses turns for geographic and celestial coordinates: longitude, latitude, azimuth, altitude, etc. Importantly, longitude determines Dec time zones () and can be appended to the time of day (), but not to durations, e.g. the time since this webpage was loaded: .