Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Remove class with compatibility for SVG since classList is not supported on SVG elements in IE
function removeClass(el, cls) { /* istanbul ignore if */ if (!cls || !(cls = cls.trim())) { return; } /* istanbul ignore else */ if (el.classList) { if (cls.indexOf(' ') > -1) { cls.split(/\s+/).forEach(function (c) { return el.classList.remove(c); }); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hackSVG() {\n\tif (SVGElement && SVGElement.prototype) {\n\n\t\tSVGElement.prototype.hasClass = function(className) {\n\t\t\treturn new RegExp('(\\\\s|^)' + className + '(\\\\s|$)').test(this\n\t\t\t\t\t.getAttribute('class'));\n\t\t};\n\n\t\tSVGElement.prototype.addClass = function(className) {\n\t\t\tif...
[ "0.78191614", "0.7007154", "0.6695475", "0.66890395", "0.66020536", "0.65034467", "0.649159", "0.6461104", "0.6440373", "0.6440336", "0.6415478", "0.63980174", "0.63980174", "0.63980174", "0.63980174", "0.63980174", "0.6375955", "0.63752407", "0.63540304", "0.63540304", "0.63...
0.0
-1
only used in dev mode
function checkDuration(val, name, vnode) { if (typeof val !== 'number') { warn("<transition> explicit " + name + " duration is not a valid number - " + "got " + JSON.stringify(val) + ".", vnode.context); } else if (isNaN(val)) { warn("<transition> explicit " + name + " duration is NaN - " + 'the dur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDevMode(){_runModeLocked=true;return _devMode;}", "function isDevMode(){_runModeLocked=true;return _devMode}", "function devDebug(){\n\n}", "function initDevMode() {\n if(!document.getElementById(\"devModeCheckbox\").checked) {\n // If not in dev mode, hide the devModeContainer.\n document....
[ "0.689489", "0.6842149", "0.6738177", "0.64978427", "0.6495801", "0.64551413", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.6330048", "0.63274556", ...
0.0
-1
Normalize a transition hook's argument length. The hook may be: a merged hook (invoker) with the original in .fns a wrapped component method (check ._length) a plain function (.length)
function getHookArgumentsLength(fn) { if (isUndef(fn)) { return false; } var invokerFns = fn.fns; if (isDef(invokerFns)) { // invoker return getHookArgumentsLength(Array.isArray(invokerFns) ? invokerFns[0] : invokerFns); } else { return (fn._length || fn.length) > 1; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHookArgumentsLength(fn){if(isUndef(fn)){return false;}var invokerFns=fn.fns;if(isDef(invokerFns)){// invoker\nreturn getHookArgumentsLength(Array.isArray(invokerFns)?invokerFns[0]:invokerFns);}else{return(fn._length||fn.length)>1;}}", "function getHookArgumentsLength(fn){if(isUndef(fn)){return false;...
[ "0.62618375", "0.62618375", "0.59820837", "0.5928923", "0.5928923", "0.5928923", "0.5928923", "0.58920735", "0.58920735", "0.58659106", "0.58659106", "0.58558553", "0.58558553", "0.5846772", "0.583989", "0.5837602", "0.5837602", "0.5837602", "0.5837602", "0.5837602", "0.58376...
0.5888032
9
recursively search for possible transition defined inside the component root
function locateNode(vnode) { return vnode.componentInstance && (!vnode.data || !vnode.data.transition) ? locateNode(vnode.componentInstance._vnode) : vnode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateTransition(transition) {\n // Start in true state so adding transition can make to uncraftable\n const depth = new Depth({value: 0, craftable: true});\n depth.addTransition(transition);\n transition.depth = depth;\n\n if (transition.newActor) {\n this.setObjectDepth(transition.newActor...
[ "0.55757385", "0.5497444", "0.54544854", "0.5381369", "0.5290448", "0.527318", "0.5269538", "0.526022", "0.5095887", "0.5027769", "0.5004154", "0.5001877", "0.49790743", "0.49790743", "0.4972675", "0.4972675", "0.4972675", "0.4972675", "0.49646884", "0.49556395", "0.49484763"...
0.49299294
22
in case the child is also an abstract component, e.g. we want to recursively retrieve the real component to be rendered
function getRealChild(vnode) { var compOptions = vnode && vnode.componentOptions; if (compOptions && compOptions.Ctor.options.abstract) { return getRealChild(getFirstComponentChild(compOptions.children)); } else { return vnode; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRealChild(vnode){var compOptions=vnode&&vnode.componentOptions;if(compOptions&&compOptions.Ctor.options.abstract){return getRealChild(getFirstComponentChild(compOptions.children));}else{return vnode;}}", "function getRealChild(vnode){var compOptions=vnode&&vnode.componentOptions;if(compOptions&&compO...
[ "0.77155274", "0.77155274", "0.77155274", "0.74058825", "0.74058825", "0.74058825", "0.74058825", "0.7385631", "0.7341109", "0.73057556", "0.73011476", "0.72863895", "0.72863895", "0.72863895", "0.72863895", "0.72863895", "0.72863895", "0.72863895", "0.72863895", "0.72687095", ...
0.7312265
9
Convert HTML string to AST.
function parse(template, options) { warn$2 = options.warn || baseWarn; platformIsPreTag = options.isPreTag || no; platformMustUseProp = options.mustUseProp || no; platformGetTagNamespace = options.getTagNamespace || no; transforms = pluckModuleFunction(options.modules, 'transformNode'); preTra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseHtmlToJS(string) {\n if (typeof string !== 'string') return JSON.stringify('')\n const result = []\n const doc = parser\n .parseFromString(string, 'text/html')\n .getElementsByTagName('body')[0]\n const evs = doc.getElementsByTagName('eval')\n let docstring = doc.innerHTML\n for (const ev...
[ "0.66462386", "0.6481843", "0.63228405", "0.58751845", "0.5842588", "0.58259124", "0.5805921", "0.57757133", "0.5763632", "0.5757537", "0.5639053", "0.56308234", "0.5621697", "0.5586912", "0.5540693", "0.5512361", "0.55060846", "0.55060846", "0.54788935", "0.54763645", "0.547...
0.0
-1
for script (e.g. type="x/template") or style, do not decode content
function isTextTag(el) { return el.tag === 'script' || el.tag === 'style'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decodeNoscript(text) {\n text = text.replace(/&(amp;)*lt;/g, \"<\");\n text = text.replace(/&(amp;)*gt;/g, \">\");\n return text;\n }", "function decodeNoscript(text) {\n text = text.replace(/&(amp;)*lt;/g, \"<\");\n text = text.replace(/&(amp;)*gt;/g, \">\");\n ...
[ "0.60237193", "0.60237193", "0.60237193", "0.58653784", "0.58653784", "0.58653784", "0.5768732", "0.57102084", "0.5695103", "0.5680149", "0.5654979", "0.5647032", "0.5622369", "0.5615911", "0.55983204", "0.55952823", "0.5590286", "0.5524241", "0.5524241", "0.55132294", "0.542...
0.0
-1
Expand input[vmodel] with dyanmic type bindings into vifelse chains Turn this: into this:
function preTransformNode(el, options) { if (el.tag === 'input') { var map = el.attrsMap; if (map['v-model'] && (map['v-bind:type'] || map[':type'])) { var typeBinding = getBindingAttr(el, 'type'); var ifCondition = getAndRemoveAttr(el, 'v-if', true); var ifConditionExtra = ifCon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "build(model) {\n\t\t// set bindable data\n\t\tthis.priority = 1;\n\t\tthis.resolver = RaziloBindCoreDetector.resolver(this.resolvable, this.node);\n\t\tthis.alterer = RaziloBindCoreDetector.resolver(this.alterable, this.node);\n\t\tthis.config = RaziloBindCoreDetector.resolver(this.configurable, this.node);\n\t\tt...
[ "0.5099135", "0.50751156", "0.5050662", "0.49777082", "0.49444857", "0.47863242", "0.4748242", "0.47311747", "0.47311747", "0.46976653", "0.46858987", "0.46858987", "0.46175727", "0.4611006", "0.4602934", "0.4564084", "0.4540552", "0.45345384", "0.4525263", "0.45231798", "0.4...
0.4396166
55
Goal of the optimizer: walk the generated template AST tree and detect subtrees that are purely static, i.e. parts of the DOM that never needs to change. Once we detect these subtrees, we can: 1. Hoist them into constants, so that we no longer need to create fresh nodes for them on each rerender; 2. Completely skip the...
function optimize(root, options) { if (!root) { return; } isStaticKey = genStaticKeysCached(options.staticKeys || ''); isPlatformReservedTag = options.isReservedTag || no; // first pass: mark all non-static nodes. markStatic$1(root); // second pass: mark static roots. markStaticRoo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderStatic(index, isInFor) {\n var cached = this._staticTrees || (this._staticTrees = []);\n var tree = cached[index];\n // if has already-rendered static tree and not inside v-for,\n // we can reuse the same tree by doing a shallow clone.\n if (tree && !isInFor) {\n return Array.isArray(tree) ?...
[ "0.5880571", "0.5880571", "0.5880571", "0.58350605", "0.58350605", "0.5824642", "0.57727903", "0.5771187", "0.5771187", "0.5753321", "0.5727817", "0.5724282", "0.5724282", "0.57216436", "0.57216436", "0.57216436", "0.57216436", "0.57141685", "0.57141685", "0.5708121", "0.5705...
0.0
-1
hoist static subtrees out
function genStatic(el, state, once$$1) { el.staticProcessed = true; state.staticRenderFns.push("with(this){return " + genElement(el, state) + "}"); return "_m(" + (state.staticRenderFns.length - 1) + "," + (el.staticInFor ? 'true' : 'false') + "," + (once$$1 ? 'true' : 'false') + ")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optimize(root,options){if(!root){return;}isStaticKey=genStaticKeysCached(options.staticKeys||'');isPlatformReservedTag=options.isReservedTag||no;// first pass: mark all non-static nodes.\nmarkStatic$1(root);// second pass: mark static roots.\nmarkStaticRoots(root,false);}", "function optimize(root,optio...
[ "0.5784333", "0.5784333", "0.56438416", "0.55312425", "0.55312425", "0.55312425", "0.54948413", "0.54948413", "0.54948413", "0.54948413", "0.5491165", "0.5486301", "0.54835135", "0.5478289", "0.5478289", "0.5478289", "0.5478289", "0.5478289", "0.54740214", "0.54398996", "0.54...
0.0
-1
vif with vonce should generate code like (a)?_m(0):_m(1)
function genTernaryExp(el) { return altGen ? altGen(el, state) : el.once ? genOnce(el, state) : genElement(el, state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "vi() {\n const out = this.vu();\n return (0 - (out & 1)) ^ (out >>> 1);\n }", "function Vh(a){var b=Wh;this.g=[];this.v=b;this.o=a||null;this.f=this.a=!1;this.c=void 0;this.u=this.w=this.i=!1;this.h=0;this.b=null;this.l=0}", "function Vf(a,b,c){Vf.s.constructor.call(this,a);this.ab=a.ab||Wf;th...
[ "0.57794267", "0.55322886", "0.5521897", "0.5409776", "0.5397564", "0.53930104", "0.5341749", "0.53211844", "0.5273872", "0.5271735", "0.5263714", "0.52606046", "0.5238811", "0.52317727", "0.52162987", "0.5207593", "0.5188944", "0.51770085", "0.51719", "0.51712734", "0.516058...
0.0
-1
determine the normalization needed for the children array. 0: no normalization needed 1: simple normalization needed (possible 1level deep nested array) 2: full normalization needed
function getNormalizationType(children, maybeComponent) { var res = 0; for (var i = 0; i < children.length; i++) { var el = children[i]; if (el.type !== 1) { continue; } if (needsNormalization(el) || el.ifConditions && el.ifConditions.some(function (c) { return needsNorma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function simpleNormalizeChildren(children){for(var i=0;i<children.length;i++){if(Array.isArray(children[i])){return Array.prototype.concat.apply([],children);}}return children;}// 2. When the children contains constrcuts that always generated nested Arrays,", "function simpleNormalizeChildren(children){for(var i...
[ "0.75406235", "0.7253295", "0.7253295", "0.6909584", "0.6862198", "0.6862198", "0.6862198", "0.6862198", "0.6862198", "0.66843516", "0.66843516", "0.66843516", "0.66843516", "0.66843516", "0.66843516", "0.66714686", "0.6647351", "0.66444445", "0.66444445", "0.66444445", "0.66...
0.0
-1
componentName is el.component, take it as argument to shun flow's pessimistic refinement
function genComponent(componentName, el, state) { var children = el.inlineTemplate ? null : genChildren(el, state, true); return "_c(" + componentName + "," + genData$2(el, state) + (children ? "," + children : '') + ")"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getComponent(name){\n\t\t\tfor (var i = 0; i < this[componentSymbol].length; i++) {\n\t\t\t\tif (this[componentSymbol][i].name === name){\n\t\t\t\t\treturn this[componentSymbol][i].component;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function genComponent(componentName, el, state) {\n var children = el.inlineTemplate ?...
[ "0.6479158", "0.6433516", "0.63995856", "0.63995856", "0.63792795", "0.63792795", "0.63792795", "0.63792795", "0.6290175", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133", "0.6239133...
0.6397383
4
detect problematic expressions in a template
function detectErrors(ast) { var errors = []; if (ast) { checkNode(ast, errors); } return errors; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTemplateExpression(node) {\n return node.kind === ts.SyntaxKind.TemplateExpression;\n}", "function ___R$$priv$project$rome$$internal$compiler$lint$rules$js$useTemplate_ts$shouldReplace(\n\t\texpressions,\n\t) {\n\t\tfor (let expression of expressions) {\n\t\t\tif (expression.type !== \"JSStringLite...
[ "0.58400553", "0.5832372", "0.559061", "0.53850186", "0.5374069", "0.5322277", "0.53214335", "0.53175485", "0.5279441", "0.52775097", "0.5265621", "0.52405685", "0.5231724", "0.52315867", "0.521962", "0.51854753", "0.51843756", "0.5180441", "0.5180441", "0.51465744", "0.51465...
0.0
-1
Get outerHTML of elements, taking care of SVG elements in IE as well.
function getOuterHTML(el) { if (el.outerHTML) { return el.outerHTML; } else { var container = document.createElement('div'); container.appendChild(el.cloneNode(true)); return container.innerHTML; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOuterHTML(el){if(el.outerHTML){return el.outerHTML;}else{var container=document.createElement('div');container.appendChild(el.cloneNode(true));return container.innerHTML;}}", "function getOuterHTML(el){if(el.outerHTML){return el.outerHTML;}else{var container=document.createElement('div');container.ap...
[ "0.7256126", "0.7256126", "0.7256126", "0.6928869", "0.6928869", "0.69242996", "0.69242996", "0.69242996", "0.69242996", "0.69242996", "0.6890712", "0.6890712", "0.6890712", "0.68768483", "0.6850613", "0.6850167", "0.6842378", "0.6811745", "0.6811745", "0.6811745", "0.6811745...
0.6899144
11
For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(...
[ "0.5863474", "0.5705808", "0.568645", "0.55544066", "0.55544066", "0.5446477", "0.5434516", "0.5381192", "0.5356294", "0.53282356", "0.53189546", "0.52043676", "0.51996946", "0.5156968", "0.51501393", "0.51281303", "0.51281303", "0.51281303", "0.5112595", "0.5100047", "0.5090...
0.0
-1
= ===================================== = INITIALIZATION = ======================================
$onInit() { this.templates = null; this.loaders = {}; return this.fetchTemplates() .then((result) => { this.templates = result; }) .catch((err) => this.TucToastError(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "constructor() {\n\t\t// ...\n\t}", "constructor (){}", "consructor() {\n }", "function _construct()\n\t\t{;\n\t\t}", "init () {}", "init () {}", "constructor() {\r\n ...
[ "0.7896136", "0.7896136", "0.7896136", "0.7896136", "0.7896136", "0.7896136", "0.7802553", "0.7794956", "0.7738722", "0.7686684", "0.76829463", "0.76829463", "0.767062", "0.7668082", "0.7666306", "0.7666306", "0.7666306", "0.7666306", "0.7666306", "0.76136285", "0.75894487", ...
0.0
-1
Does damage to character then returns the new value for hp
takeDamage(damage) { this.hp -= damage return this.hp }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decrementHP(dmgToCharacter, character)\n{\nreturn character -= dmgToCharacter;\n}", "TakeDamage(dmg){\n this.currentHealth = this.currentHealth - dmg;\n }", "function reduceHP(character) {\n\tif (character === 'hero') {\n\t\treturn heroHP-=heroModifier;\n\t} else if ( character === 'foe') {\...
[ "0.76166296", "0.7466972", "0.7458885", "0.7324829", "0.72104067", "0.7066451", "0.70236146", "0.7011222", "0.7011222", "0.6994396", "0.6979583", "0.6974655", "0.6964906", "0.69443434", "0.6941289", "0.6887166", "0.6877385", "0.6864992", "0.68610746", "0.6851666", "0.68228835...
0.78169566
0
Method to Encrypt Password
function encrypt(password) { var cryptLib = require('cryptlib'), iv = 'rv6Isv_BpSFBrB2V' //cryptLib.generateRandomIV(16), //16 bytes = 128 bit key = 'b16920894899c7780b5fc7161560a412' //cryptLib.getHashSha256('my secret key', 32), //32 bytes = 256 bi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encrypt(pwd)\n\t\t\t\t{\n\t\t\t\t\tvar pwd;\n\t\t\t\t\tvar encrypt;\n\t\t\t\t\tencrypt = \"\";\n\t\t\t\t\t\n\t\t\t\t\tfor(var i = 0; i < pwd.length-1; i++) //This code encrypts the password of the user so no one can hack into their ac\n\t\t\t\t\t{\n\t\t\t\t\t\tencrypt = encrypt + String.fromCharCode(pwd.c...
[ "0.7608562", "0.74953693", "0.7393032", "0.7230443", "0.712923", "0.712923", "0.6999081", "0.69891256", "0.6962442", "0.69198406", "0.68497705", "0.6823708", "0.67643297", "0.66324896", "0.66305393", "0.6618406", "0.6578186", "0.65763617", "0.6571158", "0.6541713", "0.6536283...
0.6873782
10
Class for handling open and close expandable and slide elements. Use together with cs_local_storage
function CsUiOpen(data){ if(!data){ data = {}; } this.expandables = data;/*** data format should be object[slideshow_id][element_index] ***/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expandableOpen(object) { // 369\n if (object.hasClass('active')) { // 370\n object.parent().addClass('active'); ...
[ "0.614326", "0.5830474", "0.5781463", "0.5665151", "0.5662844", "0.55898976", "0.5502207", "0.5482868", "0.54496497", "0.5426532", "0.5421832", "0.5413876", "0.5404384", "0.5403543", "0.5379306", "0.53777343", "0.53747785", "0.53654206", "0.5348594", "0.5346739", "0.5337396",...
0.6040377
1
Function that runs on the page load
componentDidMount() { // Create the board if no board currently exists if (this.props.puzzle.board.length === 0) this.props.createBoard(this.props.puzzle.dimension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function onPageLoaded() {\n}", "function alwaysRunOnload () {\n\t\n\t}", "function onPageLoad() {\n\n}", "onPageReady () {}", "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageL...
[ "0.74237376", "0.735723", "0.72477394", "0.72013575", "0.7061174", "0.6991936", "0.69910705", "0.690434", "0.6882758", "0.68556803", "0.68392515", "0.6823881", "0.6819658", "0.6797056", "0.6789706", "0.67873514", "0.6771612", "0.6770073", "0.6759901", "0.67587847", "0.6739661...
0.0
-1
Wraps adapter specific errors
static wrapError(msg, cause) { if (msg === 'unknown error' && cause && cause.message === 'transaction finished') { return cause; } const error = new Error(msg); error.cause = cause; return error; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapError( model, options ){\n\t var error = options.error;\n\t options.error = function( resp ){\n\t if( error ) error.call( options.context, model, resp, options );\n\t model.trigger( 'error', model, resp, options );\n\t };\n\t}", "defineCustomErrors() {\n this.restif...
[ "0.66136646", "0.61236686", "0.59341383", "0.5896097", "0.5858321", "0.58058864", "0.58058864", "0.58058864", "0.57519275", "0.5731109", "0.57288855", "0.56788784", "0.5644247", "0.56408226", "0.56148404", "0.55910736", "0.5532864", "0.5522146", "0.5486947", "0.54810244", "0....
0.54069114
24
Get query for creating a table
getCreateTableQuery(model_name) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCreateTableQuery(table) {\n\n curModel = model[table]\n curFields = curModel.fields\n curPrimaryKey = curModel.primaryKey\n curUnique = curModel.unique\n\n fieldsArr = []\n if (curPrimaryKey && curPrimaryKey == \"id\") fieldsArr.push(\"id INT NOT NULL AUTO_INCREMENT\")\n for (field in curFields)...
[ "0.8101686", "0.7571821", "0.74598587", "0.7146089", "0.69769526", "0.6941595", "0.691558", "0.6912032", "0.6907062", "0.6852952", "0.6767971", "0.66333085", "0.66072166", "0.65984625", "0.6566752", "0.6503564", "0.64784795", "0.6437422", "0.6367895", "0.6357904", "0.6335312"...
0.66541916
11
Get query for updating a table description
getUpdateTableDescriptionQuery(model_name) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildQuery() {\n if (!this.where || !this.data || !this.table) {\n const err = \"Bad Request. Required information not provided. Where, Data and Table properties must have values\";\n return err;\n }\n else {\n const updateQuery = `UPDATE ${this.table.database}...
[ "0.59771246", "0.5930727", "0.57898647", "0.5774747", "0.5743972", "0.5704098", "0.57003385", "0.5699431", "0.568168", "0.5603777", "0.5585658", "0.5568356", "0.5555359", "0.5507127", "0.5451554", "0.54462796", "0.5430436", "0.53800756", "0.5326476", "0.52995235", "0.52745247...
0.69137704
0
Update a table description.
async updateTableDescription(model_name, verbose = false) { return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editTableModificarDescuento() {\n var nameTable = \"ModificarDescuento\";\n var nameCols = crearListaColumnas();\n var activaAdd = true;\n var activaDelete = true;\n\n return buildTableTools(nameTable, nameCols, activaAdd, activaDelete);\n}", "dsUpdateTable(table, what) {\n switch ...
[ "0.6157903", "0.60326505", "0.60258347", "0.60035145", "0.57860243", "0.5776807", "0.574254", "0.57284105", "0.5721689", "0.5697286", "0.56662023", "0.56022316", "0.5558121", "0.55307716", "0.5519455", "0.55029863", "0.5464139", "0.54401064", "0.54230255", "0.54185796", "0.54...
0.62417847
0
Get query for adding a column
getAddColumnQuery(model_name, column_property) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCol(){\n\n}", "function addColumnsToQuery(query, rowVar, type) {\n var selectedColumns = type.getColumns();\n\n for (var i=0; i<selectedColumns.length; ++i) {\n var column = selectedColumns[i];\n\n var formula = kb.formula();\n\n formula.add(rowVar,\n ...
[ "0.6493745", "0.62392944", "0.6226198", "0.62225395", "0.61847514", "0.6048433", "0.5951221", "0.5908843", "0.5908495", "0.58875626", "0.5810588", "0.5807078", "0.57857037", "0.57662547", "0.5752022", "0.57479477", "0.5722327", "0.5720753", "0.5705436", "0.5705371", "0.569297...
0.7463335
0
Adds a column to a table
async addColumn(model_name, column_property, verbose = false) { return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addColumn() {\n if (row === 0) {\n let newRow = document.createElement(\"tr\");\n let newcol = document.createElement(\"td\");\n\n newRow.appendChild(newcol);\n table.appendChild(newRow);\n row = 1;\n } else {\n let currentRow = document.getElementsByTagName(\"tr\");\n let rowArray ...
[ "0.7430161", "0.7305142", "0.7240377", "0.7095582", "0.682408", "0.68105805", "0.6753657", "0.67045635", "0.6690123", "0.6643349", "0.6565634", "0.6478857", "0.64348733", "0.63634676", "0.6361521", "0.62762946", "0.62588644", "0.62562495", "0.62526876", "0.62188023", "0.62186...
0.62596864
16
Get query for updating a column description
getUpdateColumnDescriptionQuery(model_name, column_property) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "columnUpdate(field, value) {\n const statement = this.statement();\n statement.cql.push(`${field} = ?`);\n //\n // This should be the correct value returned\n //\n statement.params.push(this.schema.valueOf(field, value));\n }", "async updateColumnDescription(model_name, column_property, verbos...
[ "0.65731996", "0.6359543", "0.6036453", "0.5960504", "0.590713", "0.57185256", "0.55994916", "0.55994916", "0.55994916", "0.5557509", "0.55103546", "0.5493814", "0.5475874", "0.54302436", "0.5387035", "0.53806305", "0.53725815", "0.53461844", "0.5345643", "0.5341792", "0.5323...
0.7383852
0
Update a column description.
async updateColumnDescription(model_name, column_property, verbose = false) { return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeDescription(value){\n setDescription(value)\n }", "dsUpdateTableColumn(column, what) {\n switch (what) {\n case \"add\":\n this.gMap.columns.set(column.column_id, column);\n if (this.gMap.tables.has(column.table_id)) {\n ...
[ "0.6421965", "0.6391226", "0.6231136", "0.6181897", "0.59845823", "0.59795", "0.5897499", "0.5886208", "0.581858", "0.57501113", "0.56957936", "0.5668471", "0.562247", "0.561681", "0.557553", "0.55207527", "0.5516721", "0.5513251", "0.5477464", "0.5476265", "0.5403765", "0....
0.6982498
0
Get query for creating an index
getCreateIndexQuery(model_name, index) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Index(name) {\n function queryMaker(op) {\n return function () {\n return IndexQuery(name, op, arguments);\n };\n }\n return {\n eq: queryMaker(\"eq\"),\n neq: queryMaker(\"neq\"),\n gt: queryMaker(\"gt\"),\n gteq: queryMaker(\"gteq\"),\n lt: queryMaker(\...
[ "0.6902805", "0.6789207", "0.65210104", "0.64744276", "0.63980114", "0.63907725", "0.63819647", "0.6311979", "0.6243917", "0.6233102", "0.6213562", "0.6196668", "0.6187111", "0.6161459", "0.6086919", "0.59787136", "0.5967309", "0.59576064", "0.59320974", "0.58693033", "0.5782...
0.7597038
0
Get query for creating a foreign key
getCreateForeignKeyQuery(model_name, column, type, references) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFK(remote, tableName, mapping) {\n return kv.runT(remote, function(tx) {\n return internalAddFK(tx, tableName, mapping);\n });\n}", "addForeignKeyConstraint(constraintName, columns, targetTable, targetColumns, build = object_utils_js_1.noop) {\n const builder = build(new foreig...
[ "0.61243325", "0.5841556", "0.5689289", "0.5680712", "0.55090785", "0.53777814", "0.5307022", "0.5236207", "0.51817715", "0.51334786", "0.5094587", "0.5085655", "0.50366765", "0.50167507", "0.4988753", "0.49196753", "0.49007922", "0.48671803", "0.4856018", "0.48278275", "0.48...
0.61406493
0
Creates a foreign key.
async createForeignKey(model_name, column, type, references, verbose = false) { return Promise.resolve(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFK(remote, tableName, mapping) {\n return kv.runT(remote, function(tx) {\n return internalAddFK(tx, tableName, mapping);\n });\n}", "addForeignKeyConstraint(constraintName, columns, targetTable, targetColumns, build = object_utils_js_1.noop) {\n const builder = build(new foreig...
[ "0.6793326", "0.63547564", "0.60176075", "0.54422176", "0.53226614", "0.5137899", "0.51262915", "0.50528634", "0.5022981", "0.5007984", "0.48994324", "0.48639846", "0.48510808", "0.48341537", "0.48216003", "0.4795216", "0.4785337", "0.47520658", "0.47057", "0.4696571", "0.466...
0.6363829
1
Deletes all records with ignoring constraint
async deleteAllIgnoringConstraint(model_list) { return Promise.reject(new Error('not implemented')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _deleteAll() {\n\t\ttry {\n\t\t\t//Get the Request Body\n\t\t\tvar oBody = JSON.parse($.request.body.asString());\n\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to delete the entries\n\t\t\tvar oStatement = oConnection.prepareStatement(...
[ "0.6036768", "0.5890488", "0.58244836", "0.580725", "0.5790419", "0.56786513", "0.5650343", "0.5650343", "0.5650343", "0.5613035", "0.5574894", "0.5557327", "0.5543722", "0.5543176", "0.55336756", "0.55199873", "0.5500036", "0.54800034", "0.5435375", "0.5404482", "0.539788", ...
0.69969696
0
Drops a model from the database
async drop(model_name) { return Promise.reject(new Error('not implemented')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async remove() {\n // Call internally stored DB API to remove all models matching self query\n await this._db.remove(this._Model, this);\n }", "remove(modelName) {\n this.models.delete(modelName);\n }", "down () {\n // this.drop('create_orders')\n this.raw(\n `DROP TABLE orders;`\n );\...
[ "0.69867885", "0.6943038", "0.63864994", "0.6301161", "0.6272818", "0.62709665", "0.6069983", "0.6058307", "0.6047821", "0.6041676", "0.60298836", "0.6025901", "0.6011535", "0.60060817", "0.59995073", "0.599354", "0.59547085", "0.5950927", "0.5940716", "0.59273183", "0.592478...
0.6965516
1
Populate global state with the transactions from the API response:
populateTransactions(transactions) { const sortedTransactions = _.sortBy(transactions, [ 'transactionDate', 'id' ]); this.state.transactions = sortedTransactions; store.wasm.populateInWasm(sortedTransactions, this.getCategories()); this.recalculateBalances(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTransactions() {\n transaction.getTransactions()\n .then(res =>{\n console.log(\"TEST\" + res.data);\n setTransactions(res.data)}\n \n )\n .catch(err => console.log(err));\n }", "fetchTransactions(){\n\t\tlet url = new URL(CONFIG.BASE_API_USER_URL + CONFIG.TRAN...
[ "0.6795972", "0.6602208", "0.6525464", "0.62619615", "0.6157423", "0.6022187", "0.58740324", "0.5839196", "0.58344513", "0.58342546", "0.57721895", "0.5740719", "0.5704738", "0.5690752", "0.5627091", "0.560873", "0.5607009", "0.55831313", "0.55624187", "0.5557991", "0.5527006...
0.6293701
3
Update the "balances" object in global state based on the current initial balances:
recalculateBalances() { const { initialRaw, initialCooked } = this.state.balances; const { currentRaw, currentCooked } = this.wasm.getCurrentBalances( initialRaw, initialCooked ); this.state.balances = { initialRaw, currentRaw, initialCooked, currentCooked }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBalance() {\n // Create a new array with just the amounts from the transactions array\n const transactionAmounts = transactions.map( transaction => transaction.amount );\n // Calculate total balance value\n const totalBalance = transactionAmounts.reduce( (acc, amount) => ( acc += amount)...
[ "0.73256093", "0.6995509", "0.6806327", "0.65822697", "0.6578005", "0.65710527", "0.6544583", "0.6527865", "0.65205616", "0.64749414", "0.6437833", "0.64318204", "0.6323233", "0.6297109", "0.6296074", "0.6283527", "0.6266023", "0.62634283", "0.62289697", "0.6178005", "0.61593...
0.76814896
0
Put the CSS in overlay mode so we can apply custom styling to the page which does not bleed through on the application it self.
componentDidMount() { document.documentElement.className = 'overlay'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Overlay_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-vv1x9t-style\";\n\tstyle.textContent = \".overlay{position:absolute;top:0;left:0;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-...
[ "0.7451491", "0.7046119", "0.66945547", "0.63808465", "0.62485534", "0.6223648", "0.6197967", "0.60316175", "0.60127515", "0.59982514", "0.59939873", "0.59864765", "0.5957857", "0.5946308", "0.59299445", "0.5924765", "0.5898428", "0.5885494", "0.58837926", "0.58727086", "0.58...
0.6273829
4
Alow dynamic row adding to the view/edit admin form Form Process Process through the form
function formProcess(e) { e.preventDefault(); var poll = $('input[name=poll]').val(), answer = $('input[name=answer]:checked').val(), spcheck = $('input[name=spcheck]').val(), other = $('.sp-input-other').val(), elem = $(this), div = $(this).parent(), action = $(this).attr('action'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onAdd() {\n\n var tmp = $scope.section.rows[$scope.section.rows.length - 1];\n if (tmp.cols.length > 0) {\n if (tmp.cols[0].fields.length > 0) {\n $scope.section.rows.push(OdsFormService.newRowObject());\n }\n }\n }",...
[ "0.7104269", "0.7015365", "0.690652", "0.67538273", "0.67219603", "0.6598462", "0.640663", "0.63664484", "0.6365862", "0.63621897", "0.63567", "0.63559514", "0.6313567", "0.6175397", "0.6146685", "0.61373496", "0.6136194", "0.6113792", "0.61118567", "0.61112756", "0.61071193"...
0.0
-1
Allow additional answers to be added dynamically
function formAnswerRow_init() { // The form was initialized // Find the last answer in the form lastAnswer = $('#polledit .pollanswers').last().attr('id'); // If the last answer was found // Add the add/remove question buttons if(lastAnswer) { // How many questions do we have currently? var ans...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAnswer() {\n collectAnswer();\n surveyStorage.insert(self.answer);\n resetForm();\n }", "function displayAnswers() {\n let question = STORE.questions[STORE.progress];\n for(let i=0; i < question.answers.length; i++) {\n $('.js-answers').append(`<in...
[ "0.7079907", "0.6679938", "0.66750413", "0.66547763", "0.6595635", "0.6566012", "0.655475", "0.6546928", "0.651021", "0.65067124", "0.6497404", "0.648571", "0.6476448", "0.6469571", "0.6459863", "0.64449066", "0.6428458", "0.6420085", "0.6413359", "0.63979316", "0.6371995", ...
0.0
-1
Update Poll Update the results from our AJAX query
function updatePoll(action, pollID, answer, spcheck, other) { var postData; if (answer > 0) { postData = { action: 'spAjaxSubmit', poll: pollID, answer: answer, spcheck: spcheck }; } else { postData = { action: 'spAjaxSubmit', poll: pollID, answer: answer, spcheck: sp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateVote(result, status) {\n console.log(result);\n $('p.votes').text(result.voted); // update the current display value\n current_popup.find('p.votes').text(result.voted); // update the saved display value\n}", "function update_answer_in_base() {\r\n\thideDialog('sure');...
[ "0.6738941", "0.6588307", "0.6539837", "0.6428663", "0.6363477", "0.63421863", "0.62481844", "0.6247334", "0.6151876", "0.61500823", "0.60899365", "0.60521007", "0.5971688", "0.594378", "0.5937272", "0.592631", "0.5914367", "0.5897143", "0.58680713", "0.5855475", "0.58353204"...
0.6659554
1
Display Results Shows the results when requested
function displayResults(data) { var postData = { action: 'spAjaxResults', pollid: data.pollid }, html = $.ajax({ type: 'POST', async: false, url: spAjax.url, data: postData, dataType: 'html', error: function(e, textStatus, errorThrown) { console.log('An error occ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResults(results){\n\t\n}", "function displayResults(){\n\t\t//Clear the Options section\n\t\t$(\"#options\").empty();\n\n\t\t//Display Text Results in various sections\n\t\t$(\"#questionResponse\").text(\"Here is your tally!\");\n\n\t\t$(\"#options\").append(\"<p>Correct Answers: \" + correctCount +...
[ "0.79730576", "0.79211646", "0.7883751", "0.78431994", "0.7828432", "0.7816448", "0.7693606", "0.7663876", "0.76629734", "0.7611999", "0.753234", "0.7529837", "0.75223345", "0.7500063", "0.74870193", "0.74822974", "0.74167067", "0.73914045", "0.73263013", "0.7307352", "0.7304...
0.69909924
44
creates a single geometry from vertices buffers and edges informations ( and some extra shnizzle too )
function TileBuffer( tile, bufferVertices, bufferEdges, material, bufferHeights, processUvs, bufferUIDs ){ //might be useful ... this.tile = tile; var vertexCount = 0; bufferVertices.forEach( function(pts){ vertexCount += pts.length;}); //vertex pool var vertices = new...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createGeometry()\n {\n this.executeMidpoint();\n\n // Prepare specifics buffers for WebGL\n this.verticesBuffer = getVertexBufferWithVertices(this.vertices);\n this.colorsBuffer = getVertexBufferWithVertices(this.colors);\n this.indicesBuffer = getIndexBufferWithIndices(this.indices);\...
[ "0.75204957", "0.668901", "0.66171706", "0.6596451", "0.6555751", "0.6537228", "0.6518923", "0.6518923", "0.6518923", "0.6518923", "0.6512765", "0.6512765", "0.6512765", "0.6495739", "0.64944303", "0.6434993", "0.6414063", "0.6414063", "0.6414063", "0.6411727", "0.6411727", ...
0.0
-1
! Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT...
function pt(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WSAPI() {\n }", "private internal function m248() {}", "private public function m246() {}", "createObjectContext2() {\n console.log('deprecated')\n return C.extension\n }", "supportsPlatform() {\n return true;\n }", "function T7(){return typeof window>\"u\"&&(self.window=self),functio...
[ "0.57197356", "0.5128727", "0.50351185", "0.4988838", "0.48949832", "0.48705235", "0.48683858", "0.4868201", "0.48559657", "0.48422027", "0.48397198", "0.48397198", "0.48232085", "0.47672296", "0.47201046", "0.47108927", "0.46757865", "0.46757865", "0.46732754", "0.46458015", ...
0.0
-1
Getters & Setters set position()
set position(position) { // update the unit's position if(this._unit !== null) { this._unit.position = { x: position.x + 5, y: position.y + 5 } } this._position = position // update the svg positions this._svg.clickArea ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get position() { return this._position; }", "get position() { return this._position; }", "get position() {\n return this._position;\n }", "get position() {\n\t\t\treturn {x: this.x, y: this.y};\n\t\t}", "get position() {\n return {\n x: this.x,\n y: this.y\n };\n ...
[ "0.82780075", "0.82780075", "0.80046076", "0.7716837", "0.7568273", "0.75501895", "0.7544857", "0.7511875", "0.7479717", "0.74238473", "0.73244554", "0.7317127", "0.7300639", "0.729013", "0.7214949", "0.7212131", "0.7181778", "0.71781254", "0.70835364", "0.7079092", "0.707517...
0.67738414
37
obliczanie PLN > ...
function convertCurrencyToPl() { event.preventDefault(); var amount = $input.val(); // pobieranie wpisanej kwoty var from = $selectFrom.val(); // wybór waluty var results = 0; if (from === "AUD - Australia"){ results = amount * rate[1].ask } else if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function c0_get_from_PGN(c0_PGN_str) { // To get moveslist and header from PGN string...\r\n\tvar save_PGN_text=PGN_text; \r\n\tPGN_text= c0_PGN_str; \r\n\tc0_PG_gettable(2); \r\n\tPGN_text=save_PGN_text; \r\n\treturn c0_PG_1;\r\n}", "genereazaVariabilaBinomialaPrinBern(n, p) {\n\t\t\tlet i = 1;\n\t\t\tlet X = 0...
[ "0.5671335", "0.56026703", "0.5363924", "0.5334246", "0.5324484", "0.523419", "0.5125422", "0.5114311", "0.51062465", "0.5026197", "0.49883983", "0.49881962", "0.4984675", "0.49429935", "0.49296087", "0.4928105", "0.4916781", "0.491215", "0.49019387", "0.48810032", "0.4879708...
0.0
-1
obliczanie ... > PLN
function convertCurrencyFromPl() { event.preventDefault(); var amount = $input.val(); var to = $selectTo.val(); var results = 0; if (to === "AUD - Australia"){ results = amount / rate[1].bid } else if (to === "CAD - Kanada"){ results = amount / r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pos_pianeti(njd,np){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) novembre 2010\n // calcola la posizione dei pianeti \n // njd= numero del giorno giuliano della data in T.U.\n // np= numero identificativo del pianeta 0,1,2,3,4,5,6,7,8 mercurio,venere... 2 per la Terra\n // coordi...
[ "0.6141298", "0.60415524", "0.5845466", "0.5763813", "0.5685065", "0.5610218", "0.5596961", "0.55649096", "0.5511321", "0.546658", "0.54476184", "0.54298663", "0.54051334", "0.53627205", "0.5356225", "0.53172463", "0.5314092", "0.5311289", "0.52713835", "0.5264143", "0.523213...
0.0
-1
dodaje date aktualizacji danych NBP
function addDate() { var $today = $(` <p>* Według średniego kursu NBP z dnia ${day}</p> `); $('.form-text').append($today); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DateUpdater() { }", "function updateDate(){\n LetterDay.changeDay(curDay);\n Schedule.changeDay(curDay);\n refresh();\n }", "function m_aux_Update(obj_stock, fechaInicio, fechaFin) {\n document.getElementById(\"inicio\").value = formatDate(fechaInicio);\n document.getElementById(\"fin\...
[ "0.73412806", "0.69919205", "0.679107", "0.66840607", "0.66757834", "0.6549372", "0.6535445", "0.65161777", "0.64752144", "0.6404671", "0.6398586", "0.6370533", "0.6363126", "0.6349377", "0.6286914", "0.62761956", "0.62669903", "0.6260087", "0.6255318", "0.625039", "0.6249217...
0.0
-1
this is a React component, it's just a function that returns a DOM element
function App() { // our component uses JSX, which is an extension of javascript that allows // you to use HTML in your javascript. It has a few gotchas. // 1) You must always return a single element from a component. (but you can // nest as deep as you want) // 2) comments are gross return ( <div cla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() { //render method that returns the DOM representation our component\n return ( // jeśli wyrzucimy nawias i w tej samej linii damy kod z kolejnej (tutaj <div>), będzie OK\n <div>\n <h1>Hello Series</h1>\n <b>Bold</b>\n </div>\n )\n ...
[ "0.78855026", "0.74445176", "0.7435362", "0.741664", "0.73838633", "0.73472786", "0.7332701", "0.73198336", "0.7239956", "0.722207", "0.71987575", "0.7136697", "0.7108474", "0.71003914", "0.70731807", "0.70627904", "0.70494753", "0.704904", "0.7045452", "0.7030399", "0.701574...
0.0
-1
Functions for moving adjustment dots
function calcAngle (x, y){ var theta = -Math.atan2(x,y); theta *= 180 / Math.PI; return Math.round(theta + 180); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@autobind\n moveExtraDot() {\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 0] = this.colorsArray2[0];\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 1] = this.colorsArray2[1];\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 2] = this.colorsArray2[2];\...
[ "0.70726645", "0.70256454", "0.69462687", "0.68529725", "0.6558785", "0.6538571", "0.64824545", "0.63919", "0.637239", "0.6297619", "0.62845963", "0.6281163", "0.6275677", "0.6244257", "0.62192667", "0.61997306", "0.61882186", "0.61776185", "0.61737657", "0.6155761", "0.61518...
0.0
-1
Functions for moving adjustment dots
function calcAngle (x, y){ var theta = -Math.atan2(x,y); theta *= 180 / Math.PI; return Math.round(theta + 180); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@autobind\n moveExtraDot() {\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 0] = this.colorsArray2[0];\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 1] = this.colorsArray2[1];\n this.colorsArray[ (this.questionDisplayParticleEnd + 1) * 3 + 2] = this.colorsArray2[2];\...
[ "0.70726645", "0.70256454", "0.69462687", "0.68529725", "0.6558785", "0.6538571", "0.64824545", "0.63919", "0.637239", "0.6297619", "0.62845963", "0.6281163", "0.6275677", "0.6244257", "0.62192667", "0.61997306", "0.61882186", "0.61776185", "0.61737657", "0.6155761", "0.61518...
0.0
-1
dividing data set into smaller chunks repeating the process of a subset of data example for finding a number using binary search
function search(arr, val) { let min = 0; let max = arr.length - 1; while(min <= max) { let middle = Math.floor((min + max) / 2); let currentEle = arr[middle]; if(currentEle < val) { //if value us greater than the middle number min = middle + 1; //get a new min number by adding 1 to the middle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findInBlock(n, b) {\n // Find the block\n let ib = Math.floor(b/B);\n let jb = b%B;\n let m=new Array();\n for (let i=ib*B; i<ib*B+B; i++) {\n for (let j=jb*B; j<jb*B+B; j++) {\n if (this.state[i][j] == X && this.options[i][j].indexOf(n) > -1) {\n m.push({i,j});\n }\n...
[ "0.59594524", "0.5948547", "0.5946812", "0.59398526", "0.5927749", "0.5913529", "0.5905011", "0.58864576", "0.58548695", "0.5854295", "0.58460224", "0.5769017", "0.57617104", "0.5759767", "0.5758756", "0.57458687", "0.57277286", "0.57083166", "0.5680823", "0.56227577", "0.561...
0.0
-1
the opposite of polToCart, takes in an xyz point and outputs a vector in the form of [theta, phi, radius]
function cartToPol(x, y, z) { var rad = Math.sqrt((x * x) + (y * y) + (z * z)); var theta = Math.atan2(x, z); var phi = Math.atan(y / Math.sqrt((z * z) + (x * x))); return [theta, phi, rad]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cart(theta) { return coort(cos(theta), sin(theta)) }", "function cartesian2Polar(point){\n var x = point[0];\n var y = point[1];\n var theta = rad2deg(Math.atan(y/x));\n \n // Q1: Use theta\n // Q2, Q3: Use theta + 180\n // Q4: Use theta + 360\n if(x < 0) theta += 180; // Handles Q2, Q3\n if(x ...
[ "0.66544014", "0.65009457", "0.64542043", "0.61879295", "0.6182098", "0.6132723", "0.61280423", "0.60965115", "0.60925376", "0.6039797", "0.6032343", "0.6031633", "0.60217345", "0.5997201", "0.59609604", "0.59581107", "0.595402", "0.59198225", "0.5919071", "0.59147304", "0.59...
0.71333045
0
takes in an array of points and clips all the points that have a Z less than 0. Modifies the array in the process
function clipToZ0(polyPoints, tolerance, invertClipDirection) { //to save time, inverting the clip direction just means inverting all the points, then inverting back if (invertClipDirection) { polyPoints.forEach(p => { p[2] *= -1; }); } //make all the polypoints have a boolean that says whether they're clipp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filterInternal(points) {\n const bbox = this.boundingBox();\n\n const tests = points\n .filter(p => bbox.testPoint(p))\n .map(p => ({ p, c: false }));\n\n if (tests.length === 0) return tests;\n\n cycle(this.vertices, (v, vn) => {\n for (let i = 0; i < tests.length; i++) {\n const...
[ "0.6438195", "0.64005756", "0.60742074", "0.58861357", "0.58618844", "0.58593535", "0.5852372", "0.585083", "0.581269", "0.5782442", "0.57758117", "0.57401687", "0.57178754", "0.56993175", "0.56923634", "0.5652885", "0.56459713", "0.56374335", "0.56374335", "0.56361586", "0.5...
0.7223055
0
this code yoinked from the interwebs. I'm lazy. circleParams in [x, y, r] form
function intersectionOfTwoCircles(circleParams1, circleParams2) { var [x0, y0, r0] = circleParams1; var [x1, y1, r1] = circleParams2; var h, rx, ry; //get distances between circle centers var dx = x1 - x0; var dy = y1 - y0; //distance var dist = Math.sqrt((dx ** 2) + (dy ** 2)); //if circles do not intersec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function circleParameter(r){\n//calc area = 2 * PI * r\n var circumference= 2 * Math.PI * r;\n//return the value\n return circumference;\n }", "function circle_center(px, py, qx, qy, rx, ry) {\n let v1 = sq(rx)+sq(ry)-sq(px)-sq(py);\n let v2 = sq(qx)+sq(qy)-sq(px)-sq(py);\n let y = (v1*(qx-px)-v2*(rx-...
[ "0.70434695", "0.70313716", "0.6934459", "0.693423", "0.6816734", "0.6774267", "0.66680324", "0.6666213", "0.6651305", "0.6635016", "0.66315484", "0.66121453", "0.6602265", "0.6596556", "0.65947616", "0.6594575", "0.65902126", "0.6585469", "0.6583449", "0.6582784", "0.6579656...
0.0
-1
like polToCart, but 2d
function polToXY(startX, startY, angle, magnitude) { var xOff = magnitude * Math.cos(angle); var yOff = magnitude * Math.sin(angle); return [startX + xOff, startY + yOff]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isoToCart(x, y, z) {\n\t\t\tswitch (viewDir) {\n\t\t\t\tcase 0:\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tvar maxY = this[0].length;\n\t\t\t\t\tvar temp = y\n\t\t\t\t\ty = (maxY - 1) - x;\n\t\t\t\t\tx = temp;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tvar maxX = this.length,\n\t\t\t\t\t\tmaxY = thi...
[ "0.61708575", "0.61143017", "0.5873545", "0.5851866", "0.5795594", "0.572414", "0.5647291", "0.55973923", "0.5559404", "0.5553866", "0.5551906", "0.553999", "0.5530859", "0.55213404", "0.5491534", "0.5491534", "0.54495656", "0.5448066", "0.5395653", "0.53912085", "0.53779435"...
0.0
-1
takes in xy coords and turns into polar coordinates, in [distance, angle] format
function XYtoPol(x, y) { return [Math.sqrt(x * x + y * y), (Math.atan2(y, x) + (Math.PI * 2)) % (Math.PI * 2)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_radialCoordinates(angles, radius){\n\n return angles.map((angle) => {\n return Coordinate.polar({\n coords: [radius, angle - 90],\n isDegree: true\n });\n })\n\n }", "function cartesian2Polar(point){\n var x = point[0];\n var y = point[1];\n var theta = rad2deg(Math.atan(y/x))...
[ "0.7324438", "0.70453745", "0.6853811", "0.6848436", "0.6751661", "0.65970606", "0.6564569", "0.65623707", "0.6545778", "0.64938647", "0.6458699", "0.6456544", "0.64549965", "0.632968", "0.6316094", "0.6281389", "0.62318367", "0.6209195", "0.61986417", "0.61471856", "0.610625...
0.6227089
17
The role of the button when clicked.
click(e){ if ( this.url ){ bbn.fn.link(this.url); } else{ this.$emit('click', e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get role () {\r\n\t\treturn this._role;\r\n\t}", "get role () {\r\n\t\treturn this._role;\r\n\t}", "getRole() {\n return this.role;\n }", "get role() {\n\t\treturn this.__role;\n\t}", "get role() {\n\t\treturn this.__role;\n\t}", "get role() {\n\t\treturn this.__role;\n\t}", "get role() {\n\t...
[ "0.615151", "0.615151", "0.6072284", "0.6008567", "0.6008567", "0.6008567", "0.6008567", "0.59643954", "0.5961299", "0.59415185", "0.59006524", "0.5825733", "0.5727656", "0.56749594", "0.5605922", "0.56053174", "0.56033957", "0.5520337", "0.5519183", "0.55162525", "0.5508374"...
0.0
-1
Returns chunk handler with following return codes: false to indicate further chunks can be processed true to indicate all chunks have been processed Throws error to indicate a nonrecoverable state and to terminate chunk processing
getChunkHandler() { var decoder = new TextDecoder(); var partial = false; return (data) => { var currentTime = (new Date()).getTime(); var elapsedMillis = currentTime - this.prevChunkRecvTime; this.prevChunkRecvTime = currentTime; if(data.done) { return true; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validChunk(stream,state,chunk,cb){var er;if(chunk===null){er=new ERR_STREAM_NULL_VALUES();}else if(typeof chunk!=='string'&&!state.objectMode){er=new ERR_INVALID_ARG_TYPE('chunk',['string','Buffer'],chunk);}if(er){errorOrDestroy(stream,er);process.nextTick(cb,er);return false;}return true;}", "function ...
[ "0.6091588", "0.57771087", "0.57506925", "0.57506925", "0.57316005", "0.571266", "0.56755984", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", "0.56725526", ...
0.66156495
0
Make sure to remove the DOM listener when the component is unmounted.
componentWillUnmount() { window.removeEventListener("scroll",this.scrollNavigation, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_removeEventListeners() {\n\n this.el.removeEventListener('click', this._onClickBound);\n window.removeEventListener('scroll', this._onScrollBound);\n window.removeEventListener('orientationchange', this._onScrollBound);\n document.removeEventListener('spark.visible-children', this._onVisibleBound, tru...
[ "0.7633893", "0.75896627", "0.75309604", "0.74860066", "0.7478146", "0.74651057", "0.7461891", "0.7457235", "0.74252725", "0.74065685", "0.73787093", "0.73204577", "0.73193306", "0.72909427", "0.72887236", "0.7282852", "0.7269165", "0.72684735", "0.72662735", "0.72591466", "0...
0.0
-1
__________________________________________ Reflection: Use the reflection guidelines I still don't understand psuedocoding that much. I almost felt like the psuedocode i wrote was just rephrasing the question. I need feedback on this. I am having a pairing session with one of my accountability partners so I will review...
function assert(test, message, test_number) { if (!test) { console.log(test_number + "false"); throw "ERROR: " + message; } console.log(test_number + "true"); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeProperties(object, array) {\n//I-object and an array of strings\n//O-remove any properties on the object that are listed in the array\n//C-\n//E-\n //let's run a loop over the array\n for(let i = 0; i < array.length; i++) {\n //check to make sure a match is there\n if (array[i] i...
[ "0.6793467", "0.6579153", "0.65666544", "0.655022", "0.6506574", "0.64040387", "0.640142", "0.6396308", "0.6231327", "0.62225145", "0.61387235", "0.60903203", "0.608479", "0.60207534", "0.599802", "0.599802", "0.5955256", "0.5950084", "0.59402037", "0.58813554", "0.5867503", ...
0.0
-1
This is a local function that creates the new replacement representing the mutation. Used to save code further down.
function createReplacement(manifestFile, originalChange) { var replacement = { target: manifestFile, parent: originalChange.parent, after: originalChange.after, xmls: originalChange.xmls, versions: originalChange.versions, devi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mutate_1(ast) {\n\ttry {\n\t\t//var ast = UglifyJS.parse(code);\n\t\tvar_insert_init();\n\t\ttotal_for_mutate = [];\n\t\t//already_mutate = [];\n\t\ttotal_for_mutate = collectMostReferenceVar(ast);\n\t\tcntr_set.varName = generateMutateName_1();\n\t\tif( cntr_set.varName == \"GENERATE_NO_NAME\" )\n\t\t\tr...
[ "0.63831687", "0.63302076", "0.6065265", "0.6053592", "0.5997272", "0.5997272", "0.5784187", "0.57067263", "0.5590597", "0.54890096", "0.5448505", "0.5448505", "0.5448505", "0.54477924", "0.535457", "0.5349917", "0.5321629", "0.53188336", "0.53154594", "0.52757335", "0.523025...
0.0
-1
A class for holidng the information currently stored in plugin.xml It's inherited from cordovacommon's PluginInfo class In addition it overrides getConfigFiles, getEditConfigs, getFrameworks methods to use windowsspecific logic
function PluginInfo(dirname) { // We're not using `util.inherit' because original PluginInfo defines // its' methods inside of constructor CommonPluginInfo.apply(this, arguments); var parentGetConfigFiles = this.getConfigFiles; var parentGetEditConfigs = this.getEditConfigs; this.getEditConfi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get pluginConfig() {\n return {};\n }", "static get pluginConfig() {\n return {};\n }", "constructor(opts) {\nsuper(opts);\nthis._onLoad = function() {};\nthis._os = {};\nthis._isPackaged = !!opts.isPackaged;\nthis._version = null;\nthis._ge...
[ "0.6160363", "0.6160363", "0.6031177", "0.5971214", "0.5960252", "0.58978033", "0.5870313", "0.5856739", "0.5856739", "0.57083106", "0.5691128", "0.56419134", "0.56116414", "0.5561725", "0.5555309", "0.55375606", "0.55105555", "0.5495063", "0.5471126", "0.5469716", "0.5459779...
0.7357929
0
inject the service define the conroller
function ServiceTaxController(ServiceTaxFactory){ var controller = this; controller.amount = ""; controller.tax =""; controller.calculateTax = function(){ // delegate the business logic to the Service controller.tax = ServiceTaxFactory().calculateTax(controller.amount); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(service) {\n this.service = service;\n }", "controller( MyAngularService, $scope ){\n console.log('MyAngularService', MyAngularService)\n this.anothermethod( 'imastring' , { 'im' : 'object' } )\n }", "constructor($rootScope, $scope, http, $state, authService) {\r\n ...
[ "0.6263542", "0.6189317", "0.5990321", "0.5945209", "0.59451497", "0.59408385", "0.5913198", "0.58899564", "0.5881148", "0.5868697", "0.5852097", "0.5804662", "0.5804662", "0.57479525", "0.5746192", "0.5716403", "0.5714862", "0.57098913", "0.5706675", "0.5666853", "0.5634087"...
0.53231376
44
inject the service define the conroller
function ServiceTaxObjectController(ServiceTaxObjFactory){ var controller = this; controller.amount = ""; controller.tax =""; controller.calculateTax = function(){ // delegate the business logic to the Service controller.tax = ServiceTaxObjFactory.getService().calculateTax(controller.amoun...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(service) {\n this.service = service;\n }", "controller( MyAngularService, $scope ){\n console.log('MyAngularService', MyAngularService)\n this.anothermethod( 'imastring' , { 'im' : 'object' } )\n }", "constructor($rootScope, $scope, http, $state, authService) {\r\n ...
[ "0.6263542", "0.6189317", "0.5990321", "0.5945209", "0.59451497", "0.59408385", "0.5913198", "0.58899564", "0.5881148", "0.5868697", "0.5852097", "0.5804662", "0.5804662", "0.57479525", "0.5746192", "0.5716403", "0.5714862", "0.57098913", "0.5706675", "0.5666853", "0.5634087"...
0.5031243
95
using simple object factory function
function ServiceTaxFactory(){ var factory = function(){ // no longer a singleton as we instantiate it everytime return new ServiceTaxCalculationService(); }; return factory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factory() {}", "function factory() {}", "function NewObj(){}", "function Factory(){}", "function NewObj() {}", "function objectFactory() {\n\n var obj = new Object(),\n\n Constructor = [].shift.call(arguments);\n\n obj.__proto__ = Constructor.prototype;\n\n var ret = Constructor.apply(obj,...
[ "0.7771112", "0.7771112", "0.75942814", "0.7416411", "0.7411592", "0.7152688", "0.6987166", "0.69174933", "0.69002545", "0.6884604", "0.6881791", "0.6872793", "0.68662876", "0.684889", "0.6819077", "0.67909086", "0.674932", "0.67069095", "0.67069095", "0.6699136", "0.6697595"...
0.0
-1
function for KEY PRESSED
function keyPressed() { //DOWN ARROW key makes the package fall to the ground if (keyCode === DOWN_ARROW) { Matter.Body.setStatic(packageBody, false); } //movement of the helicopter using RIGHT and LEFT ARROW keys if (keyCode === RIGHT_ARROW) { helicopterSprite.x += 10; } if (keyCode === LEFT_ARROW) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyPressed() {\n}", "keyDown(_keycode) {}", "function keyPressed(){\n\tgameManager.keyPressed();\n}", "function keyPressed() {\n // toggle fullscreen mode\n if( key === 'f') {\n fs = fullscreen();\n fullscreen(!fs);\n return;\n }\n\n // dispatch all keys to adventure manager\n adventur...
[ "0.80707246", "0.78656334", "0.777595", "0.77196896", "0.77196896", "0.7686391", "0.7671907", "0.7660313", "0.76365805", "0.76293236", "0.7610183", "0.75772446", "0.7532873", "0.75008535", "0.74751586", "0.7453165", "0.74260163", "0.7418053", "0.73726743", "0.7358256", "0.733...
0.0
-1
Create title and DOM elements (input, ul)
function initList(){ var h2 = document.createElement("h2"), input = document.createElement("input"), ul = document.createElement("ul"), radio = document.createElement("div"); h2.textContent = options.title; input.setAttribute("type", "text"); input.se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildListTitleForm() {\n\tvar node = document.createElement('form')\n\tnode.innerHTML =\n\t\t'<div class=\"newitem-title-wrapper\">' +\n\t\t'<input id=\"trello-list-title-input\" type=\"text\">' +\n\t\t'<input id=\"trello-list-title-submit\" type=\"submit\" value=\"Save\">' +\n\t\t'</div>'\n\tnode.style.d...
[ "0.71939164", "0.69870967", "0.6856925", "0.6790937", "0.65213597", "0.6479513", "0.6446852", "0.64403564", "0.6376427", "0.63737494", "0.63545674", "0.6337857", "0.6309398", "0.6254302", "0.6253234", "0.62532216", "0.62394315", "0.6235267", "0.6217233", "0.6186448", "0.61710...
0.60143334
33
Which props do we want to inject, given the global state?
function select(state) { return { data: state }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSharedProps(props, state) {\n var disabled = props.disabled,\n error = props.error,\n positive = props.positive,\n adjoined = props.adjoined,\n size = props.size,\n required = props.required;\n var isFocused = state.isFocused;\n return {\n $isFocused: isFocused,\n $dis...
[ "0.5895257", "0.5828189", "0.5762007", "0.574606", "0.57456404", "0.5701255", "0.5583873", "0.5571484", "0.55711836", "0.55198026", "0.5491133", "0.548134", "0.54254246", "0.5414847", "0.5335301", "0.530306", "0.52965647", "0.5294223", "0.5284391", "0.52743727", "0.52608955",...
0.0
-1
====================================== handling uncaught exceptions ======================================
function onUncaughtException(err) { var err = "uncaught exception: " + err; console.log(err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onUncaughtException(err) {\n console.log('Uncaught exception:', err);\n }", "function handle_runtime_exceptions() {\n process.on('uncaughtException', function(err) {\n\tif ( err.rs ) {\n\t if ( err.message === cfg.MYSQL_STUPID_EXCEPTION ) {\n\t\tD.log('Ignoring stupid MySQL shutdown exception'...
[ "0.75998497", "0.71273917", "0.7115894", "0.6770893", "0.6770893", "0.6770893", "0.6765528", "0.676455", "0.6688589", "0.66681993", "0.66681993", "0.65681577", "0.65407944", "0.65407944", "0.65407944", "0.65407944", "0.65407944", "0.65407944", "0.65407944", "0.65407944", "0.6...
0.7347154
1
variable number of arguments, and checks whether there are any duplicates among the arguments passed in. Sample Output 1 areThereDuplicates(1,2,3) => false Sample Output 2 areThereDuplicates(1,2,2) => true Sample Output 3 areThereDuplicates('a', 'b', 'c', 'a') => true
function areThereDuplicates(...args) { args.sort((a,b) => a > b); let startIndex = 0; let endIndex = startIndex + 1; while (endIndex < args.length) { if (args[startIndex] === args[endIndex]) { return true; } startIndex ++ endIndex ++ } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function areThereDuplicates(...args) {\n let seen = {};\n for (let i = 0; i < args.length; i++) {\n let currArg = args[i];\n if (seen[currArg]) {\n return true;\n } else {\n seen[currArg] = 1;\n }\n }\n return false;\n}", "function areThereDuplicates() {\n if (arguments.length < 2) ret...
[ "0.90052456", "0.8961292", "0.88675886", "0.8833876", "0.8796308", "0.8744268", "0.8744268", "0.8730892", "0.8730892", "0.8730892", "0.8730892", "0.8730892", "0.8726166", "0.8719034", "0.869557", "0.8652894", "0.8636473", "0.86314887", "0.8608347", "0.86068815", "0.85904294",...
0.85460544
30
! vuex v3.4.0 (c) 2020 Evan You
function l(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:l});else{var a=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[l].concat(e.init):l,a.call(this,e)}}function l(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.677089", "0.6697306", "0.666029", "0.6330228", "0.6307708", "0.62462986", "0.62462986", "0.62462986", "0.6237768", "0.62359226", "0.6132646", "0.61251813", "0.6067375", "0.60568154", "0.60568154", "0.60568154", "0.60568154", "0.60568154", "0.60501724", "0.604128", "0.60273...
0.0
-1
O(nlog(n) + mlog(m)) time | O(1) space;
function smallestDifference(arrayOne, arrayTwo) { arrayOne.sort((a, b) => a - b); arrayTwo.sort((a, b) => a - b); let left = 0; let right = 0; let current = Infinity; let smallest = Infinity; let smallestAr = []; while (left < arrayOne.length && right < arrayTwo.length) { if (arrayOne[left] < arrayT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i]...
[ "0.6297179", "0.6173083", "0.6156061", "0.6037868", "0.6031801", "0.60007656", "0.58808464", "0.58383286", "0.5833746", "0.5768331", "0.5750295", "0.5744733", "0.57042", "0.5682194", "0.5644876", "0.56127286", "0.5603", "0.55501044", "0.55363536", "0.55123526", "0.54775923", ...
0.0
-1
timer function, stops when game is complete
function timer() { function countSeconds() { if (moves !== 0 && matched < 16) { seconds++ document.querySelector('.timer').innerHTML = seconds; } } setInterval(countSeconds, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onTimer(){\r\n\tif (turn == OPPONENT) return;\r\n\tupdate_handler({time:timer});\r\n\ttimer--;\r\n\tif (timer < 0){\r\n\t\tmissStep();\r\n }\r\n}", "function timer(){\n countStartGame -= 1;\n console.log(countStartGame);\n if (countStartGame === 0){\n console.log (\"time's up\");\n ...
[ "0.7665329", "0.7631973", "0.7621925", "0.75699234", "0.7565971", "0.7564758", "0.7543103", "0.7539606", "0.7463164", "0.7454979", "0.7428854", "0.7406808", "0.7362933", "0.7359866", "0.7344225", "0.7340552", "0.7331882", "0.7305234", "0.7275926", "0.7218693", "0.7208484", ...
0.0
-1
set up the event listener for a card. If a card is clicked: display the card's symbol (put this functionality in another function that you call from this one) add the card to a list of "open" cards (put this functionality in another function that you call from this one) if the list already has another card, check to se...
function makeCard(card) { return `<li class="card" data-card="${card}"><i class="fa ${card}"></i></li>`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickCard(event) {\n // discard clicks on already matched or open cards\n if (event.target.nodeName === 'LI'\n && !(event.target.classList.contains(\"match\"))\n && !(event.target.classList.contains(\"open\")) ) {\n\n clickCounter += 1;\n\n if(clickCounter == 1) {\n st...
[ "0.8363816", "0.82866424", "0.8223797", "0.8172263", "0.80387884", "0.8013006", "0.79875785", "0.7984061", "0.7961059", "0.7939461", "0.793091", "0.78496116", "0.78251964", "0.7812923", "0.78055465", "0.77980745", "0.7791574", "0.7780845", "0.77698153", "0.7762581", "0.772567...
0.0
-1
shuffles and generates cards
function newGame() { let deck = document.querySelector('.deck'); //shuffle the list of cards using the provided "shuffle" method let cardGrid = shuffle(allCards).map(function(card) { //loop through each card and create its HTML return makeCard(card); }); //add each card's HTML to the...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCards(){\n shuffle(cardList.concat(cardList)).forEach(createCard);\n}", "function shuffle(cards)\n{\n\t// for loop???\n\t \n}", "function shuffleTheDeck(){\n\tconst shuffledCards = shuffle(allCards);\n\t for (card of shuffledCards){\n\t\tdeck.appendChild(card);\n\t }\n }", "function...
[ "0.8397842", "0.8004055", "0.79357946", "0.790563", "0.78972083", "0.78187245", "0.7808387", "0.77921337", "0.7780534", "0.7757633", "0.7745785", "0.77032685", "0.7698047", "0.7690414", "0.768674", "0.76809675", "0.76790154", "0.76725274", "0.7655046", "0.7643025", "0.7640134...
0.7182782
97
if the cards do match, lock the cards in the open position
function cardMatch() { //add 2 to the tally of matched cards matched += 2; openCards[0].classList.add('match'); openCards[0].classList.add('open'); openCards[0].classList.add('show'); openCards[1].classList.add('match'); openCards[1].classList.add('open'); openCards[1].classList.add('show'); //empty ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lockCard() {\n\tif (listOfOpenCards.length === 2){\n\t\tlistOfOpenCards.map(x => x.className = 'card match');\n\t\tlistOfOpenCards = [];\n\t}\n}", "function lockCards() {\n cardOpen[0].setAttribute('class', 'card match');\n cardOpen[1].setAttribute('class', 'card match');\n cardOpen = [];\n moves();...
[ "0.8156235", "0.7973075", "0.79634774", "0.7900869", "0.7477614", "0.72554296", "0.7214558", "0.7109082", "0.70204383", "0.6989886", "0.6986035", "0.6969605", "0.69441897", "0.6938879", "0.6928093", "0.6906293", "0.6854446", "0.6853468", "0.6848479", "0.68430024", "0.6840769"...
0.0
-1
if the cards do not match, remove the cards from the list and hide the card's symbol
function notAMatch() { //flip back over after half a second setTimeout(function() { openCards.forEach(function(card) { card.classList.remove('open', 'show'); }); //empty array openCards = []; }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeCards() {\n // console.log(\"The cards do not match\");\n displaySymbol(openCards[0]);\n displaySymbol(openCards[1]);\n // Reset open card array so it includes a new pair of cards\n openCards = [];\n}", "function hideUnmatchedCards(){\n //If the two cards doesnot match , both the cards...
[ "0.8214757", "0.7396054", "0.7390834", "0.73540306", "0.7290043", "0.7264288", "0.71962494", "0.70385474", "0.7025885", "0.69924027", "0.69873255", "0.69783014", "0.69777924", "0.6940116", "0.6872221", "0.68702304", "0.6848148", "0.68437046", "0.6807062", "0.6790324", "0.6751...
0.0
-1
move counter and dynamic star rating
function addAMove(){ moves++; moveCounter.innerHTML = moves; //game displays a star rating from 1 to at least 3 stars - after some number of moves, star rating lowers if (moves > 8 && moves < 12) { numStars = 4; stars.innerHTML = `<li class="star"><i class="fa fa-star"></i></li><li class="star"><i class...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function starRating() {\n if (moves > 13 && moves < 16) {\n starCounter = 3;\n } else if (moves > 17 && moves < 27) {\n starCounter = 2;\n } else if (moves > 28) {\n starCounter = 1;\n }\n showStars(starCounter);\n }", "function updateStarRating() {\n const numCards = deckConfig.n...
[ "0.7978152", "0.7797134", "0.770683", "0.76945066", "0.75731206", "0.750805", "0.74506223", "0.7450224", "0.7432671", "0.74118584", "0.7406536", "0.7361821", "0.73323864", "0.7302861", "0.72934175", "0.7180411", "0.71682954", "0.71474016", "0.71390617", "0.7129922", "0.708170...
0.6561493
95
if all cards have matched, display a message with the final score
function allMatched() { //makes modal visible modal.style.display = "block"; //final number of moves finalMoves.innerHTML = moves; //final star rating finalStars.innerHTML = numStars; //final time finalTime.innerHTML = seconds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardsMatch() {\n\n // add match class\n openCards[0].classList.add('match');\n openCards[1].classList.add('match');\n\n // allow clicks again & remove 'open', 'show' classes\n for (let i = 0; i <= initialArray.length - 1; i++) {\n \tlistOfCards[i].classList.remove('no-click', 'open', 'sh...
[ "0.72996104", "0.72813344", "0.72462994", "0.7158631", "0.71239245", "0.71159536", "0.70915496", "0.7079154", "0.7065588", "0.7062179", "0.7016586", "0.6998551", "0.69661844", "0.6960086", "0.69510484", "0.6924082", "0.6894683", "0.68946195", "0.6887659", "0.68866575", "0.686...
0.0
-1
exemplos de objetos: buttons | text | scroll bars |
function R(n) { return Math.floor(n*Math.random()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(spec, add, make) {\r\n\r\n super(spec);\r\n this.__type_name = 'scrollbar';\r\n\r\n // Always active?\r\n\r\n this.active();\r\n var that = this;\r\n var context = this.context;\r\n\r\n if (!spec.abstract && !spec.el) {\r\n this.add_class('scr...
[ "0.63884103", "0.6295506", "0.62449753", "0.6136915", "0.59992653", "0.59856814", "0.596879", "0.5947066", "0.5940401", "0.59136146", "0.5877827", "0.5877412", "0.585739", "0.58143556", "0.580937", "0.5791092", "0.5781016", "0.57647043", "0.5749418", "0.572517", "0.5712889", ...
0.0
-1
popup = createObject ... popup.children = []; popup.children.push(createObject(
function closePopup(){ popup.children.forEach(function (x) { delete roomObjects[roomObjects.indexOf(x)]; }); delete roomObjects[roomObjects.indexOf(popup)]; popup = false; LAYER = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createIntroPoppup(){\n /* Create DOM Elements for the Introduction Popup */\n introPopup = createDiv('');\n introPopup.id(\"introPopup\");\n introPopup.size(windowWidth/2,windowHeight/2);\n introPopup.position(windowWidth/2-windowWidth/4,windowHeight/2-windowHeight/4)\n\n // Add Header\n intr...
[ "0.6461803", "0.63924485", "0.6388743", "0.6262573", "0.6262573", "0.611264", "0.611114", "0.6072343", "0.6064197", "0.5982051", "0.5969873", "0.59297967", "0.57954353", "0.5748041", "0.5736922", "0.5708976", "0.56922716", "0.56827587", "0.5668845", "0.56531", "0.56491286", ...
0.5890956
12
Bind updates to the map ID to this view's update
function bindMap(mapIDorObj) { var map; if(isObject(mapIDorObj)) { map = mapIDorObj; } else { map = Nori.model().getMap(mapIDorObj) || Nori.model().getMapCollection(mapIDorObj); } if (!map) { throw new Error('ViewComponent bindMap, map or mapcollection not found: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n var vm = this;\n vm.map.render()\n }", "onMapUpdated() {\n if (this.controller.isInitialized()) {\n this.refresh().then();\n }\n }", "rerender() {\n this.map.render();\n }", "function mapDataChanged(){\r\n //force an update\r\n onMapMoved();\r\n...
[ "0.6979975", "0.65961176", "0.6110922", "0.60754293", "0.60376006", "0.5918448", "0.58951396", "0.58829635", "0.5852409", "0.5811126", "0.5806654", "0.57803965", "0.5748063", "0.5710162", "0.56992614", "0.5668404", "0.5656355", "0.5649558", "0.56322104", "0.5623656", "0.55862...
0.66371274
1
Before the iew updates and a rerender occurs
function viewWillUpdate() { // update state }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_requestRender() { this._invalidateProperties(); }", "forceUpdate() {\n if (this[_queuedUpdate]) {\n this[_dirty] = true;\n return;\n }\n\n this[_virtualRender]();\n this[_queuedUpdate] = true;\n\n TaskQueue.push(() => {\n if (this[_dirty] && !t...
[ "0.69902784", "0.6775456", "0.67376155", "0.6713562", "0.6697441", "0.66334057", "0.6607549", "0.66061234", "0.6562072", "0.6562072", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65404475", "0.65278375", "0...
0.0
-1
After the view updates and a rerender occurred
function viewDidUpdate() { // stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "updateView() {\...
[ "0.747666", "0.74695826", "0.74695826", "0.7267555", "0.72659546", "0.72659546", "0.71887714", "0.71382", "0.7118186", "0.71079075", "0.7011174", "0.6967612", "0.68818605", "0.6831555", "0.6826791", "0.6798969", "0.67583394", "0.6740507", "0.66784054", "0.6639998", "0.6633269...
0.65883845
21
Call before it's been added to a view
function viewWillMount() { // stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeRender() { }", "onBeforeRendering() {}", "requestView(){\t\t\n\t\tthis.trigger('requestView');\n\t}", "_triggerLoaded() {\n\t if (this._alreadyLoaded) {\n\t // Do not trigger event twice\n\t this._triggerUpdated();\n\t return;\n\t }\n\t this._alread...
[ "0.6230445", "0.6160483", "0.5994479", "0.5956955", "0.5913882", "0.5893218", "0.5866551", "0.5840084", "0.5834206", "0.58195907", "0.58136255", "0.58080995", "0.58012974", "0.57952625", "0.57952625", "0.5774588", "0.57696325", "0.5751567", "0.5749508", "0.5749508", "0.574950...
0.5933473
4
Append it to a parent element
function mount() { if (!_html) { throw new Error('Component ' + _id + ' cannot mount with no HTML. Call render() first'); } if (this.viewWillMount) { this.viewWillMount(); } _isMounted = true; // Go out to the standard render function. DOM element is returned in ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _add_to_parent(element) {\r\n sel = settings.parentSelector || \"body\";\r\n parent = $($(sel)[0]);\r\n parent.append(element);\r\n }", "function appendTo(el, parent){\r\n parent.appendChild(el);\r\n }", "function appendTo(el, parent){\r\n paren...
[ "0.8413003", "0.8167435", "0.8167435", "0.81364316", "0.81364316", "0.81364316", "0.80843365", "0.80837005", "0.7907967", "0.7887222", "0.7814232", "0.78078955", "0.77925503", "0.77859086", "0.76338834", "0.76338834", "0.76338834", "0.76338834", "0.76338834", "0.76326317", "0...
0.0
-1
Handler for the renderer module
function onViewRendered(domEl) { setDOMElement(domEl); // from the ViewMixinEventDelegator if (this.delegateEvents) { this.delegateEvents(); } if (this.viewDidMount) { this.viewDidMount(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Renderer() {}", "function Renderer(args) {\n\n\n}", "function Renderer() {\n}", "getRenderer () {}", "onBeforeRendering() {}", "render() {\n this._addChooserHandler();\n this._addLoggerListeners();\n this._addButtonHandler();\n }", "_render() {}", "function render() {...
[ "0.6968146", "0.6959026", "0.68763715", "0.6722043", "0.6712027", "0.6704118", "0.65479404", "0.65381837", "0.6537056", "0.65112394", "0.64703846", "0.64687985", "0.6399836", "0.6389072", "0.6389072", "0.6387444", "0.63691455", "0.6351573", "0.6312154", "0.62929666", "0.62895...
0.0
-1
Call after it's been added to a view
function viewDidMount() { // stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onAfterRendering() {}", "afterRender() { }", "afterRender() { }", "function viewRenderComplete() {\n $container.trigger(topologyConstants.events.viewRenderComplete, {}); // Private Event\n }", "function _onElementAdded() {\n \n\t\t\t countElements++;\n \n\t\t\t //add all eleme...
[ "0.6597041", "0.6563622", "0.6563622", "0.65421", "0.65257585", "0.6403373", "0.6339914", "0.63190305", "0.6267129", "0.6197116", "0.61844516", "0.6160657", "0.6125654", "0.6115137", "0.61093825", "0.6022698", "0.6006362", "0.5972929", "0.5935434", "0.59314984", "0.59179956",...
0.0
-1
Call when unloading and switching views
function viewWillUnmount() { // stub }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async onReloadDefaultView () {\n if (this.pvc.formatter) {\n this.pvc.formatter.resetOptions()\n }\n this.dispatchMicrodataViewDelete(this.routeKey) // clean current view\n await this.restoreDefaultView()\n await this.setPageView()\n this.doRefreshDataPage()\n }", "remove(...
[ "0.6628944", "0.65378124", "0.65261346", "0.6511686", "0.64949626", "0.64901084", "0.63671756", "0.6330891", "0.630034", "0.62830925", "0.62658834", "0.6262522", "0.624819", "0.6234922", "0.6231489", "0.6201888", "0.6198823", "0.619428", "0.6193482", "0.61401033", "0.6105045"...
0.5939697
37
Remove a view and cleanup
function dispose() { this.unmount(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(){\n this.removeViews(Object.keys(this.views));\n this.el.innerHTML = null;\n this.layouts[this.layout].isRendered = false;\n this.layout = null;\n }", "function cleanUpView(view) {\n if (isLView(view) && !(view[FLAGS] & 256 /* Destroyed */)) {\n // Usually the Attached flag is remo...
[ "0.76624846", "0.7589065", "0.7353087", "0.73106843", "0.7261587", "0.7248664", "0.7191986", "0.7191986", "0.7191986", "0.7191986", "0.7191986", "0.7191986", "0.7189531", "0.7032381", "0.7032381", "0.70055413", "0.69255936", "0.6919672", "0.6917453", "0.6917453", "0.6917453",...
0.0
-1
Open an indexed DB Create a store if missing Handle exceptions and bugs
start() { debuglog("*IDX> start 1"); var openDB = indexedDB.open(this.dbName, 1); debuglog("*IDX> start 2"); openDB.onupgradeneeded = (evt) => { debuglog("*IDX> onupgradeneeded 1"); const db = evt.target.result; debuglog("*IDX> onupgradeneeded createO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initDatabase() {\n // console.log(\"Open database \" + DbConst.DB_NAME + \"...\");\n let req;\n try {\n req = indexedDB.open(DbConst.DB_NAME, DbConst.DB_VERSION);\n } catch (ex){\n console.error(\"Error opening database: \" + ex.name + \": \" + ex.message + \"\\nEnabling cookies ...
[ "0.73938733", "0.7298159", "0.7276275", "0.7252314", "0.7192421", "0.71675617", "0.70877016", "0.70189214", "0.6941912", "0.69221884", "0.6916285", "0.69038206", "0.6864579", "0.6840355", "0.6797693", "0.6768653", "0.6764662", "0.66868806", "0.66670173", "0.66627103", "0.6622...
0.63915086
46
`App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization. This allows for keeping state between navigation, custom error handling, injecting additional data.
function appGetInitialProps(_x) { return _appGetInitialProps.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AppPage() {\n Page.apply(this, arguments);\n }", "function MyApp() {\n return (\n <div>\n <AppPage /> \n </div>\n )\n}", "function AppComponent(_page) {\n this._page = _page;\n this._page.actionBarHidden = true;\n }", "function App() {\n\treturn (\...
[ "0.77505785", "0.6773251", "0.66307765", "0.6567512", "0.6473235", "0.64687395", "0.6411343", "0.6324162", "0.6313807", "0.6304703", "0.62666327", "0.62384087", "0.6224191", "0.61658907", "0.6123913", "0.6120967", "0.6110225", "0.610275", "0.6102656", "0.6086336", "0.6066548"...
0.0
-1
Traitement des informations de souris sur le canvas
function mouseMoveGeneric(e, down, offset) { //Position de la souris if(offset == undefined) offset = {x: 0, y: 0}; if(e.data.originalEvent.touches) { offset.x -= $("#canvasContainer").offset().left; offset.y -= $("#canvasContainer").offset().top; //Prépare la fin des touch $.each(canvasContext.touches, func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCoordinates()\n {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.drawImage(image, 0, 0);\n ctx.beginPath();\n for (var i = 0; i <= localStorage.length - 1; i++)\n {\n var key = localStorage.key(i);\n var spos = localStorage.getItem...
[ "0.63372195", "0.6301033", "0.61855525", "0.613569", "0.6103408", "0.60866106", "0.60744774", "0.606564", "0.605569", "0.5998277", "0.5980979", "0.5977468", "0.5965593", "0.59473", "0.5939026", "0.592876", "0.5915254", "0.5914248", "0.59132683", "0.5894456", "0.5894298", "0...
0.0
-1
scrollTo function with animation Gist reference:
function scrollTo(to, duration) { if (!duration) duration = 1000; let start = window.pageYOffset, change = to - start, currentTime = 0, increment = 20; const animateScroll = function(){ currentTime += increment; let val = Math.easeInOutQuad(currentTime, start, change...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollIt(element, to, duration) {\n element.animate({scrollTop: to}, duration);\n }", "function ScrollPosition() {}", "scrollTo() {\n window.scroll({\n top: this.getCurrSlide().offsetTop,\n left: 0,\n behavior: 'smooth'\n })\n }", "function p...
[ "0.73977554", "0.7182853", "0.71011186", "0.7005912", "0.69936925", "0.6978692", "0.6918748", "0.6918299", "0.6889192", "0.6870264", "0.68692076", "0.6867974", "0.6845131", "0.6833781", "0.68147564", "0.67705035", "0.6761807", "0.67571425", "0.6754924", "0.6742617", "0.673924...
0.0
-1
POST request / NOTE: Never send unencrypted user credentials in production!
function postRequest() { const formData = new FormData(document.getElementById('msg-form')); const messageHeaders = new Headers({ 'Content-Type': 'application/json', // 'Content-Length': 'kittens' // Content-Length can't be modified! 'X-Custom': 'hello world', // 'Y-Custom': 'this will not work' // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function performPostRequest (url, queryParams, onSuccess, onFailure, user, password) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n internal.onReady(request, onSuccess, onFailure, \"POST\");\n }\n\n var content = internal.createPostBody(queryParams);\n\n ...
[ "0.66349864", "0.6315772", "0.631093", "0.63018554", "0.6167797", "0.61277544", "0.6121939", "0.6110044", "0.6096248", "0.60885", "0.6085959", "0.6074166", "0.60551643", "0.60269606", "0.60030943", "0.59873265", "0.59812355", "0.59802806", "0.5973705", "0.59723115", "0.595902...
0.0
-1
!!!!!!!!!!!!!!!!!!! dont touch if yo dont now JS !!!!!!!!!!!!!!!!!!!!!!
function maxHeightElement( element ) { // function which find max height in element var heightElement = 0; $(element).each(function() { if ( $(this).height() > heightElement ) { heightElement = $(this).height(); } }); return heightElement }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BaixarOrdemTV_elementsExtraJS() {\n // screen (BaixarOrdemTV) extra code\n\n }", "function PaginaInicial_elementsExtraJS() {\n // screen (PaginaInicial) extra code\n\n }", "function Ze(){if(ea)t.innerHTML=ha;else if(ia)t.innerHTML=ia;$e();eb&&hb.call(window,eb);nb();eb=-1;bb=[];cb=...
[ "0.6236465", "0.62054086", "0.6174316", "0.61576504", "0.6156732", "0.61290836", "0.60752", "0.60291356", "0.5989826", "0.59368306", "0.5925474", "0.59048617", "0.584812", "0.58325183", "0.5831663", "0.5771951", "0.5757231", "0.5724731", "0.5679462", "0.5611899", "0.55966145"...
0.0
-1
JSONSocketConnection Options socketUrl attemptReconnectionAfterMS wait until attempting reconnection. Default 1000. Events 'open' 'closed' 'reconnecting' 'closed successfully' 'json' 'nonjson' 'message'
function JSONSocketConnection ( options ) { this.socketUrl = options.socketUrl; this._connectionDesired = false; this.attemptReconnectionAfterMS = (typeof attemptReconnectionAfterMS !== 'undefined') ? options.attemptReconnectionAfterMS : 1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SOCKET_RECONNECT(state, count) {\n state.socket.isReconnecting = true\n console.info(state.socket, count, \"reconnect socket\")\n if (count >= 3) {\n // window.location.href = '/';\n }\n }", "waitForSocketConnection(callback){\n const socket = this.socketRef;\n const r...
[ "0.597278", "0.5872539", "0.5739726", "0.5700023", "0.5660281", "0.5569321", "0.5559461", "0.55437285", "0.55231166", "0.5502351", "0.55005395", "0.54992247", "0.54989016", "0.547792", "0.5463958", "0.5444963", "0.5444", "0.5440994", "0.5423642", "0.54181707", "0.540699", "...
0.8121333
0
Given two arrays or strings, return the first element where they differ (shallow).
function firstDiff(exp, act) { var i; for (i = 0; i < exp.length && i < act.length; ++i) { if (exp[i] != act[i]) { break; } } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function difference(arr1, arr2) {\n \n \n \n}", "function diff(a, b){\n // iterate over elements in array a, return element only if it isn't in b\n return a.filter((el) => {\n return b.indexOf(el) < 0;\n });\n}", "function array_diff(a, b) {\n if (a.length === 0 || b.length === 0) {\n...
[ "0.6990529", "0.6870155", "0.67757636", "0.6708637", "0.6693603", "0.66914785", "0.6632147", "0.659691", "0.6586147", "0.6576211", "0.65690976", "0.6513549", "0.65081024", "0.6505375", "0.6500263", "0.6497347", "0.64775324", "0.6463213", "0.64549017", "0.64549017", "0.6454901...
0.0
-1
When new generator function is created, rule counter is reset. We need to reset the rule counter for SSR for each request. It's inspired by
function createGenerateClassName() { var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var _options$dangerouslyU = options.dangerouslyUseGlobalCSS, dangerouslyUseGlobalCSS = _options$dangerouslyU === void 0 ? false : _options$dangerouslyU, _options$productionPr = opti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apply_counter_DocGenerator() {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:741 apply_counter(\"+this.aIndexNT+\",\"+this.aFoundNonterms[this.aIndexNT]+\")-Call\")\n\t//----Create Object/Instance of Doc...
[ "0.61338574", "0.592852", "0.57347023", "0.5696137", "0.5674674", "0.56350255", "0.556611", "0.55608165", "0.5560295", "0.55291814", "0.54809403", "0.5463568", "0.54583687", "0.5453691", "0.54518884", "0.5414138", "0.53914666", "0.53914666", "0.53914666", "0.53914666", "0.539...
0.0
-1
3kb. Support for the jssexpand plugin.
function arrayMerge(destination, source) { return source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsmin(input,level,callback,sleep){var a=b='',theLookahead=EOF=-1;var LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';var DIGITS='0123456789',ALNUM=LETTERS+DIGITS+'_$\\\\';var cb=callback;var slp=sleep?sleep:50;var kbStep=10;function isAlphanum(c){return c!=EOF&&(ALNUM.indexOf(c)>-1||c.charC...
[ "0.5693042", "0.56452864", "0.5603044", "0.5507222", "0.5434183", "0.54249126", "0.54203904", "0.53993446", "0.5387056", "0.5336157", "0.5266502", "0.52206725", "0.52186984", "0.5195725", "0.5195725", "0.5195725", "0.51949745", "0.5190634", "0.5189627", "0.51729983", "0.51581...
0.0
-1