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 |
|---|---|---|---|---|---|---|
Sets the 'selected' of every object to 'val' | function setAll(val) {
for (var objv in vm.objList) {
vm.objList[objv][vm.selectedName] = val;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setValue(obj, val) {\n if (parseInt(val) == 1) {\n for (var i = 0; i < obj.options.length; i++) {\n if (obj.options[i].text == \"Completed\") {\n obj.options[i].selected = true;\n return;\n }\n }\n }\n else if (parseInt(val) == 0) ... | [
"0.7284863",
"0.7059392",
"0.6865309",
"0.68620133",
"0.6802477",
"0.67790514",
"0.67147756",
"0.6704249",
"0.67001855",
"0.67001855",
"0.6657563",
"0.66554374",
"0.6651004",
"0.6617338",
"0.65904576",
"0.65819806",
"0.6462919",
"0.64537776",
"0.642818",
"0.6386853",
"0.63588... | 0.7717547 | 0 |
Construct API request params | getRequestParams(searchTitle, page, pageSize) {
let params = {};
if (searchTitle) {
params["q"] = searchTitle;
}
if (page) {
params["page"] = page;
}
if (pageSize) {
params["per_page"] = pageSize;
}
return params;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(){\n\t\tthis.params = new URLSearchParams();\n\t\tthis.params.append('apikey', '47f218b0-b5d5-11e8-8c0c-03e1b17d6f1e');\n\t\tthis.params.append('size', 100);\n\t}",
"prepareParams() {\n const { filters } = this.props;\n const params = {};\n\n if (filters !== undefined) {\n // Add status... | [
"0.69572276",
"0.65392005",
"0.65199894",
"0.6422911",
"0.6416404",
"0.6302676",
"0.6271406",
"0.6267313",
"0.62118155",
"0.6211437",
"0.6091614",
"0.6065718",
"0.6065718",
"0.6016345",
"0.60091436",
"0.60086066",
"0.60054547",
"0.6004723",
"0.5996281",
"0.5962155",
"0.595501... | 0.6551596 | 1 |
To make sure we are not running the script on a live CSRS | function checkIfLiveCSRS() {
const res = db.serverCmdLineOpts();
assert(res, "The serverCmdLineOpts command failed");
assert(res.hasOwnProperty("ok"), "The ok field is not present");
assert.eq(1, res.ok, "Failed to obtain the startup configuration parameters");
assert(res.hasOwnProperty("p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isQuietube() {\r\n var quietube = /^http:\\/\\/(www\\.)?quietube\\.com\\/v\\.php\\//.test(document.URL);\r\n \r\n return quietube;\r\n }",
"function checkSetupRan () {\n fs.readFile(CONFIG_PATH, 'utf8', function (err, data) {\n if (err) console.error(err)\n if (data.indexOf(REPLACE_CORDOV... | [
"0.57326925",
"0.57089037",
"0.5625859",
"0.56073725",
"0.5587975",
"0.54947835",
"0.5492637",
"0.54784703",
"0.5474827",
"0.5449219",
"0.5409964",
"0.5404805",
"0.5404285",
"0.5404278",
"0.5390764",
"0.5390282",
"0.53898394",
"0.53824794",
"0.5371812",
"0.5350572",
"0.534582... | 0.612758 | 0 |
To make sure we are not running the script on a mongos | function checkIfMongos() {
const res = db.serverStatus();
assert(res, "The serverStatus command failed");
assert(res.hasOwnProperty("ok"), "The ok field is not present");
assert.eq(1, res.ok, "Failed to run serverStatus command");
assert(res.hasOwnProperty("process"), "The process field is... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"mongo() {\n this.mongoConnection = mongoose.connect(process.env.MONGO_URL, {\n useNewUrlParser: true,\n useFindAndModify: true,\n });\n\n // DO NOT FORGET to execute it in this.init()\n }",
"function initMongo() {\n if (!(mongoose.connection.readyState === 1)) {\n logger.info('Connecting ... | [
"0.5782218",
"0.57401407",
"0.57012606",
"0.56968534",
"0.5649694",
"0.5605457",
"0.5590872",
"0.5571603",
"0.5501775",
"0.5492308",
"0.54234886",
"0.538176",
"0.53456014",
"0.53253245",
"0.5290238",
"0.5268493",
"0.5268056",
"0.52253366",
"0.5202714",
"0.5198359",
"0.5182214... | 0.6783978 | 0 |
Creates a new TriplePatternFragmentsHtmlView | function TriplePatternFragmentsHtmlView(settings) {
if (!(this instanceof TriplePatternFragmentsHtmlView))
return new TriplePatternFragmentsHtmlView(settings);
HtmlView.call(this, 'TriplePatternFragments', settings);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_fragment$3(ctx) {\n \tvar div6, div2, div0, a0, t0, a0_class_value, div0_class_value, t1, div1, a1, t2, a1_class_value, div1_class_value, div2_class_value, t3, div5, div3, div3_class_value, t4, div4, div4_class_value, div5_resize_listener, div5_class_value, div6_class_value, current, dispose;\n\... | [
"0.55618465",
"0.5506088",
"0.5451678",
"0.54446715",
"0.54446715",
"0.54446715",
"0.5435129",
"0.5434323",
"0.5416447",
"0.54001886",
"0.5348085",
"0.53470945",
"0.53191847",
"0.52759606",
"0.52759606",
"0.52229065",
"0.52147204",
"0.5196537",
"0.5188032",
"0.51096064",
"0.5... | 0.82972765 | 0 |
This function allows the user to reset the surface and select a new plane. | reset() {
this.setState({
selectedSurface : -1
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectPlane(){\n\t\tvar select = document.getElementById(\"plane\");\n\t\t//alert(select.value);\n\t\tvar atlas = document.getElementById(\"atlas\");\n\t\tif(select.value == \"Home\"){\n\t\t\tsetTiles(\"none\");\n\t\t\tatlas.style.display = \"block\";\n\t\t} else if (select.value == \"Jaroarfor\"){\n\t\t\... | [
"0.6430001",
"0.6191683",
"0.61114234",
"0.6080016",
"0.6013899",
"0.5981542",
"0.592485",
"0.59221333",
"0.5915626",
"0.59140277",
"0.5897393",
"0.58841383",
"0.5836861",
"0.58239573",
"0.5813667",
"0.579406",
"0.5748915",
"0.57293844",
"0.57123685",
"0.567825",
"0.56704795"... | 0.62359667 | 1 |
Functions changes css class of the "type" with the "value" and removes all other classes with same "type" | function changeClass(value, type){
if(type === "hover"){
let classes = [...hover];
removeElement(classes, value);
$("#btn").addClass(value).removeClass(classes);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_removeClasses(rawClassVal) {\n if (rawClassVal) {\n if (Array.isArray(rawClassVal) || rawClassVal instanceof Set) {\n rawClassVal.forEach((klass) => this._toggleClass(klass, false));\n }\n else {\n Object.keys(rawClassVal).forEach(klass => this... | [
"0.6284646",
"0.6284646",
"0.6284646",
"0.6284646",
"0.6284646",
"0.62452596",
"0.61132854",
"0.6091311",
"0.6091311",
"0.6091311",
"0.6091311",
"0.6091311",
"0.6079293",
"0.6026004",
"0.6024059",
"0.5894187",
"0.58394706",
"0.57902735",
"0.5784449",
"0.5780144",
"0.57660735"... | 0.7124592 | 0 |
getAnimationProp(".hoverpulse") gets the animation on "selector" from the original stylesheet | function getAnimationProp(animationName){
if(animationName === "none"){
return "";
}
let rules = document.styleSheets[0].cssRules;
for(i = 0; i < rules.length; i++){
if(rules[i].name === animationName) return rules[i].cssText;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCSS(properties, duration, easing){\n\t\tvar frames = parse(properties),\n\t\t\tprop = frames[0],\n\t\t\tisTransition = (prop.isTransition != undefined)?prop.isTransition:0,\n\t\t\tn = prop.name || global.className,\n\t\t\td = prop.duration || duration || 0.5,\n\t\t\tl = prop.animationIterationCount || ... | [
"0.6062043",
"0.5734032",
"0.5719885",
"0.5719885",
"0.5617629",
"0.549508",
"0.5417567",
"0.541437",
"0.5412042",
"0.53524125",
"0.5271475",
"0.51986074",
"0.5145974",
"0.5144468",
"0.51210505",
"0.5112316",
"0.5100348",
"0.5100348",
"0.50616115",
"0.5044774",
"0.49861774",
... | 0.6540786 | 0 |
Reusable dropAndLoad function: it reads a local file dropped on a `dropElement` in the DOM in the specified `readFormat` (In this case, we want an arrayBuffer) | function dropAndLoad(dropElement, callback, readFormat) {
var readFormat = readFormat || "DataUrl";
dropElement.addEventListener(
"dragover",
function (e) {
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = "copy";
},
false
);
dropElement.addEventListener(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dropAndLoad(dropElement, callback, readFormat) {\n var readFormat = readFormat || \"DataUrl\"\n\n dropElement.addEventListener('dragover', function(e) {\n e.stopPropagation()\n e.preventDefault()\n e.dataTransfer.dropEffect = 'copy'\n }, false)\n\n dropElement.addEventListener('drop', functio... | [
"0.75295526",
"0.57323235",
"0.55832165",
"0.5496213",
"0.5487095",
"0.53741455",
"0.5356678",
"0.5353497",
"0.5315347",
"0.53017294",
"0.5232105",
"0.5166266",
"0.51406664",
"0.5139232",
"0.51383704",
"0.5111241",
"0.509694",
"0.50695515",
"0.50686467",
"0.5035469",
"0.50270... | 0.73689884 | 1 |
The visualizer object. Calls the `visualization` function every time a new frame is available. Is passed an `analyser` (audioContext analyser). | function visualizer(visualization, analyser) {
var self = this;
this.visualization = visualization;
var last = Date.now();
var loop = function () {
var dt = Date.now() - last;
// we get the current byteFreq data from our analyser
var byteFreq = new Uint8Array(analyser.frequencyBinCount);
analyse... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function visualizer(visualization, analyser) {\n var self = this\n this.visualization = visualization \n var last = Date.now()\n var loop = function() {\n var dt = Date.now() - last\n // we get the current byteFreq data from our analyser\n var byteFreq = new Uint8Array(analyser.frequencyBinCount)\n ... | [
"0.80807984",
"0.6798192",
"0.64356977",
"0.630204",
"0.59882444",
"0.58775574",
"0.5868748",
"0.58381945",
"0.5721525",
"0.55355453",
"0.5498082",
"0.5472061",
"0.53749067",
"0.53660166",
"0.53412473",
"0.5334759",
"0.53249836",
"0.531268",
"0.5286881",
"0.52542347",
"0.5247... | 0.810662 | 0 |
====================================================================== Internal Function ====================================================================== Main Function to send report | function sendReport() {
try {
// Step 1. Get Report Model by ReportName
var reportInfoResult = aa.reportManager.getReportInfoModelByName(reportName);
if(reportInfoResult.getSuccess() == false) {
// Notify adimistrator via Email, for example
logError("Could not found this report " + reportName); ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendReport() {\r\n\t framework.sendReport(); \r\n}",
"function mailReport() {\n \n \n \n \n if (RECIPIENT_EMAIL) {\n \n var SUBJECT = \"test\"\n //here is where we can customize the body of the report\n var BODY = \"campaign report: \" + campSpreadsheet.getUrl() +\n \" ad perf... | [
"0.81679505",
"0.69628954",
"0.6544311",
"0.65098614",
"0.6484306",
"0.63662595",
"0.63660413",
"0.63476706",
"0.6342422",
"0.6334306",
"0.6332116",
"0.63236475",
"0.63176346",
"0.62999856",
"0.6261255",
"0.62603956",
"0.62559843",
"0.6246222",
"0.61952317",
"0.61939764",
"0.... | 0.7874869 | 1 |
TODO: create a function called `returnLastElement` that accepts an array and returns the last element of that array | function returnLastElement (array){
var lastIndex = array.length -1;
return (array[lastIndex]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnLastElem(arr) {\n\treturn arr[arr.length - 1];\n}",
"function lastElement(arr) {\n\n}",
"function lastElement(array){\n \n if(array.length > 0){\n return array[array.length - 1];\n }\n else{\n throw \"Can not take the last element of an empty array\";\n }\n}",
"fun... | [
"0.8754109",
"0.8675162",
"0.86296743",
"0.8621844",
"0.8481945",
"0.8428741",
"0.8386784",
"0.8357252",
"0.83408326",
"0.83308446",
"0.83246434",
"0.8274694",
"0.82605624",
"0.82519376",
"0.82519376",
"0.82512087",
"0.82421863",
"0.82242674",
"0.8218993",
"0.82037616",
"0.81... | 0.88085127 | 0 |
Unbind the LDAP client from the LDAP server. | unbind() {
this._connected = false;
this._ldapjsClient.destroy();
Log.debug('Unbind LDAP client success');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UnbindResponse(options) {\n if (!options)\n options = {};\n if (typeof(options) !== 'object')\n throw new TypeError('options must be an object');\n\n options.protocolOp = 0;\n LDAPMessage.call(this, options);\n this.__defineGetter__('type', function() { return 'UnbindResponse'; });\n}",
"unbi... | [
"0.62717366",
"0.5830409",
"0.56019974",
"0.5509213",
"0.53879625",
"0.5313361",
"0.52949846",
"0.5270312",
"0.52551043",
"0.52551043",
"0.52551043",
"0.52537537",
"0.5232129",
"0.52231777",
"0.5217017",
"0.52109456",
"0.5184166",
"0.5127788",
"0.5114726",
"0.50808245",
"0.50... | 0.87677556 | 0 |
Funcion que retrocede el video en 10 seg | function retroceder() {
video.currentTime -= 10;
console.log(video.currentTime)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adelantar() {\n\n \n video.currentTime += 10;\n console.log(video.currentTime)\n}",
"function reproductor(video0,video, video2,video3,video4,video6,video7,video8,video9,video10){\n\n\tvideo6.style.opacity = \"0\";\n\tvideo7.style.opacity = \"0\";\n\tvideo8.style.opacity = \"0\";\n\tvideo9.style.opaci... | [
"0.66788286",
"0.65980643",
"0.65822136",
"0.65536773",
"0.6376854",
"0.6360762",
"0.63534456",
"0.62620455",
"0.62545276",
"0.6226497",
"0.62242144",
"0.62108207",
"0.6149969",
"0.6145967",
"0.6140861",
"0.613028",
"0.61089885",
"0.6107874",
"0.6107108",
"0.6102859",
"0.6077... | 0.71812767 | 0 |
Funcion que adelanta el video en 10 seg | function adelantar() {
video.currentTime += 10;
console.log(video.currentTime)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reproductor(video0,video, video2,video3,video4,video6,video7,video8,video9,video10){\n\n\tvideo6.style.opacity = \"0\";\n\tvideo7.style.opacity = \"0\";\n\tvideo8.style.opacity = \"0\";\n\tvideo9.style.opacity = \"0\";\n\tvideo10.style.opacity = \"0\";\n\n\tvideo0.load();\n\tvideo.load();\n\tvideo2.load()... | [
"0.6893985",
"0.67911506",
"0.676973",
"0.6499224",
"0.6490429",
"0.6481646",
"0.6473646",
"0.6431705",
"0.6369279",
"0.6336181",
"0.6322723",
"0.6281829",
"0.62812775",
"0.62689924",
"0.62621343",
"0.6260966",
"0.6228631",
"0.62219435",
"0.6220748",
"0.61918527",
"0.6187475"... | 0.70771575 | 0 |
Reinicia el video actual y lo vuelve a reproducir | function reiniciar() {
video.load();
playPause();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }",
"function manipulatevideo(){\n if( cameravideo || capturevideo ){\n cameravideo = false;\n capturevideo = false;\n capturestream = null;... | [
"0.70306945",
"0.68231475",
"0.662444",
"0.65939766",
"0.65764064",
"0.65761054",
"0.6536873",
"0.6433642",
"0.6427136",
"0.64125365",
"0.6410679",
"0.6409091",
"0.64054924",
"0.63491166",
"0.63475865",
"0.63117594",
"0.6300851",
"0.62727726",
"0.62672895",
"0.6250018",
"0.62... | 0.7423081 | 0 |
Add the given identifier signature to the list, if not already present | function addIdentifierSignature(idSignature) {
if(!idSignatures.includes(idSignature)) {
idSignatures.push(idSignature);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeIdentifierSignature(idSignature) {\n if(idSignatures.includes(idSignature)) {\n let index = idSignatures.indexOf(idSignature);\n idSignatures.splice(index, 1);\n }\n}",
"function addToEncodedSignatureMap(signature) {\n // skip... already done\n if (encodedSignatureMapReverse.has(signatur... | [
"0.61159986",
"0.558359",
"0.5577203",
"0.5461849",
"0.5383428",
"0.5333141",
"0.52904975",
"0.5151122",
"0.51420265",
"0.50970227",
"0.5075104",
"0.4924935",
"0.491228",
"0.4878793",
"0.48685485",
"0.48258483",
"0.4803998",
"0.4794646",
"0.47932377",
"0.4780224",
"0.4765968"... | 0.81937313 | 0 |
Remove the given identifier signature from the list, if present | function removeIdentifierSignature(idSignature) {
if(idSignatures.includes(idSignature)) {
let index = idSignatures.indexOf(idSignature);
idSignatures.splice(index, 1);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeTest(identifier){\n \tif (this.reststublist.indexOf(identifier) > -1)\n \t\t\tthis.reststublist.splice(this.reststublist.indexOf(identifier), 1);\n }",
"removeRestChain (identifier){\n if (identifier in this.local_RestStubs)\n this.local_RestChains.splice(this.local_RestChains.indexOf(identifie... | [
"0.63789743",
"0.62524134",
"0.5983628",
"0.5917186",
"0.5914309",
"0.58730185",
"0.57589775",
"0.5681175",
"0.56065667",
"0.559737",
"0.55610895",
"0.5550784",
"0.55387515",
"0.55158526",
"0.55017656",
"0.55016124",
"0.549968",
"0.54880464",
"0.54822046",
"0.54249364",
"0.54... | 0.813492 | 0 |
Complete the input with the clicked identifier signature | function selectIdentifierSignature() {
selectedIdSignature = this.id;
idFilter.value = selectedIdSignature;
selectButton.removeAttribute('disabled');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logMe(){\n inputValue.value=inputValue.value+this.id; //this.innerText can be used too\n} //+this.id considers multi digits instead of replacing it with each click",
"function digitDisplay(id) {\n document.getElementById(id).addEventListener(\"click\",function(){\n pinGeneratorInput.value+=do... | [
"0.5909835",
"0.5765662",
"0.5635081",
"0.5596963",
"0.5582916",
"0.54677624",
"0.5451316",
"0.5434464",
"0.53716844",
"0.53644705",
"0.536294",
"0.53298545",
"0.53156835",
"0.53156835",
"0.5310789",
"0.5302577",
"0.5295099",
"0.5288426",
"0.52753943",
"0.5249659",
"0.5237943... | 0.59934264 | 0 |
Update the ID dropdown options based on the input ID fragment | function updateIdDropdown() {
if(isSelected) {
return;
}
let updatedDropdownItems = document.createDocumentFragment();
let numberOfMatches = 0;
let idFragment = idFilter.value;
idSignatures.forEach(function(idSignature) {
if(idSignature.includes(idFragment)) {
let button = document.createEle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static updatePedidoSelector(data) {\n let select = document.getElementById(\"editPedidoSelect\");\n select.innerHTML = \"\";\n\n for (let i=0; i<data.length; i++) {\n var option = document.createElement(\"option\");\n option.text = data[i].id;\n option.setAttri... | [
"0.6884181",
"0.6777475",
"0.67141455",
"0.650263",
"0.6488048",
"0.6392735",
"0.6326724",
"0.61875916",
"0.6159506",
"0.61322147",
"0.61062455",
"0.60942423",
"0.6072582",
"0.6068224",
"0.60596174",
"0.605313",
"0.6051627",
"0.5982679",
"0.59722996",
"0.59691775",
"0.596257"... | 0.7037644 | 0 |
Insert a raddec into the DOM as a | function insertRaddec(raddec) {
let tr = document.createElement('tr');
tr.setAttribute('class', 'monospace animated-highlight-reelyactive');
appendTd(tr, new Date(raddec.timestamp).toLocaleTimeString(), 'text-center');
appendTd(tr, prepareEvents(raddec), 'text-center');
appendTd(tr, raddec.rssiSignature[0].r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertDom(element){\n\n}",
"function InsertNode() {}",
"function addDancingRiversLogo() {\n\n var dancingRiversLogoTemplate = document.getElementsByTagName(\"template\")[15];\n var dancingRiversLogoTemplateContent = document.importNode(dancingRiversLogoTemplate.content,true);\n document.getEl... | [
"0.57242686",
"0.56315094",
"0.55501044",
"0.54754454",
"0.53933185",
"0.5374206",
"0.53378546",
"0.52996224",
"0.52996224",
"0.5280623",
"0.5261474",
"0.52600133",
"0.52356863",
"0.52299345",
"0.52178603",
"0.5184823",
"0.5105782",
"0.50904953",
"0.5071623",
"0.50679356",
"0... | 0.7024151 | 0 |
Update the given node with the given content | function updateNode(node, content, append) {
append = append || false;
while(!append && node.firstChild) {
node.removeChild(node.firstChild);
}
if(content instanceof Element) {
node.appendChild(content);
}
else if(content instanceof Array) {
content.forEach(function(element) {
node.appen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateNodeContent(node, content) {\n this.getNode(node).innerHTML = content;\n }",
"function setTextContent(node, text) {\n node[0].children[0].data = text;\n}",
"function ex3_update_node(node_name, field_name, value) {\n get_node(node_name)[field_name] = value;\n // Update everything\n update_all();\n... | [
"0.81051874",
"0.69789934",
"0.69162595",
"0.6904831",
"0.687865",
"0.67131364",
"0.6556066",
"0.64799166",
"0.64162314",
"0.6371638",
"0.63359654",
"0.63055944",
"0.6298159",
"0.62976366",
"0.61668813",
"0.60865843",
"0.598212",
"0.59558046",
"0.5898815",
"0.5847815",
"0.584... | 0.7095035 | 1 |
Prepare the event icons | function prepareEvents(raddec) {
let elements = [];
raddec.events.forEach(function(event) {
let i = document.createElement('i');
let space = document.createTextNode(' ');
i.setAttribute('class', EVENT_ICONS[event]);
elements.push(i);
elements.push(space);
});
return elements;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setIconsPlace(){\r\n\r\n\t\t// media query\r\n\t\tvar mediaQuery = window.matchMedia('only screen and (max-width: 768px), only screen and (max-device-width: 768px)').matches;\r\n\r\n\t\tif (mediaQuery){\r\n\t\t// mobile version\r\n\t\t\r\n\t\t\t// set event buttons to left:0\r\n\t\t\t$(\".eventPoint\").cs... | [
"0.66002756",
"0.6440156",
"0.6305174",
"0.62802935",
"0.62331265",
"0.6160006",
"0.6152906",
"0.5975328",
"0.59578854",
"0.5924515",
"0.5814107",
"0.5746124",
"0.57242596",
"0.5719748",
"0.56542486",
"0.5607006",
"0.5607006",
"0.5605698",
"0.55839866",
"0.5580729",
"0.557292... | 0.64547473 | 1 |
Fetch the device associations and story, update entry fields | function fetchAndUpdateStoryEntry() {
isSelected = true;
idFilter.setAttribute('readonly', 'readonly');
idDropdown.innerHTML = '';
cormorant.retrieveAssociations(baseUrl, selectedIdSignature, false,
function(associations) {
selectButton.setAttribute('disabled', 'disabled');... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function retrieveAssociations(serverUrl, deviceId, isStoryToBeRetrieved,\n callback) {\n let url = serverUrl + '/associations/' + deviceId;\n retrieve(url, 'application/json', function(status, responseText) {\n let deviceAssociations = null;\n let isStoryBeingRetrieve... | [
"0.5441928",
"0.50324386",
"0.4955507",
"0.4908318",
"0.48685628",
"0.48620585",
"0.48420435",
"0.48169267",
"0.4810256",
"0.47899935",
"0.47136152",
"0.4701234",
"0.4699435",
"0.46612433",
"0.4657447",
"0.4651007",
"0.46434778",
"0.46319664",
"0.46281412",
"0.46185848",
"0.4... | 0.6158909 | 0 |
Adds community id to user data in the DB | async addCommunity(data) {
const { userId, communityId } = data;
await firebase
.database()
.ref('user/' + userId + '/community')
.set(communityId, error => {
if (error) {
throw Error('Adding the community to the user failed!', error);
}
});
// Get Communit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async createCommunity(data) {\n let key = null;\n await firebase\n .database()\n .ref('communities/')\n .push({ ...data })\n .then(\n snapshot => {\n key = snapshot.key;\n },\n error => {\n if (error) {\n throw Error('Creating a new commun... | [
"0.6336329",
"0.60296",
"0.5740054",
"0.57125163",
"0.569044",
"0.56386787",
"0.5596999",
"0.5593849",
"0.5575505",
"0.55603516",
"0.5505826",
"0.5483025",
"0.5479076",
"0.5475934",
"0.54602724",
"0.5455925",
"0.5449284",
"0.54449433",
"0.5403787",
"0.5362923",
"0.53544974",
... | 0.76668537 | 0 |
Creates a new community and returns the id of the new community | async createCommunity(data) {
let key = null;
await firebase
.database()
.ref('communities/')
.push({ ...data })
.then(
snapshot => {
key = snapshot.key;
},
error => {
if (error) {
throw Error('Creating a new community failed!', err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async addCommunity(data) {\n const { userId, communityId } = data;\n await firebase\n .database()\n .ref('user/' + userId + '/community')\n .set(communityId, error => {\n if (error) {\n throw Error('Adding the community to the user failed!', error);\n }\n });\n\n ... | [
"0.6887501",
"0.62274086",
"0.6168065",
"0.60552126",
"0.5946303",
"0.5271903",
"0.5161523",
"0.5131784",
"0.5094861",
"0.50793177",
"0.5063554",
"0.502599",
"0.49994335",
"0.4996826",
"0.49893534",
"0.4988252",
"0.49845007",
"0.49815318",
"0.49725506",
"0.49341044",
"0.49255... | 0.7295964 | 0 |
how to use testFlyweight() | function testFlyweight() {
//注文されたコーヒーの種類
var flavors = new CoffeeFlavor();
//注文があったテーブル
var tables = new CoffeeOrderContext();
//注文数
var ordersMade = 0;
var flavorFactory;
function takeOrders(flavorIn, table) {
flavors[ordersMade] = flavorFactory.getCoffeeFlavor(flavorIn);
tables[ordersMade++]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function test_bottleneck_provider() {}",
"function test_utilization_host() {}",
"function test_bottleneck_host() {}",
"function testFunction() {\n\t\t\treturn true;\n\t\t}",
"function testFunction() {\n\t\t\treturn true;\n\t\t}",
"function runTests() {\n\ttestBeepBoop();\n\ttestGetDigits();\n}",
"funct... | [
"0.6079251",
"0.574001",
"0.571465",
"0.5520773",
"0.5520773",
"0.55063605",
"0.5456856",
"0.5456482",
"0.5456482",
"0.5456482",
"0.54383117",
"0.54167324",
"0.5318148",
"0.52968436",
"0.52920854",
"0.52920854",
"0.5188569",
"0.51737374",
"0.51720166",
"0.5171303",
"0.5131869... | 0.682925 | 0 |
Converts a batch of results from applyMessage into a list of changes | function r2changes(results) {
return results.map(function(res) { return res.slice(1) }).filter(function(changes) { return changes.length })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getUpdateMessages() {\n const result = [];\n if (this.moving) {\n result.push(...this.getMoveMessages());\n }\n\n return result;\n }",
"applyChanges() {\n for (let i = 0; i < this.statusList.length; i++) {\n this.board.updateCell(...this.statusList[i]);\n }\n\n this.statusList = [... | [
"0.65033853",
"0.60605204",
"0.5788666",
"0.57542574",
"0.569939",
"0.55324966",
"0.5525031",
"0.5520696",
"0.5520696",
"0.5520696",
"0.5514181",
"0.5456802",
"0.54426587",
"0.54402536",
"0.5437567",
"0.5402672",
"0.5402672",
"0.53142416",
"0.52692074",
"0.52569383",
"0.52472... | 0.6762654 | 0 |
Adds the message to the history of the object | function addHistory(msg, msgData, authi) {
// var prev = (msgData.prev && msgData.prev.$msg) ? msgData.prev.$msg.toString('hex') : null
var entry = { id: msg.id, authi: authi, seq: msgData.seq }
var index = entry.seq - 1 // seq is 1-based
// branch in history?
if (state.history[index]) {
if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pushMessage(state, message) {\n // state.messages.reverse().push({\n state.messages.push({\n id: state.messages.length,\n date: new Date(),\n ...message,\n });\n }",
"function addMessage(sender, message, tabName) {\r\n\tvar date = new Date();\r\n\tvar newRecord = new HistoryRecord({\r\n ... | [
"0.7273042",
"0.7099663",
"0.69005495",
"0.6782281",
"0.67418456",
"0.6739948",
"0.66516685",
"0.6640859",
"0.66171205",
"0.6514518",
"0.6497964",
"0.6376945",
"0.6370797",
"0.6354475",
"0.63506836",
"0.633044",
"0.63087946",
"0.6285107",
"0.6285107",
"0.6269903",
"0.6259451"... | 0.71162575 | 1 |
Places the message in the buffer to be run after a causal dependency is handled | function bufferMessage(depId, msg, seq) {
state.buffer.push({ depId: depId, msg: msg, seq: seq })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"waitForMessage_() {\n this.wait_(4, buffer => {\n this.wait_(buffer.readUInt32BE(0), buffer => {\n this.push(this.getMessage_(buffer));\n process.nextTick(() => this.waitForMessage_());\n });\n });\n }",
"processBuffer () {\n this.ready = true\n this._triggerBuffer()\n thi... | [
"0.6051787",
"0.5957444",
"0.58392507",
"0.5774924",
"0.5740278",
"0.56410176",
"0.55930984",
"0.5592897",
"0.55889857",
"0.5561328",
"0.5555366",
"0.55448246",
"0.5485193",
"0.5451145",
"0.54259866",
"0.54259866",
"0.5411408",
"0.54071105",
"0.5406939",
"0.54023045",
"0.5394... | 0.6532477 | 0 |
Apply a message received from the feed | function applyMessage(msg, cb) {
var msgData = msgpack.decode(msg.message)
// in browsers, for some reason we have to manually construct the buffers
msgData.obj.$msg = util.toBuffer(msgData.obj.$msg)
msg.author = util.toBuffer(msg.author)
if (!msgData || !msgData.obj || msgData.obj.$rel != 'eco-ob... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function superfeedrHandler(event, context) {\n // If we have no items, this must be a notification about an error in the feed\n if(!event[\"body\"][\"items\"]) {\n return telegramBot.sendMessage(event[\"chat_id\"], \"Hum. We got a problem fetching content from \" + event[\"body\"][\"status\"][\"feed\"] + \". ... | [
"0.5949212",
"0.5627947",
"0.56167316",
"0.5590243",
"0.5449321",
"0.54436225",
"0.5393371",
"0.53807443",
"0.53169596",
"0.52701336",
"0.52467114",
"0.52148724",
"0.5207255",
"0.5170682",
"0.5163157",
"0.5143321",
"0.51335865",
"0.51310825",
"0.51302755",
"0.5125962",
"0.511... | 0.5769204 | 1 |
checks if given editor can edit user info for given editee | function canEdit(editor, editee){
return isAncestor(editee, editor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isEditor() {\n var user = Session.getActiveUser().getEmail();\n return EDITORS.indexOf(user) >= 0;\n}",
"function allowedToEdit() {\n\t\treturn role === 'farm_admin' || role === 'farmer';\n\t}",
"function isEditAllowed()\n {\n return activeInitData.editAllowed === true;\n }",
"isEditabl... | [
"0.7746476",
"0.7012474",
"0.6914663",
"0.6851598",
"0.67871666",
"0.66958416",
"0.6620751",
"0.650945",
"0.6457585",
"0.6260303",
"0.61659974",
"0.61174196",
"0.61124676",
"0.60606396",
"0.6044343",
"0.60417163",
"0.6020947",
"0.60187036",
"0.5981813",
"0.5960628",
"0.591675... | 0.73701 | 1 |
check if lower case, dotless emails are the same | function isSameEmail(a,b){
a = a.toLowerCase().replace(/\./g,'');
b = b.toLowerCase().replace(/\./g,'');
return (b===a);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function emailChecker(email) {\n\tvar x = email.toLowerCase;\n\tvar y = x.split(\"\");\n\tvar alphabet = [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z];\n\tif ( y[0] ) {}\n}",
"isEmail(value) {\n return new RegExp(\"^\\\\S+@\\\\S+[\\\\.][0-9a-z]+$\").test(\n String(value).toLowerCase()\n );\n ... | [
"0.70201135",
"0.67932075",
"0.666189",
"0.640908",
"0.6399039",
"0.6382546",
"0.6371233",
"0.62750053",
"0.6274625",
"0.6240715",
"0.6232114",
"0.6207972",
"0.61975116",
"0.61935854",
"0.61814237",
"0.61626565",
"0.6158511",
"0.6143049",
"0.6127775",
"0.6121907",
"0.60751987... | 0.7789803 | 0 |
Escapes template tags within html comments | function removeComments(template) {
// Template tag within an html comment regex
var regex = /<!--[\s\S]*?-->/g;
var str = template.html();
template.html(str.replace(regex, ""));
return template;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escapeForTemplate(raw) {\n return raw\n .replace(/^['\"]|['\"]$/g, '')\n .replace(/`/g, '\\\\`')\n .replace(/\\\\(['\"])/g, '$1');\n}",
"function _escTag(s){ return s.replace(\"<\",\"<\").replace(\">\",\">\");}",
"function _escTag(s){ return s.replace(\"<\",\"<\").replace(\">\",\"&g... | [
"0.65186805",
"0.5996652",
"0.5996652",
"0.5994413",
"0.5948788",
"0.5913054",
"0.5903399",
"0.59009415",
"0.5847199",
"0.5838216",
"0.58207077",
"0.5817178",
"0.5795047",
"0.5772507",
"0.5763636",
"0.5762407",
"0.5762407",
"0.5762407",
"0.5762407",
"0.5762407",
"0.57257444",... | 0.6015243 | 1 |
rendering the form to create the new client | render() {
return (
<React.Fragment>
<form className="clientForm">
<div className="form-group">
<label htmlFor="name">Client Name: </label>
<input
type="text"
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createForm () {\n if (document.getElementById('leaderboardButton')) {\n document.getElementById('leaderboardButton').remove();\n }\n crDom.createLeaderboardButton();\n crDom.createForm();\n crDom.createCategoriesChoice(this.filter.category);\n crDom.createDifficultyChoice(this.filter.difficu... | [
"0.63299745",
"0.62655276",
"0.6256601",
"0.6175674",
"0.6083619",
"0.6070154",
"0.6056525",
"0.6025573",
"0.60246325",
"0.6009956",
"0.59819025",
"0.59787124",
"0.59560907",
"0.59354275",
"0.5933993",
"0.59289926",
"0.59141636",
"0.5900743",
"0.58663255",
"0.58610594",
"0.58... | 0.6579971 | 0 |
get calendar HTML for specified year and month | function get_specified_calendar(calendar_year, calendar_month, dst) {
while (calendar_month < 0) {
calendar_month += 12;
calendar_year--;
}
while (calendar_month > 11) {
calendar_month -= 12;
calendar_year++;
}
if (calendar_year < 1975) {
calendar_year = 1975;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetEvents(year,month){\n\n\t/* this should be returned from api, number of day and html */\n\t return {13 : '', 18 : ''};\n }",
"createCalendarMarkup() {\n let cY = this.currYear,\n cM = this.currMonth;\n let lastDay = new Date(cY, cM + 1, 0).getDate(),\n firstDay = new Date(cY, cM, 1).g... | [
"0.6870167",
"0.6781202",
"0.669401",
"0.6683708",
"0.66591334",
"0.6615743",
"0.66126734",
"0.66113394",
"0.659359",
"0.6541714",
"0.64685315",
"0.6457624",
"0.6395247",
"0.6381584",
"0.62888646",
"0.6278861",
"0.6230129",
"0.6190073",
"0.61736315",
"0.61288303",
"0.61194634... | 0.7008839 | 0 |
change calendar HTML for specified year and month | function change_calendar(calendar_year, calendar_month, dst) {
var divElem = document.getElementById("calendar_div_" + dst);
divElem.innerHTML = get_specified_calendar(calendar_year, calendar_month, dst);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init(month, year) {\n monthDisplay.innerHTML = `${monthList[month]}, ${year}`; \n populateCalender();\n}",
"function generateCalendar(date) {\n\n\t$('#monthyear p:nth-child(2)').html('').append(calendarMonth + \" \" + calendarYear);\n\n\t// Unbind the old click listeners\n\t$('#monthyear i:nth-chi... | [
"0.68949974",
"0.67746747",
"0.6761356",
"0.67117685",
"0.6694772",
"0.66725457",
"0.66624653",
"0.6650281",
"0.66352606",
"0.6623659",
"0.661857",
"0.65491486",
"0.654217",
"0.65338176",
"0.6515929",
"0.6508797",
"0.64997506",
"0.6495292",
"0.646687",
"0.64359343",
"0.642863... | 0.70971215 | 0 |
Open a HDF5 file. Note in addition to having file specific methods the File object also inherit the full interface of Group. File is also a context manager and therefore supports the with statement. Files opened by the class will be closed after the with block, filelike object are not closed. Parameters filename : str ... | constructor (fh, filename) {
//""" initalize. """
//if hasattr(filename, 'read'):
// if not hasattr(filename, 'seek'):
// raise ValueError(
// 'File like object must have a seek method')
var superblock = new SuperBlock(fh, 0);
var offset = superblock.offset_to_datao... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_open(cb) {\n fs.stat(this._filename, (err, stat) => {\n if (err) {\n return cb(err);\n }\n\n return fs.open(this._filename, \"r\", (err, fd) => {\n if (err) {\n return cb(err);\n }\n\n this._fd = fd;\n this._size = stat.size;\n return cb(null);\... | [
"0.46856344",
"0.46829697",
"0.4573244",
"0.45625103",
"0.45122346",
"0.4354551",
"0.43314528",
"0.43314528",
"0.43314528",
"0.43144262",
"0.43022794",
"0.42545605",
"0.42285672",
"0.4200612",
"0.41548795",
"0.4147517",
"0.4129084",
"0.4100742",
"0.4100742",
"0.40913305",
"0.... | 0.56813246 | 0 |
Wrap wrapper around nodes Just pass a collection of nodes, and a wrapper element | function wrapAll(nodes, wrapper) {
// Cache the current parent and previous sibling of the first node.
var parent = nodes[0].parentNode;
var previousSibling = nodes[0].previousSibling;
// Place each node in wrapper.
// - If nodes is an array, we must increment the index we grab from
// afte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wrap(wrapper, node) {\n node.parentNode.replaceChild(wrapper, node);\n wrapper.appendChild(node);\n }",
"wrapAll(elements, wrapper) {\n elements[0].parentNode.insertBefore(wrapper, elements[0]);\n elements.forEach(x => wrapper.appendChild(x));\n ... | [
"0.7182707",
"0.7117429",
"0.710325",
"0.7054041",
"0.6860432",
"0.6603626",
"0.6603626",
"0.65895486",
"0.65662634",
"0.65662634",
"0.65662634",
"0.65425634",
"0.65425634",
"0.6517861",
"0.6517861",
"0.6517861",
"0.6513066",
"0.6487807",
"0.64512026",
"0.6404624",
"0.6380979... | 0.762078 | 0 |
function qui va generer le retour de l'API s'il y a un probleme => connexion non etablie => message d'erreur si la connexion est etablie, on cree un localStorage (ou un cookie) qui va contenir le token(retourner par l'API) et on redirige l'utilisateur vers la page articles.html | function generateUser(users){
if (users.token == null ){
document.getElementById("message").classList.add("alert", "alert-danger");
document.getElementById("message").textContent = "Vous n'êtes pas inscrit."
} else{
// let cookieUser = document.cookie = `token=${users.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function security() {\n if(!localStorage.getItem('token')){\n console.log(\"El usuari intentava entrar a la pàgina sense prèviament haver-se registrar o loggejat\");\n window.location.replace(\"../html/index.html\");\n }\n}",
"testeApi(){\n\n // INICIO CHAMADA AJAX\n v... | [
"0.6769214",
"0.66555905",
"0.6458838",
"0.6289355",
"0.6286965",
"0.6278205",
"0.6268783",
"0.62677133",
"0.62670946",
"0.6202978",
"0.61759484",
"0.6152637",
"0.6112147",
"0.6096884",
"0.6084804",
"0.60577905",
"0.6030382",
"0.60165775",
"0.60028285",
"0.5990606",
"0.598583... | 0.6718446 | 1 |
Function to get the country name based on particular country ISO code provided. | function getCountryName(countryCode) {
var countryName;
var splitData = [];
var isoCode;
splitData = countryList.split('\n');
$.each(splitData, function (i, val1) {
isoCode = val1.substring(val1.indexOf(';') + 1, val1.indexOf(','));
if ($.trim(isoCode) =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertedCountry(code){\n if(code == undefined){\n countryName= undefined;\n return undefined;\n }\n else{ \n return isoCountries[code].name;\n ... | [
"0.8027535",
"0.74993616",
"0.7469393",
"0.73453647",
"0.7337847",
"0.7306547",
"0.7203904",
"0.71786726",
"0.69264996",
"0.68984115",
"0.68876463",
"0.68615866",
"0.68123996",
"0.68066514",
"0.67618936",
"0.66850835",
"0.6676634",
"0.6599541",
"0.6588858",
"0.657293",
"0.656... | 0.7842736 | 1 |
Function to display single station similar to lightbox effect but implemented using overlay of Div tag. This function handle the click of Play button for station. | function getSingleStation() {
$('.playBtn').click(function (event) {
event.preventDefault();
var stationId = "";
var countryRaw = "";
var countryName = "";
var stationName = "";
var description = "";
var website = "";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playStation() {\n var eventData = {stationName: broadcastData.wpPlayer.nStationId, playlistId: broadcastData.wpPlayer.nPlaylistId, trackId: broadcastData.wpPlayer.nTrackId, trackUid: broadcastData.wpPlayer.nTrackUsageId};\n self.button = 'Stop'; //too early to change the play button\n ... | [
"0.72677064",
"0.6140764",
"0.60788614",
"0.60323846",
"0.60130227",
"0.58700806",
"0.58544004",
"0.5838823",
"0.57762396",
"0.5776207",
"0.575447",
"0.57527083",
"0.57387644",
"0.5729607",
"0.5727621",
"0.57184196",
"0.56946915",
"0.56888676",
"0.5679856",
"0.56794053",
"0.5... | 0.6146084 | 1 |
Once you get the test passing, do an acp cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! /////////////////////////////////// / Problem 3 Write a function called sumAndMultiply() that takes in three numbers as separate arguments and r... | function sumAndMultiply(a,b,c){ //eslint-disable-line
// You may not use the arithmetic operators +, use sum(), and *, use multiply, in this function
// [0] first element is the sum of those three numbers
var sumAB = sum(a, b); // function returns array [sum, string], need sumAB[0]
var totalSum = sum(sumAB[0], c)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sumAndMultiply(a, b, c) {\n var aAndB = sum (a,b)[0];\n console.log('a and b:'+ aAndB);\n var product = multiply(a,b)[0];\n\n var sum3 = sum (aAndB, c);\n console.log('a and B AND C:'+ sum3);\n var times3 = multiply (product, c);\n\n var totalSum = sum3[0];\n var totalP = times3[0];\n\n var msg =... | [
"0.752312",
"0.7418185",
"0.73982704",
"0.7277749",
"0.71832854",
"0.69399726",
"0.693255",
"0.6868661",
"0.67874795",
"0.67628074",
"0.6747491",
"0.67226064",
"0.6688385",
"0.66880417",
"0.6685304",
"0.66552633",
"0.6649105",
"0.6648596",
"0.66477376",
"0.6642384",
"0.663455... | 0.8242969 | 0 |
Once you get the test passing, do an acp cycle and synchronize the code between GitHub and your laptop. Don't forget to create a new branch for your work on the next question! /////////////////////////////////// / Problem 5 Write a function called multiplyArray() that takes an array of numbers as its argument and retur... | function multiplyArray(testArray){ //eslint-disable-line
// the first element is the product of the numbers in the array,
// numbers = testArray[0]...testArray[2]
// product function returns array, value is stored at first element
var productIndex0Index1 = multiply(testArray[0], testArray[1]); //returns array, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function multiplyArray(testArray) {\n var multiply1 = multiply(testArray[0], testArray[1]);\n var remultiply1 = multiply1[0];\n var multiply2 = multiply(remultiply1, testArray[2]);\n var totalmultiply = multiply2[0];\n var arrayStatement = 'The numbers ' + testArray.toString() + ' have a product of ' + totalm... | [
"0.80759495",
"0.8006325",
"0.7567716",
"0.752892",
"0.7343442",
"0.73345363",
"0.7207605",
"0.7129241",
"0.70945287",
"0.7087413",
"0.7072304",
"0.7062405",
"0.7062405",
"0.7050251",
"0.70483565",
"0.69618124",
"0.69319314",
"0.69256705",
"0.6915548",
"0.69029105",
"0.688958... | 0.80381703 | 1 |
ensure the last part only includes something that looks like a TLD | function cleanTLD(tld = "") {
return tld.split(/[/:?]/)[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTLD(fqdn) {\n fqdn = fqdn.toLowerCase(); // force lowercase for parsing\n var labels = fqdn.split('.');\n if (labels.length >= 3) {\n var www = labels[0] == 'www' ? 1 : 0;\n // assume that any domain having at least 3 labels ending with a 2 byte label, also contains a country cod... | [
"0.62106913",
"0.58785725",
"0.5863091",
"0.57694584",
"0.56991315",
"0.55164057",
"0.55131423",
"0.5418186",
"0.52793187",
"0.52540946",
"0.5228799",
"0.52260363",
"0.52180845",
"0.5206419",
"0.5193359",
"0.5188753",
"0.5186136",
"0.5165203",
"0.5165203",
"0.5165203",
"0.510... | 0.68656576 | 0 |
Set html element value. input : tag (id tag), value (set value) | function commonSetValue(tag, value)
{
//alert(tag + '<<<>>>>' + value);
var s = document.getElementById(tag);
s.value = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setElementValue ( id, value )\n {\n\tvar elt = myGetElement(id);\n\t\n\tif ( elt && elt.type && elt.type == \"checkbox\" )\n\t{\n\t if ( value && value != \"0\" )\n\t\telt.checked = true;\n\t else\n\t\telt.checked = false;\n\t}\n\t\n\telse if ( elt && typeof(value) == \"string\" )\n\t elt.valu... | [
"0.73709875",
"0.7345804",
"0.7311125",
"0.7219756",
"0.7201489",
"0.7191854",
"0.7184969",
"0.714405",
"0.714405",
"0.714405",
"0.714405",
"0.70346355",
"0.690367",
"0.6823011",
"0.6802111",
"0.6791222",
"0.67857724",
"0.6782261",
"0.67451954",
"0.66975963",
"0.6692795",
"... | 0.77385956 | 0 |
Encoding data. input : plain source string | function encodeDataString(str)
{
// Encoding.
var retStr = str.split("").reverse().join("");
retStr = '|' + retStr + ' ';
retStr = Base64.encode(retStr);
return retStr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function encode(string){\n\n}",
"function EncodeUTF8(cb) {\n this.ondata = cb;\n }",
"function utoa(data) {\n return btoa(unescape(encodeURIComponent(data)));\n}",
"function encodeData(strVal){\n\tvar strVal=window.btoa(unescape(encodeURIComponent(strVal)));\n\treturn strVal;\n}",
"functio... | [
"0.69650483",
"0.6343337",
"0.6117851",
"0.60807943",
"0.60783863",
"0.60752845",
"0.6011872",
"0.5989781",
"0.5980562",
"0.5950052",
"0.5936495",
"0.5929139",
"0.592526",
"0.592526",
"0.592526",
"0.592526",
"0.592526",
"0.592526",
"0.592526",
"0.59172",
"0.59172",
"0.59123... | 0.67465264 | 1 |
Debounce implementation that will group all calls made until the next tick into a single function call on the leading edge. Any calls past this tick will be debounced until `timeout` has expired, just like a normal debounce. After the trailing edge invocation the debounce method is reset and the flow resets to invoking... | function _debounce(func, timeout) {
let state = 'leading';
let result = null;
let timer = null;
return function(...args) {
// Leading edge
if (state == 'leading') {
result = run(func, args);
state = 'wait';
// Allow trailing to run on next tick
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function debouncer( func , timeout ) {\nvar timeoutID , timeout = timeout || 200;\nreturn function () {\nvar scope = this , args = arguments;\nclearTimeout( timeoutID );\ntimeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n} , timeout );\n}\n}",
"function debouncer... | [
"0.67575186",
"0.6731028",
"0.6731028",
"0.6720289",
"0.66234404",
"0.6566746",
"0.64379644",
"0.6385529",
"0.62441415",
"0.62141705",
"0.61853975",
"0.616392",
"0.614101",
"0.6130875",
"0.6126425",
"0.6119773",
"0.6090596",
"0.60790145",
"0.6075103",
"0.6065736",
"0.6064116"... | 0.733662 | 0 |
change position on plan return agent if the newPos is already occuped | moveAgent(agent, newPos) {
this._handleBound(newPos, agent._opts.size);
this._plan[agent.x()][agent.y()].agent = null;
var res = this._plan[newPos.x][newPos.y];
this._plan[newPos.x][newPos.y].agent = agent;
this._sma.setChanged();
return res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setAgentAt(agent, newPos) {\n this._handleBound(newPos);\n this._plan[newPos.x][newPos.y].agent = agent;\n this._sma.setChanged();\n }",
"set pos(newPos) {\n this._pos = newPos;\n }",
"sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }",
"set_posit... | [
"0.66617626",
"0.6630039",
"0.64684165",
"0.63998926",
"0.6385097",
"0.625138",
"0.61840445",
"0.61637026",
"0.6147981",
"0.613264",
"0.60840344",
"0.6081476",
"0.6076205",
"0.6057433",
"0.6046968",
"0.6046968",
"0.5982193",
"0.5967473",
"0.59519637",
"0.5948846",
"0.5946984"... | 0.7320068 | 0 |
padding blankHTML if node is empty (for cursor position) | function paddingBlankHTML(node) {
if (!isVoid(node) && !nodeLength(node)) {
node.innerHTML = blankHTML;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}",
"function paddingBlankHTML(node) {\n if (!isVoid(node) && !nodeLength(node)) {\n node.innerHTML = blankHTML;\n }\n}",
"function paddingBlankHTML(node) {\n if (!isVoi... | [
"0.8691182",
"0.8691182",
"0.8691182",
"0.8691182",
"0.8690349",
"0.8690349",
"0.6399497",
"0.63865614",
"0.631082",
"0.631082",
"0.631082",
"0.61841786",
"0.61841786",
"0.6168239",
"0.61562836",
"0.61212736",
"0.6062159",
"0.60366833",
"0.60112983",
"0.59893143",
"0.5964594"... | 0.8773841 | 0 |
Intercept image loading request and decide if we need to compress it. | function onBeforeRequestListener({ url, documentUrl }) {
checkSetup()
if (
shouldCompress({
imageUrl: url,
pageUrl: pageUrl || parseUrl(documentUrl).host, //occasionally pageUrl is not ready in time on FF
compressed,
pro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"patched() {\n this._handleImageLoad();\n }",
"load(onFinish = noop) {\n if (this.attempt > this.options.attempt - 1 && this.state.error) {\n if (process.env.NODE_ENV !== 'production' && !this.options.silent) {\n console.log(\"[@vant/lazyload] \" + this.src + \" tried too more than \" + t... | [
"0.6663679",
"0.58564",
"0.5661736",
"0.56082404",
"0.55649275",
"0.55649275",
"0.551805",
"0.5502618",
"0.5484889",
"0.54523176",
"0.5378473",
"0.53680164",
"0.5322107",
"0.5312687",
"0.52990806",
"0.5297291",
"0.5278392",
"0.5278017",
"0.5277524",
"0.52625704",
"0.52620643"... | 0.6310769 | 1 |
Firefox user agent always has "rv:" and "Gecko" | function isFirefox() {
return /rv\:.*Gecko/.test(window.navigator.userAgent)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFirefoxUserAgent() {\n let date = new Date();\n let version =\n (date.getFullYear() - 2018) * 4 +\n Math.floor(date.getMonth() / 4) +\n 58 +\n \".0\";\n return `Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:${version} Gecko/20100101 Firefox/${version}`;\n}",
"function isFirefox(){\n\tre... | [
"0.7979588",
"0.7064578",
"0.6711273",
"0.6709053",
"0.663555",
"0.65330374",
"0.6464406",
"0.6431755",
"0.64243186",
"0.64081705",
"0.63994455",
"0.63994455",
"0.63994455",
"0.6388694",
"0.63532895",
"0.6306531",
"0.6291379",
"0.6279418",
"0.62232643",
"0.62232643",
"0.62232... | 0.746812 | 1 |
Retrieve saved bytes info from response headers, update statistics in app storage and notify UI about state changes. | function onCompletedListener({ responseHeaders, fromCache }) {
const bytesSaved = getHeaderValue(responseHeaders, 'x-bytes-saved')
const bytesProcessed = getHeaderValue(responseHeaders, 'x-original-size')
if (bytesSaved !== false && bytesProcessed !== false && fromCache === false) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function watchAnalyzingResponseHandler(){\n dispatch(getAnalyzingResponse()).then(response=>{\n setAnalyzingResponseData(response.payload)\n })\n }",
"display() {\n if (this.displayedComplete) {\n return;\n }\n const transferredBytes = this.segmentOffse... | [
"0.54545873",
"0.5420233",
"0.5420233",
"0.53195846",
"0.53043586",
"0.5271071",
"0.52299005",
"0.5187683",
"0.5175",
"0.5130231",
"0.5122635",
"0.51092476",
"0.50944394",
"0.50712395",
"0.50472367",
"0.49983278",
"0.49955234",
"0.49859437",
"0.498258",
"0.4967252",
"0.495963... | 0.6539558 | 0 |
Custom property setter for `foo`. Call `requestUpdate` when implementing a custom property setter to ensure that changes to the property will trigger updates when required. Pass the old value of the property to `requestUpdate` so that any property options can be correctly applied. | set foo(newVal) {
let oldVal = this.foo;
console.log('setting foo from', oldVal, 'to', newVal);
this.setAttribute('foo', newVal);
this.requestUpdate('foo', oldVal).then(
result => console.log('updateComplete:', result)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"requestUpdateInternal(name,oldValue,options){let shouldRequestUpdate=true;// If we have a property key, perform property update steps.\nif(name!==undefined){const ctor=this.constructor;options=options||ctor.getPropertyOptions(name);if(ctor._valueHasChanged(this[name],oldValue,options.hasChanged)){if(!this._changed... | [
"0.61408687",
"0.60211366",
"0.5980273",
"0.5980273",
"0.5980273",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
"0.5939433",
... | 0.6988615 | 0 |
Custom property getter for `foo`. | get foo() {
return this.getAttribute('foo');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get foo () {\n return \"foo\";\n }",
"get property(){}",
"static get property(){}",
"get _getter() {\n return descriptorForDecorator(this)._getter;\n }",
"getProperty() {\n return this.property;\n }",
"get(property) {\n return this[property];\n }",
"function __getter(value) ... | [
"0.75216365",
"0.6625552",
"0.62571627",
"0.6041103",
"0.59837854",
"0.5974447",
"0.5945459",
"0.5928347",
"0.588513",
"0.58643717",
"0.58273935",
"0.581102",
"0.5752625",
"0.5744253",
"0.5675237",
"0.5673551",
"0.5649235",
"0.56455535",
"0.5612887",
"0.5598272",
"0.5577712",... | 0.68324935 | 1 |
Split stack message from trace | function unstack (msg) {
var sep = msg.search(/\n\s*at\s/)
return {
msg: msg.substr(0, sep)
, stack: utils.trimLines(msg.substr(sep + 1))
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function captureStack() {\n var stack = {}\n Error.captureStackTrace(stack, captureStack)\n return stack.stack.split('\\n').slice(1)\n}",
"function _formatStackTrace1(exception) {\n function comesFromFramework(call) {\n return (call.match(/@chrome:\\/\\/mozunit\\/content\\/lib\\/fsm\\.js:/) ||\n ... | [
"0.64353216",
"0.6339699",
"0.63061935",
"0.6274245",
"0.6093959",
"0.6063477",
"0.6063477",
"0.6029698",
"0.60160935",
"0.58885527",
"0.5829139",
"0.5811844",
"0.5806196",
"0.5784924",
"0.5784924",
"0.5784924",
"0.5784924",
"0.5784924",
"0.5784924",
"0.5784924",
"0.5784924",... | 0.6745426 | 0 |
This function cheks if the mail have only one '.' Input: none Output: true or false | function isDotSame() {
if (getMail().indexOf('.') == getMail().lastIndexOf('.')) {
notErrMail();
return true;
}
else {
errMail("Only one '.' can be");
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isDotExist() {\n if (getMail().indexOf('.') != -1) {\n notErrMail();\n return true;\n } else {\n errMail(\"Mail have to include '.' \")\n return false;\n }\n}",
"function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isC... | [
"0.7756734",
"0.7352885",
"0.72942084",
"0.72942084",
"0.72916263",
"0.72499704",
"0.7200266",
"0.7192424",
"0.6877185",
"0.6868677",
"0.6690415",
"0.66577417",
"0.6624524",
"0.6587601",
"0.65538245",
"0.65176547",
"0.65062356",
"0.6500098",
"0.64907676",
"0.64273024",
"0.642... | 0.7945401 | 0 |
This function cheks if the mail have '.' Input: none Output: true or false | function isDotExist() {
if (getMail().indexOf('.') != -1) {
notErrMail();
return true;
} else {
errMail("Mail have to include '.' ")
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mai... | [
"0.7743968",
"0.77316904",
"0.77243423",
"0.74695545",
"0.7468261",
"0.74575377",
"0.74089557",
"0.74089557",
"0.73337024",
"0.7303814",
"0.7008689",
"0.6960267",
"0.6895278",
"0.6837168",
"0.6826623",
"0.6815581",
"0.681027",
"0.67860204",
"0.6736263",
"0.6717914",
"0.670357... | 0.8440246 | 0 |
This function cheks with other checks if the mail is valid Input: none Output: true or false | function checkMail() {
if (getMail().length > 0) {
if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {
return true;
}
else {
return false;
}
}
//nothing put in mail box
else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = t... | [
"0.80750376",
"0.8049387",
"0.7931083",
"0.778837",
"0.76506114",
"0.76506114",
"0.75652295",
"0.75538963",
"0.7462651",
"0.7448063",
"0.74376476",
"0.7436676",
"0.7399453",
"0.7364156",
"0.73457634",
"0.73451316",
"0.73265827",
"0.7325744",
"0.73108006",
"0.73079455",
"0.727... | 0.80709964 | 1 |
This function cheks if the user choose at least one type of music Input: none Output: true or false | function checkMusic() {
var che = 0;
if (document.eMusic.music0.checked == true)
che++;
if (document.eMusic.music1.checked == true)
che++;
if (document.eMusic.music2.checked == true)
che++;
if (document.eMusic.music3.checked == true)
che++;
if (che == 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_if_music() {\n\t\t\t$(\"#meta-contents #more .more-button\").click();\t\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t\tif($(\".ytd-metadata-row-container-renderer #content a:contains('Music')\")\n\t\t\t\t\t.text().includes(\"Music\")) {\n\t\t\t\t\tthis_is_music = true;\n\t\t\t\t\tinit();\n\t\t\t\t\tthis... | [
"0.6826014",
"0.6733175",
"0.6343434",
"0.61454767",
"0.6144694",
"0.60690945",
"0.6063092",
"0.58791685",
"0.58674043",
"0.5860558",
"0.5844651",
"0.5800491",
"0.57938594",
"0.57931954",
"0.57675",
"0.5764391",
"0.57621634",
"0.57118094",
"0.5699094",
"0.5696838",
"0.5683224... | 0.681754 | 1 |
This function change the type of the password to text Input: none Output: none | function changePassTypeToText() {
document.getElementById("uPass").type = "text";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showPaswrd() {\r\n const paswrd = document.getElementById('paswrd');\r\n if (paswrd.type === 'password') {\r\n paswrd.type = 'text';\r\n } else {\r\n paswrd.type = 'password';\r\n }\r\n}",
"function changeToText(){\t\n\tfor (var i=0; i<inputs.length; i++) {\n\t\tif (inputs[i].t... | [
"0.77323365",
"0.77306604",
"0.7663049",
"0.7596778",
"0.7590959",
"0.75745887",
"0.75384545",
"0.75310683",
"0.7524917",
"0.74545413",
"0.74274486",
"0.7426405",
"0.7411907",
"0.7409813",
"0.7400809",
"0.7378968",
"0.7343712",
"0.7334643",
"0.73319095",
"0.7326749",
"0.72847... | 0.80261475 | 0 |
This function change the type of the password to password Input: none Output: none | function changePassTypeToPass() {
document.getElementById("uPass").type = "password";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changePaswordType(){\r\n\r\n var newPw=dojo.byId('dojox_form__NewPWBox_0'),\r\n veryPw=dojo.byId('dojox_form__VerifyPWBox_0');\r\n if(newPw.getAttribute('type')=='password' && veryPw.getAttribute('type')=='password'){\r\n newPw.setAttribute('type','text');\r\n veryPw.setAttribute('type'... | [
"0.7860318",
"0.770216",
"0.76459885",
"0.7552298",
"0.7529455",
"0.7518957",
"0.7494475",
"0.7494197",
"0.7479485",
"0.74774617",
"0.7423662",
"0.73727906",
"0.7372288",
"0.73653686",
"0.73546916",
"0.7351321",
"0.735089",
"0.734681",
"0.73396116",
"0.7267992",
"0.72649914",... | 0.79718137 | 0 |
Calling confirm window, when security role is deleting | function confirmRoleDelete(id, realname){
var result = confirm("Do you want to delete "+realname+"?");
if(result){
window.location = "deletingSecurityRole/"+id;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@action\n confirmAction() {\n this.confirm(this.role);\n this.close();\n }",
"handleDeleteUser() {\n const confDelete = window.confirm(\"Are you sure to delete this user? \\nYou need to Sign Up again to login\");\n if (confDelete === true) {\n this.props.handleDeleteUser();\n ... | [
"0.7587377",
"0.72769254",
"0.7209195",
"0.7169604",
"0.71158034",
"0.70548123",
"0.6967989",
"0.6963477",
"0.6953993",
"0.69298345",
"0.69275403",
"0.68906194",
"0.68629056",
"0.6851607",
"0.6832723",
"0.68128943",
"0.67831254",
"0.6779923",
"0.6775164",
"0.676257",
"0.67544... | 0.79555905 | 0 |
Create and return address object in Tizen format from Titanium address | function createTizenAddress(address) {
var result = [],
types = ['WORK', 'HOME'],
i, j, type, currentAddress, addressesCount;
for (i in address) {
type = i.toUpperCase();
if (types.indexOf(type) === -1) {
continue;
}
addressesCount = address[i].length;
for (j = 0; j < addressesCount; j++) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createTitaniumAddress(address) {\n\t\tvar result = {},\n\t\t\ti = 0,\n\t\t\ttypes = ['work', 'home'],\n\t\t\taddressesCount = address.length,\n\t\t\tj, currentAddress, typesCount, type, addressTypes;\n\t\tfor (; i < addressesCount; i++) {\n\t\t\tcurrentAddress = address[i];\n\t\t\taddressTypes = currentAd... | [
"0.69343543",
"0.6723329",
"0.6253218",
"0.61971897",
"0.6166604",
"0.6163483",
"0.60679644",
"0.60644656",
"0.603901",
"0.592425",
"0.5883932",
"0.58823985",
"0.5881159",
"0.58387226",
"0.5818712",
"0.5813025",
"0.5806606",
"0.58012056",
"0.57919997",
"0.5766444",
"0.5766322... | 0.67619604 | 1 |
Create and return address object in Titanium format from Tizen address | function createTitaniumAddress(address) {
var result = {},
i = 0,
types = ['work', 'home'],
addressesCount = address.length,
j, currentAddress, typesCount, type, addressTypes;
for (; i < addressesCount; i++) {
currentAddress = address[i];
addressTypes = currentAddress.types;
typesCount = addres... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createTizenAddress(address) {\n\t\tvar result = [],\n\t\t\ttypes = ['WORK', 'HOME'],\n\t\t\ti, j, type, currentAddress, addressesCount;\n\t\tfor (i in address) {\n\t\t\ttype = i.toUpperCase();\n\t\t\tif (types.indexOf(type) === -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\taddressesCount = address[i].length;\n... | [
"0.68577796",
"0.67490053",
"0.63639736",
"0.6270685",
"0.62554824",
"0.6228605",
"0.61496025",
"0.6077637",
"0.6075432",
"0.6070065",
"0.6042468",
"0.60319585",
"0.6007938",
"0.6001595",
"0.5994205",
"0.59442204",
"0.5929795",
"0.5901508",
"0.5888641",
"0.5877035",
"0.584935... | 0.69209665 | 0 |
This helper function generates a unique register name | function uniquegen() {
return '#btc-reg-' + uniquegen.counter++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }",
"uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }",
"uniqueName(prefix) { return `${prefix}${this.nextNameIndex++}`; }"... | [
"0.7181597",
"0.71532446",
"0.71532446",
"0.71532446",
"0.71452045",
"0.71156865",
"0.6995868",
"0.6946059",
"0.6931861",
"0.69306374",
"0.69081414",
"0.6879351",
"0.6875022",
"0.6875022",
"0.6835786",
"0.6807951",
"0.67950934",
"0.6781915",
"0.67698044",
"0.67634326",
"0.675... | 0.76696634 | 0 |
Returns a new program state object, a data structure which stores information about a particular stack | function makeProgramState(ps, bytecode, env, Name,argName) {
// TODO step 3: decide what you need to store in a program state
// object based on what your bytecode interpreter needs.
// Decide whether the arguments above are sufficient.
if (ps == null) {
ps = {
'name':Name,
'from':... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function State(env, prog) {\n this.env = env;\n this.stack = [];\n this.prog = prog;\n\n switch (env) {\n case 'glyf':\n this.zp0 = this.zp1 = this.zp2 = 1;\n this.rp0 = this.rp1 = this.rp2 = 0;\n ... | [
"0.6316239",
"0.6282009",
"0.6273233",
"0.6273233",
"0.6010794",
"0.58115566",
"0.57529247",
"0.57529247",
"0.5736295",
"0.57358456",
"0.5700609",
"0.56710464",
"0.565099",
"0.562799",
"0.56167924",
"0.5609344",
"0.5608584",
"0.56065536",
"0.5596223",
"0.55447906",
"0.5511907... | 0.7308165 | 0 |
Load all the permission role mappings into the permissions object | function loadPermissionRoles(next) {
var perm = calipso.permission.Helper,
PermissionRole = calipso.db.model('PermissionRole');
// Clear down first - this may cause strange behaviour to anyone
// making a request at just this moment ...
perm.clearPermissionRoles();
// Load the permissions
PermissionR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapPermissions() {\n\t\t\tvar nav = {}, permissionList = [];\n\t\t\tfor(var permission in service.access.permissions) {\n\t\t\t\tif(inRole(service.access.permissions[permission])) {\n\t\t\t\t\tpermissionList.push(permission);\n\t\t\t\t}\n\t\t\t}\n\t\t\tservice.permissionList = permissionList;\n\t\t\tservi... | [
"0.6895828",
"0.6664302",
"0.630471",
"0.6168938",
"0.5908403",
"0.58018947",
"0.57578343",
"0.5514491",
"0.5509939",
"0.53998405",
"0.5315033",
"0.5286478",
"0.52761525",
"0.5271603",
"0.52662486",
"0.5258932",
"0.52546716",
"0.5241616",
"0.5220377",
"0.5186889",
"0.5183444"... | 0.7254211 | 0 |
Combine (sum) each of the initial profile docs' analysis results | function combineResultValues(combined_analysis, new_analysis) {
if (!combined_analysis || combined_analysis === new_analysis) {
return new_analysis
}
var doc_doc = combined_analysis.document_tone
for (i in doc_doc.tone_categories) {
var doc_cat = doc_doc.tone_categories[i]
for (j in doc_cat.tones... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function averageScores(combined_analysis, count) {\n var doc_doc = combined_analysis.document_tone\n\n for (i in doc_doc.tone_categories) {\n var doc_cat = doc_doc.tone_categories[i]\n for (j in doc_cat.tones) {\n var doc_tone = doc_cat.tones[j]\n\n doc_tone.score = doc_tone.score / count\n }\... | [
"0.62039095",
"0.594395",
"0.58556587",
"0.573828",
"0.57098275",
"0.5628916",
"0.54957056",
"0.54569215",
"0.54212344",
"0.5401972",
"0.5364233",
"0.5236445",
"0.52353495",
"0.5220406",
"0.5207335",
"0.52007264",
"0.5185414",
"0.5178554",
"0.5134783",
"0.513104",
"0.5115382"... | 0.6436045 | 0 |
Average all of the initial profile docs' analysis results | function averageScores(combined_analysis, count) {
var doc_doc = combined_analysis.document_tone
for (i in doc_doc.tone_categories) {
var doc_cat = doc_doc.tone_categories[i]
for (j in doc_cat.tones) {
var doc_tone = doc_cat.tones[j]
doc_tone.score = doc_tone.score / count
}
}
return ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"avg() {\n\t\tlet argArr = this.args;\n\t\tfunction avgSet(s,c,f) {\n\t\t\taverage: s;\n\t\t\tceiling: c;\n\t\t\tfloor: f;\n\t\t}\n\t\tlet evaluate = function() {\n\t\t\tlet sum = 0;\n\t\t\tfor(let c=0;c<argArr.length;c++) {\n\t\t\t\tsum += argArr[c];\n\t\t\t}\n\t\t\tsum /= argArr.length\n\t\t\tlet ceil = Math.ceil... | [
"0.6388689",
"0.63149416",
"0.62456083",
"0.6238788",
"0.6192414",
"0.61758375",
"0.6168279",
"0.61395997",
"0.61094415",
"0.60920566",
"0.6065525",
"0.60461533",
"0.6032936",
"0.5914757",
"0.591427",
"0.5907704",
"0.59007406",
"0.58966583",
"0.58891886",
"0.5886969",
"0.5859... | 0.7310001 | 0 |
Wrap the tone analysis API call in a Promise so that we can take advantage of Promise.all for parallel execution | function analyzeTone(params) {
return new Promise(function(resolve, reject) {
tone_analyzer.tone(params, function (error, res) {
return error ? reject(error) : resolve(res);
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function requestAudio(){\nconst audioStream = await navigator.mediaDevices.getUserMedia({audio: true});\nconst audioContxt= new AudioContext();\n//init audio analyzer\naudioAnalzer= audioContxt.createAnalyser();\n//init audio source (mic)\nconst audioIN = audioContxt.createMediaStreamSource(audioStream);\n//... | [
"0.5599353",
"0.55440384",
"0.55341",
"0.5427899",
"0.5405543",
"0.53635526",
"0.53604865",
"0.5349886",
"0.5343791",
"0.5264776",
"0.5250307",
"0.5235751",
"0.5214601",
"0.5205418",
"0.51990336",
"0.5190371",
"0.51715297",
"0.5163161",
"0.51613563",
"0.5158352",
"0.515419",
... | 0.70067465 | 0 |
Initialization This function initializes the page and loads the default charts: retrieves the Subject IDs from the samples dataset to populate the dropdown menu calls the BuildCharts function for the first Subject ID in the list | function init() {
// Select the dropdown menu element
var selection = d3.select("#selDataset");
// Read in JSON samples, getting all of the Subject IDs and using them to build the dropdown menu options
d3.json("samples.json").then((results => {
results.names.forEach((name => {
selec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n // select dropdown menu \n var dropdown = d3.select(\"#selDataset\");\n \n // read the data \n d3.json(\"data/samples.json\").then((data)=> {\n //console.log(data)\n \n // get the id data to the dropdwown menu\n data.names.forEach(function(name) {\n ... | [
"0.76080436",
"0.7580424",
"0.7512425",
"0.7413666",
"0.7395458",
"0.73869634",
"0.73607576",
"0.7355468",
"0.73385763",
"0.7335716",
"0.72561526",
"0.7165421",
"0.7130925",
"0.71230316",
"0.710205",
"0.7093022",
"0.7090515",
"0.70774865",
"0.70501596",
"0.7014751",
"0.700581... | 0.78770256 | 0 |
Remove information when no county is hovered. | function clearDetails() {
const details = d3.select("#details");
details.select("h3")
.text("No selection");
details.select("#popn").text("N/A");
details.select("#literacy").text("Hover over a county for details.");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unselectCounty(e){\r\n\tvar layer = e.target;\r\n\tlayer.setStyle({\r\n\t\tweight: 1,\r\n\t\topacity: 1,\r\n\t\tcolor: \"white\",\r\n\t\tdashArray: '3',\r\n\t\tfillOpacity: 0.7,\r\n\t});\r\n\tcountyInfo.update();\r\n}",
"clearHighlight() {\n // ++++++++ BEGIN CUT +++++++++++\n d3.select('#... | [
"0.710507",
"0.65373915",
"0.6420827",
"0.6340611",
"0.6318469",
"0.62816715",
"0.62816715",
"0.62719965",
"0.6251468",
"0.62381965",
"0.6153905",
"0.61315703",
"0.6093633",
"0.60466063",
"0.6024938",
"0.5937337",
"0.5922994",
"0.5885905",
"0.58761877",
"0.5867379",
"0.583657... | 0.65980417 | 1 |
Create an annotation panel for display details ondemand. | function buildDetailsPanel() {
const detailXPos = chartParams.width - chartParams.detailWidth - 2 * chartParams.detailPadding;
const details = d3.select("#details")
.style("width", chartParams.detailWidth + "px")
.style("padding", "0 " + chartParams.detailPadding + "px")
.style("left", "calc(" + detailX... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createInfoPanel() {\n return new Ext.Panel({\n border: true,\n id: 'infoPanel',\n baseCls: 'md-info',\n autoWidth: true,\n contentEl: 'infoContent',\n autoLoad: {\n url: '../../apps/search/home_' + catalogue.LANG + '.h... | [
"0.6202082",
"0.61223334",
"0.6078654",
"0.6048452",
"0.5908089",
"0.5790438",
"0.5765886",
"0.57506496",
"0.5727808",
"0.57176363",
"0.5690495",
"0.56758136",
"0.5664293",
"0.5571632",
"0.55663747",
"0.55239946",
"0.54893863",
"0.54820126",
"0.5479557",
"0.54632694",
"0.5459... | 0.62824607 | 0 |
Run "npm publish" in the package root | function runNpmPublish(version = '') {
let cmd = 'npm publish'
if (version.includes('-beta.')) {
cmd = `${cmd} --tag beta`
}
console.log(`Now running "${cmd}"`)
console.log(execSync(cmd, EXEC_OTPS).toString())
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function publish(version, packageName, publishPath, public) {\r\n colorConsole.log(' Publishing ' + packageName.blue.bold + \" from \" + publishPath.cyan);\r\n\r\n let tag = \"\";\r\n // check for alpha or beta\r\n if (version.indexOf('alpha') !== -1 || version.indexOf('beta') !== -1 || version.inde... | [
"0.76080704",
"0.7313127",
"0.7272528",
"0.71982944",
"0.71900094",
"0.69495994",
"0.69495994",
"0.6916348",
"0.6716309",
"0.66415095",
"0.6559356",
"0.6435051",
"0.63607854",
"0.6307739",
"0.6199886",
"0.6171886",
"0.6133214",
"0.6084961",
"0.59239",
"0.5919155",
"0.59144557... | 0.74224734 | 1 |
Steps to take when searching has been stopped | function searchIsStopped() {
updatePopupAndBadge("stop");
updateDisabledPropOfForm(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopSearch() {\n console.log(\"Stopping search\");\n\n this.blur();\n\n browser.storage.local.get(\n [\n \"state\",\n \"startTime\",\n \"windowId\"\n ],\n function(response) {\n let state = response.state;\n browser.storage.local.set(\n {... | [
"0.6594043",
"0.64869344",
"0.63928014",
"0.6336772",
"0.63340396",
"0.62034917",
"0.61027324",
"0.60825735",
"0.6057662",
"0.6034144",
"0.6030277",
"0.5942514",
"0.5939526",
"0.5880635",
"0.58632207",
"0.5850605",
"0.58394873",
"0.5830982",
"0.5817815",
"0.5797207",
"0.57667... | 0.67001367 | 0 |
Creates a button for a friend | function addFriendButton(id, friendName) {
let btn = document.createElement("BUTTON");
btn.id = id;
btn.type = "button";
btn.classList.add("btn");
btn.classList.add("rounded");
btn.classList.add("btn-outline-danger");
btn.classList.add("friend-button");
btn.classList.add("enabled-friend... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function friendButton(){\n var makeContainer=document.createElement('div');\n var makeButton=document.createElement('button');\n var textFriend=document.createTextNode(\"Friends!\");\n var makeFriendButton= makeButton.appendChild(textFriend);\n makeContainer.appendChild(makeButton);\n document.bo... | [
"0.7983009",
"0.6685072",
"0.6576925",
"0.6547103",
"0.65308845",
"0.64432067",
"0.6421172",
"0.6410923",
"0.6410252",
"0.6394329",
"0.6355867",
"0.6347162",
"0.63352704",
"0.6332345",
"0.63311434",
"0.63311434",
"0.63281363",
"0.6301615",
"0.62949246",
"0.62920046",
"0.62554... | 0.790245 | 1 |
Removes a button for a friend and updates storage | function removeFriend() {
let friendName = getFriendNameFromButton(this);
console.log(`Removing friend: ${friendName}`);
this.parentElement.removeChild(this);
browser.storage.local.get(
[
"friends"
],
function(response) {
let friendsArray = response.friends;
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"del_friend(friend){\n if( this.friends.indexOf(friend) === -1)\n return 'friend doesnt exist';\n else {\n this.friends.splice( this.friends.indexOf(friend), 1);\n save_users(DEFAULT_USERS_FILE);\n return true;\n }\n }",
"function deleteButtons(list) {\n\tchrome.st... | [
"0.6467306",
"0.6335447",
"0.613744",
"0.6119394",
"0.6066972",
"0.60547936",
"0.6051282",
"0.6041152",
"0.5978656",
"0.59595144",
"0.5943104",
"0.5942447",
"0.5938965",
"0.58883595",
"0.5883868",
"0.5866414",
"0.5855046",
"0.5828106",
"0.58068645",
"0.5801379",
"0.5800588",
... | 0.7990012 | 0 |
Steps to take when searching needs to be paused | function pauseSearch() {
console.log("Pausing search");
this.blur();
updatePopupAndBadge("pause");
browser.storage.local.set(
{
"state": "pause"
},
function() {
updateDisabledPropOfForm(false, true);
browser.storage.local.get(
[
"startTi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resumeSearch() {\n console.log(\"Resuming search\");\n\n this.blur();\n updatePopupAndBadge(\"search\");\n browser.storage.local.set(\n {\n \"state\": \"search\"\n },\n function() {\n updateDisabledPropOfForm(true)\n\n $(\"#character-error\").hide();\n ... | [
"0.6822941",
"0.6627559",
"0.65762085",
"0.64452595",
"0.64342177",
"0.6345871",
"0.6221809",
"0.62124103",
"0.61830866",
"0.61719644",
"0.61214787",
"0.6114885",
"0.6098953",
"0.6065437",
"0.60390157",
"0.6013172",
"0.59794545",
"0.59728205",
"0.59660435",
"0.5961377",
"0.59... | 0.73745763 | 0 |
Steps to take when searching needs to be resumed | function resumeSearch() {
console.log("Resuming search");
this.blur();
updatePopupAndBadge("search");
browser.storage.local.set(
{
"state": "search"
},
function() {
updateDisabledPropOfForm(true)
$("#character-error").hide();
$("#duplicate-error").hide... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stephandler() {\n if (queryPosition === query.length -1) {\n startSearch(false);\n } else {\n delayedAdvance(false);\n }\n}",
"function search(){\n\tconsole.log(\"start search!\");\n\tvar startPos = '2-2'; // start position\n\tvar moveSeq = ['up', 'down', 'left', 'right', 'right',... | [
"0.6392788",
"0.6264819",
"0.6236756",
"0.6199077",
"0.6112589",
"0.6084301",
"0.606145",
"0.6005511",
"0.59573823",
"0.593542",
"0.59313214",
"0.5900514",
"0.58584857",
"0.58516294",
"0.5763909",
"0.57610655",
"0.57560855",
"0.5752027",
"0.5745794",
"0.5723151",
"0.57157916"... | 0.65980506 | 0 |
Extracts the name of a friend from a button | function getFriendNameFromButton(element) {
return element.innerText.split(" ").slice(0, -1).join(" ");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeFriend() {\n let friendName = getFriendNameFromButton(this);\n console.log(`Removing friend: ${friendName}`);\n this.parentElement.removeChild(this);\n\n browser.storage.local.get(\n [\n \"friends\"\n ],\n function(response) {\n let friendsArray = response.fr... | [
"0.62882835",
"0.5977733",
"0.59294844",
"0.58712137",
"0.5819067",
"0.5732184",
"0.5585238",
"0.55757445",
"0.54996574",
"0.54326963",
"0.5414444",
"0.5403821",
"0.53984994",
"0.53489983",
"0.5347311",
"0.5342247",
"0.5297201",
"0.5284489",
"0.52471095",
"0.5230455",
"0.5219... | 0.827425 | 0 |
Steps to take when searching needs to be stopped | function stopSearch() {
console.log("Stopping search");
this.blur();
browser.storage.local.get(
[
"state",
"startTime",
"windowId"
],
function(response) {
let state = response.state;
browser.storage.local.set(
{
"state": "stop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jss_search2() {\n window.clearTimeout(jss_timer);\n jss_start_search(jss_str, jss_result_elem);\n}",
"function stephandler() {\n if (queryPosition === query.length -1) {\n startSearch(false);\n } else {\n delayedAdvance(false);\n }\n}",
"function searchIsStopped() {\n upd... | [
"0.6563924",
"0.6512866",
"0.6457115",
"0.64297694",
"0.63279355",
"0.6267731",
"0.62551904",
"0.6152677",
"0.61222136",
"0.6118842",
"0.6096952",
"0.6049073",
"0.60085803",
"0.59390473",
"0.59310174",
"0.5824289",
"0.5809464",
"0.57999074",
"0.5793857",
"0.57508504",
"0.5738... | 0.66010237 | 0 |
This just hides the course info screen. Nothing fancy going on here. | function hideCourseInfo() {
document.getElementById("courseInformation").style.display = "none";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _generateCourseInfo() {\n\t\t_getCourseInfoLayout(_renderCourseInfoMain);\n\t}",
"function _renderCourseInfoMain() {\n\t\tpage.title.innerHTML = 'Expectations and FAQs for ' + settings.fulllayout.fullname;\n\t\tpage.title.style.display = 'block';\n\n\t\t_renderCourseInfoSubsections(page.contents);\n\t}"... | [
"0.68637913",
"0.67697376",
"0.663222",
"0.6470111",
"0.64243406",
"0.6304476",
"0.6283511",
"0.62809885",
"0.62739795",
"0.6242238",
"0.6241904",
"0.6223615",
"0.6193387",
"0.6184002",
"0.6182325",
"0.61791086",
"0.6177019",
"0.61611307",
"0.6154333",
"0.61499304",
"0.610732... | 0.79318845 | 0 |
This function moves the whole content of a slide by the amount of pixel as specified in pixelOffset. | function transformSlideContent(slide, pixelOffset) {
var addCallback = true;
$.each($slides, function (i) {
$(this).children('*').each(function () {
$(this).css('opacity', "1");
// Fallback for browsers that don't support CSS3.
if ($vP == "-ms-") {
if($(this).css('left') != "auto") {
var c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function defineOffset() {\n if(STATE.CURRENT_SLIDE > 1) {\n STATE.OFFSET = -STATE.RESIZE_OFFSET;\n } else {\n STATE.OFFSET = STATE.OFFSET;\n }\n }",
"function move_slide() {\n\t\t\tslides_holder.... | [
"0.61403066",
"0.59513736",
"0.5853414",
"0.58203053",
"0.5779119",
"0.567958",
"0.56614065",
"0.56171894",
"0.55934256",
"0.55724895",
"0.55267197",
"0.5514743",
"0.5511386",
"0.54983175",
"0.5494621",
"0.5487084",
"0.5470598",
"0.54314435",
"0.5410852",
"0.5398102",
"0.5397... | 0.66098124 | 0 |
This function is responsible for performing the animation on the user interface slide. | function userInterfaceSlideAnimation() {
// Move wireframe to the left and finished user interface to the right.
if($vP == '-ms-') {
$('#ui-wireframe').stop().animate({left: '-=150px'}, 1000);
$('#ui-finished').stop().animate({left: '+=150px'}, 1000);
if (parseInt($.browser.version, 10) === 9) {
$("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"performSlide() {\n if (this.prevSlide) { this.prevSlide.removeClass('prev fade-out') }\n\n this.nextSlide.removeClass('next');\n this.prevSlide = this.nextSlide;\n this.prevSlide.addClass('prev');\n\n this.currentIndex++;\n if (this.currentIndex >= this.slides.length) { this.currentIndex = 0 }\n\... | [
"0.68136555",
"0.6796813",
"0.6760561",
"0.67248386",
"0.6529508",
"0.6489184",
"0.6435938",
"0.6405668",
"0.63923824",
"0.6372536",
"0.6370997",
"0.6358418",
"0.6350681",
"0.63383186",
"0.63200593",
"0.6313716",
"0.63048446",
"0.62899446",
"0.6288646",
"0.62840545",
"0.62706... | 0.690157 | 0 |
This function is responsible for performing the animation on the quality management slide. | function qmSlideAnimation() {
if($vP == '-ms-') {
}
else {
$('.qm-magnifier').css('transform', 'translate3d(' + $currentlyAppliedXTransformation + 'px, 0px, 0px) rotate(0deg)');
$('.qm-magnifier').one($transitionEnd, function() { qmSlideAnimationStep2(); } );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animateSlidesVision(){\n\ttlSlidesVision.play();\n}",
"display(sketchUrl) {\r\n let setAnimation = (shrink)=>{\r\n selectedPokemonName.innerHTML = this.name;\r\n selectedPokemonName.style.transform = \"scale(shrink)\";\r\n selectedPokemonName.style.transition = \".5s\";\r\n\r\n... | [
"0.59834933",
"0.58804816",
"0.585798",
"0.5763651",
"0.5758714",
"0.572346",
"0.571589",
"0.5710267",
"0.5700521",
"0.56845146",
"0.56733614",
"0.5640221",
"0.56292975",
"0.56232274",
"0.5617402",
"0.56078684",
"0.56075925",
"0.5603538",
"0.55929315",
"0.55911124",
"0.558628... | 0.69693935 | 0 |
For each prompt, create a list item to be inserted in the list group | function createPromptItems() {
for (var i = 0; i < prompts.length; i++) {
var prompt_li = document.createElement('li');
var prompt_p = document.createElement('p');
var prompt_text = document.createTextNode(prompts[i].prompt);
prompt_li.setAttribute('clas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPromptItems() {\r\n\r\n for (var i = 0; i < prompts.length; i++) {\r\n var prompt_li = document.createElement('li');\r\n var prompt_p = document.createElement('p');\r\n var prompt_text = document.createTextNode(prompts[i].prompt);\r\n\r\n prompt_li.setAttribute('class', 'list-group-item... | [
"0.78179",
"0.65749246",
"0.6486479",
"0.632094",
"0.6309053",
"0.6294941",
"0.62939304",
"0.6288325",
"0.6280888",
"0.6272148",
"0.6242102",
"0.6220315",
"0.6209966",
"0.6184579",
"0.6159089",
"0.61177725",
"0.61153615",
"0.61103284",
"0.6094172",
"0.6063178",
"0.60621965",
... | 0.78959525 | 0 |
Method For Loading Data into Update Modal | function update_load_data()
{
$(function(){
$(".update_object").on("click",function(e)
{
var id=$(this).attr("update_id");
e.preventDefault();
$.ajax({
url:"member_update_load.php",
data:{id:id},
method:"POST",
success:function(response)
{
$(".update_modal_body").html(response);
$("#U... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function view_update_modal(id_table, url) {\n $(`#${id_table} tbody`).on('click', '.btn-info', function() {\n const id = $(this).data('id');\n const response = get(`${url}${id}`);\n response.then((res) => {\n load_preloader_container(res.form.id, 10);\n $('#modal_updat... | [
"0.682647",
"0.6664681",
"0.63275903",
"0.6277711",
"0.6258109",
"0.6255758",
"0.6245303",
"0.6194565",
"0.6166106",
"0.6164818",
"0.6149814",
"0.6142042",
"0.61370206",
"0.6136078",
"0.6127364",
"0.6116061",
"0.6098244",
"0.6091354",
"0.60819983",
"0.60752374",
"0.60734826",... | 0.74669373 | 0 |
from selector1 Right side to selector2 Left side | function svgAnimatingLineSelector1RightSideToSelector2LeftSide(parentSelector, selector1, selector2, svgId, svgLineId, markerId, callBackFunction) {
var parentOffset = $(parentSelector).offset();
var x1 = $(selector1).offset().left - parentOffset.left + $(selector1).outerWidth();
var y1 = $(selector1).offset().top -... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function leftToRightArrow(parentSelector, selector1, selector2, svgId, svgLineId, markerId, callBackFunction) {\n\tvar parentOffset = $(parentSelector).offset();\n\tvar x1 = $(selector1).offset().left - parentOffset.left;\n\tvar y1 = $(selector1).offset().top - parentOffset.top + $(selector1).outerHeight() * 2 / 3... | [
"0.5834704",
"0.57692",
"0.57290614",
"0.5695254",
"0.560461",
"0.53678954",
"0.53386647",
"0.5331215",
"0.5281422",
"0.52522695",
"0.52366376",
"0.5158772",
"0.51105434",
"0.5043932",
"0.5024434",
"0.4987646",
"0.49526617",
"0.495147",
"0.49508283",
"0.48785472",
"0.486041",... | 0.5769469 | 1 |
from selector1 Left side to selector2 Right side | function svgAnimatingLineSelector1LeftSideToSelector2RightSide(parentSelector, selector1, selector2, svgId, svgLineId, markerId, callBackFunction) {
var parentOffset = $(parentSelector).offset();
var x1 = $(selector1).offset().left - parentOffset.left;
var y1 = $(selector1).offset().top - parentOffset.top + $(select... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function svgAnimatingLineSelector1RightSideToSelector2LeftSide(parentSelector, selector1, selector2, svgId, svgLineId, markerId, callBackFunction) {\n\tvar parentOffset = $(parentSelector).offset();\n\tvar x1 = $(selector1).offset().left - parentOffset.left + $(selector1).outerWidth();\n\tvar y1 = $(selector1).off... | [
"0.5785021",
"0.5784183",
"0.5743537",
"0.5718726",
"0.54494476",
"0.5400656",
"0.5388773",
"0.5347605",
"0.52211106",
"0.5165228",
"0.5127391",
"0.5092392",
"0.508351",
"0.5071991",
"0.5025959",
"0.5025959",
"0.5025959",
"0.5025959",
"0.5025959",
"0.5025959",
"0.5025959",
... | 0.5807241 | 0 |
line of sight between two points bounding box for convex obstacles sampling for nonconvex | function isLineOfSight(a,b){
//quick check
//print(isColorEqualP2C(b,obstacleColor));
//var startTime5 = millis();
if(obstacles.length>0 && isColorEqualP2C(b,obstacleColor)){
return false;
}
//print(Math.round(millis()-startTime5));
if(obstacles.length==0){//if no obstacles - everything can be seen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clipSegment(start, end) {\n const quadrantStart = this.pointLocation(start)\n const quadrantEnd = this.pointLocation(end)\n\n if (quadrantStart === 0b0000 && quadrantEnd === 0b0000) {\n // The line is inside the boundaries\n return [start, end]\n }\n\n if (quadrantStart === quadrantEnd) {\... | [
"0.6710352",
"0.66019505",
"0.6462147",
"0.62616473",
"0.6175257",
"0.6140314",
"0.6140314",
"0.6129245",
"0.6116573",
"0.6104231",
"0.6093399",
"0.60906553",
"0.60537523",
"0.60527956",
"0.6021867",
"0.59669185",
"0.5965177",
"0.59633553",
"0.5954011",
"0.59432137",
"0.59290... | 0.67880833 | 0 |
END City background color picker / Fill Zone select box according to country | function fill_zones_cmb(str,f){
var country_id=str.value;
var front='';
if(f==1){
front='&front=1';
}
/* Remove selected city in dorp down*/
if(jQuery('select#city_id option:selected').val()!=''){
jQuery('select#city_id option:selected').remove();
}
document.getElementById('process_state').... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wpsc_update_regions_list_to_match_country( country_select ) {\n\tvar country_meta_key = wpsc_get_element_meta_key( country_select );\n\tvar region_meta_key;\n\n\tif ( country_meta_key.indexOf( \"shipping\" ) === 0 ) {\n\t\tregion_meta_key = 'shippingregion';\n\t} else {\n\t\tregion_meta_key = 'billingre... | [
"0.6559346",
"0.62165403",
"0.6147792",
"0.6109238",
"0.608415",
"0.6013633",
"0.59786415",
"0.5947858",
"0.5946649",
"0.593466",
"0.59286046",
"0.5920043",
"0.5872922",
"0.5872821",
"0.5862918",
"0.5855897",
"0.58512574",
"0.5844028",
"0.5795585",
"0.5788862",
"0.5786485",
... | 0.6286864 | 1 |
returns the number of Gecko hangs, and the computed minimum threshold for those hangs (which is a value >= gHangThreshold) | function numGeckoHangs() {
var hangs;
switch(gMode) {
case "threadHangs":
hangs = numGeckoThreadHangs();
panel.port.emit("warning", hangs === null ? "unavailableBHR" : null);
return hangs
case "eventLoopLags":
hangs = numEventLoopLags();
panel.port.emit("warning", hangs === nul... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function YProximity_get_detectionThreshold()\n {\n var res; // int;\n if (this._cacheExpiration <= YAPI.GetTickCount()) {\n if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {\n return Y_DETECTIONTHRESHOLD_INVALID;\n }\n }\n ... | [
"0.56400764",
"0.5571592",
"0.5504529",
"0.54471725",
"0.5441428",
"0.54342943",
"0.5331793",
"0.5218065",
"0.5218065",
"0.52040035",
"0.52040035",
"0.5190624",
"0.5082941",
"0.50540483",
"0.50508624",
"0.500668",
"0.500668",
"0.49992463",
"0.49955714",
"0.4995019",
"0.498194... | 0.7848076 | 0 |
fail gracefully; if this fails, we will return null in `getUptime()` | function getUptime() {
try {
return profiler.getElapsedTime();
} catch (e) { // retrieving the pref failed, but we can still fail gracefully and just not show it
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calcUptime() {\n lumServer.healthcheck.serverUptime = utils.milliSecsToString(utils.now());\n }",
"function getServerUptime() {\n const secs = Math.floor(process.uptime());\n const date = new Date(null);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n}",
"function tw... | [
"0.6219444",
"0.55356634",
"0.5354726",
"0.53213996",
"0.5278748",
"0.52771926",
"0.5118537",
"0.5118537",
"0.5102453",
"0.49537644",
"0.48749185",
"0.46858403",
"0.46661568",
"0.46184644",
"0.46026054",
"0.45957664",
"0.4583004",
"0.4581592",
"0.45506248",
"0.45246089",
"0.4... | 0.692305 | 0 |
output: true or false based on whether an inventory item is available algorithm: Return all transactions with the given id. Sum up the qunatities of each, return true if it is positive. If the movement property is 'out', the quantity is subtracted, if 'in' it is added | function isItemAvailable(inventoryId, transactionList) {
var finalQuantity = transactionsFor(inventoryId, transactionList).reduce(function(sum, transaction) {
if (transaction.movement === 'in') {
return sum + transaction.quantity;
} else {
return sum - transaction.quantity;
}
}, 0);
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isItemAvailable(inventoryItem, transactions) {\n var myTransactions = select(inventoryItem, transactions);\n\n var inventory = myTransactions.reduce(function(total, transaction) {\n if (transaction.movement === 'in') {\n return total + transaction.quantity;\n } else if (transaction.movement ... | [
"0.6716089",
"0.6309978",
"0.586299",
"0.57902217",
"0.5780739",
"0.5744121",
"0.5735617",
"0.5595509",
"0.5582013",
"0.5577834",
"0.5566547",
"0.5556241",
"0.5531874",
"0.5530577",
"0.5515576",
"0.5499023",
"0.54892087",
"0.5481223",
"0.54684305",
"0.5437975",
"0.5431819",
... | 0.702267 | 0 |
Returns a random dog image from the breed. | getRandomDogImageByBreed(breedName) {
return this.$resource('https://dog.ceo/api/breed/' + breedName + '/images/random').get().$promise;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomDog(){\n let i = getRandomInt(171);\n try{$('.sub__voting-image img').attr('src', MyVariables.breedOptions[i].url);\n $('.sub__voting-image img').attr('ImgId', MyVariables.breedOptions[i].reffImgId);\n $('.sub__voting-image img').attr('value',MyVariables.breedOptions[i... | [
"0.7512695",
"0.7506158",
"0.71351314",
"0.697718",
"0.68675697",
"0.678132",
"0.67362446",
"0.6731448",
"0.6612739",
"0.6576894",
"0.65337753",
"0.65207803",
"0.64745885",
"0.64652294",
"0.6453137",
"0.64247507",
"0.63928634",
"0.636113",
"0.63535386",
"0.631973",
"0.6296142... | 0.7806028 | 0 |
Add shiftType to DOM | function addShiftTypeDOM(shiftType) {
var id = shiftType.id;
var fullName = shiftType.fullName;
var shortName = shiftType.shortName;
var startTime = shiftType.startTime;
var endTime = shiftType.endTime;
var secondStartTime = shiftType.secondStartTime;
var secondEndTime = shiftType.sec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shiftCursor(node, shiftAmount){\r\n\t\tvar win, sel, range, loc;\r\n\t\t\r\n\t\tif(isContentEditable(node)){\r\n\t\t\twin = getNodeWindow(node);\r\n\t\t\tsel = win.getSelection(); range = sel.getRangeAt(0);\r\n\t\t\tloc = range.startOffset + shiftAmount;\r\n\t\t\tconsole.dir(node);\r\n\t\t\tconsole.dir(ra... | [
"0.54255104",
"0.5314567",
"0.51650107",
"0.508984",
"0.50594944",
"0.50348985",
"0.4885204",
"0.4885204",
"0.4885204",
"0.4885204",
"0.4885204",
"0.48469085",
"0.4830481",
"0.4814971",
"0.4810274",
"0.4775727",
"0.47695234",
"0.47462922",
"0.4746033",
"0.47252053",
"0.472107... | 0.7211027 | 0 |
Given a sequence already in `state`, save its transformed coordinates for the given method. | insertTransformedSequence(state, { description, method, visualization }) {
Vue.set(state.sequences[description].visualization, [method], visualization)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"transformSequence({ commit, state }, { description, sequence }) {\n // We need to check that\n if (!Object.prototype.hasOwnProperty.call(state.sequences, description)) {\n commit(\"insertSequence\", { description, sequence })\n }\n commit(\"insertTransformedSequence\", {\n description,\n ... | [
"0.6031065",
"0.5455461",
"0.5249479",
"0.51385367",
"0.51385367",
"0.51385367",
"0.51385367",
"0.50869995",
"0.5077348",
"0.5029562",
"0.49735102",
"0.48869905",
"0.48842382",
"0.47917396",
"0.4777521",
"0.47664797",
"0.47664797",
"0.47664797",
"0.47664797",
"0.47664797",
"0... | 0.62360835 | 0 |
Overwrite the entire `sequences` object in `state` | setSequences(state, sequences) {
Vue.set(state, "sequences", sequences)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetState() {\n this._movements = 0;\n }",
"resetState(state) {\n for (let prop in state) {\n state[prop] = initialState[prop];\n }\n }",
"resetState(state) {\n for (let prop in state) {\n state[prop] = initialState[prop];\n }\n }",
"function... | [
"0.5940362",
"0.59222317",
"0.59222317",
"0.5848051",
"0.58327985",
"0.5770358",
"0.5762363",
"0.57581586",
"0.5720176",
"0.57174593",
"0.57174593",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222",
"0.5675222... | 0.70204073 | 0 |
Transform a sequence using the current visualization method and save it. If the sequence already exists in `state` but does not have the current visualization method's data, it will be modified. Otherwise, the sequence will be transformed and added. TODO: add a check to prevent duplicate transformation | transformSequence({ commit, state }, { description, sequence }) {
// We need to check that
if (!Object.prototype.hasOwnProperty.call(state.sequences, description)) {
commit("insertSequence", { description, sequence })
}
commit("insertTransformedSequence", {
description,
method: state.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"insertTransformedSequence(state, { description, method, visualization }) {\n Vue.set(state.sequences[description].visualization, [method], visualization)\n }",
"insertSequence(state, { description, sequence }) {\n Vue.set(state.sequences, description, {\n sequence,\n visualization: {},\n })\n... | [
"0.75861555",
"0.6169491",
"0.5794635",
"0.5417616",
"0.5417616",
"0.5417616",
"0.5417616",
"0.5351346",
"0.52920675",
"0.5257297",
"0.52184546",
"0.52184546",
"0.52184546",
"0.52184546",
"0.52184546",
"0.5217127",
"0.51234716",
"0.5118991",
"0.5103091",
"0.50490546",
"0.5040... | 0.73049384 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.