query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
queue sequence of balls to start playback | function queueSequence() {
scheduled = [];
let now = context.currentTime;
let bar = Math.round((now - start_time) / beatsToSeconds(4.0));
let start = start_time + bar * beatsToSeconds(4.0);
for (let slot of slots) {
if (slot.on) {
let time = beatsToSeconds(slot.col / 4.0);
playSound(slot.drum... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function queue(){\n\t\twindow.requestAnimationFrame(loop);\n\t}",
"function startQueue () {\n if (queue.started) return\n queue.started = true\n queue.id = setInterval(function () {\n var next = queue.shift()\n if (!next) {\n clearInterval(queue.id)\n queue.started ... | [
"0.6479632",
"0.61854154",
"0.6151152",
"0.6143351",
"0.603038",
"0.6008676",
"0.59698963",
"0.59443265",
"0.5935759",
"0.59255964",
"0.5882317",
"0.58766145",
"0.58705485",
"0.5825776",
"0.58256096",
"0.5820931",
"0.5814805",
"0.58106947",
"0.58106947",
"0.57860667",
"0.5770... | 0.69508994 | 0 |
Exit from editing row | function StopEditing(){
SetEditRow(-1)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function finishEdit(event) {\n var updatedTodo = $(this).data(\"todo\");\n if (event.which === 13) {\n updatedTodo.text = $(this).children(\"input\").val().trim();\n $(this).blur();\n updateTodo(updatedTodo);\n }\n }",
"function finishEdit(event) {\n var updatedActivit... | [
"0.69140047",
"0.68844306",
"0.68257314",
"0.67729247",
"0.6692957",
"0.6687025",
"0.65971345",
"0.65958816",
"0.65880996",
"0.6527298",
"0.6493864",
"0.6482518",
"0.64780456",
"0.64780354",
"0.64145416",
"0.6381324",
"0.63705605",
"0.63560253",
"0.634721",
"0.6329136",
"0.63... | 0.78242856 | 0 |
Creates a new subscription | async function createSubscription(subscription, mimeType) {
const mtype = mimeType || 'application/json';
const response = await http.post(subscriptionsResource, subscription, {
'Content-Type': mtype
});
expect(response.response).toHaveProperty('statusCode', 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSubscription() {\n pubsub\n .topic(topic)\n .createSubscription(subscriber)\n .then(results => {\n const subscriptionResult = results[0];\n console.log(`Subscription ${subscriptionResult} created.`);\n// Once the subs... | [
"0.8107472",
"0.7073862",
"0.7032868",
"0.68511015",
"0.6834743",
"0.6737922",
"0.67349094",
"0.65740466",
"0.6511153",
"0.64605975",
"0.64605975",
"0.6412466",
"0.64115345",
"0.64046115",
"0.6395401",
"0.63713324",
"0.6345671",
"0.62712306",
"0.62492234",
"0.6230064",
"0.613... | 0.7279491 | 1 |
Checks whether a certain subscriptionId entity content has NOT been received | function assertNotificationNoContent(accumPayload, subscriptionId, entityInfo) {
assertExistence(accumPayload, subscriptionId, entityInfo);
const entityId = entityInfo.entityId;
const index = entityInfo.index;
const attribute = entityInfo.attribute;
const entityData = accumPayload[subscriptionId].... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSubscribed(doc) {\n return (\n doc &&\n doc.contextParameters &&\n doc.contextParameters.subscribedNotifications &&\n doc.contextParameters.subscribedNotifications.length > 0\n );\n }",
"function isUnsubscribeSuccessResponse( _reqId, _subId, _inJson) {\n // TODO: better to check wit... | [
"0.6015484",
"0.596195",
"0.5923747",
"0.55093616",
"0.5435952",
"0.54110324",
"0.54073536",
"0.5330292",
"0.53103536",
"0.52745396",
"0.5218931",
"0.51912427",
"0.5134314",
"0.505241",
"0.5051036",
"0.50474304",
"0.50275856",
"0.50275856",
"0.50275856",
"0.5022735",
"0.50116... | 0.59798527 | 1 |
Gets all ngModels from node | function getNgModelNodes(node) {
var query = '[ng-model], [data-ng-model]';
return node.querySelectorAll(query);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getModels() {\n return StaticServices.modelService.get().getModels();\n}",
"function getModels() {\n return standaloneServices_StaticServices.modelService.get().getModels();\n}",
"function getModels() {\n return standaloneServices_1.StaticServices.modelService.get().getModels();\n }",
... | [
"0.68214005",
"0.6781015",
"0.66536075",
"0.63178927",
"0.6095352",
"0.6077866",
"0.60283434",
"0.6005624",
"0.5960191",
"0.58877563",
"0.588479",
"0.5821529",
"0.5774462",
"0.57484245",
"0.572428",
"0.5674551",
"0.5661051",
"0.5548213",
"0.54940546",
"0.5492071",
"0.54894966... | 0.6942971 | 0 |
3. crear una funcion que se encargue de recoger todos estod datos y ponerlos en el navegador. imprimirPlatillos, se encargara a partir de los elementos en platillos convertiorlos a HTML y agregarlos en divplatillos | function imprimirPlatillos(){
// 3.1 me va sa servir para acumular el texto HTML de cada platillo
let platillosHtml = "";
// 3.2 comencemos a recorrer el arreglo de los platillos
for(let i = 0; i < platillos.length; i++){
// console.log(platillosHtml);
// 3.3 a partir de las propiedades ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imprimirPLatillos(){\n //3.1 me va a servir para acumular el texto HTML de cada platillo\n let platillosHtml = \"\";\n //3.2 comencemos a recorrer el arreglo de los platillos\n for(let i = 0; i < platillos.length; i++){\n platillosHtml = platillosHtml + \n `<div class=\"tarjeta\"... | [
"0.7751108",
"0.6795555",
"0.6599461",
"0.6529872",
"0.64740133",
"0.64447296",
"0.6417106",
"0.6415995",
"0.6409488",
"0.64058435",
"0.63891983",
"0.6380562",
"0.633203",
"0.63299334",
"0.63268566",
"0.6320069",
"0.6305921",
"0.6305921",
"0.62851655",
"0.6260882",
"0.6257469... | 0.7819811 | 0 |
4. vamos a crear una funcion que me perita obener el elemento clic en cada boton agregado anteriormente. | function obtenerBotones(){
//4.1 obtener lso elementeos por el nombre de su clase. cokñmo los he generado dinamicamente utilizo getElementsByClassName para tener un arreglo de sos botones
"obtenerElemetoPorSuClase"
let listaBotones = document.getElementsByClassName("boton")
// 4.2 como he obtenido los b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eventoClickBotonD() { // Agrega el evento click a todos los botones de habilitar y deshabilitar\n let listaElementosDOM = document.querySelectorAll(\".botonD\");\n for (let i = 0; i < listaElementosDOM.length; i++) {\n // se asigna evento click a cada boton\n listaElementosDOM[i].addE... | [
"0.6480134",
"0.616515",
"0.616129",
"0.6094705",
"0.60543525",
"0.60305053",
"0.59975725",
"0.59500235",
"0.59451187",
"0.5944609",
"0.58950657",
"0.5876236",
"0.5863847",
"0.58252853",
"0.58009744",
"0.5781468",
"0.5765815",
"0.57504356",
"0.5749043",
"0.5741114",
"0.573534... | 0.68136394 | 0 |
show panel tooltip (only for toolbox icons) | function showPanelTooltip(id, text) {
icon = $(id).getBoundingClientRect();
panel_tooltip.html(text)
.attr("class", "popup-panel-tooltip n visible")
.style("left", (icon.left + 16 - 110) + "px")
.style("top", (icon.top + 40) + "px");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showToolTip(d,i){\n tooltip.classed('showthetooltip', true)\n }",
"function showToolTip($this){\n\tvar msg = $this.attr(\"data-tip\");\n\tif($this.children('span.tooltip').length == 0){\n\t\t$this.append('<span class=\"tooltip\">'+msg+'</span>');\n\t}\n\tvar $tooltip = $this.find('span.tooltip')... | [
"0.72320795",
"0.70357895",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
"0.6990801",
... | 0.75314385 | 0 |
Clears all local storage. | static clearAllLocalStorage() {
localStorage.clear();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearAll() {\n localStorage.clear();\n }",
"clear() {\n try {\n localStorage.clear();\n }\n catch (error) {\n console.error(error);\n }\n }",
"function clearLocalStorage() {\n localStorage.clear();\n}",
"function clearLocalStora... | [
"0.87544054",
"0.83322173",
"0.8206812",
"0.8206812",
"0.8181186",
"0.8170723",
"0.81581753",
"0.8153463",
"0.810503",
"0.80696917",
"0.80510956",
"0.8043833",
"0.80380917",
"0.80298597",
"0.8011009",
"0.7994607",
"0.79841805",
"0.7973921",
"0.7954251",
"0.7947729",
"0.794678... | 0.8815481 | 0 |
Apply a set of options to a currently bound texture. This is an internal function for use by createTexture and loadTexture. | function applyTextureOpts(gl, options) {
if (options.magFilter) {
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, options.magFilter);
}
if (options.minFilter) {
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, options.minFilter);
}
if (options.wrapS) {
gl.texParameteri(gl.TEXTURE_2D... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setFiltering (options = {}) {\n if (!this.valid) {\n return;\n }\n\n this.powerOf2 = isPowerOf2(this.width) && isPowerOf2(this.height);\n // let defualtFilter = (this.powerOf2 ? 'mipmap' : 'linear');\n // this.filtering = options.filtering || defualtFilter;\n th... | [
"0.62348145",
"0.58904475",
"0.5824546",
"0.57639724",
"0.5686604",
"0.5667951",
"0.56513196",
"0.5616692",
"0.560705",
"0.5605217",
"0.55989254",
"0.5587483",
"0.5584665",
"0.5552588",
"0.54315865",
"0.5430785",
"0.5423881",
"0.5406114",
"0.5384386",
"0.537914",
"0.5312255",... | 0.7388561 | 0 |
End the evaluation of the current generation | function endEvaluation(){
console.log('Generation:', neat.generation, '- average score:', neat.getAverage());
neat.sort();
var newPopulation = [];
// Elitism
for(var i = 0; i < neat.elitism; i++){
newPopulation.push(neat.population[i]);
}
// Breed the next individuals
for(var i = 0; i < neat.pops... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function endEvaluation(){\n\n Field.addReport({\n generationId: neat.generation,\n avgScore: neat.getAverage(),\n maxScore: bestCar.brain.score,\n bestCar: bestCar\n });\n\n // add random value for elites and resort in case there would be equal scores\n for(var i = 0; i < neat.elitism; i++){\n n... | [
"0.7025104",
"0.69909316",
"0.65663636",
"0.6486441",
"0.6474113",
"0.64545035",
"0.6431101",
"0.6430097",
"0.6429966",
"0.630937",
"0.6259732",
"0.622432",
"0.622432",
"0.6202839",
"0.6202839",
"0.61753446",
"0.6148177",
"0.60944825",
"0.6088701",
"0.60536724",
"0.6036994",
... | 0.7182183 | 0 |
Function to return a random integer between minVal and maxValue inclusive | function randInt(minVal, maxVal) {
var size = maxVal - minVal + 1;
return Math.floor(minVal + size*Math.random());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRndInteger(min, max) {return Math.floor(Math.random() * (max - min) ) + min;}",
"function getRandomInt(minValue, maxValue) {\n return Math.floor(Math.random() * (maxValue - minValue)) + minValue;\n }",
"function randomIntBetween(minValue,maxValue){\n return parseInt(Math.floor(Math.min... | [
"0.8474653",
"0.8408962",
"0.8408012",
"0.83931315",
"0.8362521",
"0.8265617",
"0.8262089",
"0.8231066",
"0.8228476",
"0.8227103",
"0.82251215",
"0.8222549",
"0.8218023",
"0.8215301",
"0.8214981",
"0.8214981",
"0.8214981",
"0.8214981",
"0.8214981",
"0.8214981",
"0.8214981",
... | 0.86623096 | 0 |
shallow copy defaults + attrs | function assign (defaults, attrs) {
var obj = {};
for (var prop in defaults) {
if (hasOwn.call(defaults, prop)) obj[prop] = defaults[prop];
}
// allow 'true' to just use defaults
if (isObject(attrs)) {
for (var prop in attrs) {
if (hasOwn.call(attrs, prop)) obj[prop] = attrs[prop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static serializedMergeNonDefault(defaults,attrs,src,dest) {\n attrs.forEach(function (attr) {\n if (typeof(src[attr]) != 'undefined') {\n // copy the number 0\n if (typeof(src[attr]) === 'number' ||\n typeof(src[attr]) === 'boolean' ||\n typeof(src[attr]) === 'string' ) {\n ... | [
"0.6991444",
"0.66641647",
"0.65855926",
"0.65400916",
"0.6321782",
"0.6284339",
"0.6152818",
"0.61157095",
"0.6095527",
"0.60728204",
"0.6056095",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0.60337573",
"0... | 0.69019365 | 1 |
Rewrite the UserAgent header to say "Linux" instead of "Windows". | function rewriteUserAgentHeader(e) {
for (var header of e.requestHeaders) {
if (header.name.toLowerCase() === "user-agent") {
// tell itau that we are on FreeBSD, not on Windows
header.value = header.value.replace("Windows NT","FreeBSD OS").replace("Linux","FreeBSD OS");
}
}
return {requestHea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHeaderName() {\n return \"User-Agent\";\n}",
"function overrideUA(req) {\n for (const header of req.requestHeaders) {\n if (header.name.toLowerCase() === \"user-agent\") {\n header.value = CUSTOM_USER_AGENT;\n }\n }\n return { requestHeaders: req.requestHeaders };... | [
"0.6848817",
"0.62614864",
"0.61655885",
"0.6070237",
"0.59403616",
"0.59082556",
"0.58672345",
"0.58564496",
"0.58280385",
"0.5827826",
"0.5827826",
"0.58197904",
"0.58190894",
"0.58190894",
"0.5722706",
"0.5712096",
"0.5702553",
"0.56915945",
"0.56915945",
"0.56683415",
"0.... | 0.7701254 | 0 |
a convenience function for showing a notification on a chat screen. you can give a message type of success, error, or neutral which styles the notification repeats a lot of the code that displayMessage does, might extract that. | function displayNotification(chat_style, message, type){
var styles = {
success: "color: green; font-weight: italic;",
error: "color: red; font-weight: italic;",
neutral: "font-weight: bold;"
};
var str = '<span title="'+timeStamp()+'" style="'+ styles[type] +'">' + message + '</span><br />';
jQuery('#tabs-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMessage(_message, _type, _timeout){\n var iconName, type;\n switch (_type){\n case \"error\":\n iconName = \"img/error.png\";\n type = \"error\";\n break;\n case \"success\":\n iconName = \"img/success.png\";\n type = \"success\";\n break;\n }\n // create the no... | [
"0.80173194",
"0.7929546",
"0.79059094",
"0.7580249",
"0.755439",
"0.7500256",
"0.74801594",
"0.7475539",
"0.73909575",
"0.73909575",
"0.7378991",
"0.73141754",
"0.7290376",
"0.720871",
"0.7204926",
"0.7182967",
"0.7133162",
"0.71331537",
"0.7065313",
"0.70425344",
"0.7035169... | 0.79575795 | 1 |
Get the deepmost chunk array | function getTopChunks() {
return chunkStack[chunkStack.length - 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLarge(arr){\n \n}",
"function flattenDepth(array)\n{\nconsole.log(array.flat(2)); //[1, 2, 3, Array(1), 5]\n}",
"function getChunkForReading(coords) {\n\t\tvar key = getChunkKey(coords);\n\t\t// iterate through all stack items, from deep-most to outer one\n\t\tfor (var i = chunkStack.length - ... | [
"0.5594833",
"0.557989",
"0.55504924",
"0.5428835",
"0.53893363",
"0.53777695",
"0.5375955",
"0.5332327",
"0.5321652",
"0.5311985",
"0.53113073",
"0.5253966",
"0.5253338",
"0.5252456",
"0.52354974",
"0.5195991",
"0.51824915",
"0.51792765",
"0.51783764",
"0.51697326",
"0.51569... | 0.6342611 | 0 |
Gets the chunk specified by its coordinates in the current stack position or null, if the chunk does not exist | function getChunkForReading(coords) {
var key = getChunkKey(coords);
// iterate through all stack items, from deep-most to outer one
for (var i = chunkStack.length - 1; i >= 0; i--) {
if (key in chunkStack[i])
return chunkStack[i][key];
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTile (cellX,cellY)\n{\n\t//debug (\"getTile (\"+cellX+\",\"+cellY+\") - \" + chunksCache.length);\n\t\n\tvar found=null;\n\t\n\tfor (var i=0;i<chunksCache.length;i++)\n\t{\t\n\t\tvar testChunk=chunksCache [i];\n\t\t\n\t\tfound=testChunk.getTile (cellX,cellY);\n\t\t\n\t\tif (found!=null)\n\t\t{\n\t\t\tr... | [
"0.60963637",
"0.57474613",
"0.57173645",
"0.57039225",
"0.5687198",
"0.5685691",
"0.56652",
"0.5629587",
"0.55722225",
"0.55194104",
"0.53269523",
"0.53269523",
"0.5325684",
"0.5308568",
"0.53030574",
"0.5165513",
"0.51492554",
"0.51176727",
"0.5102974",
"0.5042636",
"0.5042... | 0.7775024 | 0 |
Load form for payment from Braintree | function loadDropIn(token, csrf, payment_endpoint, user_payload) {
braintree.client.create({
authorization: token
}, function (err, clientInstance) {
if (err) {
return;
}
braintree.hostedFields.create({
client: clientInstance,
styles: {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"'click .js-submitPaymentButton'(event) {\n event.preventDefault()\n const instance = Template.instance()\n\n // if payment is tokenized\n if (instance.payment.get().state === 'TOKENIZED') {\n\n // if payment method can be requested\n if (instance.dropin.isPaymentMethodRequestable()) {\n ... | [
"0.64059025",
"0.61797416",
"0.615843",
"0.597348",
"0.59478617",
"0.57580596",
"0.560161",
"0.5563833",
"0.5527301",
"0.5464632",
"0.54478633",
"0.543158",
"0.53978765",
"0.53782773",
"0.53782773",
"0.5366178",
"0.52898175",
"0.5272543",
"0.52669305",
"0.526185",
"0.5260875"... | 0.6780261 | 0 |
payload x coordinate of COM | get COMpayload() { return [-this.COMx, 0, 0]; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"coord(x) { return this.field.value(x); }",
"getOriginX() { return this.originX; }",
"getNoteHeadBeginX() {\n return this.getAbsoluteX() + this.x_shift;\n }",
"get offsetX() { return this._offset_x; }",
"function getXCrds(e){\r\n displayX = mapRange(mapRange((e.clientX-rect.left),0,800,-400,400),-400,4... | [
"0.6247874",
"0.6135637",
"0.6017062",
"0.5992037",
"0.5984986",
"0.5890809",
"0.5873889",
"0.58697486",
"0.58693707",
"0.5867041",
"0.5767805",
"0.5767805",
"0.5756467",
"0.5756467",
"0.57537377",
"0.5752909",
"0.57416385",
"0.57334554",
"0.5709602",
"0.57065487",
"0.5680109... | 0.74630135 | 0 |
aerodynamic roll angle [rad] initial roll, pitch, yaw | get roll() { return Math.atan2(Math.sin(this.bank), (Math.cos(this.alpha) * (Math.cos(this.bank) - Math.tan(-this.FPA) * Math.tan(this.alpha)))); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function roll(angle){\r\n\t\r\n // Create a new identity quaternion\r\n var quate = quat.create();\r\n \r\n // Calculate the roll angle\r\n var rollAngle = speed * angle;\r\n \r\n // Create a quaternion from the given angle and rotation axis then returns it\r\n // quat.setAxisAngle = function(out, axis, ra... | [
"0.7055662",
"0.6501173",
"0.6426963",
"0.6287076",
"0.62288934",
"0.6227584",
"0.615684",
"0.6124754",
"0.6114442",
"0.6074751",
"0.60476667",
"0.6003543",
"0.59639734",
"0.596001",
"0.5948734",
"0.5896163",
"0.5896069",
"0.5825474",
"0.5825057",
"0.5802375",
"0.57990706",
... | 0.73357564 | 0 |
initialize live outputs based on the results from trajectory module | function init() {
// defines initial parameters
const altitude = Math.round(trajectoryOptions.cond.h);
const velocity = Math.round(trajectoryOptions.cond.vInf);
const [, , , , , , , , , dynamicPress, mach, , ,] = trajectoryOptions.calcAtmoProperties(altitude, velocity, lander); // eslint-disable-line co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n let lastState = 0;\n\n const motionInput = new MotionInput();\n const intensity = new Intensity();\n const kick = new Kick();\n const bridge = new lfo.sink.Bridge({\n processFrame: frame => {\n const state = frame.data[0];\n console.log(frame.data);\n\n if (lastState !== ... | [
"0.59666294",
"0.5852452",
"0.5842181",
"0.57895386",
"0.5767863",
"0.5583295",
"0.55771905",
"0.5570515",
"0.5539143",
"0.55237556",
"0.54694533",
"0.5445226",
"0.5441389",
"0.5438202",
"0.543409",
"0.54332095",
"0.5431352",
"0.54272836",
"0.5417562",
"0.5416727",
"0.5382973... | 0.6364891 | 0 |
Creates a lander mesh in the initial position and orientation. Creates two coordinate frames: NED and BODY frames. | function init() {
// creates mesh group for BODY and NED FRAMES with axes helpers
const BODYframe = createAxes('BODY', 0.15);
const NEDframe = createAxes('NED', 25);
// creates vehicle geometry and mesh
const points = [];
for (let i = 0; i < xLath.length; i++) {
points.push(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createFrame()\n {\n const texture = loadTexture('doors/side')\n\n const frame = new THREE.Mesh(\n generateWall(10, 4, 0.5, [\n {x: 0.9, y: 0.9, width: 1.2, height: 0.9},\n {x: 0.9, y: 2.2, width: 1.2, height: 0.9},\n {x: 2.5, y: 0.9, width: 1... | [
"0.6436727",
"0.629299",
"0.62357146",
"0.6204725",
"0.5959213",
"0.57911104",
"0.57759774",
"0.5760848",
"0.57362",
"0.57074773",
"0.5674021",
"0.56656",
"0.56656",
"0.56639034",
"0.5656637",
"0.562546",
"0.562155",
"0.56034845",
"0.55797815",
"0.5570678",
"0.5567083",
"0.... | 0.7264089 | 0 |
plays animation 5 times faster | function playAnimX5() {
// does not respond when there are no results
if (Object.keys(results.arr).length === 0) {
const calcnotpressed = document.querySelector('#calcnotpressed');
calcnotpressed.style.visibility = 'visible';
return;
}
if (!isPlay) {
action.play();
action.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function firstLoop() {\n anim.playSegments([0,18], true);\n}",
"function animationGagne()\n{\n \n \n win();\n grue.setPos(2);\n setTimeout(function(){\n sonMario.play();\n mario.setPos(18);\n grue.setPos(1);\n crochet.setPos(2);\n\n\n\n setTimeout(function(){\n ... | [
"0.70117813",
"0.6918327",
"0.68952066",
"0.67423517",
"0.67423517",
"0.6712332",
"0.6609689",
"0.65515417",
"0.65168184",
"0.6501459",
"0.64040047",
"0.64040047",
"0.6390841",
"0.63588256",
"0.6332552",
"0.6332552",
"0.6322343",
"0.63192165",
"0.629299",
"0.6291028",
"0.6289... | 0.74736613 | 0 |
sets clip Action time | function setTime(time) { action.time = time; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRangeTimeLapseAction() {\n rangeTimeLapse.oninput = function(){\n updateLabelDate();\n stopVideo();\n updateImage();\n }\n}",
"function playclip(time) { \n player.start(0, loopStartPoint);\n\n clip.interval = loopLength;\n}",
"function applyModifier(mo... | [
"0.66408086",
"0.6377409",
"0.62196684",
"0.6093065",
"0.59857875",
"0.59851444",
"0.5909496",
"0.5889968",
"0.5881234",
"0.5866342",
"0.58495235",
"0.5794765",
"0.57845336",
"0.5760224",
"0.5752608",
"0.5752608",
"0.5752608",
"0.5752608",
"0.5752608",
"0.5752608",
"0.5752565... | 0.74896 | 0 |
debugger; const Sequelize = require('sequelize'); let sequelize; | function getSquelize(exchangeId) {
sequelize = sequelize || new Sequelize(process.env.PG_CONNECTION_STRING || 'postgresql://postgres:ameen*3n@localhost:5432/trading_bot');
debugger;
return sequelize;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSequelizeInstance() {\n return theSequelizeInstance;\n}",
"function DBInit() {\n let db = require('./util/DBImpl');\n db.SequelizeInit();\n}",
"initializeSequelize(){\n\t\tconst sequelize = new Sequelize(\n\t\t\tthis._props.dbName,\n\t\t\tthis._props.dbUser,\n\t\t\tthis._props.dbPassword, ... | [
"0.6331703",
"0.6196707",
"0.61507714",
"0.6136977",
"0.588353",
"0.58695817",
"0.58206445",
"0.5808848",
"0.57151324",
"0.558552",
"0.55791414",
"0.5519203",
"0.5508649",
"0.53488976",
"0.5342141",
"0.53322774",
"0.5290861",
"0.5254704",
"0.5240814",
"0.52197737",
"0.5216514... | 0.6494986 | 0 |
checks user OpenAPI session status | function get_status() {
VK.Auth.getLoginStatus(function (val) {
if (val.session === null) {
switch_buttons(false);
} else {
get_user_info(val).then(set_user_info).then(vk_cont());
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkSession() {var active = !PROD && localStorage.getItem('authenticated') ? true : false;var timestamp = (0, _utils.grabTimestamp)();var getItemId = function getItemId() {return JSON.parse(localStorage.getItem('userDetails'));};if (getItemId() != null) {return { type: CHECK_SESSION, active: active, auth... | [
"0.727162",
"0.69108737",
"0.6737343",
"0.67197263",
"0.6692616",
"0.66314375",
"0.6559268",
"0.6541547",
"0.65198326",
"0.64614886",
"0.6460551",
"0.6433997",
"0.6428331",
"0.63919485",
"0.6368024",
"0.6360227",
"0.6349285",
"0.634449",
"0.63442683",
"0.634399",
"0.63038343"... | 0.70067173 | 1 |
Function adds the register function to global scope | addGlobalRegisterUIFunction() {
// window.registerUI = this.register.bind(this);
window.registerUI = this.resolveScript.bind(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"register() { }",
"async register() {}",
"register( fn ) {\n this.callbacks.push( fn )\n }",
"function register(name, fn, checkArgs, returns) {\n MISC_FUNCTIONS[name] = {\n checkArguments: checkArgs,\n evaluatedArgs: true,\n evaluate: fn,\n type: re... | [
"0.73613703",
"0.70231485",
"0.6923509",
"0.6769555",
"0.6696746",
"0.6644749",
"0.66370624",
"0.663469",
"0.6457807",
"0.64022934",
"0.63465464",
"0.6346412",
"0.627731",
"0.6249262",
"0.62487984",
"0.62411034",
"0.6229452",
"0.6180385",
"0.6153301",
"0.61498594",
"0.6137693... | 0.7409337 | 0 |
Calculator can display its results in DOM if element provided | function Calculator(displayElement) {
this.$el = $(displayElement || "<div></div>"); // wrap as jQuery element
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display(number){\n const dataCurrentOperand = document.querySelector('[data-current-operand]');\n dataCurrentOperand.innerHTML = number; \n}",
"function getResultOperation() {\r\n document.querySelector(\".btn-result\").addEventListener(\"click\", (event) => {\r\n removeZero();\r\n // pengo... | [
"0.6813343",
"0.6765967",
"0.6756932",
"0.67114437",
"0.6655984",
"0.66263396",
"0.6620895",
"0.6569944",
"0.65572894",
"0.6536526",
"0.652544",
"0.652544",
"0.6517878",
"0.65013254",
"0.6476928",
"0.6460231",
"0.64251035",
"0.64113826",
"0.6382909",
"0.6379952",
"0.6363407",... | 0.6831593 | 0 |
LOADGAME: This is the very first method loaded. It loads game data from a JSON file and shows the gender selection menu | function loadGame() {
// Load scene data from JSON
var request = new XMLHttpRequest();
request.onload = function () {
stateMachineData = new Object();
stateMachineData = JSON.parse(this.responseText);
init();
};
request.open("get", "Assets/sceneData/scenedata.json", true);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadGame() {\n if (!localStorage['rpg_save[meta]']) {\n message('No Saved Game - Starting Fresh', 'info');\n return;\n } else {\n message('Loading Saved Game', 'info');\n }\n\n meta = JSON.parse(atob(localStorage['rpg_save[meta]']));\n \n //resource = JSON.parse(atob(... | [
"0.6643414",
"0.6637901",
"0.6573635",
"0.64434177",
"0.63945884",
"0.63011014",
"0.6226821",
"0.6167778",
"0.61453897",
"0.6130509",
"0.61121136",
"0.60612524",
"0.60234153",
"0.59861857",
"0.598057",
"0.5956643",
"0.5956082",
"0.59303206",
"0.5929461",
"0.5923539",
"0.58902... | 0.7039655 | 0 |
Write a function called displayCities that console.logs all the values in the citiesLivedIn array: | function displayCities() {
for (
var i = 0;
i < instructorData.additionalData.moreDetails.citiesLivedIn.length;
i++
) {
console.log(instructorData.additionalData.moreDetails.citiesLivedIn[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayCities() {\n let cities = instructorData.additionalData.moreDetails.citiesLivedIn;\n for(let i=0; i<cities.length; i++) {\n console.log(cities[i]);\n }\n}",
"function displayCities() {\n // console.log('value', this.value);\n const matchingCities = findCities(this.value, allCities);\n... | [
"0.8348731",
"0.7614272",
"0.72775805",
"0.69691044",
"0.691132",
"0.66582566",
"0.6624044",
"0.6606376",
"0.65664405",
"0.65538925",
"0.6518842",
"0.6429436",
"0.6338753",
"0.6323892",
"0.63221014",
"0.62693584",
"0.6239295",
"0.61880565",
"0.61737597",
"0.61346364",
"0.6132... | 0.84076995 | 0 |
Write a function called displayHometownData that console.logs all the values inside of the hometown object | function displayHometownData() {
var homeTownList = instructorData.additionalData.moreDetails.hometown;
for (key in homeTownList) {
console.log(homeTownList[key]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayHometownData() {\n let hometown = instructorData.additionalData.moreDetails.hometown;\n for(let key in hometown) {\n console.log(hometown[key]);\n }\n}",
"function presentData(orbits) {\r\n orbits.getAllAges();\r\n orbits.getRestOfLife();\r\n\r\n let planetsArr = Object.entries(orb... | [
"0.8290007",
"0.660712",
"0.6349556",
"0.63406205",
"0.6228542",
"0.6215465",
"0.6203615",
"0.6181833",
"0.61083555",
"0.6105366",
"0.6069673",
"0.5994414",
"0.5992343",
"0.5986615",
"0.594617",
"0.59317666",
"0.5899446",
"0.5890114",
"0.5885025",
"0.58678436",
"0.5850956",
... | 0.8327463 | 0 |
write a function called addDetail that accepts two parameters, a key and a value and adds the key and value to the moreDetails object and returns the moreDetails object | function addDetail(key, val) {
var moredetails = instructorData.additionalData.moreDetails;
moredetails[key] = val;
return moredetails;
// console.log(moredetails);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addDetail (key, value) {\n let addTomoreDetails = instructorData.additionalData.moreDetails;\n addTomoreDetails[key] = value;\n return addTomoreDetails;\n}",
"function add(detail) {\n return Axios.post(DETAILS_API, detail).then(async (response) => {\n // Verification si il se trouve en cache\n ... | [
"0.8495778",
"0.63169444",
"0.6074815",
"0.5886709",
"0.58230364",
"0.5614682",
"0.55504334",
"0.55246437",
"0.5507047",
"0.5448775",
"0.54468226",
"0.5441773",
"0.5441773",
"0.5441773",
"0.54402095",
"0.5316402",
"0.53001714",
"0.52487636",
"0.51981753",
"0.5189008",
"0.5175... | 0.85710484 | 0 |
let's write a function called removeDetail that removes a key in the moreDetails object and returns the moreDetails object (the new keys added above are not included in these examples). | function revmoeDetail(keyToBeRemoved) {
var moredetails = instructorData.additionalData.moreDetails;
// console.log(moredetails[keyToBeRemoved]);
// delete moredetails[keyToBeRemoved];
if (keyToBeRemoved in moredetails) {
delete moredetails[keyToBeRemoved];
console.log(keyToBeRemoved + " has been delet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addDetail (key, value) {\n let addTomoreDetails = instructorData.additionalData.moreDetails;\n addTomoreDetails[key] = value;\n return addTomoreDetails;\n}",
"function addDetail(key, val) {\n var moredetails = instructorData.additionalData.moreDetails;\n moredetails[key] = val;\n return moredetail... | [
"0.61475706",
"0.6078158",
"0.5488203",
"0.54560703",
"0.5454211",
"0.54270494",
"0.5389922",
"0.53881264",
"0.52464736",
"0.5233281",
"0.5217937",
"0.5177207",
"0.5084374",
"0.50503427",
"0.504647",
"0.5035778",
"0.5021621",
"0.50086594",
"0.49963304",
"0.49903917",
"0.49896... | 0.8155719 | 0 |
afterLoadPlugins callback Add the sequelize session store | async _afterLoadPlugins() {
//get session plugin
const sessionPlugin = this.pm.plugins['@midgar/session']
//add sequelise store
await sessionPlugin.addStore('sequelize', async (midgar) => {
//if the db is install return sequelize store
if (midgar.services.db.installed) {
return new... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initializeSequelize(){\n\t\tconst sequelize = new Sequelize(\n\t\t\tthis._props.dbName,\n\t\t\tthis._props.dbUser,\n\t\t\tthis._props.dbPassword, {\n\t\t\t\thost: this._props.dbHost,\n\t\t\t\tdialect: this._props.dbDialect,\n\t\t\t\tport: this._props.dbPort,\n\t\t\t\toperatorsAliases: this._props.operatorsAliases,... | [
"0.5810928",
"0.5620125",
"0.536435",
"0.52997935",
"0.5295029",
"0.5294415",
"0.5149178",
"0.5115121",
"0.5114885",
"0.5112647",
"0.50837654",
"0.507943",
"0.502747",
"0.5016156",
"0.5014929",
"0.50003946",
"0.496343",
"0.49527395",
"0.49491316",
"0.49491316",
"0.49491316",
... | 0.88816583 | 0 |
Add POI and route button | function CustomControl(controlDiv, map) {
//Add POI button
var addPOIButton = document.createElement('button');
addPOIButton.setAttribute("class", "controlUI");
addPOIButton.title = ADD_NEW_POI;
controlDiv.appendChild(addPOIButton);
//Marker icon
var marker = document.createElement('span');
marker.set... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapAddPOI(poiData, poiIcon) {\n if (map.getSource(\"places\")) {\n map.getSource(\"places\").setData(poiData);\n } else {\n map.addSource(\"places\", {\n type: \"geojson\",\n data: poiData,\n });\n\n // Add a layer showing the places.\n map.addLayer({\n ... | [
"0.6264439",
"0.595688",
"0.5749734",
"0.57115966",
"0.56911975",
"0.5620071",
"0.55757546",
"0.5497689",
"0.5482198",
"0.5482198",
"0.54669505",
"0.5432948",
"0.54221666",
"0.53926444",
"0.5329181",
"0.5304708",
"0.52826834",
"0.5266649",
"0.524886",
"0.52292174",
"0.5217736... | 0.60420966 | 1 |
Helper function to sort by globalZ | function zsort(a, b) {
return a._globalZ - b._globalZ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortObjectByZ(elements){\n\tsortedElements = [];\n\tconsole.log(elements);\n\tfor(element in elements){\n\t\tsortedElements.push([element, elements[element].index])\n\t};\n\treturn sortedElements.sort(function(a, b){ return a[1] - b[1]});\n}",
"sort() {}",
"function Sort() { }",
"function compare(a,... | [
"0.63008016",
"0.6287777",
"0.6177865",
"0.6147891",
"0.61474127",
"0.60767454",
"0.60345125",
"0.5980166",
"0.58969814",
"0.58185285",
"0.57883114",
"0.57631403",
"0.57460624",
"0.57335496",
"0.56922436",
"0.56849474",
"0.5679669",
"0.56265557",
"0.5620966",
"0.56092894",
"0... | 0.78032583 | 0 |
Read the previous log file and find the last successful promo | function readLog(file) {
let lastSuccessfulPromo;
const convertObjToProcessed = obj => {
let processed = new ProcessedPromo();
processed.id = Number(obj.Id.trim());
processed.gasSpent = Number(obj.Gas.trim());
processed.promo = {
serial: Number(obj.Serial.trim()),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function YModule_get_lastLogs()\n {\n var content; // bin;\n // may throw an exception\n content = this._download(\"logs.txt\");\n return content;\n }",
"handleFetchPreviousLog() {\n // Ongoing previous log fetch, wait for that to complete\n if (this.state.i... | [
"0.59619856",
"0.5892539",
"0.5580566",
"0.54919016",
"0.5427118",
"0.54210585",
"0.5387686",
"0.5381075",
"0.53002906",
"0.52929544",
"0.52632076",
"0.5236534",
"0.5221934",
"0.5163068",
"0.51462024",
"0.5142673",
"0.51180893",
"0.51032096",
"0.4968593",
"0.4968096",
"0.4916... | 0.61683136 | 0 |
promise that verifies the download stream. currently uses etcher's internal hashing methods, but it might be a good idea to switch to blake2 or other in the furure. | function downloadVerifier (source, expectedChecksum) {
return new Promise((resolve, reject) => {
source.createReadStream().then(stream => {
const hasher = new sdk.sourceDestination.ProgressHashStream(sdk.constants.XXHASH_SEED, BITS, 'buffer')
hasher.on('finish', () => {
sdk.utils.streamToBuffe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function verify() {\n const [hashFile, hashFileSignature, key] = await Promise.all([\n getHashFile(),\n getHashFileSignature(),\n getNextKey(),\n ]);\n await verifyHashFileSignature(hashFile, hashFileSignature, key);\n await compareHash(hashFile);\n }",
"function Download()\n{\n... | [
"0.5819565",
"0.57052064",
"0.5681963",
"0.5667534",
"0.565597",
"0.5646296",
"0.5606306",
"0.55431026",
"0.55249375",
"0.54852784",
"0.54435825",
"0.5419808",
"0.5401147",
"0.5400236",
"0.53769934",
"0.536178",
"0.52699554",
"0.5258922",
"0.52469134",
"0.5234585",
"0.5225268... | 0.6197952 | 0 |
Printing Integers with While Print integers from 2000 to 5280, using a WHILE. | function printInt(){
let i = 2000;
while(i <= 5280){
console.log(i)
i++
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function integers(){\n var num = 2000;\n while(num < 5280){\n console.log(num);\n num ++;\n }\n}",
"function whilePrint(){\n var i = 2000;\n var numArr = [];\n\n while (i <= 5280) {\n numArr.push(i);\n i++;\n }\n document.getElementById(\"pq6out\").innerHTML = numArr;\n}",
"function ev... | [
"0.81920326",
"0.7778871",
"0.70092094",
"0.66811186",
"0.6670166",
"0.66155595",
"0.6432369",
"0.6416562",
"0.6399458",
"0.63895905",
"0.6326608",
"0.62674373",
"0.61609375",
"0.6109446",
"0.6107701",
"0.60959256",
"0.608393",
"0.6048348",
"0.60396105",
"0.6030512",
"0.59849... | 0.8273449 | 0 |
Print and Count Print all integer multiples of 5, from 512 to 4096. Afterward, also log how many there were. | function PrintCount() {
var count = 0
for (var i = 512; i < 4096; i++){
if (i%5 == 0){
console.log(i);
count++
}
}
console.log('there are', count, "mulitples of five")
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printAndCount(){\nvar count = 0;\n\n\tfor (var i = 512; i <= 4096 ; i++) {\n\t\tif (i % 5 === 0){\n\t\t\tconsole.log(i);\n\t\t\tcount++;\n\t\t}\n\t}\n\tconsole.log(\"the count is\" + count);\n}",
"function printAndCount(){\n for (let i = 512; i < 4096; i++){\n if (i % 5 === 0){\n console.log(i)... | [
"0.83608955",
"0.8339964",
"0.8099222",
"0.6700599",
"0.66959494",
"0.6590481",
"0.6511094",
"0.643616",
"0.6395992",
"0.63738006",
"0.6373486",
"0.6370113",
"0.6354703",
"0.6295697",
"0.626588",
"0.6216963",
"0.61919147",
"0.6189727",
"0.61725926",
"0.6152883",
"0.6053113",
... | 0.867068 | 0 |
Counting, the Dojo Way Print integers 1 to 100. If divisible by 5, print "Coding" instead. If by 10, also print " Dojo". | function CountingDojo() {
for (var i = 1; i<101; i++){
if (i%5==0){
console.log('Coding')
if(i%10==0){
console.log('Dojo')
}
}
else{
console.log(i)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dojoWay() \n{\n //...loop 1 - 100\n for (var i = 1; i <= 100; i++) \n {\n //...if divisible by 5 -> print \"Coding\"\n if(i % 10 == 0)\n {\n console.log('Dojo');\n }\n //...if divisible by 10 -> print \"Dojo\"\n else if(i % 5 == 0)\n {\n... | [
"0.7972907",
"0.79203266",
"0.7662732",
"0.68972343",
"0.6846025",
"0.65361917",
"0.6416671",
"0.63749075",
"0.63157594",
"0.6297271",
"0.62814224",
"0.62777174",
"0.6272925",
"0.6254226",
"0.62457395",
"0.6244613",
"0.6203316",
"0.61943835",
"0.6188215",
"0.6188203",
"0.6166... | 0.8047629 | 0 |
Countdown by Fours Log positive numbers starting at 2016, counting down by fours (exclude 0), without a FOR loop. | function CountDownFours() {
for(var i = 2016; i>0; i--){
if (i%4==0){
console.log(i)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countdownByFives() {}",
"function countDown(){\n const newYearsDate= new Date(newYears);\n const currentDate = new Date();\n const totalSeconds = (newYearsDate - currentDate)/ 1000;\n \n const days = Math.floor(totalSeconds / 3600 / 24);\n const hours = Math.floor(totalSeconds / 3600 %... | [
"0.65298545",
"0.6100711",
"0.58698153",
"0.5749819",
"0.56295633",
"0.5498224",
"0.5460712",
"0.54341525",
"0.5414581",
"0.5393095",
"0.53891647",
"0.5381225",
"0.5366674",
"0.53628856",
"0.53500026",
"0.5322161",
"0.5289176",
"0.528689",
"0.52626973",
"0.52598184",
"0.52470... | 0.7116632 | 0 |
create an element with 'tagname' and containing 'text' (can be anything) | function createHTML(tagname, text) {return create(tagname).html(text)} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_element(element, text) {\r\n\t\tlet new_element = document.createElement(element);\r\n\t\tnew_element.textContent = text;\r\n\t\treturn new_element;\r\n\t}",
"function createElement(element, text){\n let domElement = document.createElement(element),\n textNode = document.createTextN... | [
"0.80323905",
"0.78696036",
"0.7724592",
"0.76341647",
"0.76060903",
"0.753826",
"0.74900776",
"0.74779797",
"0.74366677",
"0.73720694",
"0.73669755",
"0.73527014",
"0.7316001",
"0.72011566",
"0.71823233",
"0.7146826",
"0.71023434",
"0.707621",
"0.707621",
"0.7053734",
"0.704... | 0.79696554 | 1 |
create a link with 'href' and 'text' | function a(href, text) {return createHTML('a', text).attr('href', href);} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_url(link, text){\n\treturn \"<a href='\"+link+\"' target='_blank'>\"+text+\"</a>\";\n}",
"function createAnchor(text, href) {\n let anchor = document.createElement(\"a\");\n anchor.appendChild(document.createTextNode(text));\n if (href) {\n anchor.setAttribute(\"href\", href);\n ... | [
"0.8226133",
"0.8030273",
"0.76279116",
"0.74572647",
"0.73175216",
"0.72577155",
"0.70660895",
"0.7065482",
"0.7053917",
"0.7050465",
"0.7043111",
"0.7043111",
"0.6936493",
"0.6930996",
"0.68709636",
"0.68210727",
"0.6745631",
"0.6736642",
"0.6723422",
"0.6708628",
"0.670481... | 0.8428003 | 0 |
awakeseries collection of resource data | function awakeCollection (resource, data)
{
var series = {
'key': resource,
'values' : []
};
for (var i=0; i<data['sleep-'+resource].length; i++)
{
series.values.push([new Date(data['sleep-'+resource][i].dateTime).getTime(), +data['sleep-'+resource][i].value]);
}
return series;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSeriesData() {\n let _seriesData = []\n const _itmList = this.getEntityIds()\n for (const id of _itmList) {\n const _entity = this.items[id]\n if (_entity.seriesdata) _seriesData.push(_entity.seriesdata)\n }\n return _seriesData\n }",
"data() {\n ... | [
"0.59130526",
"0.57912815",
"0.5750854",
"0.563081",
"0.5625522",
"0.56172234",
"0.56103563",
"0.55967146",
"0.55940455",
"0.5590936",
"0.5557174",
"0.55098164",
"0.5505253",
"0.5497108",
"0.54969376",
"0.5462715",
"0.5462715",
"0.5408342",
"0.54008186",
"0.53880054",
"0.5362... | 0.6592744 | 0 |
scatterseries collection of resource data | function scatterCollection (resourceSet, dataSet)
{
var dataLength = dataSet[0]['sleep-'+resourceSet[0]].length;
var scatterData = [];
for (var i=0; i<dataLength; i++)
{
var daySet = {
key: dataSet[0]['sleep-'+resourceSet[0]][i].dateTime,
values: [{
x: +dataSet[0]['sleep-'+resourceSet[0]][i].v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSeriesData() {\n let _seriesData = []\n const _itmList = this.getEntityIds()\n for (const id of _itmList) {\n const _entity = this.items[id]\n if (_entity.seriesdata) _seriesData.push(_entity.seriesdata)\n }\n return _seriesData\n }",
"async #getSeri... | [
"0.6367686",
"0.61391175",
"0.6003138",
"0.5884738",
"0.5809275",
"0.5804654",
"0.5736721",
"0.5718674",
"0.570326",
"0.5668445",
"0.5626922",
"0.5595719",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"0.5592009",
"... | 0.7545761 | 0 |
HOW TO USE: Call initialiseCharts() to initialise. Afterwards, use update(beginYear, endYear, genreFilter, countryFilter) to recalculate the charts. CREATE | function initialiseCharts(idRangePicker, idLineChart, idBarChart, idMap, idBubbleChart) {
divIDRangePicker = idRangePicker;
divIDLineChart = idLineChart;
divIDBarChart = idBarChart;
divIDMap = idMap;
divIDBubbleChart = idBubbleChart;
d3.dsv(';')("data/GenreYearCountry.csv", function (error, dat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCharts(container, apiEndpoint, countryList, title, yearArray, yaxislabel) {\n // set legend to year born field\n $(\".legend-block.past .text-label\").text($(\"#born\").val());\n $(\".legend-holder\").show(); // show legend now that the charts are coming\n\n d3.json(apiEndp... | [
"0.68534815",
"0.6718311",
"0.6675959",
"0.6561513",
"0.65397006",
"0.64972746",
"0.64596695",
"0.6445032",
"0.638227",
"0.6371689",
"0.6362469",
"0.6356062",
"0.63050413",
"0.6298674",
"0.6277052",
"0.6271273",
"0.6267061",
"0.6229679",
"0.62143254",
"0.61997",
"0.61953694",... | 0.71218073 | 0 |
Convert "firestore" data into pairs that can be used in line graph, Currently only returns time temperature pair | function parseFirestoreData() {
let timeArr = [];
let TemperatureArr = [];
// let PressureArr = [];
// let ConductivityArr = [];
//console.log(dummyData2);
dummyData2.forEach((timestamp) => {
let keyVal = Object.keys(timestamp);
// console.log(timestamp[keyVal].T);
// console.log(keyVal);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getMissionData(missionName) {\n let dataObj = {};\n let dataset = [];\n\n let dataCoordinatesRaw = {};\n let coordinates = [];\n\n // Specific mission document\n let mission = await db\n .collection(\"Gliders\")\n .doc(gliderUID)\n .collection(\"Missions\")\n .doc(missionName);\n\n... | [
"0.6238944",
"0.6056053",
"0.5956987",
"0.57890594",
"0.56777745",
"0.56274384",
"0.5606293",
"0.5568092",
"0.55653906",
"0.55402815",
"0.54638356",
"0.54303753",
"0.54132557",
"0.53764117",
"0.5330744",
"0.53122675",
"0.5311984",
"0.5295514",
"0.52949846",
"0.5266049",
"0.52... | 0.79695666 | 0 |
button configurators configures download of data to xlsxfile | function createDownloadBtns(btn, chart) {
btn.addEventListener("click", () => {
if (chart.data.datasets[0].data.length != 0) {
downloadExcel(
activeMission,
chart.data.datasets[0].label,
chart.data.datasets[0].data
);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"excelTable(){\n let downloader = new Downloader();\n downloader.postDownload(\"/api/notifications/list/excel\", this.state.data, \"notifications.xlsx\")\n }",
"Export() {\n\n this.Collection();\n var todaysDate =new Date().getTime().toString();\n let a = document.createEleme... | [
"0.6567887",
"0.628006",
"0.6267587",
"0.6213518",
"0.61439097",
"0.61439097",
"0.61147696",
"0.61055726",
"0.6038457",
"0.59430486",
"0.592515",
"0.59080064",
"0.58872837",
"0.5885429",
"0.58334005",
"0.5813448",
"0.5777753",
"0.57761365",
"0.5751163",
"0.5747827",
"0.574769... | 0.6397259 | 1 |
Creates all the charts and adds to array of charts (may not be necessary?) currently includes: Conductivity, Pressure, Temperature | function createAllCharts() {
createChartHTML("Conductivity");
createChartHTML("Pressure");
createChartHTML("Temperature");
const chartConductivity = createChartAndFunctions(
"Conductivity",
"C",
"Conductivity S/m",
"rgba(255, 108, 58",
2
);
const chartPressure = createChartAndFunction... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createAllCharts() {\n // Generate all the config setups\n const config = chartData();\n\n charts.push(createChart('.sales-total canvas', config.salesTotal));\n charts.push(createChart('.sales-reps-compare canvas', config.salesCompare));\n charts.push(createChart('.orders canvas', config.ord... | [
"0.7717523",
"0.7439489",
"0.7357327",
"0.7250744",
"0.7037419",
"0.6963238",
"0.69026816",
"0.68098736",
"0.67648625",
"0.664449",
"0.66412765",
"0.66363823",
"0.6597879",
"0.65792775",
"0.65427667",
"0.6501886",
"0.6456593",
"0.64541817",
"0.6423132",
"0.64190626",
"0.64186... | 0.8318149 | 0 |
changes the value of STORE.hideCompleted | function toggleHideItems(){
console.log('toggleHideItems ran');
STORE.hideCompleted = !STORE.hideCompleted;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeHideCompleted() {\n vm.showLoader = true;\n vm.isTaskVisible = _.isString( $location.search().task );\n\n Project\n .update($scope.project.id, {\n settings: {\n hide_completed: $scope.project.settings.hide_completed\n }\n })\n .then(onProjectUpdateSucce... | [
"0.7092869",
"0.7085534",
"0.6941994",
"0.6724803",
"0.6471306",
"0.6430527",
"0.64147145",
"0.6407927",
"0.6407927",
"0.6393105",
"0.6388569",
"0.638493",
"0.6374409",
"0.6300793",
"0.62401223",
"0.6237471",
"0.6167118",
"0.612577",
"0.61185116",
"0.6076422",
"0.60620105",
... | 0.7647328 | 0 |
when the checkbox with id togglefiltercompleteditems is clicked run toggleHideItems() | function handleToggleHideItemFilter() {
console.log('handleToggleHideItemFilter ran');
$('#toggle-filter-completed-items').click(event => {
toggleHideItems();
renderShoppingList();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleHideItems(){\n console.log('toggleHideItems ran');\n STORE.hideCompleted = !STORE.hideCompleted;\n}",
"function handleCheckedItemFilter() {\n $('.js-checked-item-filter').change(function() {\n toggleCheckedItemFilter();\n renderShoppingList();\n });\n}",
"function checkItem... | [
"0.72026277",
"0.7148138",
"0.6981085",
"0.689137",
"0.67752784",
"0.6641373",
"0.66163665",
"0.6588772",
"0.6578712",
"0.6540847",
"0.650575",
"0.6411723",
"0.6407942",
"0.6387612",
"0.63831824",
"0.63797456",
"0.633784",
"0.63361186",
"0.63042843",
"0.6301445",
"0.6275832",... | 0.76549166 | 0 |
target the form with the class jsshoppinglistsearchentry and on keyup run a function that grabs the searchEntry results, aka the word that the user enters in the search bar then run the current value of searchEntry to the changeSearchTerm() to change the global value of STORE.searchTerm | function handleFilterBySearchTerm() {
$('.js-shopping-list-search-entry').on('keyup', event => {
console.log('handleFilterBySearchTerm fired!');
const searchEntry = $(event.currentTarget).val();
changeSearchTerm(searchEntry);
renderShoppingList();
console.log(`I am mutating the global value of S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keyupHandler() {\n var matches, $html, value = $(this).val();\n // Only proceed if the search needle has changed.\n if (value !== needle) {\n needle = value;\n // Initialize the cache of menu links upon first search.\n if (!links && needle.length >= needleMinLength) {\n // @... | [
"0.7196669",
"0.7039169",
"0.6793373",
"0.679265",
"0.6705022",
"0.66457963",
"0.66324043",
"0.6631028",
"0.6628151",
"0.65434307",
"0.65415215",
"0.6537437",
"0.6533292",
"0.6531373",
"0.6499752",
"0.64939946",
"0.64769894",
"0.6470887",
"0.6459879",
"0.6458949",
"0.64526254... | 0.7057374 | 1 |
Generate a random color based on a hash of the name of the logger | function getRandomLoggerColor(loggerName) {
function getHashCode(str) {
return _.reduce(_.range(0, str.length), function (total, num) {
return str.charCodeAt(num) + ((total << 5) - total);
}, 0);
}
function computeColor(value) {
return ((value... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"randomColor() {\n return '#' + Math.floor(Math.random() * 16777215).toString(16);\n }",
"function generateColor() {\n return '#' + Math.random().toString(16).substr(-6);\n}",
"function createColor(){\n\treturn '#'+ ('000000' + Math.floor(Math.random()*16777216).toString(16)).slice(-6);\n}",
"fun... | [
"0.7446524",
"0.7434274",
"0.73688716",
"0.72482824",
"0.721236",
"0.7209733",
"0.7206138",
"0.71980107",
"0.71773064",
"0.7168664",
"0.7153189",
"0.7134144",
"0.7116739",
"0.71142185",
"0.71102124",
"0.7108413",
"0.70988613",
"0.7096412",
"0.7084822",
"0.707789",
"0.70755464... | 0.83354187 | 0 |
Logger Constructor _new_ `Logger`(string `instance`, [Object `window`]) Creates a new `Logger` object representing a specific component or module defined using the `instance` parameter. `instance` in this case is a string representing the name of the object creating the logger Example: `var log = new Logger("Applicatio... | function Logger(instance, window) {
var self = this;
this.instance = instance;
this.color = getRandomLoggerColor(instance);
this.window = window;
this.useColors = (function useColors(window) {
// is webkit? http://stackoverflow.com/a/16459606/376773
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logger(instanceName) {\n var name = (Utils.isUndefined(instanceName)) ? 'Icecast.js' : \"Icecast.js/\" + instanceName;\n var instance = LogLevel.getLogger(name);\n instance.setLevel(__LOG_LEVEL__);\n return instance;\n}",
"function newLogger() {\n\n const logger = {\n logObj: {\n ... | [
"0.6901845",
"0.6536676",
"0.6323664",
"0.6257734",
"0.6207352",
"0.61917406",
"0.6166819",
"0.6148106",
"0.6147693",
"0.6147693",
"0.6147693",
"0.61458653",
"0.61065495",
"0.6100615",
"0.60989034",
"0.60989034",
"0.60927224",
"0.60823816",
"0.60823816",
"0.60823816",
"0.6082... | 0.78356445 | 0 |
Serves as the single point of access for import logic Even though this class delegates most of the work to the GoogleService, it exists to serve as a layer between the controller and the implementation if, in the future, the backend provider for videos changes, the controller needs no updates. | function ImportService($q, GoogleService) {
var service = {};
// The google libraries are loaded async
// and may not be available when a service
// method is called but we still want to
// enable the call and return a promise
// that will be resolved once the library
// has been loaded.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get apiEndpoint() {\n return 'videointelligence.googleapis.com';\n }",
"function GoogleService($q) {\n var service = {};\n\n // A queue of functions to execute once the\n // google client library is ready\n var readyQueue = [];\n\n var clientId = '45117185497-phoi4l1lpk872mbu5kj3rv69cb6... | [
"0.6003586",
"0.58997595",
"0.58584183",
"0.57622695",
"0.56229013",
"0.561094",
"0.55480003",
"0.5454084",
"0.544904",
"0.54293996",
"0.5404522",
"0.5404404",
"0.5403128",
"0.5347024",
"0.5347024",
"0.5347024",
"0.5347024",
"0.5347024",
"0.5347024",
"0.5347024",
"0.5347024",... | 0.59171796 | 1 |
Converts the given date into W3C datetime format (eg: 20110309T21:55:41Z). | function _w3cDate(date) {
if(date === undefined || date === null) {
date = new Date();
} else if(typeof date === 'number' || typeof date === 'string') {
date = new Date(date);
}
return date.getUTCFullYear() + '-' +
_zeroFill(date.getUTCMonth() + 1) + '-' +
_zeroFill(date.getUTCDate()) + 'T' +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function thingspeakFormatDate(date) {\n \tlet d = new Date(date);\n return d.toISOString().substr(0,19).replace(\"T\",\" \");\n }",
"function parseW3cDate(dateStr) {\n \n if ( dateStr == null || dateStr == '' )\n return null;\n \n var date = null;\n \n var dateAndTime = dateStr.spli... | [
"0.6771883",
"0.6401992",
"0.62556803",
"0.62388825",
"0.6229991",
"0.61983967",
"0.61735195",
"0.61510044",
"0.6111681",
"0.6080695",
"0.6075197",
"0.596576",
"0.5964681",
"0.59555787",
"0.59359455",
"0.5925205",
"0.5915673",
"0.5874267",
"0.5864246",
"0.58336073",
"0.580765... | 0.7516573 | 0 |
Generate random player info with a point limit | function GenerateRandomPlayerInfo(name, points) {
var random;
var info = new PlayerInfo();
var maxStat = 10;
for (var i = 0; i < points; i++) {
random = Math.floor(Math.random() * 7);
if (random == 7) {
random--;
}
DistributePoint(info, random, maxStat);
}
info.name = name;
info.handedness =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randCoord(){\r\n return Math.floor( Math.random() * maxLimit() / 24 ) * 24 ;\r\n}",
"function generatePlayer() {\r\n const randNum = Math.floor(Math.random()*players.length);\r\n return players[randNum];\r\n}",
"function genPoint()\n{\n if (pts.length < MAX_NUM_PTS * 4)\n {\n var velX = ... | [
"0.72175914",
"0.6725073",
"0.6704327",
"0.6633082",
"0.6608466",
"0.65615994",
"0.65577805",
"0.65446115",
"0.65209776",
"0.6467083",
"0.64610463",
"0.64610463",
"0.64610463",
"0.6444011",
"0.64158034",
"0.6389173",
"0.6385567",
"0.6369097",
"0.6367003",
"0.6315188",
"0.6304... | 0.7911669 | 0 |
The component the obstacles and the user piece | function component(width, height, color, x, y)
{
this.width = width;
this.height = height;
this.x = x;
this.y = y;
this.update = function() {
ctx = canvarea.context;
ctx.fillStyle = color;
ctx.fillRect(this.x, this.y, this.width, this.height);
}
// Checks hitt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Component(width, height, image, x, y) {\n this.image = new Image();\n this.image.src = image;\n this.width = width;\n this.height = height;\n this.x = x;\n this.y = y;\n this.speedX = 0;\n this.speedY = 0;\n this.userPull = 0;\n this.update = function () {\n // Redesenha... | [
"0.7129343",
"0.6457519",
"0.6398569",
"0.63034946",
"0.6295442",
"0.6156138",
"0.61508214",
"0.6144639",
"0.61079556",
"0.61019564",
"0.6090307",
"0.60821694",
"0.60809463",
"0.6075709",
"0.6071559",
"0.6055489",
"0.5969449",
"0.59671766",
"0.59541047",
"0.59527344",
"0.5951... | 0.70448697 | 1 |
func_229019_a_(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer$Impl;DDD)V func_218803_a(Lnet/minecraft/world/World;Lnet/minecraft/entity/MobEntity;Lnet/minecraft/pathfinding/Path;F)V func_229574_b_()V func_71190_q(Ljava/util/function/BooleanSupplier;)V | function transformRender( node ) {
for( var i in node.methods ) {
var method = node.methods[ i ];
if( method.name == ASMAPI.mapMethod("func_229019_a_") && method.desc == "(Lcom/mojang/blaze3d/matrix/MatrixStack;Lnet/minecraft/client/renderer/IRenderTypeBuffer$Impl;DDD)V" ) {
for( var i =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r$1b(r,t){if(n$1j(r),t.hasModelTransformation)return r.vertex.code.add(n$1x`vec4 transformPositionWithDepth(mat4 proj, mat4 view, mat4 model, vec3 pos, vec2 nearFar, out float depth) {\nvec4 eye = view * (model * vec4(pos, 1.0));\ndepth = calculateLinearDepth(nearFar, eye.z);\nreturn proj * eye;\n}`),void... | [
"0.5889767",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.55462486",
"0.5448362",
"0.54449576",
"0.5392011",
"0.5369481",
"0.53680784",
"0.5310813",
"0.5291806",
"0.5284761",
"0.5273145",
"0.524556",
"0.521... | 0.5772937 | 1 |
Function that will Add One Octave | addOctave() {
if (this.numOctave < 7){
// Add one Octave to the Piano
this.numOctave+= 1;
this.octaveZero+= 1;
this.octaveOne+= 1;
this.octaveTwo+= 1;
//Move forward 12 keys
this.firstKey += 12;
this.lastKey += 12; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add(r, x){return r + x;}",
"function addOne (x) {\n return x + 1;\n}",
"function addOne(num) {\nreturn num +1;\n}",
"function addOne(x) {\n x = x + 1;\n return x;\n }",
"function add() {\n calculateResult(mathOperations.add, mathOperations.addOperator);\n}",
"function add(x,y)... | [
"0.6183789",
"0.59759825",
"0.58861846",
"0.5809191",
"0.5784552",
"0.574773",
"0.5720116",
"0.5714915",
"0.57118607",
"0.5701307",
"0.5677775",
"0.5663955",
"0.5651299",
"0.5642857",
"0.5622659",
"0.5608826",
"0.5588708",
"0.55850875",
"0.5583208",
"0.5568107",
"0.5564125",
... | 0.64902866 | 0 |
in the event handler, when a piano key is clicked all associated data for that key (note, name, color, and octave which is stored in pianoNotes) is sent as event details (evt.detail) and broken up into variables note, name, and octave. | handleKeyClickCE(evt) {
// detail will hold the information of the Key
let currentNote = evt.detail;
// Detail of the Key
let name = currentNote.name;
let octave = currentNote.octave;
this.note = currentNote.key;
/* event details are placed in to current Note, whe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keyClicked(event) {\n //For test purpose\n //console.log(\"Clicked note : \" + event.target.id);\n \n //Touch or click check function for each individual note\n if (event.target.id == \"note1s\") {\n notePressed(\"note1s\");\n }\n if (event.targe... | [
"0.6561608",
"0.6263508",
"0.6085171",
"0.60513157",
"0.57795495",
"0.5773402",
"0.57639784",
"0.575637",
"0.5739236",
"0.57325685",
"0.5658259",
"0.5600639",
"0.55687165",
"0.5564359",
"0.5498289",
"0.54608685",
"0.53928",
"0.53851867",
"0.535724",
"0.53439605",
"0.5319142",... | 0.7352143 | 0 |
Method that update movie database array stored in local //storage | updateLocalStorage(updatedMovieDatabase){
saveToLocalStorage(updatedMovieDatabase);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function putInLocalStorage() {\n\ttext = JSON.stringify(movieArray);\n\tlocalStorage.setItem(\"movieArray\", text);\n}",
"function setMovieData(index){\n //no need JSON.stringify, because it's not an array\n localStorage.setItem('selectedMovieIndex', index);\n}",
"function setMovieData(movieInd,moviePric... | [
"0.7084315",
"0.68804115",
"0.66584074",
"0.6628413",
"0.6563926",
"0.65207577",
"0.65075886",
"0.650166",
"0.6451164",
"0.6426934",
"0.6421825",
"0.6387032",
"0.6387032",
"0.6387032",
"0.636806",
"0.63479775",
"0.63479775",
"0.6346423",
"0.6333971",
"0.6305921",
"0.6305921",... | 0.7320609 | 0 |
Showing current rate on fired mouseover event | function showCurrentRate(){
var numberOfStars = document.getElementById('starScore');
var rating = this.getAttribute('data-rating');
document.getElementById("starScore").innerHTML = rating;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _hoveringOver(value) {\n vm.overStar = value;\n vm.percent = 100 * (value / vm.max);\n }",
"function mouseover (d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.State, v.freq[d.data.type]]\n ... | [
"0.6762144",
"0.638129",
"0.615988",
"0.6102166",
"0.5998161",
"0.5958283",
"0.5903966",
"0.5901801",
"0.5897949",
"0.58706415",
"0.585152",
"0.58501273",
"0.5849858",
"0.5846139",
"0.5832276",
"0.5824253",
"0.5813135",
"0.57981855",
"0.5791041",
"0.57901514",
"0.57806015",
... | 0.6422336 | 1 |
Function that remove temporay currentChoice from Local Storage and refresh index page | function cleanCurrentChoiceFromLocalStorage(){
//removinig local stored temporary movie id
localStorage.removeItem('currentChoice');
localStorage.removeItem('currentGenre');
localStorage.removeItem('currentYear');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearLocalStorage() {\n localStorage.removeItem('previousSearches');\n}",
"function removeButtonActive() {\n var parent,questId;\n parent = document.getElementsByClassName(\"questelement\")[0];\n parent.parentNode.removeChild(parent);\n ... | [
"0.67436975",
"0.6721419",
"0.6717859",
"0.6596375",
"0.65163803",
"0.65092826",
"0.64782506",
"0.64624894",
"0.64350414",
"0.64019436",
"0.6353847",
"0.6353814",
"0.6352943",
"0.634371",
"0.6338684",
"0.63302535",
"0.63070685",
"0.63045573",
"0.62993914",
"0.62914014",
"0.62... | 0.777106 | 0 |
Changes the watcher's edit permissions | async changeEditPerm(canEdit) {
await db('note_watchers')
.where({
note_id: this.noteId,
user_id: this.id
})
.update({can_edit: canEdit});
this.canEdit = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updateCanEdit() {\n const reviewRequest = this.get('reviewRequest');\n const userSession = RB.UserSession.instance;\n\n this.set('canEdit',\n userSession.get('authenticated') &&\n !userSession.get('readOnly') &&\n !reviewRequest.get('hasDraft'))... | [
"0.6854802",
"0.6842447",
"0.6618027",
"0.6559802",
"0.6546019",
"0.6320112",
"0.6139365",
"0.5947453",
"0.5886454",
"0.5727693",
"0.5723897",
"0.57073134",
"0.56974804",
"0.5688623",
"0.56741554",
"0.56723094",
"0.5671508",
"0.5621234",
"0.5614386",
"0.56042755",
"0.55601346... | 0.809595 | 0 |
Function is use to get family Doctor | function getFamilyDoctors(req, res) {
co(function* () {
let userInfo = yield utility.getUserInfoByToken(req.headers);
let constantmsg= yield utility.language(userInfo);
var count = req.query.count ? req.query.count : 0;
var skip = req.query.count * (req.query.page - 1);
var sorting = req.query.s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPersonFamily(person, people) {\n var parents = getPersonParents(person, people);\n var siblings = getPersonSiblings(person, people);\n var currentSpouse = getPersonCurrentSpouse(person, people);\n var children = getPersonChildren(person, people); \n outputPersonFamilyResults(person, pare... | [
"0.5985347",
"0.57041794",
"0.5678597",
"0.56265265",
"0.5510397",
"0.5483973",
"0.54808754",
"0.5472426",
"0.53023577",
"0.5295053",
"0.52481854",
"0.5153435",
"0.51356936",
"0.51086384",
"0.5051311",
"0.5038187",
"0.4965906",
"0.4950373",
"0.49413463",
"0.49301344",
"0.4911... | 0.5903157 | 1 |
Function is use to color Status by Id | function colorStatusbyId(req, res) {
co(function* () {
let userInfo = yield utility.getUserInfoByToken(req.headers);
let constantmsg= yield utility.language(userInfo);
var id = req.swagger.params.id.value;
Status.findById({_id:id}).exec(function(err, status) {
if (err) {
res.jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getColor(id) {\n return (this.state.selected === id || this.state.highlighted === id) ? '#ff0099' :'#000000';\n }",
"function colorById(d) {\n return assignColor(d.fsa_group_id);\n }",
"function changeStatus(item,res){\n axios.put('/status',{_id: item._id,status:res})\n if (res==='... | [
"0.7364462",
"0.68248266",
"0.67541057",
"0.6699843",
"0.6685933",
"0.6595136",
"0.6545238",
"0.65148854",
"0.64649224",
"0.64439803",
"0.64439803",
"0.6407661",
"0.63920313",
"0.6391059",
"0.6389553",
"0.63751435",
"0.63611645",
"0.6319532",
"0.6309696",
"0.6305929",
"0.6282... | 0.7471983 | 0 |
NORMALIZES THE ITEM NAME TO OUR DB ACCEPTABLE FORMAT: spaces become _ | function normalizeItemName(itemName){
itemName = itemName.trim();//remove new lines from the item TODO have xpath do this
itemName = itemName.replace(/\s+/g, '_')
itemName = itemName.replace(/\W+/g, '')
itemName = itemName.toUpperCase()
return itemName
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeName(birdDataObj){\n var splitTheName = splitName(birdDataObj);\n // Joins the array with underscore\n var combinedName = splitTheName.join('_');\n // console.locombinedNameg(combinedName);\n return combinedName;\n }",
"function underscores_to_dashes(item) {\n\n // if the u... | [
"0.6606377",
"0.64595985",
"0.6343194",
"0.6343194",
"0.63226885",
"0.6230645",
"0.6195722",
"0.61134875",
"0.6008834",
"0.5964459",
"0.59611714",
"0.59604084",
"0.5954313",
"0.5923108",
"0.5904374",
"0.5904374",
"0.5904374",
"0.5900561",
"0.58761257",
"0.57621",
"0.57568485"... | 0.74088514 | 0 |
Fires the SPA route_change event. If it's been over 50ms since the last route change, fire a new route change event. Several Angular events may call this function that trigger off each other (e.g. $routeChangeStart from $locationChangeStart), so this combines them into a single route change. We also want $routeChangeSt... | function fireRouteChange() {
var now = BOOMR.now();
if (now - lastRouteChangeTime > 50) {
BOOMR.plugins.SPA.route_change.call(null, null, arguments);
}
lastRouteChangeTime = now;
// clear any $locationChangeStart triggers since we've handled it
// either via $routeChangeStart or $stateChangeSta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _triggerRoute() {\n if (cache.noTrigger) {\n cache.noTrigger = false;\n return;\n }\n $.router.events.trigger(eventNames.routeChanged, { data: cache.data });\n }",
"function locationChangeStartCallback(e) {\n if (AuthenticationService.getLastConnectTime... | [
"0.5840991",
"0.5666072",
"0.5627991",
"0.56171334",
"0.5602915",
"0.5602915",
"0.5602915",
"0.5602915",
"0.5602915",
"0.5602915",
"0.5602915",
"0.54835993",
"0.5393927",
"0.5242223",
"0.5129996",
"0.5115042",
"0.51121956",
"0.5045893",
"0.49589255",
"0.49288273",
"0.48813942... | 0.7858506 | 0 |
function that show the schedule for the requested period | function showSchedule(yosV,stream,secV,dayV,prdV,context){//context html element that request the schedule
var course="undefined",instructor="undifined",room="undifined";
//get the elements
var yosElement,secElement,dayElement,prdElement;
if(yosV=="-1")
yosElement=activeYosElement;
else
yosElemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySchedules() {\n\t\tclearSchedules();\n\t\t\n\t\tdisplayNextSchedules(10);\n\t}",
"function shellGetSchedule() {\n\tif (_FCFS) {\n\t\t_StdIn.putText(\"Current schedule is FCFS.\");\n\t}\n\telse if (_Priority) {\n\t\t_StdIn.putText(\"Current schedule is Non-Preemptive Priority.\");\n\t}\n\telse {\n... | [
"0.76359725",
"0.6926441",
"0.69197637",
"0.6821076",
"0.66299826",
"0.66131276",
"0.6573485",
"0.6552066",
"0.65279955",
"0.6502245",
"0.64994186",
"0.63965315",
"0.6271157",
"0.6260049",
"0.6260049",
"0.62353665",
"0.62353665",
"0.6224609",
"0.61982465",
"0.6178554",
"0.617... | 0.70955336 | 1 |
get sec element with value attribute of secV on the given yosElement element | function getSecElement(yosElement,stream,secV,context){
if(typeof yosElement == 'undefined'){
window.alert("undefined yos")
return undefined;
}
//window.alert("nodename :"+yosElement.nodeName;
var allSec = yosElement.getElementsByTagName("sec");
for (var i = allSec.length - 1; i >= 0;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDayElement(secElement,dayV,context){\n\tif(typeof secElement == 'undefined'){\n\t\twindow.alert(\"getDayElement\"+ \"undefined sec\");\n\t\treturn undefined;\n\t}\n\t//check dayV if it is for the same dayV\n\tif(dayV==\"-1\"){\n\t\tdayV=activeDayElement.getAttribute(\"value\");//if so get the activeDay... | [
"0.59980094",
"0.5570199",
"0.5209545",
"0.5102986",
"0.50665885",
"0.4904934",
"0.48407316",
"0.4821508",
"0.48209992",
"0.48128897",
"0.4750852",
"0.4722355",
"0.47072202",
"0.4671871",
"0.46565",
"0.46195322",
"0.46162182",
"0.46029913",
"0.4588368",
"0.45853296",
"0.45781... | 0.73463154 | 0 |
get day element with value attribute of dayV on the given secElement | function getDayElement(secElement,dayV,context){
if(typeof secElement == 'undefined'){
window.alert("getDayElement"+ "undefined sec");
return undefined;
}
//check dayV if it is for the same dayV
if(dayV=="-1"){
dayV=activeDayElement.getAttribute("value");//if so get the activeDayElement dayV
context="-1"; /... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPrdElement(dayElement,prdV,context){\n\tif (typeof dayElement == 'undefined') \n\t\t return undefined;\n\t//check prdV if it is for the same prdV\n\tif(prdV==\"-1\"){\n\t\tprdV=activePrdElement.getAttribute(\"value\");//if so get the activePrdElement prdV\n\t\tcontext=\"-1\"; // means use the previous ... | [
"0.63742846",
"0.54027486",
"0.5345434",
"0.5345434",
"0.5345434",
"0.53065735",
"0.52507293",
"0.52497804",
"0.52440554",
"0.52270234",
"0.522605",
"0.5195235",
"0.51559794",
"0.5094118",
"0.50842357",
"0.49907556",
"0.49900225",
"0.49754468",
"0.49649683",
"0.48968488",
"0.... | 0.79337627 | 0 |
get period element with value attribute of prdV on the given dayElement | function getPrdElement(dayElement,prdV,context){
if (typeof dayElement == 'undefined')
return undefined;
//check prdV if it is for the same prdV
if(prdV=="-1"){
prdV=activePrdElement.getAttribute("value");//if so get the activePrdElement prdV
context="-1"; // means use the previous context/tab
}
var all... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDayElement(secElement,dayV,context){\n\tif(typeof secElement == 'undefined'){\n\t\twindow.alert(\"getDayElement\"+ \"undefined sec\");\n\t\treturn undefined;\n\t}\n\t//check dayV if it is for the same dayV\n\tif(dayV==\"-1\"){\n\t\tdayV=activeDayElement.getAttribute(\"value\");//if so get the activeDay... | [
"0.59184617",
"0.5870838",
"0.55282044",
"0.54174054",
"0.5308747",
"0.5268528",
"0.50702643",
"0.5068245",
"0.49540904",
"0.49540904",
"0.49540904",
"0.4911768",
"0.4911768",
"0.4911768",
"0.4911768",
"0.4911768",
"0.4910557",
"0.4894523",
"0.484428",
"0.482574",
"0.47647718... | 0.7627807 | 0 |
AJAX // showHint for course names of the activedepartment hintfor = 1 for courses and 2 for insructor name | function showHint(str,hintFor){
if (str.length == 0) {
document.getElementById("txtHint").innerHTML = "";
return;
} else {
//if & is in the str, then start looking after '&'
if(str.search('&')>0){
str=str.slice((str.search('&'))+1);
//trim white space
str=str.trim();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showHint() {\r\n \r\n\tvar str=document.getElementById('cat').value;\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n document.getElementById(\"Desig\").innerHTML ... | [
"0.69469917",
"0.67791307",
"0.62495756",
"0.6226623",
"0.6216119",
"0.62096053",
"0.616617",
"0.611367",
"0.6104043",
"0.6044868",
"0.6012818",
"0.60072494",
"0.5852597",
"0.58387023",
"0.5816858",
"0.57959414",
"0.578931",
"0.57722294",
"0.5759431",
"0.57485074",
"0.5719362... | 0.6915531 | 1 |
function that set selected hint text to course name input field and clear hints | function setHint(context){
//if there is & in the field// then append after the & char
var strV =document.getElementById("courseName").value;
if(strV.search('&')>0){
document.getElementById("courseName").value=strV.slice(0,strV.search('&')+1)+" "+context.innerHTML;
}else{
document.getElementById("courseName").v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHint2(context){\n\t//if there is & in the field// then append after the & char\n\tvar strV =document.getElementById(\"instructorName\").value;\n\tif(strV.search('&')>0){\n\t\tdocument.getElementById(\"instructorName\").value=strV.slice(0,strV.search('&')+1)+\" \"+context.innerHTML;\n\t}else{\n\t\tdocu... | [
"0.6750296",
"0.65574026",
"0.6142152",
"0.61079717",
"0.6093914",
"0.60905105",
"0.5990484",
"0.59855586",
"0.59639037",
"0.5955736",
"0.5877192",
"0.58370674",
"0.58121693",
"0.5809149",
"0.5803538",
"0.57916284",
"0.57885116",
"0.5784878",
"0.57687366",
"0.57683283",
"0.57... | 0.724209 | 0 |
function that set selected hint text to course name input field and clear hints | function setHint2(context){
//if there is & in the field// then append after the & char
var strV =document.getElementById("instructorName").value;
if(strV.search('&')>0){
document.getElementById("instructorName").value=strV.slice(0,strV.search('&')+1)+" "+context.innerHTML;
}else{
document.getElementById("inst... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHint(context){\n\t//if there is & in the field// then append after the & char\n\tvar strV =document.getElementById(\"courseName\").value;\n\tif(strV.search('&')>0){\n\t\tdocument.getElementById(\"courseName\").value=strV.slice(0,strV.search('&')+1)+\" \"+context.innerHTML;\n\t}else{\n\t\tdocument.getEl... | [
"0.7242929",
"0.6552604",
"0.61423486",
"0.6107907",
"0.6092023",
"0.60886604",
"0.59849894",
"0.59840214",
"0.5961351",
"0.59510607",
"0.5874548",
"0.58349574",
"0.58123946",
"0.5806821",
"0.58016026",
"0.5788717",
"0.5788134",
"0.5782821",
"0.5773665",
"0.5767444",
"0.57569... | 0.6750103 | 1 |
makeEmail make me an email Write the function that will make this code work. | function makeEmail() {
console.log("Make me an Email");
// ---- put function here ----
function makeEmail(fname, lname) {
return `${fname}.${lname}@evolveu.ca`
}
const larryEmail = makeEmail('larry', 'shumlich');
const shouldBeLarryEmail = 'larry.shumlich@evolveu.ca';
if (larryEmail != shouldBeLarryEmail) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateEmail(){\n\n setupDates();\n \n body = \"Your daily update email.\";\n \n body += checkWasteCollection();\n \n body += \"<h2>Humidity Forecast</h2>\";\n \n getWeatherData();\n \n body += \"<br><em>For full weather information, visit the <a href='https://www.metoffice.gov.uk/weather/fore... | [
"0.67715263",
"0.6728889",
"0.6670112",
"0.66102713",
"0.65931875",
"0.6551866",
"0.65315205",
"0.65196484",
"0.6515494",
"0.6500241",
"0.6492749",
"0.64741063",
"0.645357",
"0.64422286",
"0.64404327",
"0.6434871",
"0.6417959",
"0.63906884",
"0.6379364",
"0.6372716",
"0.63422... | 0.7172683 | 0 |
makeTrain make me a train Write the function that will make this code work. | function makeTrain() {
console.log("Make me a Train");
// ---- put function here ----
function makeTrain(a, b, c) {
return `${a}.${b}.${c}`
}
const myTrain = makeTrain('one', 'two', 'three');
const shouldTrain = 'one.two.three';
if (myTrain != shouldTrain) {
console.log("***** We have an error here *****... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function train() {\n //get the label of the class selected from the board\n let label = mltk.getActiveClass();\n //get some data from the board sensor and use it as training features\n let features = mltk.getMagnetometerData();\n mltk.addTrainingData(label, features);\n}",
"function train(){\n clarifai.t... | [
"0.7220872",
"0.7097225",
"0.705095",
"0.6788563",
"0.67334855",
"0.6667919",
"0.66670436",
"0.6600901",
"0.6513355",
"0.62221307",
"0.61946344",
"0.6191522",
"0.6158209",
"0.613174",
"0.6113487",
"0.6111412",
"0.6097401",
"0.60728717",
"0.6046759",
"0.60449946",
"0.6044657",... | 0.7628724 | 0 |
makeEmailArr / Write the function to format an email based on an array | function makeEmailArr() {
// Write the function after this comment ---
function makeEmailArr(arg) {
return `${arg[0]}.${arg[1]}@evolveu.ca`;
}
// and before this comment ---
const arrayLarry = ['larry', 'shumlich'];
assertEquals('larry.shumlich@evolveu.ca', makeEmailArr(arrayLarry));
assertEquals('bill.smith... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeEmailArr(inputArray) {\n\n\tconsole.log(\"array 0 and 1 \", inputArray[0], inputArray[1]);\n\n\treturn inputArray[0] + \".\" + inputArray[1] + \"@evolveu.ca\";\n// try a string literal to concat elemnets\n}",
"function makeEmailArr(arg) {\n\t\treturn `${arg[0]}.${arg[1]}@evolveu.ca`;\n\t}",
"make... | [
"0.7318946",
"0.7014277",
"0.6343349",
"0.6254969",
"0.6182726",
"0.60463005",
"0.5956722",
"0.58936083",
"0.58880967",
"0.58493865",
"0.5794245",
"0.5753107",
"0.57460946",
"0.57343054",
"0.5716054",
"0.5690459",
"0.56871086",
"0.56313133",
"0.5624695",
"0.5609726",
"0.56037... | 0.70215356 | 1 |
5280: Internet Explorer will keep connections alive if we don't abort on unload | function xhrOnUnloadAbort() {
jQuery( window ).unload(function() {
// Abort all pending requests
for ( var key in xhrCallbacks ) {
xhrCallbacks[ key ]( 0, 1 );
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function keepalive() {\n\tcur_ws.is_alive = true\n}",
"function beforeUnload() {\n for (var index = 0; index < currentRequests.length; index++) {\n currentRequests[index].abort();\n }\n}",
"function keepalive() { }",
"function onUncaughtLoad() {\n if (online()) {\n // if there was already an... | [
"0.6447986",
"0.641647",
"0.63310903",
"0.62325734",
"0.6207039",
"0.61461955",
"0.60995346",
"0.59651506",
"0.59651506",
"0.59651506",
"0.59651506",
"0.59651506",
"0.59518206",
"0.59262234",
"0.59215736",
"0.59086424",
"0.5907085",
"0.58819675",
"0.58699304",
"0.58699304",
"... | 0.65578127 | 1 |
Append API response to log.txt | function appendResponse(){
//Convert API response to string and removes commas
var cleanArray = logArray.toString().replace(/,/g, "");
//Uses FS NPM to pass API response with line breaks in utf8 encoding
fs.appendFile('log.txt', "Response:\r\n" + cleanArray + "\r\n", 'utf8', function(err) {
// If an err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addRequest() {\n fs.appendFile(\"log.txt\", textLog, function(err){\n if (err) {\n return console.log(err);\n } \n });\n}",
"function logResponse(respMsg) {\r\n if (logFile == \"yes\") {\r\n fs.appendFileSync(\"error.log\", \"\\r\" + respMsg)\r\n }\r\n}",
"f... | [
"0.7114794",
"0.7037508",
"0.695822",
"0.6803771",
"0.67134935",
"0.66248745",
"0.65498304",
"0.6389443",
"0.63722897",
"0.636899",
"0.6294939",
"0.62729436",
"0.62699693",
"0.62327754",
"0.6211589",
"0.6158485",
"0.6132774",
"0.6124481",
"0.61224145",
"0.61128473",
"0.610991... | 0.82450783 | 0 |
The primnary workflow for a list exchange. Filling in various opts lets us skip ahead. | async function workflow(client: le.LEClient, opts: IArgsFlow) {
// $$$ SAve Opts to file at each stage; can then just resume via '--resume foo.txt'
if (!opts.id) {
if (!opts.h) {
var phrase = await inputPassPhrase();
var encryptor = new Encryptor(phrase);
var file ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"flow(type, opts = {}) {\n assert(flowTypes.indexOf(type) > -1, `${type} is not a flow control option`)\n assert(isObj(opts), `Additional flow options must be passed as an object.`)\n currentPolicy.flow = type\n if (Reflect.has(opts, 'delay')) currentPolicy.delay = opts.delay\n if (Reflect.... | [
"0.46976924",
"0.46590668",
"0.46289545",
"0.4597674",
"0.45771474",
"0.45741516",
"0.4518186",
"0.44671166",
"0.44643563",
"0.44606388",
"0.44566822",
"0.44490287",
"0.44460478",
"0.4434229",
"0.43912464",
"0.4388109",
"0.43865752",
"0.43789157",
"0.43754524",
"0.4360293",
"... | 0.506334 | 0 |
Match the HTML and add the links to the links global variable | function matchHTML(html) {
// Go through whole HTML string, we match for "href="
for (var i = 0; i + 5 < html.length; i++) {
if (html.substring(i, i + 5) == "href=") {
// Get index of start link and set end to start
var start = i + 6;
if (html.charAt(start) == '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMatchedLinks(data) \n {\n // extract every a href info\n let regexHref = /<a.*?href=[\"|'](.*?)[\"|']/gim;\n let matchesLinks = data.match(regexHref);\n \n // extract href source from all the links and add it to url array\n let regexUrl = /href=[\"|'](.*?)[\"|']/\n let i;\n let urls = []... | [
"0.67340404",
"0.67199695",
"0.6539393",
"0.64921355",
"0.62578845",
"0.6220562",
"0.6197013",
"0.61880344",
"0.6182636",
"0.60739875",
"0.6041106",
"0.60297424",
"0.6000645",
"0.5988735",
"0.59609556",
"0.59595114",
"0.5946304",
"0.5941999",
"0.59250385",
"0.58762103",
"0.58... | 0.6966246 | 0 |
Prepare components to show valid and invalid links | function setComponents() {
// Set display for components
setDisplay('htmlExtract', false);
setDisplay('urlExtract', false);
setDisplay('valid', true);
setDisplay('filters', false);
// Build HTML
var html = '<h3>Extracted Links</h3>';
var link_html = [];
for (var i = 0; i <... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setComponents(validLinks, isDict) {\r\n // Build HTML\r\n var html = '';\r\n var raw = '';\r\n var combined = '';\r\n var length = 0;\r\n\r\n if (isDict) {\r\n Object.keys(validLinks).forEach(function (key) {\r\n html += buildLink(key, validLinks[key]);\r\n r... | [
"0.6525314",
"0.56450725",
"0.56378037",
"0.5415843",
"0.5384491",
"0.5381221",
"0.5234566",
"0.50895643",
"0.50804305",
"0.5036418",
"0.5033958",
"0.5022466",
"0.4982067",
"0.4946432",
"0.49445313",
"0.49437654",
"0.4927426",
"0.49015516",
"0.4900837",
"0.4893107",
"0.485526... | 0.6631996 | 0 |
subscribe to the server validation changes | function serverValidationManagerCallback(isValid, propertyErrors, allErrors) {
if (!isValid) {
modelCtrl.$setValidity('valServer', false);
//assign an error msg property to the current validator
modelCtrl.errorMsg = propertyErrors[0].errorMsg;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function realtimeValidation() {\n\n\tconst nameRegEx = /[a-zA-Z]{1,}/;\n\n\tconst $emailInput = $('#mail');\n\tconst emailRegEx = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\n\n\t// These listeners bind to input events, and check the validity of each input\n\t$nameInput.bind('input', () => {isValidInput($... | [
"0.6190109",
"0.6105898",
"0.6105898",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"0.6099538",
"... | 0.69788104 | 0 |
add listeners to the marker provided by i | function addMarkerListeners( i ) {
google.maps.event.addListener(marker[i], 'rightclick', function(event) {
$("#list-instructions").slideUp();
info_windows[i].close();
info_windows[i] = null;
marker[i].setVisible(false);
marker[i].setMap(null);
deal_locations_new... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_listener(i) {\n markers[i].addListener('mouseover', function() {\n if (open_infowindow) { // close old\n open_infowindow.close();\n }\n // open new\n infowindows[i].open(map, markers[i]);\n open_infowindow = infowindows[i];\n });\n }",
"funct... | [
"0.80570734",
"0.71744555",
"0.6611004",
"0.6553022",
"0.64215624",
"0.64018846",
"0.63570774",
"0.63401467",
"0.63399875",
"0.6304465",
"0.6304082",
"0.6302327",
"0.62831545",
"0.627295",
"0.6261808",
"0.62151855",
"0.6207867",
"0.6202257",
"0.62003314",
"0.6181147",
"0.6150... | 0.7661188 | 1 |
close all info windows | function closeAllInfoWindows() {
$.each( info_windows, function(i, item) {
if(info_windows[i] != null ){
info_windows[i].close();
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeInfoWindows() {\n for (i=0; i<this.infoWindowArray().length; i++) {\n this.infoWindowArray()[i].close();\n }\n}",
"function closeAllInfoWindows() {\r\n\tmodifiedMarkerArrayAllInfoWindow(false);\r\n}",
"function closeInfoWindows() {\r\n var len = infoWindows.length;\r\n if (len ... | [
"0.88288087",
"0.8644815",
"0.84852546",
"0.8463024",
"0.8378664",
"0.8144842",
"0.7862934",
"0.77739614",
"0.7702994",
"0.7693923",
"0.76825905",
"0.7625631",
"0.76139855",
"0.7596637",
"0.7426332",
"0.74245065",
"0.7418057",
"0.73930025",
"0.7378941",
"0.7361215",
"0.734272... | 0.88462913 | 0 |
to handle each change from green, to yellow, to red, and then to green again. Complete the function that takes a string as an argument representing the current state of the light and returns a string representing the state the light should change to. For example, update_light('green') should return 'yellow'. fn(str) =>... | function updateLight(current){
switch(current){
case 'green': return 'yellow';
case 'yellow': return 'red';
case 'red': return 'green';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adjust_lightness(color_str, func) {\n /* Hack to handle for example F00 */\n if (color_str.length == 3) {\n color_str = color_str[0] + color_str[0] + color_str[1] + color_str[1] + color_str[2] + color_str[2]\n }\n\n /* More hacks */\n if (color_str == 'black') color_str = '000000';\n... | [
"0.68155515",
"0.6175265",
"0.6033366",
"0.59358114",
"0.59213746",
"0.5908041",
"0.5860511",
"0.58073115",
"0.57891935",
"0.5773238",
"0.5746536",
"0.57253265",
"0.5716841",
"0.56512046",
"0.56364936",
"0.56262213",
"0.5615458",
"0.56153274",
"0.5578684",
"0.5545072",
"0.554... | 0.7230482 | 0 |
Renders a form for uploading one or more cluster/spatial files | function CoordinateLabelForm({
formState,
addNewFile,
updateFile,
saveFile,
deleteFile,
isAnnDataExperience
}) {
const coordinateFiles = formState.files.filter(coordinateLabelFileFilter)
const associatedClusterFileOptions = formState.files.filter(f => f.file_type === 'Cluster')
.map(file => ({ label... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderForm() {\n var formContent = \"\";\n var numOfFiles = $(\"#num_files\").val();\n\n formContent += '<div class=\"form-row\">'+\n '<input type=\"hidden\" id=\"num_uploaded_files\" name=\"num_uploaded_files\" value=\"' + numOfFiles + '\"/></div>';\n\n for (let i = 1; i <= numOfFiles;... | [
"0.61222184",
"0.5964612",
"0.58657837",
"0.58340526",
"0.5774314",
"0.56763303",
"0.5671063",
"0.5663919",
"0.5641011",
"0.56371814",
"0.5624012",
"0.56166744",
"0.559852",
"0.5581538",
"0.55160165",
"0.54952455",
"0.5493402",
"0.54816693",
"0.54791147",
"0.5478483",
"0.5472... | 0.6382734 | 0 |
Attaches listeners to GFM checkboxes. | attachCheckboxListeners() {
const _this = this;
let checkboxIndex = 0;
this.containerRef.current.querySelectorAll('input[type="checkbox"]').forEach(node => {
if (node.getAttribute('data-rendered-by') !== 'markdown-renderer') {
node.setAttribute('disabled', true)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attachListeners() {\n $('xAngle').addEventListener('change', postAngleMessage);\n $('yAngle').addEventListener('change', postAngleMessage);\n $('animateOff').addEventListener('click', function() {\n $('animateOn').checked = '';\n naclModule.postMessage(false);\n });\n $('animateOn').addEventLis... | [
"0.65306526",
"0.6484184",
"0.64108545",
"0.63456917",
"0.62629515",
"0.6186422",
"0.61315674",
"0.606785",
"0.6044165",
"0.5873244",
"0.5851063",
"0.58434784",
"0.5782076",
"0.57378376",
"0.57153285",
"0.57082874",
"0.56987435",
"0.5698097",
"0.56908786",
"0.56906605",
"0.56... | 0.724856 | 0 |
initialise fitVids plugin for resizing IFRAME YouTube videos | function initFitvids() {
$('.block-video').fitVids();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initFitVids() {\n\tjQuery('.video-holder').fitVids();\n}",
"function initFitVids() {\n\tjQuery('#content').fitVids();\n\tjQuery('.videoarea').fitVids();\n}",
"function initFitVids() {\n\tjQuery('.preview').fitVids();\n\tjQuery('.video-block').fitVids();\n}",
"function onPlayerReady() {\n $(flexVi... | [
"0.78577906",
"0.75925875",
"0.756892",
"0.72875154",
"0.72671086",
"0.71977067",
"0.7060155",
"0.6984524",
"0.69372463",
"0.69326293",
"0.6921797",
"0.6893463",
"0.68545794",
"0.678622",
"0.67527753",
"0.667117",
"0.6669577",
"0.66598034",
"0.6630841",
"0.662197",
"0.6599084... | 0.76722705 | 1 |
loading in the numbers | function loadNumbers(n){
for(var i = 0; i < n; i++){
nums[i]= int(random(100));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadNums(numOne, numTwo) {\n document.querySelector(\"#num1\").innerHTML = numOne;\n document.querySelector(\"#num2\").innerHTML = numTwo;\n}",
"function numberLoad(id){\n $(id).each(function () {\n $(this).prop('Counter',0).animate({\n Counter: $(this).text()\n }, {\n ... | [
"0.63816005",
"0.6286582",
"0.6043318",
"0.58624256",
"0.5787548",
"0.5767979",
"0.57387084",
"0.5665059",
"0.56460065",
"0.5603216",
"0.55439264",
"0.5536631",
"0.5509939",
"0.5470362",
"0.542159",
"0.5417854",
"0.5411831",
"0.539816",
"0.53981507",
"0.537596",
"0.53732884",... | 0.63797265 | 1 |
Position the flyout to proper location in the offset container. This positioning is based on both trigger and flyout are in the same offset container. | function __positioning($trigger, $flyout, placement) {
var triggerPos = {
top: $trigger[0].offsetTop,
left: $trigger[0].offsetLeft
};
var triggerSize = {
width: $trigger.outerWidth(),
height: $trigger.outerHeight()
};
var flyoutSize = {
width: $flyout.outerWidth(true),
height: $flyout.outerH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showFlyout(flyout, anchor, placement) {\n flyout.winControl.show(anchor, placement);\n}",
"function adjustOffset() {\n var offsetY = Math.round($formBox.outerHeight());\n\n if (offsetY === 0) {\n // happens when pane gets closed - don't do ... | [
"0.6394231",
"0.6189447",
"0.6023778",
"0.6023778",
"0.58570164",
"0.57932836",
"0.5768422",
"0.5725221",
"0.56308985",
"0.5603886",
"0.5572577",
"0.5563488",
"0.55596435",
"0.5501781",
"0.5477049",
"0.54370236",
"0.54239136",
"0.5398117",
"0.53904045",
"0.5377522",
"0.537679... | 0.6955403 | 0 |
save width in cookie | function advanced_ads_save_width () {
var width = advanced_ads_get_browser_width();
advanced_ads_set_cookie('advanced_ads_browser_width', width, advanced_ads_cookieexpires);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveWindowSize()\n{\n\twidth = $(window).width() \n\theight = $(window).height()\n\t$.cookie(\"windowWidth\", width)\n\t$.cookie(\"windowHeight\", height)\n}",
"function saveCookie() {\n var d = new Date();\n d.setTime(d.getTime() + (30*24*60*60*1000)); // 30 days expiry\n var expires = \"expires=\... | [
"0.6831725",
"0.60534316",
"0.5875172",
"0.587071",
"0.5849151",
"0.5843151",
"0.58163387",
"0.5800457",
"0.5742816",
"0.57196903",
"0.5703396",
"0.56421083",
"0.5641905",
"0.56391495",
"0.56351787",
"0.5612307",
"0.55877376",
"0.5569092",
"0.55555457",
"0.55297136",
"0.54370... | 0.8141989 | 0 |
changeSale('.header, .footer, .item', '.newprice', '.oldprice', '.sale'); | function changeSale(container, newPrice, oldPrice, sale, saleNumber) {
var container = container;
$(newPrice).each(function () {
var price = parseInt($(this).text()),
percent = $(this).closest(container).find(sale).text().replace(/[^0-9]/gim, ''),
currency = $(this).text().... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setItemPrice(){\n\t$('.js_i_total_price_for_one').each(function(){\n\t\tvar i_total_price_for_one = $(this);\n\t\tvar i_get_price_for_one = $(this).closest('.js_item_block').find('.row.active .price_block').html();\n\t\ti_total_price_for_one.html(i_get_price_for_one);\t\n\t})\n}",
"function updateSales(... | [
"0.6394666",
"0.61093307",
"0.6076012",
"0.59964716",
"0.5970257",
"0.59681034",
"0.5888191",
"0.58810353",
"0.58430934",
"0.5837865",
"0.5822454",
"0.5794206",
"0.5752858",
"0.5733821",
"0.57327974",
"0.5698713",
"0.5673374",
"0.5667842",
"0.56523854",
"0.5614821",
"0.561319... | 0.6845277 | 1 |
========================================================= set up playcanvas app ========================================================= | function SetUpPlayCanvas(){
console.log('SetUpPlayCanvas');
pc = require('./client/playcanvas-latest-mod.js').pc;
//require('./client/scriptbase.js');
//console.log(canvas);
app = new pc.Application(canvas,{});
//console.log(app.loader);
//app.loader.load('http://127.0.0.1:3000/client/scriptbase.js', "script");... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup() {\n createCanvas(windowWidth,windowHeight);\n\n setupPlayer();\n}",
"function setup() {\n\n \n createCanvas(windowWidth,windowHeight);\n // specify multiple formats for different browsers\n beach = createVideo(['assets/waves2.mov',\n 'assets/waves2.mov']);\n beach.... | [
"0.70572644",
"0.70210195",
"0.69280314",
"0.6702268",
"0.6633332",
"0.6632206",
"0.6595795",
"0.6562816",
"0.6549864",
"0.6547496",
"0.6508706",
"0.64956445",
"0.6480984",
"0.64761406",
"0.64723164",
"0.6457284",
"0.6452873",
"0.6447951",
"0.6440714",
"0.6440272",
"0.643806"... | 0.7487677 | 0 |
Check if string contains one or more conditions. | function hasCondition(str) {
if (pattern.test(str)) {
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _supportsCondition(str) {\n\t\tif(!str) {\n\t\t\t_supportsCondition.throwSyntaxError();\n\t\t}\n\n\t\t/** @enum {number} @const */\n\t\tvar RMAP = {\n\t\t\tNOT: 1\n\t\t\t, AND: 2\n\t\t\t, OR: 4\n\t\t\t, PROPERTY: 8\n\t\t\t, VALUE: 16\n\t\t\t, GROUP_START: 32\n\t\t\t, GROUP_END: 64\n\t\t};\n\n\t\tvar resul... | [
"0.6160881",
"0.61393327",
"0.61393327",
"0.61279345",
"0.6036065",
"0.5976847",
"0.5858638",
"0.5800298",
"0.5789298",
"0.5728464",
"0.57252234",
"0.572133",
"0.5704508",
"0.5683376",
"0.5658623",
"0.565557",
"0.5637594",
"0.5625538",
"0.5620379",
"0.55478543",
"0.5544604",
... | 0.7369054 | 0 |
When given a string that possibly contains one or more conditions, evaluate them. | function evaluateCondition(input, str, output) {
// Check for universal match
if (str === '*') {
return output;
}
var tokens = str.match(pattern);
// Check if there is a condition at all
if (tokens === null) {
// There is no condition
return null;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _supportsCondition(str) {\n\t\tif(!str) {\n\t\t\t_supportsCondition.throwSyntaxError();\n\t\t}\n\n\t\t/** @enum {number} @const */\n\t\tvar RMAP = {\n\t\t\tNOT: 1\n\t\t\t, AND: 2\n\t\t\t, OR: 4\n\t\t\t, PROPERTY: 8\n\t\t\t, VALUE: 16\n\t\t\t, GROUP_START: 32\n\t\t\t, GROUP_END: 64\n\t\t};\n\n\t\tvar resul... | [
"0.6745099",
"0.63628405",
"0.62803507",
"0.58840346",
"0.5656557",
"0.56300646",
"0.5580486",
"0.5544538",
"0.5541916",
"0.55410904",
"0.5444021",
"0.54336977",
"0.54055184",
"0.5399424",
"0.53884465",
"0.53884465",
"0.5384313",
"0.5344353",
"0.5344028",
"0.5329613",
"0.5313... | 0.67980826 | 0 |
I always thought that my old friend John was rather richer than he looked, but I never knew exactly how much money he actually had. One day (as I was plying him with questions) he said: "Imagine I have between m and n Zloty..." (or did he say Quetzal? I can't remember!) "If I were to buy 9 cars costing c each, I'd only... | function howmuch(m, n) {
let minimum;
let maximum;
let boatPossiblePrices = [];
let carPossiblePrices = [];
let result = [];
if(m > n){
minimum = n;
maximum = m;
} else {
minimum = m;
maximum = n;
}
for(let i = minimum; i <= maximum; i++){
let equationBoat = (i - 2)/7;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMoneySpent(keyboards, drives, b) {\n let combinations = [];\n keyboards.map((keyboard) => {\n drives.map((drive) => {\n combinations.push(drive + keyboard);\n });\n });\n let underBudget = combinations.filter((combo) => combo <= b);\n return underBudget.length != 0 ? Math.max(...underBu... | [
"0.5878441",
"0.5686631",
"0.5673283",
"0.5603153",
"0.5570084",
"0.55515224",
"0.54987246",
"0.5461409",
"0.5459858",
"0.5429805",
"0.5423337",
"0.5415979",
"0.5363827",
"0.5359294",
"0.53177077",
"0.5305954",
"0.53012776",
"0.5273052",
"0.52719",
"0.52702355",
"0.52644724",... | 0.6198823 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.