query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Translate a 2D line from the given base object and parts. The translation uses the parts as 2D vertexes from POLYLINE.
function translateAs2Dline(obj, layers, parts, options) { // console.log('##### completing Path2D using vectors') // convert the parts to a series of X/Y/BULG lists obj['vlen'] = parts.length obj['pptxs'] = [] obj['pptys'] = [] obj['bulgs'] = [] for (let vector of parts) { obj['pptxs'].push(vector.x) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateCurrent (obj, layers, parts, options) {\n if (obj === null) return null\n\n let type = obj.type\n // console.log('##### translating Current as '+type)\n if (type === '2dline') {\n return translateAs2Dline(obj, layers, parts, options)\n }\n\n if (type === '3dline') {\n // FIXME what to...
[ "0.64469427", "0.59493816", "0.5834614", "0.58306515", "0.56830555", "0.5637804", "0.5552064", "0.55329406", "0.54032946", "0.5353673", "0.5274353", "0.5226844", "0.5205989", "0.5200088", "0.51881444", "0.51850665", "0.51790774", "0.51658446", "0.5165831", "0.5151198", "0.514...
0.75933886
0
translate a complex object from the given base object and parts CSG plus a series of polygons => CSG Path2D plus a series of 2D vectors => Path2D CSG plus a series of 3D vectors => CSG
function translateCurrent (obj, layers, parts, options) { if (obj === null) return null let type = obj.type // console.log('##### translating Current as '+type) if (type === '2dline') { return translateAs2Dline(obj, layers, parts, options) } if (type === '3dline') { // FIXME what to do? return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translatePath2D (obj, layers, options) {\n const closed = parseInt('00000000000000001', 2)\n\n // expected values\n let vlen = obj['vlen']\n let pptxs = obj['pptxs']\n let pptys = obj['pptys']\n let bulgs = obj['bulgs']\n let flags = obj['lflg']\n let name = obj['name']\n\n // translation\n le...
[ "0.6527949", "0.64812857", "0.6183206", "0.60782534", "0.5553901", "0.5521177", "0.55140585", "0.5504819", "0.54627913", "0.54148275", "0.53934526", "0.536961", "0.5359797", "0.53593206", "0.53593206", "0.53205556", "0.528307", "0.5245547", "0.52324486", "0.5204728", "0.51976...
0.6744774
0
translate the given layer into a wrapper function for the previous translated objects
function translateLayer (layer) { let name = layer['lnam'] || 'Unknown' let script = `function ${name}() { ` for (let object of layer['objects']) { script += object['script'] } script += ' return [' for (let object of layer['objects']) { script += object['name'] + ',' } script += ']\n}\n' re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function layerMethod(k, fun) {\n var pos = k.match(position)[0],\n key = k.replace(position, ''),\n prop = this[key];\n\n if (pos === 'after') {\n this[key] = function () {\n var re...
[ "0.60859966", "0.60854304", "0.5868217", "0.5846041", "0.5738265", "0.57298326", "0.57043546", "0.5524261", "0.55103445", "0.54771346", "0.54649526", "0.5444886", "0.54021484", "0.5376963", "0.52984345", "0.5295463", "0.529527", "0.5242732", "0.5242732", "0.5242732", "0.52427...
0.7285599
0
convert the given data to array if not already
function toArray (data) { if (Array.isArray(data)) return data return [data] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArray (data) {\n if (!data) return []\n if (data.constructor !== Array) return [data]\n return data\n}", "function toArray (data) {\n if (!data) return []\n if (data.constructor !== Array) return [data]\n return data\n}", "function prepareData(data) {\n if (data.length == null) {\n t...
[ "0.72526604", "0.72526604", "0.7033525", "0.7013663", "0.69413096", "0.6776854", "0.66380733", "0.64649814", "0.6358212", "0.6295313", "0.6291211", "0.6291211", "0.61791015", "0.6116833", "0.605684", "0.60130024", "0.5997421", "0.5991684", "0.5991416", "0.59747297", "0.597472...
0.7449661
0
determin if the given object is a Path2D object NOTE: Can be removed once CSG provides this functionality
function isPath (object) { if (object && 'points' in object && Array.isArray(object.points)) { return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPath(layerTwo, y, x) {\n return (layerTwo[y][x] === 0);\n}", "function isPathIndirect(path) {\n if (path.paths && path.paths.length && path.paths[0].length > 1) {\n return true;\n }\n return false;\n }", "function inPath(x, y){ return utils.isPointInsidePath(path, x, y) }", "functi...
[ "0.64963716", "0.62277937", "0.61285245", "0.6060422", "0.605397", "0.59063035", "0.5885838", "0.5840472", "0.5774", "0.57711095", "0.577036", "0.57690316", "0.57588613", "0.5747253", "0.5712233", "0.5704884", "0.5704884", "0.5682089", "0.56516135", "0.56059176", "0.55799544"...
0.750247
0
Blob.js See Node and Browserify Compatible
function makeBlob (contents, options) { const blob = typeof window !== 'undefined' ? window.Blob : Blob return blob }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _blobConstructor() {\n if (!window.Blob) {\n return false;\n }\n\n return true;\n }", "function getBlob() {\n var var_args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n var_args[_i] = arguments[_i];\n }\n var BlobBuild...
[ "0.674062", "0.67206824", "0.67206824", "0.67206824", "0.67206824", "0.67206824", "0.67206824", "0.65403676", "0.65403676", "0.65180224", "0.6517012", "0.64964134", "0.6465372", "0.63991153", "0.6398619", "0.6393407", "0.6369452", "0.63568157", "0.63538736", "0.63538736", "0....
0.7116433
0
deserialize the given JSON source and return a JSCAD script fn (optional) original filename of JSON source
function deserialize (src, fn, options) { options && options.statusCallback && options.statusCallback({progress: 0}) fn = fn || 'amf' const defaults = {version: '0.0.0'} options = Object.assign({}, defaults, options) const {version} = options // convert the JSON into an anonymous object var obj = JSON.pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate (src, filename, options) {\n let reader = createReader(src, options)\n\n let code = `// Produced by JSCAD IO Library : DXF Deserialization (${options.version})\n\n`\n // code += '// date: ' + (new Date()) + '\\n'\n // code += '// source: ' + filename + '\\n'\n code += translateAsciiDxf(read...
[ "0.5916767", "0.58463323", "0.5822588", "0.57884645", "0.5765651", "0.5755237", "0.574957", "0.5663764", "0.55941105", "0.5593211", "0.558752", "0.55745", "0.55745", "0.55745", "0.55745", "0.5565639", "0.5544099", "0.5526373", "0.5517841", "0.5512589", "0.551235", "0.549610...
0.7140552
1
converts input data to array if it is not already an array
function toArray (data) { if (!data) return [] if (data.constructor !== Array) return [data] return data }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toArray (data) {\n if (Array.isArray(data)) return data\n return [data]\n}", "function toArray(input) {\n if (Array.isArray(input)) {\n return input;\n } else {\n return [input];\n }\n }", "function anArray(data) {\n if (Array.isArray(data)) return data\n if (data) ...
[ "0.7652267", "0.75589466", "0.7529968", "0.74800605", "0.7292527", "0.7275315", "0.7256856", "0.7010287", "0.68436646", "0.68436646", "0.68377227", "0.6831479", "0.6817006", "0.6782288", "0.67804277", "0.67575574", "0.6753815", "0.6746039", "0.6730182", "0.6730182", "0.673018...
0.7564197
1
tail :: [a] > [a] drop head element
function tail(a) { return drop(1, a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tail (a) {\n return drop(1, a)\n}", "function tail(a) {\n return drop(1, a);\n }", "removeTail() {\n if (this.length === 0) return undefined;\n let tail = this.tail;\n if (this.length === 1) {\n this.head = null;\n this.tail= null;\n } else {\n ...
[ "0.8276625", "0.8274212", "0.75934935", "0.7375947", "0.72924197", "0.71893877", "0.71792734", "0.71590966", "0.7147409", "0.7104265", "0.70829916", "0.70753956", "0.70356214", "0.7009391", "0.70059973", "0.70048344", "0.6971065", "0.69591993", "0.69570214", "0.6955845", "0.6...
0.8316875
0
curry4 :: ((a, b, c, d) > e) > (a > b > c > d > e)
function curry4(f) { function curried(a, b, c, d) { // eslint-disable-line complexity switch (arguments.length) { case 0: return curried; case 1: return curry3(function (b, c, d) { return f(a, b, c, d); }); case 2: return curry2(function (c, d) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _curry(fn) {\n return function(a, b) {\n return arguments.length == 2\n ? fn(a, b)\n : function(b) {\n return fn(a, b);\n };\n };\n}", "function curry3(fun) {\n return function (one) {\n return function (two) {\n return function (three) {\n return fun(one, ...
[ "0.5984047", "0.5965732", "0.58191925", "0.57760495", "0.5775985", "0.57570374", "0.5695799", "0.56836236", "0.5649085", "0.56427264", "0.56069213", "0.55837715", "0.55632746", "0.5559551", "0.551984", "0.55063087", "0.5503064", "0.5472972", "0.54473984", "0.5419576", "0.5416...
0.6670121
0
function is called once ALL files have been read (not evaluated/compiled)
function afterFilesRead(_ref2, files) { var memFs = _ref2.memFs, memFsCount = _ref2.memFsCount, memFsTotal = _ref2.memFsTotal, memFsChanged = _ref2.memFsChanged; memFsCount = files.length; memFsTotal = files.length; // console.log('afterFilesRead', memFs, memFsTotal, files, 'ch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_files(){\n delete require.cache[require.resolve('./static/en.json')];\n MAIN.proto = require('./static/en.json');\n delete require.cache[require.resolve('./static/moves.json')];\n MAIN.moves = require('./static/moves.json');\n delete require.cache[require.resolve('./static/database.json')];\n M...
[ "0.65509707", "0.64487064", "0.6399971", "0.63178116", "0.6261364", "0.61841774", "0.61284715", "0.61070895", "0.61015075", "0.60901386", "0.6027162", "0.6008593", "0.5999708", "0.5993734", "0.5983177", "0.59346443", "0.5929877", "0.59068716", "0.5890324", "0.588754", "0.5885...
0.66779965
0
update the dropzone visual
function updateDropZoneVisual(file, memFsTotal) { if (file) { var text = memFsTotal > 1 ? 'Current file: ' + file.name + ' (' + (memFsTotal - 1) + ' more files)' : 'Current file: ' + file.name; document.getElementById('currentfile').innerHTML = text; document.getElementById('filedropzone_filled')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createDropzone() {\n const dropCtrl = new SimpleDropzone(this.dropEl, this.inputEl);\n dropCtrl.on('drop', ({files}) => this.load(files));\n }", "function SingleUploadDropZoneOptions(dropzoneNode) {\n\n //Fetch the data for the designated Node for control\n var infoNode = dropzoneNode.pare...
[ "0.65357745", "0.65013987", "0.6500678", "0.6465969", "0.6264541", "0.6251049", "0.62471753", "0.61664706", "0.6156892", "0.6058091", "0.60093266", "0.597527", "0.59520763", "0.5884459", "0.58107436", "0.575057", "0.5691291", "0.5678939", "0.5654238", "0.56482923", "0.5638636...
0.70723873
0
parse the file (and convert) to a renderable source (jscad)
function parseFile(file) { var source = file.source, name = file.name; if (source === '') { if (isLocalMode()) { throw new Error('Could not read file. You are using a local copy of OpenJSCAD.org; if you are using Chrome, you need to launch it with the following command line option:\n\n--a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readAndCompileFile(file) {\n var reader = new FileReader();\n reader.onload = function(e) {\n fileBuffer = new Uint8Array(e.target.result);\n compile(fileBuffer);\n };\n reader.readAsArrayBuffer(file);\n}", "loadIcsFile(e){\n var fr = new FileReader();\n fr.onloadend = (r...
[ "0.60833406", "0.5824924", "0.577855", "0.57506675", "0.57506675", "0.573665", "0.57210606", "0.5689104", "0.56369555", "0.55996823", "0.55941397", "0.55762637", "0.5553621", "0.55517644", "0.55232304", "0.5510946", "0.54676425", "0.5454019", "0.5450561", "0.54272234", "0.540...
0.68731594
0
new GL.Buffer(target, type) Provides a simple method of uploading data to a GPU buffer. Example usage: var vertices = new GL.Buffer(gl.ARRAY_BUFFER, Float32Array); var indices = new GL.Buffer(gl.ELEMENT_ARRAY_BUFFER, Uint16Array); vertices.data = [[0, 0, 0], [1, 0, 0], [0, 1, 0], [1, 1, 0]]; indices.data = [[0, 1, 2], ...
function Buffer(target, type) { this.buffer = null; this.target = target; this.type = type; this.data = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBuffer(gl, destination, data, name, type){\n var buffer = gl.createBuffer();\n if (!buffer) {\n console.log('Failed to create the ',name,' buffer');\n return -1;\n }\n \n gl.bindBuffer(destination, buffer);\n gl.bufferData(destination, data, type);\n return buffer;...
[ "0.7601553", "0.7517907", "0.74254346", "0.7366479", "0.7168627", "0.7034653", "0.69743377", "0.6960243", "0.6861082", "0.68383145", "0.6789798", "0.6775039", "0.6749322", "0.6749089", "0.67134005", "0.66461617", "0.6627729", "0.6627729", "0.6627729", "0.6609122", "0.65833795...
0.75294435
1
new GL.Mesh([options]) Represents a collection of vertex buffers and index buffers. Each vertex buffer maps to one attribute in GLSL and has a corresponding property set on the Mesh instance. There is one vertex buffer by default: `vertices`, which maps to `gl_Vertex`. The `coords`, `normals`, and `colors` vertex buffe...
function Mesh(options) { options = options || {}; this.vertexBuffers = {}; this.indexBuffers = {}; this.addVertexBuffer('vertices', 'gl_Vertex'); if (options.coords) this.addVertexBuffer('coords', 'gl_TexCoord'); if (options.normals) this.addVertexBuffer('normals', 'gl_Normal'); if (options.colors) this.a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Mesh () {\n\tthis.vertices = [];\t// type vec4\n\tthis.normals = [];\t// type vec4\n\tthis.colors = [];\t// type vec4\n\tthis.indices = [];\t// type int\n\tthis.faceNormals = [];\n\tthis.faceColors = [];\n\t\n\tthis.startIndex = 0;\n\tthis.vertexNum = 0;\n}", "function Mesh() {\n\t\tthis.vertices = []\n...
[ "0.69644564", "0.68433595", "0.6434534", "0.63319737", "0.6268487", "0.6171406", "0.6131513", "0.60082185", "0.59428066", "0.59265244", "0.59098774", "0.5891535", "0.588597", "0.58719575", "0.583762", "0.5824394", "0.5793992", "0.57935643", "0.5751522", "0.57470757", "0.57168...
0.84975594
0
Allow passing in the id of an HTML script tag with the source
function followScriptTagById(id) { var element = document.getElementById(id); return element ? element.text : id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_script(js_src, id) {\r\n var script = document.createElement('script');\r\n script.src = js_src;\r\n script.id = id;\r\n document.head.appendChild(script);\r\n}", "function injectScript(source) {\r\n // Utilities\r\n var isFunction = function (arg) {\r\n return (Object.p...
[ "0.71042657", "0.65054417", "0.64936966", "0.6273018", "0.6264854", "0.62166685", "0.6191584", "0.6140084", "0.61293346", "0.6106292", "0.60797155", "0.59589875", "0.5935107", "0.5925126", "0.588118", "0.5879811", "0.587366", "0.58635575", "0.5849838", "0.5849784", "0.5841606...
0.6540287
1
The `gl_` prefix must be substituted for something else to avoid compile errors, since it's a reserved prefix. This prefixes all reserved names with `_`. The header is inserted after any extensions, since those must come first.
function fix(header, source) { var replaced = {}; var match = /^((\s*\/\/.*\n|\s*#extension.*\n)+)\^*$/.exec(source); source = match ? match[1] + header + source.substr(match[1].length) : header + source; regexMap(/\bgl_\w+\b/g, header, function (result) { if (!(result in replaced)) { source = sour...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fix(header, source) {\n var replaced = {};\n var match = /^((\\s*\\/\\/.*\\n|\\s*#extension.*\\n)+)[^]*$/.exec(source);\n source = match ? match[1] + header + source.substr(match[1].length) : header + source;\n EJSS_WEBGLGRAPHICS.Utils.regexMap(/\\bgl_\\w+\\b/g, header, function(result) {\n ...
[ "0.643403", "0.59814006", "0.52864647", "0.5068689", "0.5059331", "0.5020697", "0.49986613", "0.49922404", "0.49854457", "0.4979148", "0.49744788", "0.49553597", "0.49553597", "0.48740733", "0.48632616", "0.48474476", "0.48461485", "0.4822192", "0.48086154", "0.48044237", "0....
0.63660175
1
Matrix stack Implement the OpenGL modelview and projection matrix stacks, along with some other useful GLU matrix functions.
function addMatrixStack() { gl.MODELVIEW = ENUM | 1; gl.PROJECTION = ENUM | 2; var tempMatrix = new Matrix(); var resultMatrix = new Matrix(); gl.modelviewMatrix = new Matrix(); gl.projectionMatrix = new Matrix(); var modelviewStack = []; var projectionStack = []; var matrix, stack; gl.matrixMode = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GLGLMatrixStack() {\n this.modelViewMatrixStack = [Mat4.create()];\n this.projectionMatrixStack = [Mat4.create()];\n this.currentMVIndex = 0;\n this.currentPIndex = 0;\n}", "function addMatrixStack() {\n gl.MODELVIEW = Math.ENUM | 1;\n gl.PROJECTION = Math.ENUM | 2;\n var tempMatrix = new...
[ "0.8402453", "0.8295196", "0.82324755", "0.74927396", "0.7163417", "0.7145708", "0.7145708", "0.7145708", "0.7121273", "0.7121273", "0.7107851", "0.70070297", "0.70070297", "0.70070297", "0.70070297", "0.70064324", "0.70064324", "0.70064324", "0.70064324", "0.70064324", "0.68...
0.8490239
0
Immediate mode Provide an implementation of OpenGL's deprecated immediate mode. This is depricated for a reason: constantly respecifying the geometry is a bad idea for performance. You should use a `GL.Mesh` instead, which specifies the geometry once and caches it on the graphics card. Still, nothing beats a quick `gl....
function addImmediateMode() { var immediateMode = { mesh: new Mesh({ coords: true, colors: true, triangles: false }), mode: -1, coord: [0, 0, 0, 0], color: [1, 1, 1, 1], pointSize: 1, shader: new Shader('\ uniform float pointSize;\ varying vec4 color;\ varying vec4 c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addImmediateMode() {\n var immediateMode = {\n mesh: new Math.Mesh({coords: true, colors: true, triangles: false}),\n mode: -1,\n coord: [0, 0, 0, 0],\n color: [1, 1, 1, 1],\n pointSize: 1,\n shader: new Math.Shader('\\\n uniform float pointSize;\\\n varying vec4 color;\\\n ...
[ "0.8123097", "0.6898372", "0.6746739", "0.62509036", "0.6244484", "0.6227142", "0.62064767", "0.61991894", "0.61215675", "0.61083245", "0.60915464", "0.6090834", "0.60906357", "0.6087357", "0.6080543", "0.60801846", "0.6069959", "0.60482943", "0.60401165", "0.6034694", "0.600...
0.8117207
1
Improved mouse events This adds event listeners on the `gl.canvas` element that call `gl.onmousedown()`, `gl.onmousemove()`, and `gl.onmouseup()` with an augmented event object. The event object also has the properties `x`, `y`, `deltaX`, `deltaY`, and `dragging`.
function addEventListeners() { console.log('adding event listeners'); var context = gl, oldX = 0, oldY = 0, buttons = {}, hasOld = false; var has = Object.prototype.hasOwnProperty; function isDragging() { for (var b in buttons) { if (has.call(buttons, b) && buttons[b]) return tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEventListeners() {\n var context = gl, oldX = 0, oldY = 0, buttons = {}, hasOld = false;\n var has = Object.prototype.hasOwnProperty;\n\n function isDragging() {\n for (var b in buttons) {\n if (has.call(buttons, b) && buttons[b]) return true;\n }\n return false;\n }\n\n function aug...
[ "0.82433194", "0.6712713", "0.6613749", "0.65920323", "0.6447085", "0.6138747", "0.6120449", "0.61172545", "0.6020045", "0.6005958", "0.59471565", "0.5885716", "0.5846484", "0.58217216", "0.5710912", "0.57016236", "0.56735224", "0.56719947", "0.564452", "0.56256187", "0.56241...
0.79798007
1
new GL.Matrix([elements]) This constructor takes 16 arguments in rowmajor order, which can be passed individually, as a list, or even as four lists, one for each row. If the arguments are omitted then the identity matrix is constructed instead.
function Matrix() { var m = Array.prototype.concat.apply([], arguments); if (!m.length) { m = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; } this.m = hasFloat32Array ? new Float32Array(m) : m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Matrix() {\n var m = Array.prototype.concat.apply([], arguments);\n if (!m.length) {\n m = [\n 1, 0, 0, 0,\n 0, 1, 0, 0,\n 0, 0, 1, 0,\n 0, 0, 0, 1\n ];\n } else if (m.length == 9) {\n m = [\n m[0], m[3], m[6], 0,\n m[1], m[4], m[7], 0,\n m[2], m[5], m[8], 0,...
[ "0.75868547", "0.67929196", "0.6768205", "0.66839427", "0.6559112", "0.64364403", "0.63328576", "0.6318469", "0.6316325", "0.6261932", "0.61821204", "0.6139888", "0.61241305", "0.60706455", "0.60542357", "0.6046402", "0.6009304", "0.59934485", "0.5989211", "0.5960892", "0.593...
0.73595726
1
src/raytracer.js Provides a convenient raytracing interface. new GL.HitTest([t, hit, normal]) This is the object used to return hit test results. If there are no arguments, the constructed argument represents a hit infinitely far away.
function HitTest(t, hit, normal) { this.t = arguments.length ? t : Number.MAX_VALUE; this.hit = hit; this.normal = normal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CHit() {\n this.hitNum = -1; // default: SKY color\n this.hitGeom = null; // (reference to)the CGeom object\n this.t0 = g_t0_MAX; // default: t set to hit very-distant-sky\n \n this.hitPt = vec4.create(); // World-space location where the ray pierced\n //...
[ "0.64246756", "0.63231665", "0.61392164", "0.5967533", "0.572876", "0.56987536", "0.56010526", "0.5585128", "0.5572894", "0.55676436", "0.5542732", "0.5532545", "0.55249274", "0.5504913", "0.55036366", "0.54811263", "0.5460561", "0.5405263", "0.54036206", "0.54036206", "0.540...
0.7727865
0
new GL.Raytracer() This will read the current modelview matrix, projection matrix, and viewport, reconstruct the eye position, and store enough information to later generate perpixel rays using `getRayForPixel()`. Example usage: var tracer = new GL.Raytracer(); var ray = tracer.getRayForPixel( gl.canvas.width / 2, gl.c...
function Raytracer() { var v = gl.getParameter(gl.VIEWPORT); var m = gl.modelviewMatrix.m; var axisX = new Vector(m[0], m[4], m[8]); var axisY = new Vector(m[1], m[5], m[9]); var axisZ = new Vector(m[2], m[6], m[10]); var offset = new Vector(m[3], m[7], m[11]); this.eye = new Vector(-offset.dot(axisX), -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Raytracer( parent ) \n{\n var defaults = { width: 32, height: 32, near: 1, left: -1, right: 1, bottom: -1, top: 1, scanline: 0, visible: true, anim: parent, ambient: vec3( .1, .1, .1 ) };\n for( i in defaults ) this[ i ] = defaults[ i ];\n \n this.m_square = new N_Polygon( 4 ); // ...
[ "0.61365086", "0.61365086", "0.61365086", "0.6118788", "0.6044174", "0.5926258", "0.5881958", "0.587968", "0.58198565", "0.5616731", "0.56010926", "0.5589606", "0.5558413", "0.5525262", "0.5524625", "0.5454825", "0.54239047", "0.5401546", "0.5401546", "0.53938127", "0.5325399...
0.73209804
0
nflTeam Models an nfl team name, conference, and division
function nflTeam(name, conference, division, finishPlace) { this.name = name.toLowerCase(); this.conference = conference.toLowerCase(); this.division = division.toLowerCase(); this.finishPlace = finishPlace; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflDivisionMatchup(team1, team2) {\n this.conference1 = team1.conference;\n this.division1 = team1.division;\n this.conference2 = team2.conference;\n this.division2 = team2.division;\n this.games = new Array();\n}", "function Team(team){\n this._id = team._id;\n this.name = team.name;\n...
[ "0.71160805", "0.70211554", "0.67627", "0.6345059", "0.6157316", "0.6016102", "0.59653026", "0.59161276", "0.5891639", "0.58902663", "0.58865714", "0.58803576", "0.5823405", "0.5803451", "0.5771059", "0.5767733", "0.57556635", "0.57365644", "0.5734137", "0.5728544", "0.572293...
0.86666864
0
find function passed "this" is a team name string
function teamMatch(team) { return team.name == this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findTeam(teams, ro) {\n var teamName = ro[\"groupname\"];\n for (var i = 0; i < teams.length; i++) {\n if (teams[i].name == teamName) {\n return teams[i];\n } else {\n // console.log(\"No such team!\" + te...
[ "0.64304537", "0.62020195", "0.5971294", "0.5962423", "0.5962423", "0.59617865", "0.5889959", "0.58491963", "0.580124", "0.57536244", "0.5542515", "0.5535636", "0.5497157", "0.54964995", "0.5435024", "0.54188895", "0.5343173", "0.5333216", "0.53180254", "0.52936125", "0.52837...
0.7191027
0
end nflTeam // ///////////////////////////////////////// nflGame Models an nfl game matchup homeTeam, awayTeam : object references, not just names
function nflGame(homeTeamName, awayTeamName) { var homeTeam = teams.find(teamMatch, homeTeamName); var awayTeam = teams.find(teamMatch, awayTeamName); this.homeTeam = homeTeam; this.awayTeam = awayTeam; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflDivisionMatchup(team1, team2) {\n this.conference1 = team1.conference;\n this.division1 = team1.division;\n this.conference2 = team2.conference;\n this.division2 = team2.division;\n this.games = new Array();\n}", "function nflTeam(name, conference, division, finishPlace) {\n this.na...
[ "0.71618927", "0.7103094", "0.65720695", "0.633135", "0.63240325", "0.6255061", "0.62364227", "0.62354445", "0.6235152", "0.61494946", "0.6144874", "0.61207783", "0.60963124", "0.6059261", "0.60250705", "0.60124105", "0.5935705", "0.58824706", "0.5877155", "0.5823436", "0.582...
0.85477185
0
end nflGame // ///////////////////////////////////////// nflDivisionMatchup Models a divisional matchup (1 division vs another division) and models the games in that matchup conference1, division1 conference1, division1 games collection
function nflDivisionMatchup(team1, team2) { this.conference1 = team1.conference; this.division1 = team1.division; this.conference2 = team2.conference; this.division2 = team2.division; this.games = new Array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflFinishPlaceMatchupHistory(conference, division1, division2) {\n this.conference = conference;\n this.division1 = division1;\n this.division2 = division2;\n this.homeAwayHistory = \"--\"; // [0] 2 years ago, [1] 1 year ago\n this.homeAwayThisYear = \"-\";\n this.pattern = \"-HR-RH-\";\...
[ "0.60754687", "0.6028272", "0.5942616", "0.5682059", "0.5487753", "0.545201", "0.5163401", "0.5160118", "0.5159407", "0.51450545", "0.5144779", "0.51057434", "0.50649565", "0.50483274", "0.50465435", "0.5020046", "0.49728543", "0.49703577", "0.4958401", "0.4956414", "0.495118...
0.7801423
0
end nflDivisionMatchup // ///////////////////////////////////////// nflSeasonMatchups Models a seasons worth of games categorized into collections of nflDivisionMatchup (s) Provides organized history of the past 4 seasons necessary to produce the next seasons set of games divisionMatchups intraConferenceMatchups interC...
function nflSeasonMatchups(year) { this.year = year; this.divisionMatchups = new Array(); this.intraConferenceMatchups = new Array(); this.intraConferenceFinishPlaceMatchups = new Array(); this.interConferenceMatchups = new Array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflDivisionMatchup(team1, team2) {\n this.conference1 = team1.conference;\n this.division1 = team1.division;\n this.conference2 = team2.conference;\n this.division2 = team2.division;\n this.games = new Array();\n}", "function createPriorSeasonMatchups(gameFileName, year, nflseasons) {\n ...
[ "0.71335524", "0.6675333", "0.63144076", "0.615556", "0.59510237", "0.57975066", "0.5755257", "0.57155657", "0.569276", "0.56796336", "0.5667251", "0.5651245", "0.56470984", "0.5611148", "0.5609379", "0.56054014", "0.5602461", "0.55719674", "0.5563339", "0.55631685", "0.55471...
0.78398246
0
seasonMatch: array find function seasonMatchups represents the array element being checked as a "find" candidate optional index: the array index of seasonMatchups array element optional arr: the array being searched optional this: passed as the 2nd argument to find, to be used in comparing and checking the array elemen...
function seasonMatch(seasonMatchups) { return seasonMatchups.year == this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflSeasonMatchups(year) {\n this.year = year;\n this.divisionMatchups = new Array();\n this.intraConferenceMatchups = new Array();\n this.intraConferenceFinishPlaceMatchups = new Array();\n this.interConferenceMatchups = new Array();\n}", "function createPriorSeasonMatchups(gameFileName, ...
[ "0.6578348", "0.59462374", "0.58754885", "0.5856566", "0.567831", "0.5628711", "0.5622757", "0.5554335", "0.5541252", "0.5541252", "0.5538065", "0.55227154", "0.54767966", "0.54606605", "0.54467165", "0.54374254", "0.5407705", "0.5404845", "0.54039735", "0.5382766", "0.536966...
0.76292956
0
end nflSeasonMatchups // nflFinishPlaceMatchupHistory homeAwayHistory[2] : for 2 years ago homeAwayHistory[1] : for 1 years ago homeAwayHistory[0] : for this year
function nflFinishPlaceMatchupHistory(conference, division1, division2) { this.conference = conference; this.division1 = division1; this.division2 = division2; this.homeAwayHistory = "--"; // [0] 2 years ago, [1] 1 year ago this.homeAwayThisYear = "-"; this.pattern = "-HR-RH-"; // this.patte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflSeasonMatchups(year) {\n this.year = year;\n this.divisionMatchups = new Array();\n this.intraConferenceMatchups = new Array();\n this.intraConferenceFinishPlaceMatchups = new Array();\n this.interConferenceMatchups = new Array();\n}", "appendAwayteamData(teams, match, j){\n\t\tteams[j...
[ "0.6687798", "0.63425696", "0.613902", "0.6126559", "0.6038473", "0.5912858", "0.58991", "0.5853513", "0.5839169", "0.57365954", "0.5736356", "0.5687623", "0.56733626", "0.56488645", "0.56444263", "0.55849814", "0.55234456", "0.5514432", "0.55099815", "0.55082476", "0.546482"...
0.75491935
0
createPriorSeasonMatchups read in prior seasons and sort games into different matchup categories
function createPriorSeasonMatchups(gameFileName, year, nflseasons) { games = new Array(); fs.createReadStream(gameFileName).pipe(csv()) .on('data', processGameCsvLine) .on('end', endGamesCsvFile); sleep(100); // Testing the loading of games console.log('games.length before matchup so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nflSeasonMatchups(year) {\n this.year = year;\n this.divisionMatchups = new Array();\n this.intraConferenceMatchups = new Array();\n this.intraConferenceFinishPlaceMatchups = new Array();\n this.interConferenceMatchups = new Array();\n}", "function createCurrentRanking(players, matches) {...
[ "0.6044585", "0.5882029", "0.5877526", "0.58573407", "0.54876834", "0.53631103", "0.53629154", "0.5333458", "0.5305182", "0.5302196", "0.529782", "0.5284696", "0.52776587", "0.52725196", "0.5239374", "0.5212119", "0.51894677", "0.51887", "0.5186574", "0.51645494", "0.5140796"...
0.7949936
0
removes the 'backgroundToRemove' element
function removePreviousBackground() { $("#backgroundToRemove").remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeBackground() {\n var element = document.getElementById(\"background\");\n element.parentNode.removeChild(element);\n }", "remove() {\n this.background_.remove();\n }", "onRemoveImage() {\n\t\tconst { backgroundImage } = this.props.attributes\n\t\tcons...
[ "0.8696178", "0.8114309", "0.7495405", "0.73662806", "0.688799", "0.68864167", "0.6664281", "0.66549623", "0.65807366", "0.6544427", "0.6511641", "0.64688486", "0.6453546", "0.6447844", "0.64021397", "0.6398973", "0.63978076", "0.6392633", "0.63842845", "0.6374291", "0.636363...
0.83200145
1
Determine the conductor and musebot paths.
function get_paths() { // Get the musebot conductor path // From the top patcher if running as a patcher if (!max.isruntime) { mfolder.set(this.patcher.parentpatcher.filepath); mfolder.up(); } // ... or from the runtime if running as a standalone else { mfolder.set(max.apppath); } mc_path = mf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static setPaths() {\n\t\tthis._url_app = this.dirname(import.meta.url);\n\t\tthis._url_page = this.dirname(location.href);\n\t}", "function checkPaths() {\n var cwd = process.cwd();\n // If windows, split on backslash else on forward slash\n var paths = os.type() == \"Windows_NT\" ? cwd.split(\"\\\\\") : cwd....
[ "0.5531539", "0.5511419", "0.54040027", "0.53968567", "0.5313078", "0.5253995", "0.5132922", "0.507412", "0.50460935", "0.5013498", "0.5012831", "0.49956393", "0.4957869", "0.49118015", "0.4900219", "0.4882778", "0.4875176", "0.48500577", "0.4839825", "0.48354244", "0.4822630...
0.7780286
0
Add a musebot to the dictionary and umenu.
function parse_add_bot(path, bot_os, has_info, cnt) { // Get the musebot name from the config file var config = new File(path + "config.txt", "readwrite"); var line = config.readline(); var name = line.slice(3); // Rewrite the bot's port number for listening line = config.readline(); // mc_hostname local...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_add_bot(bot)\n{\n list_arr.push(bot);\n udp_route_add(bot);\n}", "function word_add(w, e) {\n var list = words[w];\n if (!list) {\n list = new Array();\n words[w] = list;\n }\n list.push(e);\n}", "addPhrase(phrase) {\n this.privGrammerBuilder.addPhrase(phrase);\...
[ "0.5655054", "0.56504035", "0.5618198", "0.55480003", "0.54642993", "0.54101866", "0.5385858", "0.5372738", "0.5348522", "0.5339852", "0.53178245", "0.5313791", "0.53079224", "0.525355", "0.5246502", "0.5246502", "0.52324927", "0.51854604", "0.5185009", "0.51830167", "0.51482...
0.61588657
0
Parse the musebot files for information on it.
function parse_bot_info(path, uname) { var file = new File(path + "info.txt", "read"); var section = sect.null; var subsect = sect.null; var flags = 0; var token = ""; var line = ""; var index; // Read through the file line by line file.open(); while (file.position !== file.eof) { line = file....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_add_bot(path, bot_os, has_info, cnt)\n{\n // Get the musebot name from the config file\n var config = new File(path + \"config.txt\", \"readwrite\");\n var line = config.readline();\n var name = line.slice(3);\n\n // Rewrite the bot's port number for listening\n line = config.readline(); // ...
[ "0.6376614", "0.5804419", "0.57080156", "0.5659319", "0.5396668", "0.5236414", "0.52160555", "0.51634085", "0.5098611", "0.50826377", "0.5053195", "0.5049192", "0.5048294", "0.50281584", "0.5027449", "0.50214183", "0.502007", "0.5019629", "0.50096595", "0.49856558", "0.497542...
0.7085182
0
Set keywords to unknown when there is no info.txt file for a bot.
function parse_no_info(uname) { mc_dict.append("bots::" + uname + "::types", "unknown"); mc_dict.append("types::unkown", uname); mc_dict.append("bots::" + uname + "::sends", "unknown"); mc_dict.append("sends::unkown", uname); mc_dict.append("bots::" + uname + "::receives", "unknown"); mc_dict.append("receiv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setKeywords() {\n let keywords;\n\n try {\n keywords = win.document.querySelector(\"meta[name='keywords']\");\n } catch (e) {\n keywords = window.document.querySelector(\"meta[name='keywords']\");\n }\n\n if (keywords && keywords.content) utils.mergeDeep(ortb2, { site: { keywords: keywords.cont...
[ "0.5666366", "0.5487662", "0.5174983", "0.51251066", "0.49726826", "0.4937983", "0.48823762", "0.48823762", "0.48823762", "0.48823762", "0.48823762", "0.48823762", "0.48823762", "0.48260358", "0.47933292", "0.47358108", "0.4701127", "0.4701127", "0.46684012", "0.46243918", "0...
0.668905
0
Recurse through the subfolders to search for musebots.
function parse_search_bots(path, cnt) { var folder = new Folder(path); var subfold_arr = []; var flags = 0; // Loop through the folder while (!folder.end && (flags < 15)) { // If the file is a subfolder store it if ((folder.filetype === "fold") && (folder.filename !== "__MACOSX")) { subfold_ar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_paths()\n{\n // Get the musebot conductor path\n // From the top patcher if running as a patcher\n if (!max.isruntime) {\n mfolder.set(this.patcher.parentpatcher.filepath);\n mfolder.up();\n }\n // ... or from the runtime if running as a standalone\n else {\n mfolder.set(max.apppath); }...
[ "0.5768423", "0.55643654", "0.55019116", "0.5479504", "0.5362996", "0.53565055", "0.52817225", "0.5278968", "0.5239018", "0.5236314", "0.52316576", "0.52288795", "0.52144766", "0.5195282", "0.5181812", "0.5164597", "0.5147794", "0.5140107", "0.5097657", "0.5091382", "0.504677...
0.67970514
0
Parse the ensemble files for information.
function parse_search_ens() { // Create temporary arrays for speed var supp_arr = mc_dict.get("lists::supp"); var unsupp_arr = mc_dict.get("lists::unsupp"); // Go through all the files in the ensemble folder var folder = new Folder(ensembles_path); while (!folder.end) { if (folder.filetype === "TEXT") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_ens_file(ensemble, filename, supp_arr, unsupp_arr)\n{\n var file = new File(ensembles_path + filename, \"read\");\n\n var number = 1;\n var line = \"\";\n var token_arr = [];\n\n // Read through the file line by line\n file.open();\n\n // First line\n line = file.readline().trim();\n token_...
[ "0.63914335", "0.5183212", "0.512369", "0.51196414", "0.5030555", "0.50055915", "0.49945366", "0.49643517", "0.49631462", "0.4957196", "0.49427626", "0.4942238", "0.49405235", "0.49003214", "0.48626325", "0.48471308", "0.48392648", "0.48065662", "0.48040128", "0.47879595", "0...
0.628652
1
Parse an ensemble file.
function parse_ens_file(ensemble, filename, supp_arr, unsupp_arr) { var file = new File(ensembles_path + filename, "read"); var number = 1; var line = ""; var token_arr = []; // Read through the file line by line file.open(); // First line line = file.readline().trim(); token_arr = line.split(/[ ]+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_search_ens()\n{\n // Create temporary arrays for speed\n var supp_arr = mc_dict.get(\"lists::supp\");\n var unsupp_arr = mc_dict.get(\"lists::unsupp\");\n\n // Go through all the files in the ensemble folder\n var folder = new Folder(ensembles_path);\n while (!folder.end) {\n if (folder.fil...
[ "0.5514489", "0.5417596", "0.5355493", "0.52735835", "0.5267812", "0.5234684", "0.5212126", "0.5170541", "0.5158322", "0.5153746", "0.50463367", "0.504036", "0.5031919", "0.50178355", "0.5015982", "0.500215", "0.49895424", "0.49537987", "0.49408114", "0.48989588", "0.48891842...
0.67103297
0
Sort a subdictionary in a dictionary.
function dict_sort_key(dict, key) { dict_proc_key(dict, key); var count = dict.get("counts::" + key); // If there are more than one subkeys if (count > 1) { var key_arr = dict.get("lists::" + key); var tmp; // Remove and replace the subkeys to sort them // Also sort array values when necessa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort_dict(dict) {\n items = Object.keys(dict).map(function(key) {\n return [key, dict[key]];\n });\n items.sort(function(first, second) {\n return second[1] - first[1];\n });\n sorted_dict={}\n $.each(items, function(k, v) {\n updatekey = v[0]\n updatevalue = ...
[ "0.6685655", "0.624081", "0.62049735", "0.5930604", "0.58403784", "0.57909346", "0.5769445", "0.56330836", "0.5607143", "0.5513458", "0.5486117", "0.54848963", "0.5460991", "0.54417145", "0.5434027", "0.54311496", "0.5412831", "0.54071033", "0.5397843", "0.5364215", "0.533437...
0.72105885
0
Fill a umenu with keys from an array.
function umenu_fill(filter, keys, first_entry) { // Get the umenu and clear it var umenu = top_patch.getnamed("umenu_" + filter); umenu.message("clear"); // Append a first entry for the umenu if necessary if (first_entry) { umenu.message("append", first_entry); umenu.message("append", "-"); } //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillArray(a, w) {\n var len = a.length;\n for(var key = 0; key < len; ++key) {\n a[key] = w;\n }\n return a;\n }", "function fillArray() {}", "function setKeys() {\n\t\t\tfor (var i = 0; i < items.length; i++) {\n\t\t\t\tconcrete._selected.keys[items[i].id] = value;\n\t\t\t}\n\t\t}",...
[ "0.59228057", "0.5712496", "0.5385899", "0.5355717", "0.53399485", "0.5312041", "0.52228034", "0.52184975", "0.52184975", "0.52023995", "0.51830333", "0.5178082", "0.5170287", "0.5146448", "0.51176643", "0.50701326", "0.50685376", "0.5052528", "0.5025527", "0.50005114", "0.49...
0.65759015
0
Remove all the objects in a patcher but the inlets.
function rem_objects(obj) { if (obj.maxclass !== "inlet") { obj.patcher.remove(obj); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static #scrubOperations(patches) {\n const mutable = new Set(['firstName', 'lastName']);\n const replacements = patches.filter(patch => patch.op === 'replace');\n\n return replacements.filter(replacement => {\n const properties = new Set(replacement.path.split('/'));\n co...
[ "0.6102292", "0.58465886", "0.5769824", "0.575906", "0.57182294", "0.5686224", "0.56629586", "0.5639984", "0.5636437", "0.56336164", "0.5590462", "0.55174726", "0.5509927", "0.5505484", "0.54993194", "0.5486408", "0.5462284", "0.54617876", "0.54617876", "0.5433641", "0.540742...
0.7060181
0
Static scripting of the udp.route subpatcher. Done once at reset only, for all the supported bots.
function udp_route_static() { if (debug) { post("TRACE: udp_route_static ( )\n"); } // Get the udp subpatcher and remove all the objects with the exception of the inlets var udp_patch = top_patch.getnamed("udp_route").subpatcher(); udp_patch.apply(rem_objects); // Get the inlet objects var udp_inlet_bots...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function udp_route_script(init)\n{\n if (debug) { post(\"TRACE: udp_route_script ( \" + init + \" )\\n\"); }\n\n // If there are no routing changes, don't do anything\n if (udp_route_chg === false) { return; }\n // ... otherwise reset the change tracker\n else { udp_route_chg = false; }\n\n // Get the udp s...
[ "0.7211841", "0.6888906", "0.650193", "0.6099513", "0.5296809", "0.48898867", "0.48891088", "0.48498726", "0.48375434", "0.4827874", "0.48114285", "0.47978416", "0.47813824", "0.47640178", "0.4760671", "0.46677166", "0.46671754", "0.4625533", "0.46015266", "0.45987594", "0.45...
0.793762
0
Return an array from the values associated to a key in a dictionary. Always returns an array, even if empty or singleton. And ignores "_" placeholders.
function array_from_keys(dict) { // Test that dict is a dictionary before calling getkeys if (get_type(dict) !== "Dict") { return []; } var keys = dict.getkeys(); switch (get_type(keys)) { // If there is only one key case "String": if (keys === "_") { return []; } else { return [keys]; } // If th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_from_val(dict, key)\n{\n switch (dict.getsize(key)) {\n case 0: return [];\n case 1:\n if (dict.get(key) === \"<empty>\") { return []; }\n else { return [dict.get(key)]; }\n default: return dict.get(key);\n }\n}", "function GM_getArray(gm_key){\r\n tmp = GM_getValue(gm_key,'new Arra...
[ "0.8005166", "0.65519124", "0.64479786", "0.6381691", "0.6381691", "0.62890637", "0.6214253", "0.6194136", "0.6132284", "0.61225724", "0.6087366", "0.6034423", "0.6024318", "0.59795177", "0.59314454", "0.59096843", "0.5895667", "0.5895667", "0.580478", "0.580478", "0.580478",...
0.7238005
1
Count the number of keys in a dictionary.
function cnt_from_keys(dict) { if (get_type(dict) !== "Dict") { return 0; } var d = (dict.contains("_")) ? 1 : 0; var keys = dict.getkeys(); switch (get_type(keys)) { case "String": return (1 - d); case "Array": return (keys.length - d) default: return 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDictLength(dict) {\r\n return Object.keys(dict).length;\r\n}", "function countKeys(obj) {\n\tvar size = 0, key;\n\tfor (key in obj) {\n\t\tif (obj.hasOwnProperty(key)) size++;\n\t}\n\treturn size;\n}", "function count(obj) { return Object.keys(obj).length; }", "function numKeys(obj)\n{\n va...
[ "0.7951693", "0.7451655", "0.7348638", "0.71987176", "0.71683073", "0.7150804", "0.7128896", "0.7050375", "0.69390815", "0.69390815", "0.69390815", "0.69277036", "0.6892387", "0.68146205", "0.6738999", "0.67080134", "0.66138726", "0.6581589", "0.6554039", "0.6522311", "0.6427...
0.8009184
0
Update the filter flags.
function filter_update_flags(filter) { // Update the flags: set flag to 0 if ((filt_togg[filter] === 0) || (filt_list[filter].length === 0)) { filt_flags = filt_flags & ~filt_pow[filter]; } // ... or set flag to 1 else { filt_flags = filt_flags | filt_pow[filter]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFilter() {\n view.map.ground.opacity = 0.5;\n updateFilterGeometry();\n featureFilter = {\n // autocasts to FeatureFilter\n geometry: filterGeometry,\n spatialRelationship: selectedFilter\n };\n\n lv1.filter = featureFilter;\n lv2.filter = featureFilter;\n }", "up...
[ "0.7434608", "0.7297858", "0.71701384", "0.68427044", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", "0.6639881", ...
0.822983
0
Update the filtered musebot lists.
function filter_update() { // Calculate intersection depending on which filters are active var select_list; switch (filt_flags) { case 0: select_list = array_from_val(mc_dict.get("lists"), "supp"); break; case 1: select_list = filt_list["types"].slice(0); break; // need slice(0) to copy the array case 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "applyFilters() {\n const filters = this.getActiveFilters();\n const newResults = this.filterResults(filters);\n this.updateStatus(newResults);\n this.updateClearButton();\n this.callback(newResults);\n }", "function updateSearch()\n\t{\n\t\t// Start with fresh copy.\n\t\tvar filteredItems = items...
[ "0.61963403", "0.6171064", "0.6142339", "0.6136641", "0.61204326", "0.6114752", "0.5982282", "0.59556806", "0.5928482", "0.5907955", "0.586343", "0.5857442", "0.5853834", "0.5828636", "0.58062524", "0.57953376", "0.5791501", "0.5759395", "0.5759395", "0.5759395", "0.5759395",...
0.7282871
0
Open and close text files.
function exam_open(type, file) { if (locked) { warn_is_locked(); return; } var text = top_patch.getnamed("text"); // If a text window is already open if (exam_is_open) { text.message("wclose"); // Just close the text file if the cmd applies to the already open file if (file === exam_file_cur) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "open_file(filename, text)\n {\n let all_open_filenames = [];\n for(let element of this.files)\n {\n all_open_filenames.push(element[0]);\n }\n // check if the file isn't already open.\n if(all_open_filenames.includes(filename))\n {\n this.ac...
[ "0.54953635", "0.534445", "0.53272647", "0.5251513", "0.5241201", "0.52353984", "0.515874", "0.50988287", "0.50844175", "0.5029313", "0.5022417", "0.4991413", "0.49549836", "0.491238", "0.48708823", "0.4853595", "0.48491907", "0.48255774", "0.48020998", "0.47780794", "0.47722...
0.5571287
0
Script the udp_route subpatcher dynamically. Called at intialization, or after updating udp_route_arr[]. Then updates the subpatcher, and the max objects: udp_route_ind, udp_route, udp_send_arr[]
function udp_route_script(init) { if (debug) { post("TRACE: udp_route_script ( " + init + " )\n"); } // If there are no routing changes, don't do anything if (udp_route_chg === false) { return; } // ... otherwise reset the change tracker else { udp_route_chg = false; } // Get the udp subpatcher and remov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function udp_route_static()\n{\n if (debug) { post(\"TRACE: udp_route_static ( )\\n\"); }\n\n // Get the udp subpatcher and remove all the objects with the exception of the inlets\n var udp_patch = top_patch.getnamed(\"udp_route\").subpatcher();\n udp_patch.apply(rem_objects);\n\n // Get the inlet objects\n ...
[ "0.74173385", "0.70508134", "0.7040487", "0.557213", "0.5133583", "0.51065534", "0.4921375", "0.48460004", "0.4697147", "0.45752978", "0.45528036", "0.45066488", "0.4495936", "0.4405435", "0.44039047", "0.43947", "0.43857208", "0.43719652", "0.43665585", "0.43665585", "0.4366...
0.74271166
0
Add a bot and update the dynamic routing.
function udp_route_add(bot) { if (!udp_route_dyn) { return; } if (debug) { post("TRACE: udp_route_add ( " + bot + " )\n"); } if (mc_dict.contains("udp_route::" + bot)) { return; } var resized = false; // track if the routing array has been resized var ind = 0; // to hold the first empty slot /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_add_bot(bot)\n{\n list_arr.push(bot);\n udp_route_add(bot);\n}", "function parse_add_bot(path, bot_os, has_info, cnt)\n{\n // Get the musebot name from the config file\n var config = new File(path + \"config.txt\", \"readwrite\");\n var line = config.readline();\n var name = line.slice(3);\n\...
[ "0.6383977", "0.6134375", "0.57454777", "0.5535023", "0.5341116", "0.5302663", "0.5253084", "0.52475685", "0.5230412", "0.5205375", "0.5182153", "0.5155569", "0.5147008", "0.5100773", "0.50993484", "0.5097692", "0.5047423", "0.50409377", "0.50168246", "0.5001951", "0.49886203...
0.68098754
0
Remove a bot and update the dynamic routing.
function udp_route_remove(bot) { if (!udp_route_dyn) { return; } if (debug) { post("TRACE: udp_route_remove ( " + bot + " )\n"); } // Decrement the count, retrieve the index, and update the routing array udp_route_cur--; var ind = mc_dict.get("udp_route::" + bot); mc_dict.remove("udp_route::" + bot); ud...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_rem_bot(bot)\n{\n mc_dict.remove(\"tracked::\" + bot);\n var index = list_arr.indexOf(bot);\n if (index > -1) { list_arr.splice(index, 1); }\n udp_route_remove(bot);\n}", "function udp_route_add(bot)\n{\n if (!udp_route_dyn) { return; }\n if (debug) { post(\"TRACE: udp_route_add ( \" + bot +...
[ "0.6505405", "0.5638831", "0.5619476", "0.5504617", "0.525246", "0.52403766", "0.52350134", "0.5167467", "0.51660556", "0.5147815", "0.5118088", "0.50912124", "0.50792444", "0.5061925", "0.50577164", "0.5009658", "0.4995991", "0.49877378", "0.4948829", "0.49078894", "0.490495...
0.76435226
0
Reduce the routing array if it is too empty.
function udp_route_reduce() { if (!udp_route_dyn) { return; } if (debug) { post("TRACE: udp_route_reduce ( )\n"); } // If the array is less than a quarter full and not of minimum length if ((udp_route_cur <= udp_route_arr.length / 4) && (udp_route_arr.length >= 2 * udp_route_min)) { // Remove the gaps an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAllRoutes(){\n if (renderArray != undefined){\n console.log(\"HI!\")\n // simply setting renderArray = null doesn't work \n for(var i = 0; i < renderArray.length; i++){\n renderArray[i].setDirections( { routes: [] } ); \n }\n\n // probably not ...
[ "0.64542204", "0.6279683", "0.53936255", "0.5391167", "0.53754306", "0.5337759", "0.53333944", "0.52070236", "0.5180837", "0.51371926", "0.5134244", "0.51298416", "0.51226825", "0.5088115", "0.5087649", "0.5078803", "0.505202", "0.5037661", "0.503629", "0.50341314", "0.503208...
0.6447611
1
Respond to an exiting message sent by a bot.
function mess_exiting(bot) { if (debug) { post("TRACE: exiting ( " + bot + " )\n"); } bot_clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "exitSendWithPhrase(ctx) {\n\t}", "exitSendFromPhrase(ctx) {\n\t}", "function respond() {\n var post = JSON.parse(this.req.chunks[0]);\n sendingGroup = post.group_id;\n sendingUser = post.name;\n message = post.text;\n\n if (botIdAlt !== null && sendingGroup !== groupId) {\n botId = botIdAlt;\n } else ...
[ "0.6766077", "0.6678503", "0.6646371", "0.6593443", "0.6559984", "0.64662755", "0.6406363", "0.62324744", "0.6187304", "0.6184717", "0.61634", "0.61008793", "0.60710484", "0.6009106", "0.59885895", "0.59569824", "0.5954326", "0.5911376", "0.59037036", "0.5898663", "0.58712107...
0.6819094
0
Add a bot to the tracked list.
function list_add_bot(bot) { list_arr.push(bot); udp_route_add(bot); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addBotPlayers(players) {\n let bot1 = new WeakBot('PPE');\n players.push(bot1);\n\n let bot2 = new AggroBot('Aura');\n players.push(bot2);\n }", "ADD_BOTS(state, characters) {\n let bots = state.gamesession.elements?.[0]?.elements\n ?.find((el) => el.name === 'MultiPlayerCampaign')\n ...
[ "0.6103521", "0.57754266", "0.57754266", "0.56409156", "0.5599392", "0.55730677", "0.5506382", "0.547586", "0.54432714", "0.5442991", "0.5437865", "0.54045033", "0.53998804", "0.53285336", "0.531249", "0.5302174", "0.5283002", "0.528044", "0.52443373", "0.52439564", "0.524272...
0.7365861
0
Remove a bot from the tracked list.
function list_rem_bot(bot) { mc_dict.remove("tracked::" + bot); var index = list_arr.indexOf(bot); if (index > -1) { list_arr.splice(index, 1); } udp_route_remove(bot); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAllBotsFromBotManager() {\n debug('deleteAllBotsFromBotManager');\n Object.keys(bots).forEach((botName) => {\n delete bots[botName];\n });\n }", "remove(idx) {\n console.log(\"---Begin wishList.remove()---\");\n console.log(`Parameters: Idx:${idx}`);\n delete th...
[ "0.61812854", "0.5734471", "0.5727927", "0.5699482", "0.56977695", "0.56612337", "0.56427586", "0.56269944", "0.56269944", "0.56188905", "0.56188905", "0.56128544", "0.5583258", "0.5570817", "0.55602705", "0.55365", "0.5534556", "0.5530304", "0.5521352", "0.55208486", "0.5519...
0.7515637
0
Clear a bot from the list, depending on its state.
function list_clear(index) { if (index < Math.min(list_arr.length - 10 * (list_page - 1), 10)) { var bot = list_arr[index + 10 * (list_page - 1)]; switch (mc_dict.get("tracked::" + bot + "::state")) { case "scheduled": task_cancel_match(bot, bot_func_launch); list_rem_bot(bot); break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_rem_bot(bot)\n{\n mc_dict.remove(\"tracked::\" + bot);\n var index = list_arr.indexOf(bot);\n if (index > -1) { list_arr.splice(index, 1); }\n udp_route_remove(bot);\n}", "clearThings (gameState) {\n this.things.forEach((thing) => {\n /* Force remove of the thing. */\n thing.update...
[ "0.70178074", "0.6255973", "0.6229697", "0.6166484", "0.6166461", "0.6093807", "0.5808141", "0.5749629", "0.5650997", "0.56268024", "0.56225926", "0.55662", "0.55657315", "0.5559886", "0.55588305", "0.5539037", "0.55349976", "0.5503927", "0.5479063", "0.5477928", "0.5476388",...
0.744982
0
Cancel a task with matching arguments.
function task_cancel_match(bot, func) { for (var i = 0; i < task_arr.length; i++) { if ((task_arr[i]["arguments"][0] === bot) && (task_arr[i]["function"] === func)) { task_arr.splice(i, 1)[0].cancel(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelTask(taskId) {\n return this.postListEndpoint('canceltask', {\n task_id: taskId,\n });\n }", "async function cancelTask(taskSid) {\n try {\n await client.taskrouter\n .workspaces(context.TWILIO_WORKSPACE_SID)\n .tasks(taskSid)\n .update({\n assignmentStatus...
[ "0.6919877", "0.64372665", "0.6369403", "0.63575584", "0.62748426", "0.61859554", "0.5979679", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.59581196", "0.5946272", ...
0.65895826
1
Reset the ensemble variables.
function ens_reset() { // Reset the ensemble variable values ens_cur = ""; ens_bot_arr.length = 0; ens_clear_arr.length = 0; ens_on = false; // Create or reset the ensemble task if (get_type(ens_task) !== "Task") { ens_task = new Task(ens_func_clear, this, "null"); } ens_task.interval = 500; ens_task...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetExperiment(scope) {\n\tinitialisationOfVariables(scope);\n\tinitialisationOfControls(scope);\n\tinitialisationOfImages(scope);\n\tshowResult(scope);\n\thall_effect_stage.update();\n}", "reset()\n {\n this._state = this._initialState;\n this._prevState = this._initialState;\n ...
[ "0.68755996", "0.6855041", "0.67163444", "0.6621773", "0.66002464", "0.65623885", "0.65343773", "0.6527563", "0.6499486", "0.6479638", "0.6471441", "0.64697105", "0.6466304", "0.6465749", "0.6455422", "0.6452487", "0.6450172", "0.6439747", "0.6417955", "0.6407285", "0.6405858...
0.73541534
0
Main function to Launch an ensemble. Launches a series of subfunctions controlled by a task.
function ens_launch(ens) { if (debug) { post("TRACE: ensemble ( " + ens + " )\n"); } // Cancel the ensemble task in case it was running ens_task.cancel(); // Set the ensemble variable values ens_cur = ens; ens_bot_arr = array_from_keys(mc_dict.get("ensembles::" + ens + "::bots")); ens_clear_arr = arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function launch() {}", "function launch() {}", "function runMainFunction() {}", "function main() {\n _initEvent();\n // initWorker();\n initScene();\n initCamera();\n initRender();\n initLight();\n initContr();\n initStats();\n initAxesHelper();\n _createModel();\n animate();...
[ "0.6168409", "0.6168409", "0.5740328", "0.5681323", "0.5586077", "0.5572533", "0.55261093", "0.5502438", "0.5453522", "0.5399774", "0.5368758", "0.5324454", "0.53004104", "0.5234076", "0.51918656", "0.51841885", "0.5174255", "0.5174255", "0.5170825", "0.5170034", "0.5148911",...
0.6303603
0
Task function to confirm that all the ensemble bots have come online.
function ens_func_confirm(ens) { if (debug) { post("TRACE: ens_func_confirm ( " + ens + " )\n"); } // Remove bots that come alive from the list of ensemble bots var i = 0; while (i < ens_bot_arr.length) { if (mc_dict.contains("alive::" + ens_bot_arr[i])) { ens_bot_arr.splice(i, 1); } else { i++; } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function pingInternet() {\n const hosts = [\"p2pvps.org\", \"google.com\", \"yahoo.com\", \"amazon.com\", \"en.wikipedia.org\"];\n\n let res;\n let passCnt = 0;\n for (let i = 0; i < hosts.length; i++) {\n res = await ping.promise.probe(hosts[i]);\n //console.log(res);\n if (res.alive) {\n ...
[ "0.5993746", "0.58815163", "0.5865459", "0.583945", "0.5790167", "0.5740917", "0.56570035", "0.5641744", "0.5617448", "0.5574721", "0.5507857", "0.54605335", "0.5453102", "0.5394815", "0.5389179", "0.5383722", "0.5373104", "0.5370595", "0.53695273", "0.5367156", "0.5345098", ...
0.6946176
0
Clear bots and ensembles.
function clear() { bot_clear(); ens_reset(); clear_failed(); task_cancel_all(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAllBotsFromBotManager() {\n debug('deleteAllBotsFromBotManager');\n Object.keys(bots).forEach((botName) => {\n delete bots[botName];\n });\n }", "resetSocialRobot(){\n for(var i = 0; i < this._robot.length; i++){\n this._robot[i].reset();\n }\n }", "clearAll () {\n ...
[ "0.7635036", "0.67158633", "0.669925", "0.66812253", "0.66653657", "0.66651297", "0.66519994", "0.66042536", "0.6536183", "0.6493874", "0.6457639", "0.6401329", "0.63806295", "0.6378501", "0.63747776", "0.63570523", "0.6309726", "0.6275045", "0.6223978", "0.62137395", "0.6198...
0.78504115
0
Set an object to a value.
function set_value(object, value) { top_patch.getnamed(object).message("set", value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set value( value ) {}", "function setValue(o, key, value) {\n\t\to[key] = value\n\t\treturn o\n\t}", "set(value) {\n setter(value);\n propValue = value;\n }", "set gameObject(value) {}", "function setValue(object, path, value) {\n var last = path.pop();\n path.reduce((o, k) => o[k] = o[k] || {...
[ "0.7303106", "0.6885487", "0.67532885", "0.67384386", "0.67130476", "0.669491", "0.65876114", "0.6486199", "0.6428747", "0.64254606", "0.6415341", "0.6392246", "0.6350614", "0.62677264", "0.6262609", "0.62075603", "0.6207116", "0.6176096", "0.6160877", "0.61286074", "0.612860...
0.7183671
1
Raise a warning for an ensemble file.
function warn_ensembles(ensemble, number, mess, line) { var warning = new Dict(); warning.replace("type", mess); warning.replace("line", line); warn("ensembles::" + ensemble + "::" + number, warning, ensemble + " (" + number + "): " + mess + ": \"" + line + "\""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fileReject() {\n Object(vega_util__WEBPACK_IMPORTED_MODULE_0__[\"error\"])('No file system access.');\n}", "function onWarning(error) { handleError.call(this, 'warning', error);}", "async function fileReject() {\n (0,vega_util__WEBPACK_IMPORTED_MODULE_0__.error)('No file system access.');\n}",...
[ "0.5745849", "0.56632143", "0.56429976", "0.553969", "0.5515161", "0.5455466", "0.54362786", "0.53968346", "0.53968346", "0.53968346", "0.5393255", "0.5393255", "0.5393255", "0.5393255", "0.5393255", "0.5393255", "0.5393255", "0.53901124", "0.51891416", "0.51829016", "0.51287...
0.63630927
0
Raise a warning to indicate the patch is locked while resetting.
function warn_is_locked() { post("WARNING: Unable to proceed. Reset in process.\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeLock() {\n this.locked = false;\n }", "function lockModal() {\n locked = true;\n }", "function lockModal() {\n locked = true;\n }", "function lockModal() {\n locked = true;\n }", "_beforePatch() {\n return new Promise((resolve) => {\n const pa...
[ "0.58890057", "0.570604", "0.570604", "0.570604", "0.56048334", "0.56009877", "0.5596661", "0.5582188", "0.5582188", "0.5497862", "0.5497862", "0.5497862", "0.54678684", "0.54350734", "0.54289216", "0.54005027", "0.53696835", "0.53386706", "0.53386706", "0.5332239", "0.533063...
0.7390238
0
Catch invalid returns from objects sending information back.
function _invalid_return() { post("ERROR: Invalid return.\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "discharge () {\n if (this.hasOwnProperty('thrown')) throw this.thrown;\n else return this.returned\n }", "function identifyAnyErrors(res) {\n if (res.fee_amount) {\n return false;\n }\n return true;\n}", "function returnInvalid(res) {\n returnArray = {\"valid\": false};\n res.status(20...
[ "0.59908986", "0.57392824", "0.5621447", "0.56096315", "0.5575242", "0.54666597", "0.546472", "0.54199946", "0.5311106", "0.52629614", "0.52601904", "0.52265507", "0.51428556", "0.51422274", "0.51309186", "0.5128254", "0.5098024", "0.5094423", "0.50681233", "0.50584334", "0.5...
0.6285579
0
Catch any other invalid message to the script.
function anything() { post("ERROR: Invalid message sent to the script. Could be an incorrect return.\n"); var args = arrayfromargs(messagename, arguments); post(" ", args, "\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invalid_input(message) {\n sys.error(\"Invalid input: \" + message);\n process.exit(1);\n}", "function invalid(id) {\n var text = 'Oops! Looks like you entered an incorrect command.';\n sendText(id, text);\n}", "onInvalid() {\n }", "function handleError() {\n if(!isValid) {\n disp...
[ "0.6783931", "0.6357032", "0.6244091", "0.6199182", "0.6119362", "0.6027802", "0.59992075", "0.5889922", "0.58744305", "0.58545434", "0.58353066", "0.57387483", "0.5718764", "0.57049984", "0.56752235", "0.56543416", "0.5648916", "0.56487924", "0.561948", "0.561948", "0.560889...
0.66087765
1
line chart click event
onChartClick(event) { console.log("chart clicked"); console.log(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lineChartClick(d) {\r\n // set parameters\r\n $(\"#curr-country-code\").val(d.name);\r\n $(\"#curr-year\").val(d.year);\r\n $(\"#selectable2\").val(d.year);\r\n \r\n PushDataToMap(AvailablePercentageSeries, $(\"#selectable\").val(), $(\"#selectable2\").val()); \r\n drawChart(nu...
[ "0.73782885", "0.6958878", "0.69403565", "0.6751023", "0.67328364", "0.67264855", "0.6646455", "0.66035205", "0.65937024", "0.6576464", "0.6497882", "0.6489701", "0.6444975", "0.6386823", "0.63799405", "0.636579", "0.62201065", "0.6194027", "0.61757815", "0.6133128", "0.61211...
0.69942427
1
Accessibility: Apply some bandaids on a11y issues. / NOTE: These changes fix some issues clientside that can't / easily be addressed otherwise. Blacklight.onLoad DOM / modifications do not work for elements added dynamically, / e.g., context tree navigation or child component nav, so the / applyAccessibilityPatches() f...
function applyAccessibilityPatches() { /* ---------------------------------- */ /* Area: typeahead search box */ /* ---------------------------------- */ /* Issue: missing ARIA label. /* Platform: Blacklight */ /* Version fixed in: (not fixed) */ /* https://github.com/projectblacklight/blacklight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_module(){\n\nvar handiVersionNumber = \"3.3.2\";\n\n//TODO: report whether an element should be visible or invisible to a screen reader\n\n//create hANDI instance\nvar hANDI = new AndiModule(handiVersionNumber,\"h\");\n\n//This function updates the Active Element Inspector when mouseover/hover is on ...
[ "0.60757744", "0.58535856", "0.577283", "0.5724389", "0.5697621", "0.5612408", "0.55083185", "0.55029696", "0.54610234", "0.5453896", "0.5446815", "0.5444246", "0.5443106", "0.5409229", "0.5403514", "0.5401879", "0.53951645", "0.5385926", "0.53758204", "0.5330468", "0.5323188...
0.7726568
0
FUNCTION NAME: appleApiRetrieve() PURPOSE: Displays songs/albums based on parameters by appending them as html elements PARAMETERS: None
function appleApiRetrieve(){ $(".musicGrid").empty(); //Remove for refresh purposes var searchNumber = $(".limit").val(); //Stores the amount of searches desired var searchIndex = $(".genreDropDown").find(":selected").attr("data-index"); //Stores the genre index var searchTypeIndex = $(".searchTy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listAlbums() {\n s3.listObjects({Delimiter: '/'}, function(err, data) {\n if (err) {\n return alert('There was an error listing your albums: ' + err.message);\n } else {\n var albums = data.CommonPrefixes.map(function(commonPrefix) {\n var prefix = commonPrefix.Prefix;\n var...
[ "0.6589137", "0.6570047", "0.6524336", "0.65192556", "0.6356358", "0.62902594", "0.62195665", "0.62012804", "0.61558706", "0.6110241", "0.609224", "0.6084006", "0.60777116", "0.6062933", "0.60614777", "0.59347624", "0.58947587", "0.5893461", "0.58795565", "0.585791", "0.58509...
0.66270244
0
function: setMatrixUniforms inputs: none outputs: none Function to initialize mvMatrix
function setMatrixUniforms() { gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMatrixUniforms() {\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\n gl.uniformMatrix4fv(shaderProgram.pMatrixUniform, false, pMatrix);\n}", "function setMatrixUniforms() {\r\n gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mvMatrix);\r\n gl.uniformMatrix...
[ "0.843347", "0.84259135", "0.8414192", "0.8393475", "0.8376076", "0.83643764", "0.82450634", "0.8137607", "0.8137607", "0.8134143", "0.8127249", "0.811699", "0.811699", "0.811699", "0.80526876", "0.792903", "0.75711834", "0.75039965", "0.72657657", "0.7233569", "0.71638334", ...
0.86468637
0
function: loadShaderFromDOM() input: id element identifer to indicate script for shader outputs: initialized shader description: load shader information
function loadShaderFromDOM(id) { var shaderScript = document.getElementById(id); // If we don't find an element with the specified id // we do an early exit if (!shaderScript) { return null; } // Loop through the children for the found DOM element and // build up the shader source code as a str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadShaderFromDOM(id) {\r\n var shaderScript = document.getElementById(id);\r\n \r\n // If we don't find an element with the specified id\r\n // we do an early exit \r\n if (!shaderScript) {\r\n return null;\r\n }\r\n \r\n // Loop through the children for the found DOM element and\r\n // build...
[ "0.8592685", "0.8592685", "0.856407", "0.76341903", "0.74294186", "0.74294186", "0.7232671", "0.7230439", "0.71939164", "0.7139937", "0.71206665", "0.70556647", "0.7055186", "0.70298094", "0.70261264", "0.7019135", "0.7011484", "0.7011484", "0.6901209", "0.6875764", "0.687155...
0.86247563
1
function: animate() inputs: none outputs: none description: function to determine values for the vertices to be placed on the screen
function animate() { // get time values to determine if certain animations should be updated var timeNow = new Date().getTime(); var elapsed = timeNow - lastTime; if (lastTime != 0) { // check if we have hit the x boundries and we should bounce the graphic in the opposite x direction if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\r\n const t = clock.getElapsedTime();\r\n\r\n wave.geometry.vertices.map(v => {\r\n const waveX1 = 0.75 * Math.sin(v.x * 2 + t * 3);\r\n const waveX2 = 0.25 * Math.sin(v.x * 3 + t * 2);\r\n const waveY1 = 0.1 * Math.sin(v.y * 3 + t * 0.5);\r\n const multi ...
[ "0.6947383", "0.65341616", "0.6403284", "0.638764", "0.63537186", "0.6337105", "0.63143426", "0.6249218", "0.62373406", "0.6211564", "0.6203452", "0.620062", "0.6162639", "0.6159699", "0.6139938", "0.6104242", "0.61003256", "0.60887367", "0.607922", "0.6049895", "0.60432947",...
0.67956686
1
Function Name: tsToTime() Arguments: ts Purpose: Convert TimeStamp To Date Time.
function tsToTime(ts) { var time = new Date(ts); var tsToTimeObj = { 'year':time.getYear(), 'mon':time.getMonth() + 1, 'day':time.getDate(), 'hour':time.getHours(), 'minu':time.getMinutes(), 'sec':time.getSeconds(), 'mili':time.getMilliseconds() }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timestamp(ts) {\n return moment(ts).format(\"YYYY-MM-DD HH:mm:ss.SSS\");\n}", "function timestampToDate(_ts) {\n var date = new Date(Number(_ts));\n var monthNames = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n ...
[ "0.6715292", "0.6602194", "0.64941674", "0.6425419", "0.61523956", "0.6080981", "0.5996153", "0.59682083", "0.5863522", "0.56806105", "0.56062037", "0.55959105", "0.55572647", "0.55487263", "0.55364054", "0.55201817", "0.5499637", "0.5487409", "0.5481357", "0.5466485", "0.545...
0.7677169
0
Function Name: loadAndDrawTaskTimeline() Arguments: div_id Purpose: Load data and call the draw chart function.
function drawTaskTimeline(div_id){ var data = webData.TimelineData; for(var i in data){ var startTime = tsToTime(parseInt(data[i][2])); var endTime = tsToTime(parseInt(data[i][3])); if (typeof (data[i][2]) == "string"){ data[i][2] = new Date ( startTime.year, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawGantt(data,div_id) {\n for(var i in data){\n tasks.push( new Object({\n startDate: new Date(data[i][2]),\n endDate: new Date(data[i][3]),\n taskName: data[i][0],\n status: data[i][1]\n }) );\n\n taskNames.push( data[i][0] );\n }\n\...
[ "0.663354", "0.57209146", "0.5669862", "0.56430036", "0.56310934", "0.5612529", "0.5532449", "0.54824615", "0.5478405", "0.54726917", "0.5436779", "0.5385613", "0.5339559", "0.5337852", "0.53348285", "0.53243804", "0.5308026", "0.5258752", "0.521264", "0.52085555", "0.5203371...
0.7731733
0
Function Name: drawChartTaskTimeline() Arguments: data, div_id
function drawGantt(data,div_id) { for(var i in data){ tasks.push( new Object({ startDate: new Date(data[i][2]), endDate: new Date(data[i][3]), taskName: data[i][0], status: data[i][1] }) ); taskNames.push( data[i][0] ); } taskNamesFil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawTaskTimeline(div_id){\n var data = webData.TimelineData;\n for(var i in data){\n var startTime = tsToTime(parseInt(data[i][2]));\n var endTime = tsToTime(parseInt(data[i][3]));\n if (typeof (data[i][2]) == \"string\"){\n data[i][2] = new Date (\n st...
[ "0.8181839", "0.63430625", "0.6023595", "0.59036744", "0.5834594", "0.5767286", "0.5736173", "0.5709802", "0.57095075", "0.5659898", "0.56220496", "0.56147", "0.55892795", "0.55874574", "0.5557375", "0.5535027", "0.5525769", "0.5509886", "0.5503982", "0.54988295", "0.54802454...
0.7393295
1
Register all callbacks used by Google Assistant Action executed during creation time.
setCallbacks() { const that = this; // declare assistant canvas action callbacks const callbacks = { onUpdate(data) { that.commands[data.command ? data.command.toUpperCase() : 'DEFAULT'](data); }, }; // called by the Interactive Canvas web app once web app has loaded to // regis...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onCreate(callback) {\n\t\tthis.dispatcher.register('create', callback);\n\t}", "function CallbackConstructorRegistry() {}", "setupCallbacks() {\n\t var key, fn;\n\t var callbacks = {\n\t 'initialize': 'onInitialize',\n\t 'change': 'onChange',\n\t 'item_add': 'onItemAdd',\n\t 'item_rem...
[ "0.64025617", "0.5970303", "0.5873574", "0.58366764", "0.5778926", "0.5762536", "0.56963074", "0.5670182", "0.5666433", "0.5601844", "0.55972886", "0.55769527", "0.5573888", "0.5552691", "0.55245984", "0.5482397", "0.5471664", "0.5464658", "0.5449989", "0.544395", "0.5440043"...
0.60498464
1
Retorna todos os produtos com uma caracteristica pelo tipo da caracteristica
async selectByTipo(req, res) { const { tipo } = req.body const produtos = await Produtos.findAll({ include: [ { association: "caracteristicas", where: { tipo: { [Op.iLike]: `%${tipo}%` } }, attributes: ['tipo'], }, ] }) return res.json({ produtos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decideTipoCartao (conteudo) {\n\t\tvar qtdaChar = conteudo.replace(/<br>/g, \"\").length;\n\t\tvar linhas = conteudo.split(\"<br>\").length;\n\t\tvar palavras = conteudo.replace(/<br>/g, \"\").split(\"\");\n\t\tvar maior = \"\";\n\n\t\tpalavras.forEach(function (palavra) {\n\t\t\tif (palavra.length > maio...
[ "0.63351136", "0.5712412", "0.5694084", "0.56191176", "0.5597238", "0.55738306", "0.55139947", "0.5479369", "0.5455967", "0.5437905", "0.5411112", "0.53784984", "0.535274", "0.5338419", "0.53338915", "0.5310085", "0.52865416", "0.5261818", "0.52521515", "0.52385336", "0.52236...
0.6491954
0
Retorna todos os produtos com uma caracteristica pelo valor da caracteristica
async selectByValor(req, res) { const { valor } = req.body const produtos = await Produtos.findAll({ include: [ { association: "caracteristicas", where: { valor: { [Op.iLike]: `%${valor}%` } }, attributes: ['valor'], }, ] }) return res.json({ pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pesquisar() {\n let valor = document.getElementById(\"pesquisa\").value;\n let produtosCorrespondentes = listaProdutos.filter((produto) => {\n const regex = new RegExp(`^${valor}`, \"gi\");\n if (produto.nome.match(regex) || produto.codigo.match(regex)) {\n return true;\n }\n });\n if (p...
[ "0.6132453", "0.5791237", "0.56576115", "0.5629736", "0.5609019", "0.55915153", "0.5574279", "0.55578965", "0.5552714", "0.5528972", "0.551018", "0.55029386", "0.5476507", "0.54760516", "0.5410934", "0.53835547", "0.53550917", "0.53533155", "0.5352246", "0.5268445", "0.526410...
0.6035735
1
Retorna todos os produtos com uma caracteristica pelo id da caracteristica
async selectById(req, res) { const { id } = req.params const produtos = await Produtos.findAll({ include: [ { association: "caracteristicas", where: { id } }, ] }) return res.json({ produtos }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async all_products_cart(id) {\n try {\n return await mysql.get(`SELECT producto.id_producto, producto.nombre_producto, producto.stock, producto.foto, producto.precio, producto.descripcion, producto.id_marca, producto.estado, producto.fecha_creaciom, marcas.nombre, marcas.logo FROM producto INNER ...
[ "0.63035816", "0.6241794", "0.6075183", "0.60222095", "0.60000527", "0.5938769", "0.5908191", "0.58914894", "0.58519095", "0.5775414", "0.571488", "0.5708551", "0.5693542", "0.56832194", "0.5674951", "0.5670113", "0.5625118", "0.56225616", "0.5605111", "0.55509156", "0.552886...
0.66505295
0
quick way to determine whether a css file has been cached locally
function fileIsCached(href) { return window.localStorage && localStorage.font_css_cache && (localStorage.font_css_cache_file === href); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isCached(fileName) {\n return fs__default['default'].existsSync(this.cachedFilename(fileName));\n }", "function checkCss(){\n\tvar cssStyleSheets = ['https://tttproject.github.io/style/ancient.css',\n\t\t\t\t 'https://tttproject.github.io/style/XIXcenturystyle.css',\n\t\t\t\t 'https://tttproje...
[ "0.73859495", "0.70121425", "0.68454576", "0.67283815", "0.6612192", "0.65993536", "0.65993536", "0.6465404", "0.6369273", "0.623759", "0.61800957", "0.6072128", "0.60476434", "0.6011944", "0.60002893", "0.5967812", "0.59646237", "0.59501296", "0.5944778", "0.5932154", "0.591...
0.83183557
0
Deletes an observer from the internal list of observers.
deleteObserver(observer) { this._observers = [...this._observers].filter(subscriber => subscriber !== observer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeObserver(observer) {\n if (!this.hasObserver(observer)) {\n return;\n }\n\n const index = this.observers.indexOf(observer);\n this.observers.splice(index, 1);\n }", "removeObserver ( observer ) {\n const removeIndex = this.observers.findIndex( obs => {\n ...
[ "0.80678844", "0.7724623", "0.7568855", "0.7147798", "0.71072274", "0.696634", "0.68850553", "0.68258685", "0.65894544", "0.6248902", "0.61288965", "0.6087053", "0.60646117", "0.6048224", "0.6032474", "0.59766877", "0.5949111", "0.5946479", "0.5930194", "0.59301066", "0.58796...
0.8326758
0
Deletes all observers from the internal list of observers.
deleteObservers() { this._observers = new Set(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n\t\tfor ( const observer of this._observers.values() ) {\n\t\t\tobserver.destroy();\n\t\t}\n\n\t\tthis.stopListening();\n\t}", "deleteObserver(observer) {\n this._observers = [...this._observers].filter(subscriber => subscriber !== observer);\n }", "stopObservers() {\n eac...
[ "0.72972864", "0.70841044", "0.692571", "0.6858323", "0.6824395", "0.6718529", "0.659786", "0.65284884", "0.65284884", "0.6507161", "0.6448749", "0.64051247", "0.6401369", "0.63705534", "0.6354055", "0.63375354", "0.6281017", "0.6248903", "0.62364554", "0.6234052", "0.6228589...
0.81791115
0
============ Magic Sword ================= Magic swords provide a bonus and 1 extra die on attacks
function isHasMagicSword(sheetId) { return isCharacterHasAbility(sheetId, "Magic Sword"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attack () { // this is the method describing how character attack\n const bestStat = Math.max(this.str, this.int); // Determinate best offensive statistic between strength agility and intelligence\n return Math.floor((1 + Math.random()) * (bestStat / 3)); // deal damage between half and full of the stats\n ...
[ "0.6454681", "0.6170748", "0.6169153", "0.61496574", "0.6099491", "0.6087678", "0.60869133", "0.60378647", "0.59998417", "0.5991288", "0.5986099", "0.5933567", "0.5903128", "0.5866483", "0.5827086", "0.5821406", "0.57931846", "0.5791535", "0.5767915", "0.574709", "0.57250124"...
0.64647377
0
============ Nonmagic Melee Immunity ================= Can only be hit by magic swords
function isHasMeleeImmunity(chatTarget, attackSheetId, defendSheetId, defendName) { if (isCharacterHasAbility(defendSheetId, "Normal Attack Immunity") && !isHasMagicSword(attackSheetId)) { sendChat(chatTarget, css.warning + defendName + " is immune to nonmagical attacks!"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function microMissles() {\n targetObj.health -= 5 + addMods();\n targetObj.hits++\n checkHealth(targetObj.health)\n update();\n}", "function punch() {\n target.health -= 5 + addMods();\n target.hits++;\n update();\n}", "function attackMagic() {\r\n setLockedInput(true);\r\n var playerMagicAttack = Mat...
[ "0.7046358", "0.6339982", "0.63141596", "0.630747", "0.63017726", "0.6272402", "0.6228002", "0.6214144", "0.6210187", "0.6197306", "0.6169884", "0.6159094", "0.6143619", "0.61343485", "0.61264807", "0.6125339", "0.6098974", "0.6086763", "0.6082124", "0.6078508", "0.60784924",...
0.6750603
1
============ Magic Armor ================= Provides a bonus to the target number when attacked
function getMagicArmorBonus(chatTarget, defendSheetId, defendName) { if (isCharacterHasAbility(defendSheetId, "Magic Armor")) { sendChat(chatTarget, css.magicItem + defendName + " is protected by magic armor!"); return parseInt(getAttribute(defendSheetId, "Magic Armor")); } retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function punch() {\n target.health -= 5 + addMods();\n target.hits++;\n update();\n}", "function attack(uint _zombieId, uint _targetId) external ownerOf(_zombieId) {\n Zombie storage myzombie = zombies[_zombieId];\n Zombie storage enemyZombie = zombies[_targetId];\n uint rand = randMod(100);\n if (ran...
[ "0.69037235", "0.6726995", "0.6386452", "0.6385529", "0.6315172", "0.63143677", "0.6296958", "0.6257051", "0.6220139", "0.61723894", "0.61642617", "0.61410093", "0.6133526", "0.61219233", "0.6107261", "0.61069226", "0.60922265", "0.6060214", "0.6015535", "0.6008736", "0.59938...
0.7005444
0
input player object,target elem, and new elem type
function appendPlayer(obj, target, elem) { const html = document.createElement(elem); const text = `${obj.name}, ${obj.email}, Owes: ${obj.amountDue}`; html.textContent = text; target.append(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeTarget(target) {\n this.targetElem = target\n }", "function movePlayer(e){\n\te.target.appendChild(playerPiece)\n}", "function change(elementid, player) {\n trackxo[elementid] = player;\n document.getElementById(elementid).innerHTML = player;\n let gameWon = checkWin(trackxo, player);\n if ...
[ "0.60556835", "0.5774257", "0.5649702", "0.5605369", "0.5560052", "0.5530783", "0.55011415", "0.54620165", "0.5430627", "0.54279786", "0.54145294", "0.5401855", "0.5397547", "0.53910315", "0.53643334", "0.53643334", "0.53406006", "0.533586", "0.5321771", "0.5308911", "0.53028...
0.6065477
0
Stub the build method to ensure that it fails within the test context
function build() { throw Error('A build should not have been triggered!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "build() {\n\t\tthrow Error('\"build\" method must be implemented');\n\t}", "build(func, stage, region) {\n return BbPromise.reject(new SError(`Runtime \"${this.getName()}\" should implement \"build()\" method`));\n }", "static build(testCase) {\n return new TestCaseBuilder(testCase)\n ...
[ "0.6541411", "0.58477217", "0.5711428", "0.5577169", "0.5577169", "0.54298717", "0.5363912", "0.53405786", "0.52390605", "0.502126", "0.5001677", "0.489827", "0.48705646", "0.4808344", "0.480201", "0.4785597", "0.47845897", "0.4779438", "0.47702673", "0.47439292", "0.47380975...
0.67971927
0
Function verifies if all of the cell are reviewed.
checkIfAllReviewed() { return (this.flags.length + this.reveiledNum) === this.map.length * this.map[0].length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDone() {\n \"use strict\";\n var singles = $(cells).filter(\".singleton\"),\n i;\n if (singles.length < 81) {\n return false;\n }\n for (i = 1; i < 10; i++) {\n if (duplicates(rows[i])) {\n return false;\n }\n if (duplicates(cols[i])) {\n ...
[ "0.64197177", "0.6261273", "0.6226513", "0.6222801", "0.62205607", "0.6193089", "0.61550206", "0.61491275", "0.60922956", "0.6092178", "0.60720694", "0.6015545", "0.6013338", "0.6006585", "0.59979373", "0.5978911", "0.5942979", "0.58391047", "0.58351606", "0.58267266", "0.582...
0.7409778
0
Remplace les occurences de search par repl dans str
function replaceAll(str, search, repl) { while (str.indexOf(search) != -1) str = str.replace(search, repl); return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceAll(find, replace, str) {\n return str.replace(new RegExp(find, 'g'), replace);\n }", "function replaceAll(str, find, replace) {\n\t\t\t\t\t\t\t\twhile (str.indexOf(find) > -1) {\n\t\t\t\t\t\t\t\t\tstr = str.replace(find, replace);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn str;\n\t\t\t\t...
[ "0.6399558", "0.63990164", "0.63990164", "0.63661885", "0.6202271", "0.6180168", "0.6180168", "0.61325186", "0.61194575", "0.61194575", "0.6100717", "0.6073527", "0.60608745", "0.6032969", "0.60255986", "0.59975344", "0.59968764", "0.59817326", "0.59723896", "0.5956682", "0.5...
0.70800084
0
Run the Bands In Town API
function bandsInTownAPI() { inquirer.prompt([ { type: "input", name: "name", message: "What's the band name?" } ]).then(function (band) { sendBandInTownAPI(band.name) }) .catch(function (error) { console.log("error:", error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bandsInTownAPI() {\n let artist = process.argv.splice(3, process.argv.length - 1).join(\" \");\n var queryUrl = \"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=codingbootcamp\";\n\n request(queryUrl, (err, response, body) => {\n if (artist === \"\" || err) {\n ...
[ "0.6932832", "0.5924187", "0.58369887", "0.5803534", "0.5789202", "0.57085997", "0.56560826", "0.55930525", "0.557085", "0.5547729", "0.5543207", "0.55359805", "0.55180854", "0.54325", "0.5421205", "0.54136074", "0.53686154", "0.53663766", "0.53492415", "0.53355753", "0.52745...
0.65486825
1
Write previous selections to the random.txt file
function writeToRandomFile(selected) { fs.writeFile("random.txt", selected, function (err) { if (err) { return console.log(err); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveChoice() {\n fs.appendFile(\"log.txt\", saveThis + \"\\n\", function (err) {\n if (err) {\n console.log(err);\n }\n else {\n // console.log(\"Content Added!\");\n }\n });\n}", "function randomSelection() {\n\t\tfs.readFile(\"random.txt\", \"utf...
[ "0.6536418", "0.6460789", "0.59783876", "0.5777794", "0.57373273", "0.5733218", "0.5726031", "0.5664947", "0.5593649", "0.55913514", "0.55517346", "0.54831845", "0.5480825", "0.5467723", "0.5408385", "0.540728", "0.5370721", "0.5345628", "0.5316353", "0.53088593", "0.5305393"...
0.78894395
0
sets new hash in session storage and then redirects to that page
function incrementFlow() { setHash(getNextHash()); redirect(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redirect(id) {\n sessionStorage.setItem(\"id\", id);\n this.f();\n }", "function went4(){\n window.location.assign(\"taxdedc.html\");\n sessionStorage.totexem = 0 ;\n}", "function set_cart_hash( cart_hash ) {\r\n if ( $supports_html5_storage ) {\r\n localStorage.setItem( ...
[ "0.6629989", "0.65652585", "0.656399", "0.6394631", "0.6383158", "0.63421065", "0.63329726", "0.62547624", "0.61923635", "0.6154587", "0.6154335", "0.61502564", "0.6024011", "0.6016562", "0.6010682", "0.59945387", "0.5955198", "0.59537596", "0.5942266", "0.5925467", "0.592027...
0.6767902
0
put in hash, get page path from flow object
function getPathFromHash(hash) { for (var i in flowObject) { if (flowObject[i].hash == hash) { return flowObject[i].page } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getH() {return window.location.hash; }", "readHashProps(){\n return _.pick(this.parseParms(window.location.href.split('?')[1]),['skip','take','page']);\n }", "function Utils_GetPagePath() {\n\treturn $(location).attr('pathname');\n}", "function getHash(where)\n{\n\tvar current = window.loc...
[ "0.59110886", "0.56332195", "0.5628884", "0.56124514", "0.55719966", "0.551772", "0.5516166", "0.5498782", "0.5498782", "0.54965967", "0.54927456", "0.5479338", "0.5471351", "0.54337096", "0.5424287", "0.53986984", "0.53986984", "0.53927857", "0.5389266", "0.53620696", "0.534...
0.76628846
0
Define a function that will listen for messages on the queue for number of seconds
function listenForMessages(seconds) { console.log('Doorbell Listener Started for timeout: ' + seconds); // Long poll the service bus for seconds sb.receiveQueueMessage(queue, { timeoutIntervalInS: seconds }, function(err, data) { if(err){ // This path will get hit if we didn't get an...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timerSecondsHandler(seconds)\n{\n mainSocket.sockets.emit('countDown', seconds);\n}", "QUEUE_TIMER(state, clientNum) {\n const index = state.clients.findIndex(c => c.number === clientNum);\n const client = state.clients[index];\n\n let timer = () => {\n const timeData = dateMeth...
[ "0.6445623", "0.60182995", "0.589796", "0.58839077", "0.5734594", "0.56599116", "0.5651677", "0.56386554", "0.5633704", "0.5632427", "0.5632427", "0.5622041", "0.5610912", "0.557269", "0.55459124", "0.55237895", "0.5506024", "0.54818135", "0.54766023", "0.5465997", "0.5463889...
0.6887635
0
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file e...
function FloorPlanView(map) { var visibleFloorPlans = {}; var that = this; function asLatLng(coords) { return [coords[1], coords[0]]; } function buildImageOverlay(floorPlan) { return L.imageOverlay.rotated(floorPlan.url, asLatLng(floorPlan.topLeft), asLatLng(floorPlan.topRight), as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storm_track_visable(onOff){\n if (onOff){\n mymap.addLayer(sat_marker);\n mymap.addLayer(marker);\n mymap.addLayer(polyline);\n }else{\n mymap.removeLayer(sat_marker);\n mymap.removeLayer(marker);\n mymap.removeLayer(polyline);\n }\n}", "function showOv...
[ "0.60049605", "0.5956502", "0.5956502", "0.590703", "0.590302", "0.5882822", "0.5830068", "0.58035254", "0.57968295", "0.5776277", "0.57726204", "0.57716924", "0.57117254", "0.57111967", "0.56696683", "0.5667073", "0.566185", "0.5659527", "0.5655453", "0.5637835", "0.56237525...
0.7102394
0
find crosspoint with horizontal line
function crosspoint_horizontal(start, dir, y) { DEBUG && nhiro.assert(dir.y != 0, 'dir.y == 0. no crosspoint.'); var igrad = dir.x / dir.y; var new_x = start.x + (y - start.y) * igrad; return nhiro.V2.make(new_x, y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "intersection ( line ) {\n //console.log('horizontal intersection', this, line);\n if ( line.a.y > this.y && line.b.y > this.y ) return null; // Above\n if ( line.a.y < this.y && line.b.y < this.y ) return null; // Below\n\n const cx = line.fx(this.y);\n if ( cx < this.a ) return null; // Left\n i...
[ "0.7279687", "0.67430645", "0.6713725", "0.6650618", "0.6529452", "0.6367318", "0.634261", "0.6233417", "0.62034625", "0.60412544", "0.6030109", "0.60144395", "0.5958685", "0.59310204", "0.5916382", "0.59134245", "0.5901352", "0.58940065", "0.58871365", "0.585855", "0.5851849...
0.70820284
1
find crosspoint with vertical line
function crosspoint_vertical(start, dir, x) { DEBUG && nhiro.assert(dir.x != 0, 'dir.x == 0. no crosspoint.'); var grad = dir.y / dir.x; var new_y = start.y + (x - start.x) * grad; return nhiro.V2.make(x, new_y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLineCross(x11, y11, x12, y12, x21, y21, x22, y22, w, h){\n var l1 = lineEq(x11, y11, x12, y12),\n l2 = lineEq(x21, y21, x22, y22);\n // console.log(\"l1, l2\",l1,l2);\n // if(l1[0] == 'vertical'){\n\n // }else{\n\n // }\n var interX = calculateX(l1, l2); //calculate the inter...
[ "0.6623894", "0.66190416", "0.65742683", "0.62953466", "0.6199789", "0.6170662", "0.61324483", "0.6111479", "0.6056452", "0.6043707", "0.5991565", "0.5965369", "0.5949385", "0.59401214", "0.5933686", "0.5882633", "0.58598304", "0.5840663", "0.5834192", "0.58225685", "0.581340...
0.712789
0
find crosspoint with rect, means the nearest crosspoint with horizontal and vertical lines
function crosspoint_rect(start, dir, rect) { nhiro.assert(rect.w > 0); nhiro.assert(rect.h > 0); // find four crosspoint var top = crosspoint_horizontal(start, dir, rect.y); var bottom = crosspoint_horizontal(start, dir, rect.y + rect.h); var left = crosspoint_vertical(st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLineCross(x11, y11, x12, y12, x21, y21, x22, y22, w, h){\n var l1 = lineEq(x11, y11, x12, y12),\n l2 = lineEq(x21, y21, x22, y22);\n // console.log(\"l1, l2\",l1,l2);\n // if(l1[0] == 'vertical'){\n\n // }else{\n\n // }\n var interX = calculateX(l1, l2); //calculate the inter...
[ "0.64485604", "0.6319692", "0.62941223", "0.62868536", "0.6283635", "0.62542844", "0.6219695", "0.61704445", "0.606403", "0.6060026", "0.60493076", "0.6016741", "0.6014444", "0.598536", "0.5976604", "0.59665656", "0.595672", "0.59313387", "0.5918098", "0.5868542", "0.58617145...
0.76319486
0
warning when destroying barrels full of liquid
function startDestroyBlock(x, y, z, side){ var block = Level.getTile(x, y, z); if(block == 200 || block == 201 || block == 204) ModPE.showTipMessage("Make sure you empty the barrel first \n or the liquid will be lost!"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "die() {\n this.BB = new BoundingBox(0,0,0,0);\n this.velocity.x = 0\n this.dead = true;\n }", "function removeItems() {\n let itemRemoved = targetObj.inventory.pop();\n if (targetObj.damage_boost > 0 || targetObj.damage_boost < 0) {\n targetObj.damage_boost -= itemRemoved.modifier;\n...
[ "0.6306291", "0.5829246", "0.57789016", "0.5638264", "0.561631", "0.5610675", "0.56077445", "0.5595048", "0.55919063", "0.5577963", "0.55770916", "0.557218", "0.5556852", "0.5541308", "0.5538971", "0.5528346", "0.55277187", "0.5507868", "0.54958045", "0.54878354", "0.54812676...
0.6206236
1
displaying date and time
function displayDateandTime() { var currentDate = new Date(), day = currentDate.getDate(), month = "0" + (currentDate.getMonth() + 1), year = currentDate.getFullYear(), hours = currentDate.getHours(), minutes = currentDate.getMinutes(); if (hours < 10) { hours = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaytime() {\n time = new Date();\n document.getElementById('time').innerHTML = time;\n }", "function displaytime() {\n var date = new Date();\n var date_hour = date.getHours();\n var date_minute = date.getMinutes();\n var date_seconds = date.g...
[ "0.7740913", "0.76731145", "0.76222", "0.76009864", "0.75922143", "0.7573744", "0.7497481", "0.7497255", "0.7478225", "0.7466755", "0.7466755", "0.7465878", "0.74250656", "0.7414627", "0.7393617", "0.7382792", "0.73692936", "0.73585516", "0.7354876", "0.7336982", "0.7336092",...
0.7775971
0