One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
const crypto = require('crypto'); | |
const base64url = require('base64url'); | |
const cbor = require('cbor'); | |
const asn1 = require('@lapo/asn1js'); | |
const jsrsasign = require('jsrsasign'); | |
/* Apple Webauthn Root | |
* Original is here https://www.apple.com/certificateauthority/Apple_WebAuthn_Root_CA.pem | |
*/ | |
let appleWebAuthnRoot = 'MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8wHQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMxNTAwMDAwMFowSzEfMB0GA1UEAwwWQXBwbGUgV2ViQXV0aG4gUm9vdCBDQTETMBEGA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTB2MBAGByqGSM49AgEGBSuBBAAiA2IABCJCQ2pTVhzjl4Wo6IhHtMSAzO2cv+H9DQKev3//fG59G11kxu9eI0/7o6V5uShBpe1u6l6mS19S1FEh6yGljnZAJ+2GNP1mi/YK2kSXIuTHjxA/pcoRf7XkOtO4o1qlcaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUJtdk2cV4wlpn0afeaxLQG2PxxtcwDgYDVR0PAQH/BAQDAgEGMAoGCCqGSM49BAMDA2cAMGQCMFrZ+9DsJ1PW9hfNdBywZDsWDbWFp28it1d/5w2RPkRX3Bbn/UbDTNLx7Jr3jAGGiQIwHFj+dJZYUJR786osByBelJYsVZd2GbHQu209b5 |
const parseArgs = require('minimist'); | |
const io = require('socket.io')(); | |
const tf = require('@tensorflow/tfjs-node'); | |
const { model: modelDir = 'model', speed: maxSpeed = 30 } = parseArgs( | |
process.argv.slice(2) | |
); | |
tf.loadLayersModel(`file://${modelDir}/model.json`).then((model) => { | |
io.on('connection', async (socket) => { |
async function* dataGenerator() { | |
while (true) { | |
const csvStream = fs.createReadStream(pathToCSV).pipe(csv({ | |
headers: ['center', 'left', 'right', 'steering', 'throttle', 'brake', 'speed'], | |
mapValues: ({ value }) => value.trim() | |
})); | |
for await (const { center, left, right, steering } of csvStream) { | |
const centerImageBuffer = fs.promises.readFile(center); | |
const leftImageBuffer = fs.promises.readFile(left); |
const files = [fetch('file1'), fetch('file2'), fetch('file3')]; | |
let chain = Promise.resolve(); | |
for (const file of files) { | |
chain = chain | |
.then(() => { | |
return file; | |
}) | |
.then(file => console.log(file)); |
A simple asynchronous data store.
STATUS: This is a thought experiment, not a serious proposal. Would basic async storage like this be useful? With this plus some locking primitive, could you build Indexed DB?
Like Indexed DB:
ACTION=="change", ENV{DISPLAY}=":0", ENV{XAUTHORITY}="/home/USER/.Xauthority", RUN+="/bin/bash /home/USER/bin/monitorhotplug.sh" |
'use strict'; | |
class Request { | |
constructor() { | |
this._history = []; | |
this._promiseChain = Promise.resolve(); | |
} | |
get(url, resolve, reject) { | |
this._promiseChain = this._promiseChain | |
.then(() => __fetch(url)) |
const streets = [ | |
'Абельмановская улица', | |
'площадь Абельмановская Застава', | |
'Абрамцевская просека', | |
'Абрамцевская улица', | |
'Абрикосовский переулок', | |
'Авангардная улица', | |
'улица Авиаконструктора Микояна', | |
'улица Авиаконструктора Миля', | |
'улица Авиаконструктора Сухого', |