_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q11300 | train | function(data) {
var corners = [];
for (var i = 0; i < data.length; i += 2) {
corners.push({
x: data[i],
| javascript | {
"resource": ""
} | |
q11301 | train | function () {
if (!this._image instanceof IMSoftcrop.Image || !this._image.ready) {
return;
}
this._waitForWorkers++;
var _this = this;
if (window.Worker) {
// If workers are available, thread it
var featureWor... | javascript | {
"resource": ""
} | |
q11302 | train | function(rect) {
var imageRadius = 0,
imagePoint = {
x: rect.x,
y: rect.y
};
if (rect.width / this._image.w > 0.45) {
// Feature point (face) takes up a large portion of the image
rect.height *= 1.2;
... | javascript | {
"resource": ""
} | |
q11303 | train | function (redraw) {
var cx, cy;
this._keepCenter = true;
cx = this._container.clientWidth / 2;
cy = this._container.clientHeight / 2;
var ix = ((this._image.w * this._zoomLevel) / 2) + (this._image.x * this._zoomLevel) + this._margin;
var iy = ((... | javascript | {
"resource": ""
} | |
q11304 | train | function (zoomLevel, redraw) {
this._zoomLevel = zoomLevel / 100;
if (this._keepCenter) {
this.centerImage(false);
}
| javascript | {
"resource": ""
} | |
q11305 | train | function (redraw) {
var imgDim = this._image.getDimensions();
var vFactor = (this._container.clientHeight - this._margin * 2) / imgDim.h;
var hFactor = (this._container.clientWidth - this._margin * 2) / imgDim.w;
// Set correct zoom level
if (vFactor < hFacto... | javascript | {
"resource": ""
} | |
q11306 | train | function () {
var _this = this;
window.addEventListener(
'resize',
function () {
_this.onResize(event);
},
false
);
this._canvas.addEventListener(
'dblclick',
... | javascript | {
"resource": ""
} | |
q11307 | train | function(event) {
event.preventDefault();
event.stopPropagation();
if (typeof this._image == 'undefined') {
return false;
}
this.toggleLoadingImage(true);
var point = this.getMousePoint(event);
this._image.addFocusPoi... | javascript | {
"resource": ""
} | |
q11308 | train | function (event) {
var point = this.getMousePoint(event);
if (this._crop instanceof IMSoftcrop.Softcrop && typeof this.handle === 'string') {
this.updateImageInfo(true);
this._dragPoint = point;
this._dragObject = this.handle;
}
... | javascript | {
"resource": ""
} | |
q11309 | train | function (event) {
var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
var zoom = 0;
if (delta < 0 && this._zoomLevel < this._zoomMax) {
// Zoom in
zoom = this._zoomLevel < 1 ? 0.01 : 0.03;
}
else if (de... | javascript | {
"resource": ""
} | |
q11310 | train | function (event) {
return {
x: event.pageX - this._position.x,
| javascript | {
"resource": ""
} | |
q11311 | train | function() {
var offset = IMSoftcrop.Ratio.getElementPosition(this._canvas);
| javascript | {
"resource": ""
} | |
q11312 | train | function () {
this._drawCross(
'red',
{
x: this._container.clientWidth / 2,
y: this._container.clientHeight / 2
}
);
this._drawCross(
'green',
{
... | javascript | {
"resource": ""
} | |
q11313 | train | function (color, point) {
var ctx = this._canvas.getContext('2d');
ctx.beginPath();
ctx.fillStyle = color;
ctx.strokeStyle = color;
ctx.lineWidth = 0.5;
ctx.arc(point.x, point.y, 5, 0, 2 * | javascript | {
"resource": ""
} | |
q11314 | globsToRegExpStr | train | function globsToRegExpStr(str) {
return str.split(STRING_TESTS.GLOBSTAR)
// => [ theWholeTextIfThereIsNoGlobstar, "**", everythingAfter ]
.map((v, i) =>
(i + 1) % 2 === 0 ? // (**) part
// Replace unescaped '**' glob
v.r... | javascript | {
"resource": ""
} |
q11315 | preparePatternStringSegment | train | function preparePatternStringSegment(str) {
if (STRING_TESTS.ARRAY.test(str)) {
const els = str.replace(/([^\\]),/g, "$1$1,")
| javascript | {
"resource": ""
} |
q11316 | train | function(setting, value) {
if (-1 === this._supportedPostParams.indexOf(setting)) {
this.console.error('Parameter unsupported, may cause error:', setting);
| javascript | {
"resource": ""
} | |
q11317 | train | function(settings) {
for (var k in settings) {
if (settings.hasOwnProperty(k)) {
this.param(k, | javascript | {
"resource": ""
} | |
q11318 | train | function(varArgs) {
for (var i = 0, m = arguments.length; i | javascript | {
"resource": ""
} | |
q11319 | train | function(config) {
var data, request;
data = querystring.stringify(config);
request = http.request(this._closureEndpoint, this._handleResponse.bind(this));
request.on('error', function(e) {
this.console.error('Request error', e);
this._errCallback('http_request_... | javascript | {
"resource": ""
} | |
q11320 | train | function(response) {
var chunks = [];
response.on('data', function(chunk) {
chunks.push(chunk);
});
| javascript | {
"resource": ""
} | |
q11321 | train | function(json) {
if (json.serverErrors) {
this._handleNoCompiledCode(json.serverErrors);
} else {
json.compiledCode = this._header + json.compiledCode;
if (this.file) {
| javascript | {
"resource": ""
} | |
q11322 | train | function(response) {
this.console.error('Server responded with error:');
this.console.error('Status', response.statusCode);
this.console.error('Headers', response.headers);
response.on('data', function(chunk) {
| javascript | {
"resource": ""
} | |
q11323 | train | function(err) {
var file = fs.realpathSync(this.file);
if (!err) {
this.console.info('Compiled code saved to', file);
} else {
| javascript | {
"resource": ""
} | |
q11324 | MinHeap | train | function MinHeap(compareFn) {
this._elements = [null];
this._comparator = new Comparator(compareFn);
Object.defineProperty(this, 'n', {
| javascript | {
"resource": ""
} |
q11325 | parseUseragent | train | function parseUseragent(ua) {
if (!ua) {
return null;
}
let platform,
webview = false,
version,
engine,
result,
major,
minor,
patch,
float,
index,
name,
temp,
os;
ua = ua.toLowerCase();
if (~ua.indexOf('mobile')) {
platform = 'm... | javascript | {
"resource": ""
} |
q11326 | clearAndDoTasks | train | function clearAndDoTasks(arr) {
var tasks = arr.slice(0),
i;
// Clear the original array
arr.length = | javascript | {
"resource": ""
} |
q11327 | checkNextRequire | train | function checkNextRequire(options) {
if (!modulep) {
return;
}
if (options.strict === false) {
return;
}
// Overwrite the original wrap method
modulep.wrap = function wrap(script) {
var head;
// Restore the original functions
modulep.wrap = modulep.original_wrap;
modulep._resolveFilen... | javascript | {
"resource": ""
} |
q11328 | Queue | train | function Queue (name, redisClient) {
this.hasQuit = false
| javascript | {
"resource": ""
} |
q11329 | removeOne | train | function removeOne(array, item) {
var found = array.indexOf(item);
if (found > -1) { | javascript | {
"resource": ""
} |
q11330 | copy | train | function copy(array, first, count) {
first = valueOrDefault(first, 0);
count = valueOrDefault(count, array.length);
| javascript | {
"resource": ""
} |
q11331 | find | train | function find(array, f, context) {
var i, // iterative variable
l; // array length variable
for (i = 0, l = array.length; i < l; i += 1) {
if | javascript | {
"resource": ""
} |
q11332 | batch | train | function batch(options) {
var validationError = validateOptions(options);
var settings = _.extend({
time: 0,
count: 0
}, options);
var cache = [];
var lastWrite = 0;
var timeout;
/**
* @private
* @description
* Writes all the collected data to the stream.
*
* @param {Stream} stre... | javascript | {
"resource": ""
} |
q11333 | ConditionalExpression | train | function ConditionalExpression(node, print) {
print.plain(node.test);
this.space();
this.push("?"); | javascript | {
"resource": ""
} |
q11334 | AssignmentPattern | train | function AssignmentPattern(node, print) {
print.plain(node.left); | javascript | {
"resource": ""
} |
q11335 | AssignmentExpression | train | function AssignmentExpression(node, print, parent) {
// Somewhere inside a for statement `init` node but doesn't usually
// needs a paren except for `in` expressions: `for (a in b ? a : b;;)`
var parens = this._inForStatementInit && node.operator === "in" && !_node2["default"].needsParens(node, parent);
if (pa... | javascript | {
"resource": ""
} |
q11336 | BindExpression | train | function BindExpression(node, print) {
print.plain(node.object);
| javascript | {
"resource": ""
} |
q11337 | LinkedList | train | function LinkedList() {
this._length = 0;
this.head = null;
this.tail = null;
// Read-only length property
Object.defineProperty(this, 'length', {
| javascript | {
"resource": ""
} |
q11338 | train | function(object, __type, parameters, args) {
if (parameters) {
object.id = parameters.id || (parameters.id = (processor.id_generator++).toString(16)); // set per session uid
object.name = parameters.name;
// default prime binds
... | javascript | {
"resource": ""
} | |
q11339 | train | function(type, factory) {
var key_parameters = {},
__type = parse_type(type, key_parameters) .toLowerCase();
// normalize prop name, remove lead '/'
for(var prop in key_parameters)
if (prop[0] === '/') {
key_parameters[prop.slice(1)] = key... | javascript | {
"resource": ""
} | |
q11340 | train | function(alias, type) {
var parameters = {},
__type = parse_type(type, parameters) .toLowerCase(),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + | javascript | {
"resource": ""
} | |
q11341 | train | function(type, parameters, args) {
parameters = parameters || {};
args = args || {};
var __type = parse_type(type, parameters, args),
constructor = resolve_ctr(__type, parameters);
if (!constructor)
throw new TypeError('Type ' + __type +... | javascript | {
"resource": ""
} | |
q11342 | train | function(com) {
var root_nodes = this.root_nodes;
if (typeof com === 'string') {
if (com in processor) {
var object = processor[com];
if (typeof object === 'object' && '__type' in object) {
delete processor[name];
... | javascript | {
"resource": ""
} | |
q11343 | train | function(name, value) {
var parameters = this.parameters;
if (arguments.length < 1)
return parameters[name] || parameters['/' + name];
| javascript | {
"resource": ""
} | |
q11344 | train | function(index, type, /*optional*/ $prime, /*optional*/ args, /*optional*/ callback, /*optional*/ this_arg) {
if (!type)
return;
// normalize arguments
if (typeof $prime === 'function') {
this_arg = args;
callback = $prime;
... | javascript | {
"resource": ""
} | |
q11345 | getIncludeFiles | train | function getIncludeFiles(glob) {
var folders = settings.folders;
var options = {
read: false,
cwd: path.resolve(folders.dest + | javascript | {
"resource": ""
} |
q11346 | ObjectExpression | train | function ObjectExpression(node, parent) {
if (t.isExpressionStatement(parent)) {
// ({ foo: "bar" });
| javascript | {
"resource": ""
} |
q11347 | determineTabs | train | function determineTabs(line, tab){
let tabs = '';
for (let i = 0; i < | javascript | {
"resource": ""
} |
q11348 | train | function (fn) {
var origError = console.error
var origExit = process.exit
var origLog = console.log
console.error = error = jest.fn()
console.log = print = jest.fn()
process.exit = exit = jest.fn()
return execPromise(fn).then(
function (value) {
console.error = origError
... | javascript | {
"resource": ""
} | |
q11349 | History | train | function History() {
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
classCallCheck(this, History);
this.configuration = Object.assign({}, baseConfig, config);
this.supported = checkSupport(window);
var _configuration = this.configu... | javascript | {
"resource": ""
} |
q11350 | start | train | function start(callback) {
var dbDeferred = Q.defer();
config = defaultConfig;
if (typeof gmeConfig.rest.components[CONFIG_ID] === 'object' &&
gmeConfig.rest.components[CONFIG_ID].options) {
config = gmeConfig.rest.components[CONFIG_ID].options;
}
mongodb.MongoClient.connect(confi... | javascript | {
"resource": ""
} |
q11351 | GLTFTextureDDSExtension | train | function GLTFTextureDDSExtension() {
if ( ! THREE.DDSLoader ) {
throw new Error( 'THREE.GLTFLoader: Attempting to | javascript | {
"resource": ""
} |
q11352 | send | train | function send(payload, promise) {
if (typeof apostle.domainKey == 'undefined'){
promise.reject('invalid', [{error: 'No domain key defined. Please set a domain key with `apostle.domainKey = "abc123"`'}])
return;
}
(request || superagent)
.post(apostle.deliveryEndpoint)
.type('json')
.send(payload)
.set('A... | javascript | {
"resource": ""
} |
q11353 | train | function(template, options) {
queue = apostle.createQueue();
queue.push(template, | javascript | {
"resource": ""
} | |
q11354 | train | function(template, options){
var payload = { data: {}, template_id: template };
// Add root attributes to the payload root
for(var attr in rootAttributes){
if(!rootAttributes.hasOwnProperty(attr)){
continue;
}
if(typeof options[attr] === 'undefined'){
continue;
}
var key = rootAt... | javascript | {
"resource": ""
} | |
q11355 | train | function(){
var payload = { recipients: {} },
invalid = [],
promise = new Promise();
for(var i=0, j=this.mails.length; i < j; i++){
var data = this.mails[i],
email = data.email;
if(!data.template_id){
invalid.push(data)
data.error = "No template provided" | javascript | {
"resource": ""
} | |
q11356 | DeclareModule | train | function DeclareModule(node, print) {
this.push("declare | javascript | {
"resource": ""
} |
q11357 | _interfaceish | train | function _interfaceish(node, print) {
print.plain(node.id);
print.plain(node.typeParameters);
if (node["extends"].length) {
this.push(" extends ");
print.join(node["extends"], { separator: ", " });
}
if (node.mixins | javascript | {
"resource": ""
} |
q11358 | TupleTypeAnnotation | train | function TupleTypeAnnotation(node, print) {
this.push("[");
print.join(node.types, { | javascript | {
"resource": ""
} |
q11359 | TypeAlias | train | function TypeAlias(node, print) {
this.push("type ");
print.plain(node.id);
print.plain(node.typeParameters);
this.space();
| javascript | {
"resource": ""
} |
q11360 | ObjectTypeIndexer | train | function ObjectTypeIndexer(node, print) {
if (node["static"]) this.push("static ");
this.push("[");
print.plain(node.id);
this.push(":");
this.space();
print.plain(node.key); | javascript | {
"resource": ""
} |
q11361 | ObjectTypeProperty | train | function ObjectTypeProperty(node, print) {
if (node["static"]) this.push("static ");
print.plain(node.key); | javascript | {
"resource": ""
} |
q11362 | responseErrorBuilder | train | function responseErrorBuilder(err, res) {
if (res && res.body && _.isObject(res.body) && res.body.error) {
// pass through error obj from API
return res.body;
} else {
// build custom error
return {
error: {
| javascript | {
"resource": ""
} |
q11363 | signedRequestHeaders | train | function signedRequestHeaders(apiKey, apiSecretKey, apiUserToken, options) {
if (!apiKey || !apiSecretKey || !apiUserToken) {
return false;
}
var apiExpDate = Math.floor(Date.now() / 1000) + 600;
var | javascript | {
"resource": ""
} |
q11364 | train | function(config){
// Do parse
this.process = function(vinyl){
var data = vinyl.contents.toString('utf8');
// Parse
var sections = parse(vinyl.path, data, config);
// Format
format(vinyl.path, sections, config);
// Compute new title
var first = marked.lexer(sections[... | javascript | {
"resource": ""
} | |
q11365 | ContractRunner | train | function ContractRunner(config, data) {
events.EventEmitter.call(this);
var self = this;
self.config = config;
if (typeof data !== 'object' ||
typeof data.manifest !== 'object') {
throw new Error('ApiHandler must be instantiated with the manifest');
}
self._manifest = data.manifest;
self._api... | javascript | {
"resource": ""
} |
q11366 | train | function (needsStitching) {
var initData = {
viewPort: {},
document: {},
bodyTransform: {}
},
de = document.documentElement,
el = document.createElement('div'),
body = document.body;
// Get current scroll-... | javascript | {
"resource": ""
} | |
q11367 | train | function (initData) {
var body = document.body;
// Reset document height (if changed at all)
body.style.height = initData.document.cssHeight;
// Reset document offset
if | javascript | {
"resource": ""
} | |
q11368 | compile | train | function compile(filename) {
var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var result;
opts.filename = filename;
var optsManager = new _transformationFileOptionsOptionManager2["default"]();
optsManager.mergeOptions(transformOpts);
opts = optsManager.init(opts);
va... | javascript | {
"resource": ""
} |
q11369 | shouldIgnore | train | function shouldIgnore(filename) {
if (!ignore && !only) {
return getRelativePath(filename).split(_path2["default"].sep).indexOf("node_modules") >= 0;
| javascript | {
"resource": ""
} |
q11370 | istanbulLoader | train | function istanbulLoader(m, filename, old) {
istanbulMonkey[filename] | javascript | {
"resource": ""
} |
q11371 | registerExtension | train | function registerExtension(ext) {
var old = oldHandlers[ext] || oldHandlers[".js"] || require.extensions[".js"];
var loader = normalLoader;
if (process.env.running_under_istanbul) loader = istanbulLoader;
require.extensions[ext] = function | javascript | {
"resource": ""
} |
q11372 | hookExtensions | train | function hookExtensions(_exts) {
_lodashCollectionEach2["default"](oldHandlers, function (old, ext) {
if (old === undefined) {
delete require.extensions[ext];
| javascript | {
"resource": ""
} |
q11373 | monthConfigs | train | function monthConfigs () {
return [
[{
interval: Plottable.TimeInterval.month,
step: 1,
// full month name
formatter: Plottable.Formatters.time('%B')
}, {
interval: Plottable.TimeInterval.year,
step: 1,
formatter: Plottable.Formatters.time('%Y')
}],
[{
i... | javascript | {
"resource": ""
} |
q11374 | parseHeader | train | function parseHeader(value, name){
// Throw error if value is not array or string
if(value && (!utils.isArray(value) && !utils.isString(value))){
throw new Error(`Default Header for "${name}" must be Array or String`);
}
// In case when no error was threw, check if value is array
// Set all values to UpperCase ... | javascript | {
"resource": ""
} |
q11375 | ElementsEventHandler | train | function ElementsEventHandler(socket) {
var _this = this;
//Call EventEmmiter _contructor_
events.EventEmitter.call(this);
this.socket = socket;
// On every message event received by socket we get
// an message event object like {event:, data:}
// we emit a local event through an EventEmitter interface... | javascript | {
"resource": ""
} |
q11376 | train | function (m, u) {
return [
m[0][0] * u[0] + m[0][1] * u[1] + m[0][2] * u[2],
m[1][0] * u[0] + m[1][1] * | javascript | {
"resource": ""
} | |
q11377 | train | function (px, py, radius) {
var cx = 0;
var cy = 0;
var dx = cx - px;
var dy = cy - py;
var dd = Math.sqrt(dx * dx + dy * dy);
var a = Math.asin(radius / dd);
var b = Math.atan2(dy, dx);
| javascript | {
"resource": ""
} | |
q11378 | getChatboxElement | train | function getChatboxElement() {
var content = h('div', {
});
var keyPressHandler = (e) => {
if (e.charCode === 13) {
var messageText = e.srcElement.value;
if (messageText.length > 0) {
e.srcElement.value = "";
sendMessage(messageText);
}
}
}
... | javascript | {
"resource": ""
} |
q11379 | setupDebug | train | function setupDebug (driver, options) {
var indentation = 0;
function stringFill (filler, length) {
var buffer = new Buffer(length);
buffer.fill(filler);
return buffer.toString();
}
function getIndentation (add) {
return stringFill(' ', (indentation + add) * 2);
}
if (options.debug) {
... | javascript | {
"resource": ""
} |
q11380 | AdaptationEngine | train | function AdaptationEngine(node) {
this.node = node;
this.modelObjMapper = new ModelObjectMapper();
const | javascript | {
"resource": ""
} |
q11381 | SecretGenerator | train | function SecretGenerator(manifest, instance_id, secrets) {
ApiModule.call(this);
| javascript | {
"resource": ""
} |
q11382 | _get_annotations_by_filter | train | function _get_annotations_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._annotations, | javascript | {
"resource": ""
} |
q11383 | _get_annotations_by_key | train | function _get_annotations_by_key(key){
var anchor = this;
var ret = [];
each(anchor._annotations, function(ann){
if( ann.key() | javascript | {
"resource": ""
} |
q11384 | _get_annotation_by_id | train | function _get_annotation_by_id(aid){
var anchor = this;
var ret = null; | javascript | {
"resource": ""
} |
q11385 | _get_referenced_subgraphs_by_filter | train | function _get_referenced_subgraphs_by_filter(filter){
var anchor = this;
var ret = [];
each(anchor._referenced_subgraphs, function(g){
var res = filter(g);
| javascript | {
"resource": ""
} |
q11386 | _get_referenced_subgraph_by_id | train | function _get_referenced_subgraph_by_id(iid){
var anchor = this;
var ret = | javascript | {
"resource": ""
} |
q11387 | noctua_graph | train | function noctua_graph(new_id){
bbop_graph.call(this);
this._is_a = 'bbop-graph-noctua.graph';
// Deal with id or generate a new one.
if( typeof(new_id) !== 'undefined' ){
this.id(new_id);
}
// The old edit core.
this.core = {
'edges': {}, // map of id to edit_edge - edges not completely ... | javascript | {
"resource": ""
} |
q11388 | _is_same_ann | train | function _is_same_ann(a1, a2){
var ret = false;
if( a1.key() === a2.key() &&
a1.value() === a2.value() &&
| javascript | {
"resource": ""
} |
q11389 | is_iri_ev_p | train | function is_iri_ev_p(ann){
var ret = false;
if( ann.key() === 'evidence' && ann.value_type() | javascript | {
"resource": ""
} |
q11390 | pull_seeds | train | function pull_seeds(entity, test_p){
each(entity.annotations(), function(ann){
//console.log(ann.key(), ann.value_type(), ann.value());
// Is it an evidence annotation.
if( ! test_p(ann) ){
// Skip.
//console.log('skip folding with failed test');
}else{
//console.log('start foldin... | javascript | {
"resource": ""
} |
q11391 | _unfold_subgraph | train | function _unfold_subgraph(sub){
// Restore to graph.
// console.log(' unfold # (' + sub.all_nodes().length + ', ' +
// | javascript | {
"resource": ""
} |
q11392 | noctua_node | train | function noctua_node(in_id, in_label, in_types, in_inferred_types){
bbop_node.call(this, in_id, in_label);
this._is_a = 'bbop-graph-noctua.node';
var anchor = this;
// Let's make this an OWL-like world.
this._types = [];
this._inferred_types = [];
this._id2type = {}; // contains map to both... | javascript | {
"resource": ""
} |
q11393 | noctua_edge | train | function noctua_edge(subject, object, predicate){
bbop_edge.call(this, subject, object, predicate);
this._is_a = 'bbop-graph-noctua.edge';
// Edges are not completely anonymous in this world.
| javascript | {
"resource": ""
} |
q11394 | getStringValue | train | function getStringValue(value)
{
var return_value = '';
switch(typeof(value))
{
case 'string':
return_value = "'" + value + "'";
break;
case 'number':
return_value = value;
break;
case 'object':
if(value==null)
return_value = value;
else
{
var | javascript | {
"resource": ""
} |
q11395 | JSONparse | train | function JSONparse(string)
{
string = string.replace(/:\s*"([^"]*)"/g, function(match, p1) {
return ': "' + p1.replace(/:/g, '@colon@') + '"';
}).replace(/:\s*'([^']*)'/g, function(match, p1) {
return ': "' + | javascript | {
"resource": ""
} |
q11396 | KeyPair | train | function KeyPair(privkey) {
if (!(this instanceof KeyPair)) {
return new KeyPair(privkey);
| javascript | {
"resource": ""
} |
q11397 | parsePacket | train | function parsePacket(packet) {
var parsedPacket = loopPacket.parse(packet);
var convertedPacket = {};
for(var property in parsedPacket) {
var value = parsedPacket[property];
switch (property){
case "BarTrend":
value = _convertBarTrend(value);
break;
case "TempIn":
case "T... | javascript | {
"resource": ""
} |
q11398 | writeToLogFile | train | function writeToLogFile(rawPacket, parsedPacket) {
if (!debugMode) { return; }
var now = new Date().toUTCString();
fs.appendFile(config.debugRawDataFile, 'Package received at ' + now + ':\n' + rawPacket + '\n\n', function (err) {
if (err) {
console.error('Could not write raw package to ' + config.debu... | javascript | {
"resource": ""
} |
q11399 | train | function (params) {
var resourceObject = {
url: resource.url(),
method: method,
headers: resource.headers
};
if (typeof params === 'object') {
resourceObject.json = true;
resourceObject.body = params;
}
else if (typeof params === 'string') {
resourceObject.bo... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.