return { datetime: item.AcceptTime, content: item.AcceptStation }; }); _.reverse(expressInfo.traces);
function formatDepth(ds) { return { exchange: 'okex', time: new Date(), bids: _formatDepth(ds.bids), asks: _formatDepth(_.reverse(ds.asks)), }; }
// Returns the best matches for person from the prefs dictionary. // Number of results and similarity function are optional params. let topMatches = (prefs, person, n = 5, similarity = 'sim_pearson') => { let scores = []; let prefsWithoutPerson = _.omit(prefs, person); _.forIn(prefsWithoutPerson, (value, key) => { let score = { person: key }; if (similarity === 'sim_pearson') score.score = Pearson.sim(prefs, person, key); if (similarity === 'sim_euclidean') score.score = Euclidean.sim(prefs, person, key); scores.push(score); }); scores = _.reverse(_.sortBy(scores, 'score')); scores.length = n; return scores; }
function formatWsFutureDepth(ds, o) { const res = {}; _.forEach(ds, (d) => { const { data, channel } = d; if (!data || data.result) return null; const { bids, asks, timestamp } = data; const info = _parseWsFutureDepthChannel(channel); const line = { ...info, exchange: 'okex', time: new Date(timestamp), bids: _formatFutureDepth(bids), asks: _formatFutureDepth(_.reverse(asks)) }; res[`${info.contract_type}_${info.symbol}`] = line; }).filter(d => d); return res; }
function formatWsDepth(ds) { const res = {}; _.forEach(ds, (d) => { const { channel, data } = d; const { bids, asks, timestamp, result } = data; if (result) return null; const info = _parseWsDepthChannel(channel); const line = { ...info, exchange: 'okex', time: new Date(timestamp), bids: _formatDepth(bids), asks: _formatDepth(_.reverse(asks)), }; res[info.symbol] = line; }); return res; }
_this._triggerUserCountUpdate(); if (!_this._cachedMessages || !_this._cachedMessages.length) { _this._cachedMessages = _.reverse(res.body.messages, 'd'); _.each(_this._cachedMessages, function (message) { message.date = new Date(message.d);
}) if (BDocument.UseProd) { _.reverse(Prod.tree).concat(Prod.prod).forEach(function(Pr) { var Cod = [BizRow.CodeBill, Pr.CodeProd].join("_"); var PCode = _.isEmpty(Pr.CodeParentProd) ? CodeBill : [BizRow.CodeBill, Pr.CodeParentProd].join("_")
_.reverse(routeWords)
scores = _.reverse(_.sortBy(scores, 'score'));