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 |
|---|---|---|---|---|---|---|
AJAX request for point region | function getPointReg() {
$.ajax({
url: 'http://data.greeniot.it.uu.se/4dialog/',
data: JSON.stringify(request),
dataType: 'json',
type: 'POST',
success: function (data, status, xhr) {
alert('Success!');
dataReply = data['Replies'];
console.log(da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ajax1(){\n return $.ajax({\n url: 'https://9ex1ark3n8.execute-api.us-west-2.amazonaws.com/test/georesource',\n type: \"POST\",\n async: true,\n crossDomain: true,\n contentType: 'application/json',\n data: JSON.stringify({\"userCurrentLat\": String(centerPo... | [
"0.6552179",
"0.6429667",
"0.6407963",
"0.6407406",
"0.63460606",
"0.6326344",
"0.63079023",
"0.62980336",
"0.62908494",
"0.6289673",
"0.62797934",
"0.6274331",
"0.62500435",
"0.61735934",
"0.6156304",
"0.6133693",
"0.61114264",
"0.60920495",
"0.6091192",
"0.60908306",
"0.608... | 0.6682869 | 0 |
AJAX request for rectangular region | function getRectReg() {
$.ajax({
url: 'http://data.greeniot.it.uu.se/4dialog/',
data: JSON.stringify(requestRect),
dataType: 'json',
type: 'POST',
success: function (data, status, xhr) {
alert('Success!');
dataReply = data['Replies'];
console.log... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRectangle() {\n $.get(\"/shape/rectangle\", function (data, status) {\n var obj = JSON.parse(data);\n app.drawRectangle(obj.loc,obj.width,obj.height,obj.color);\n }, \"json\");\n}",
"function formRequestRect() {\n var startDate = document.getElementById('fromDate').value;\n ... | [
"0.6802538",
"0.62879753",
"0.6237342",
"0.619567",
"0.6068134",
"0.60173947",
"0.60075676",
"0.5837605",
"0.57982445",
"0.57537323",
"0.5734219",
"0.56981945",
"0.56286293",
"0.56218225",
"0.56165457",
"0.5536776",
"0.55275124",
"0.5510065",
"0.54942447",
"0.54802716",
"0.54... | 0.72722846 | 0 |
End Loaners request & info Add loaner Request / Executes a MySQL query to insert a new loaner request into the database. Returns a Promise that resolves to the ID of the newlycreated request entry. | function addLoanerRequest(business, mysqlPool) {
return new Promise((resolve, reject) => {
business.loanerid = null;
mysqlPool.query(
'INSERT INTO loaners SET ?',
business,
function (err, result) {
if (err) {
reject(err);
} else {
resolve(result.insertId);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editloanerRequest(loanerID, loanerRequest, mysqlPool) {\n return new Promise((resolve, reject) => {\n\n mysqlPool.query('UPDATE loaners SET ? WHERE loanerid = ?', [ loanerRequest, loanerID ], function (err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result.affec... | [
"0.598638",
"0.5838457",
"0.5660038",
"0.5524698",
"0.5518542",
"0.54853964",
"0.54335463",
"0.54022163",
"0.53626597",
"0.53487337",
"0.53120524",
"0.53100586",
"0.5268593",
"0.52566296",
"0.5210159",
"0.51730436",
"0.5161515",
"0.51526874",
"0.51229316",
"0.51099616",
"0.50... | 0.69170326 | 0 |
verb :: a > IO () | function verb(x){
if (verbose) console.log(x)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function madLib(verb, adj, noun) {\n console.log(\"We shall \" + verb.toUpperCase() + \" the \" +\n adj.toUpperCase() + \" \" + noun.toUpperCase() + \".\");\n}",
"start(adverb) {\n console.log(`The engine starts up ${adverb}...`);\n }",
"function say({subject, verb, object}) {\n // templat... | [
"0.60394865",
"0.5868769",
"0.58581084",
"0.5673872",
"0.5559282",
"0.55566835",
"0.5549495",
"0.5534578",
"0.5489632",
"0.5429867",
"0.5415497",
"0.54095024",
"0.53883463",
"0.5383298",
"0.53830963",
"0.53830963",
"0.53830963",
"0.53830963",
"0.537771",
"0.5375188",
"0.53743... | 0.73517853 | 0 |
trace :: a > a | function trace(x){
console.log(x)
return x
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fun(a){\n // console.log(\"a got :\" + a);\n return a>33;\n}",
"function LT(state) {\n var stack = state.stack;\n var e2 = stack.pop();\n var e1 = stack.pop();\n\n if (DEBUG) console.log(state.step, 'LT[]', e2, e1);\n\n stack.push(e1 < e2 ? 1 : 0);\n}",
"function LT(state) {\n ... | [
"0.6143167",
"0.5844841",
"0.58168393",
"0.5814575",
"0.5783991",
"0.5745361",
"0.57412505",
"0.5730339",
"0.5710722",
"0.567436",
"0.5673485",
"0.56393266",
"0.5593709",
"0.55411017",
"0.5541014",
"0.55351627",
"0.5530739",
"0.5530739",
"0.5530739",
"0.5530739",
"0.5530739",... | 0.59782845 | 1 |
| No more Flydom! speedcore :: String > Obj > Tree > Elem | function speedcore(tagname, attrs, childs) {
var e = document.createElement(tagname);
for (k in attrs){
if (typeof attrs[k] === "object")
for (l in attrs[k])
e[k][l] = attrs[k][l];
else e[k] = attrs[k];
}
for (var i = 0; i < childs.length; i = i + 3){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(ele) {\n\n this.dom = {\n fps: false\n }\n\n this.fpsStack = false;\n this.stackSize = 60;\n this.index = 0;\n\n this.last = 0;\n this.now = 0;\n\n this.delta = 0;\n\n this.currentFrameFps = 0;\n\n this.total = 0;\n ... | [
"0.54057324",
"0.5323757",
"0.5133726",
"0.50459915",
"0.50153553",
"0.4988585",
"0.4974603",
"0.49497432",
"0.49497432",
"0.49446854",
"0.49293894",
"0.49293894",
"0.49293894",
"0.49221972",
"0.48774603",
"0.48680824",
"0.48649448",
"0.48633167",
"0.48445198",
"0.48423773",
... | 0.62073725 | 0 |
TODO turn octave elements to their original URLs fromBBCode :: Elem > String | function fromBBCode(e) {
e.innerHTML = e.innerHTML.replace(/<br>/g, "\n")
var srcs = { "img": "[img]%s[/img]", "iframe": "%s" }
, wraps = { "strong": "b", "em": "i", "u": "u", "sup": "sup"
, "sub": "sub"
}
, datas = { "object": "%s" }
for (var t in srcs) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseBBList(bbdiv)\n{\n var lines = new Array(\n \"[b]$[/b]$Bold$font-weight:bold\",\n \"[i]$[/i]$Italic$font-style:italic\",\n \"[u]$[/u]$Underline$text-decoration:underline\",\n \"[code]$[/code]$Code$font-family:Courier\",\n \"---\",\n \"[red]$[/red]$Red$colo... | [
"0.56234694",
"0.55693394",
"0.5493085",
"0.5385098",
"0.5325124",
"0.5225326",
"0.5218578",
"0.52130556",
"0.5184497",
"0.5138019",
"0.5114805",
"0.50829303",
"0.50678986",
"0.5067593",
"0.5056804",
"0.49949327",
"0.49387124",
"0.49044496",
"0.48882502",
"0.4881549",
"0.4877... | 0.65795034 | 0 |
Set temporary class name; useful for temporary styles. | function tempClassName(e, cn, t) {
e.className += ' ' + cn
setTimeout(function() {
e.className = e.className.replace(' ' + cn, "")
}, t)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setClassName() {\n logBody.push(\"setClassName\");\n if (inOuterClass === false) {\n attribute[\"outerClass\"][\"name\"] = tokenValue;\n\n logBody.push(`attribute[\"outerClass\"][\"name\"] -> ${attribute[\"outerClass\"][\"name\"]}`)\n }\n ... | [
"0.65743595",
"0.6258897",
"0.59262013",
"0.5890206",
"0.5880457",
"0.58714056",
"0.5818661",
"0.57952476",
"0.57842046",
"0.5753532",
"0.57420075",
"0.571091",
"0.56894714",
"0.56674796",
"0.56541574",
"0.5637611",
"0.56265044",
"0.5558343",
"0.5549419",
"0.5526856",
"0.5487... | 0.69127077 | 0 |
| Get the tbody containing post s tbody :: IO Elem | function tbody(){
var e = document.getElementById("main").getElementsByClassName("topic")[0]
return e.children[1]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTBody(tbody) {\n $html = \"<tr>\";\n for ( var i in tbody ) {\n $html += \"<td>\" + tbody[i] + \"</td>\";\n }\n $html += \"</tr>\";\n return $html;\n}",
"function tableBodyObject() {\r\n return $('#' + opts.tableBodyId);\r\n }",
"retrieve(tableObj){\n // Is this a... | [
"0.66072726",
"0.63111085",
"0.6101699",
"0.6002876",
"0.58924204",
"0.58502626",
"0.5686468",
"0.5667687",
"0.5603305",
"0.55988324",
"0.5550444",
"0.5421194",
"0.53916144",
"0.5368096",
"0.53530616",
"0.5343077",
"0.5343077",
"0.53084457",
"0.52981675",
"0.52981675",
"0.528... | 0.65594107 | 1 |
| Find the post table rows and return them. focus :: Elem > IO [Elem] | function focus(div){
var e = div.getElementsByClassName("topic")[0]
if (e) {
var es = e.children[1].children
return tail(es)
} else return []
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"focus() {\n this._selectRowByIndex(0);\n this._FBPTriggerWire('--focus');\n }",
"function getSelTableRowOffsets() {\n var retVal=\"\";\n var start=0,end=0;\n var DOM = dw.getDocumentDOM();\n var offsets = DOM.getSelection(true); // gets pairs of offsets if multiple selections\n var nod... | [
"0.5594145",
"0.55671823",
"0.55427265",
"0.5467514",
"0.5462408",
"0.5460956",
"0.5434095",
"0.53530556",
"0.53530556",
"0.53530556",
"0.53465044",
"0.5343016",
"0.53333324",
"0.530495",
"0.5278508",
"0.5241081",
"0.5228079",
"0.52124745",
"0.5159254",
"0.51396245",
"0.51350... | 0.5635931 | 0 |
| Find the topics and return their parent. focusThreads :: Elem > IO Elem | function focusThreads(div){
var e = div.getElementsByClassName("posts")[0]
return e
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function focus(div){\n var e = div.getElementsByClassName(\"topic\")[0]\n\n if (e) {\n var es = e.children[1].children\n\n return tail(es)\n\n } else return []\n}",
"function processTreeViewThreads() {\n $scope.threads = [];\n\n var start = angular.copy($scope.topic);... | [
"0.6781681",
"0.5646511",
"0.5450486",
"0.52367043",
"0.5142683",
"0.51403564",
"0.50858146",
"0.50684184",
"0.50513494",
"0.50432324",
"0.50273293",
"0.5024438",
"0.50130737",
"0.49877247",
"0.498293",
"0.49623397",
"0.49423188",
"0.49423188",
"0.49040213",
"0.48692358",
"0.... | 0.6430051 | 1 |
| Get the class="c_view" element. lastUserlist :: IO Elem | function lastUserlist(){
var ft = document.querySelector(".c_view")
verb("BENIS")
verb(ft)
var ftl = ft.parentNode
return ftl
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"last() {\n this._followRelService(\"last\", \"List\");\n }",
"function last$get$0() {\n if ( !this.list ) return undefined;\n return this.list[this.list.length - 1];\n }",
"lastNode(list) {\r\n\t\t\t\t\tif (list.length === 0) {\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\... | [
"0.6197985",
"0.6110052",
"0.58192945",
"0.56384695",
"0.56069654",
"0.5589363",
"0.5363539",
"0.52876186",
"0.5241194",
"0.5228905",
"0.51994604",
"0.5178482",
"0.5169251",
"0.51636827",
"0.51352376",
"0.51212066",
"0.5115463",
"0.5115463",
"0.51079553",
"0.5083383",
"0.5079... | 0.73653996 | 0 |
fiveSiblings :: Elem > [Elem] | function fiveSiblings(e) {
var es = [ e, e.nextElementSibling
, e.nextElementSibling.nextElementSibling
, e.nextElementSibling.nextElementSibling.nextElementSibling
, e.nextElementSibling.nextElementSibling.nextElementSibling.nextElementSibling
]
return es
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSiblings(elem) {\n const parent = getParent(elem);\n if (parent != null)\n return getChildren(parent);\n const siblings = [elem];\n let { prev, next } = elem;\n while (prev != null) {\n siblings.unshift(prev);\n ({ prev } = prev);\n }\n while (next != null) {\n... | [
"0.6738881",
"0.6683905",
"0.6583111",
"0.6570836",
"0.6570836",
"0.6570836",
"0.6570836",
"0.6570836",
"0.65093994",
"0.65014315",
"0.6379704",
"0.6247641",
"0.61024994",
"0.60672015",
"0.6013804",
"0.5992025",
"0.5935704",
"0.5935704",
"0.5935704",
"0.59321105",
"0.5877299"... | 0.77011275 | 0 |
TODO generalize the SHIT out of this you B I T C H TODO remove deleted nodes updatePost :: Elem > Elem > IO () | function updatePost(ne, oe) {
var coe = oe.childNodes
, cne = ne.childNodes
, changed = false
verb("cne #" + cne.length + ", coe #" + coe.length)
try {
// Add or change nodes
for (var i = 0; i < cne.length; i++) {
verb( "cne.nodeType: " + cne[i].nodeType + "; coe.nodeType: "
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Post() {}",
"function postOrderTraversal(node) {}",
"function postToElem( post, kind ) {\n /*\n \"userpost\" :\n {\n \"n\" : username,\n \"k\" : seq number,\n \"t\" : \"post\" / \"dm\" / \"rt\"\n \"msg\" : message (post/rt)\n \"time\" : u... | [
"0.56988937",
"0.5678078",
"0.5605252",
"0.55862224",
"0.55509746",
"0.5537773",
"0.5503496",
"0.5396176",
"0.53901887",
"0.53706604",
"0.536433",
"0.534909",
"0.5347408",
"0.5339026",
"0.5338255",
"0.5333919",
"0.53301424",
"0.529478",
"0.5280457",
"0.5276469",
"0.52740973",... | 0.675305 | 0 |
remNextButton :: IO () | function remNextButton() {
var ns = document.getElementsByClassName("c_next")
map(function(n){ n.parentNode.parentNode.removeChild(n.parentNode) }, ns)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goNext() {\n \t$('.chat__input__text').off('click', $scope.activeConversation.question.action);\n \t$('.chat__input__icon').off('click', $scope.activeConversation.question.action);\n \tupdateNext();\n }",
"function removeNext(){\n $('#modal-next').remove();\n}",
"function handleNextBtn() ... | [
"0.72139144",
"0.711095",
"0.7060491",
"0.70594066",
"0.6884916",
"0.6766464",
"0.674658",
"0.6744649",
"0.6734225",
"0.6717172",
"0.6714922",
"0.6707467",
"0.669374",
"0.668915",
"0.6684204",
"0.66469204",
"0.6644976",
"0.66320086",
"0.65869194",
"0.65835625",
"0.65668005",
... | 0.74610305 | 0 |
FIXME find all form elements with "name" and "value" attributes getPostArgs :: Elem > IO Obj | function getPostArgs(t) {
var ts = t.parentNode.parentNode.parentNode.getElementsByTagName("input")
var o = {}
for (var i = 0; i < ts.length; i++)
if (ts[i].type === "hidden") o[ts[i].name] = ts[i].value
o["sd"] = '1'
return o
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"extractData({elements}) {\n return Array.from(elements)\n //remove button element before further processing\n .filter(el => el.nodeName === 'INPUT')\n .map(\n el => ({\n name: el.name,\n value: el.value,\n ... | [
"0.63043386",
"0.62912875",
"0.6215373",
"0.61862856",
"0.6178387",
"0.6133813",
"0.6132094",
"0.61249715",
"0.6104822",
"0.60815436",
"0.60160875",
"0.59706134",
"0.59077704",
"0.59056675",
"0.5896619",
"0.58418745",
"0.58409667",
"0.58409667",
"0.58313257",
"0.58313257",
"0... | 0.69639075 | 0 |
| Highlight the elements that have actions during Ctrl mode. highlightModeElems :: Bool > IO () | function highlightModeElems(b) {
verb("Highlighting elements? " + b)
var s = document.getElementById("beta-style-highlight")
if (s === null) {
s = document.createElement("style")
s.id = "beta-style-highlight"
}
if (b) s.textContent =
".beta-highlight { box-shadow: 0 0 10px... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableElements(){\n\t// change mouse pointer type of character objects and item objects\n\t$(\"#characters\").children().each(function(index) {\n\t\t$(this).css({\n\t\t\t\"cursor\" : \"pointer\"\n\t\t});\t\n\t\t$(this).click(selectCharacter);\n\t});\n\t$('#items').children().each(function(index) {\n\t\t$(... | [
"0.57524306",
"0.5603158",
"0.55279326",
"0.5405445",
"0.5268602",
"0.52205926",
"0.51891977",
"0.5131276",
"0.5089458",
"0.50484824",
"0.50330514",
"0.5025397",
"0.49994814",
"0.4991258",
"0.49757594",
"0.49407867",
"0.49373406",
"0.4917695",
"0.4900679",
"0.48936588",
"0.48... | 0.62170047 | 0 |
hideUserlists :: IO () | function hideUserlists() {
if (readify('beta-userlist', false)) {
debu("Hiding userlists!")
var s = document.createElement("style")
s.id = "beta-style-userlist"
s.textContent = ".c_view-list { display: none !important } "
document.body.appendChild(s)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideList() {\n var userList = document.getElementById(\"userList\");\n userList.style.display = userList.style.display == \"none\" ? \"block\" : \"none\";\n}",
"function hideList(list) {\n list.style.display = \"none\";\n}",
"function displayNoneList() {\n document.querySelector('ul').style.di... | [
"0.7620194",
"0.706941",
"0.6755396",
"0.6713005",
"0.6658812",
"0.64042246",
"0.63795894",
"0.6360661",
"0.6360661",
"0.6360661",
"0.63472104",
"0.63413453",
"0.62976116",
"0.62889576",
"0.6280732",
"0.62445706",
"0.62114424",
"0.6208472",
"0.61985785",
"0.61985314",
"0.6175... | 0.8371633 | 0 |
toggleFloatingQR :: IO () | function toggleFloatingQR() {
if (localStorage["beta-floating"]) delete localStorage["beta-floating"]
else localStorage["beta-floating"] = '1'
floatQR()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showQrCode() {\n const {\n canvas,\n action,\n actionText,\n closeText,\n parent,\n qrCodeGenerated,\n address\n } = this;\n\n if (qrCodeGenerated) {\n parent.classList.toggle(NavQrButton.HAS_QR_CLASS);\n this.positionQrCode();\n return;\n }\n\n QRCo... | [
"0.6274627",
"0.61841005",
"0.61614794",
"0.6120956",
"0.609195",
"0.5756525",
"0.57278955",
"0.5690463",
"0.566276",
"0.56393003",
"0.5633521",
"0.5579381",
"0.5542731",
"0.5525999",
"0.551154",
"0.5495145",
"0.536319",
"0.53517926",
"0.5350112",
"0.53281754",
"0.5311013",
... | 0.7896032 | 0 |
moveQR :: Event > IO () | function moveQR(e) {
verb("Moving QR...")
var q = quickReply().parentNode.parentNode
if (e) {
localStorage["beta-fl-x"] =
def(0, Math.max(e.screenX - q.scrollWidth / 2, 0))
localStorage["beta-fl-y"] =
def(0, Math.max(e.screenY - q.scrollHeight / 2, 0))
}
q.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"move() {\n\n }",
"move () {\n }",
"move() {\n }",
"move() { }",
"move() { }",
"move(event){\n this.xyE = this.getXY(event);\n }",
"onMove() {\n }",
"shoulderFrameRAction(event) {\n if (this.baseFrameActionActivated) return;\n\n let currentActionInitialEventCoords =... | [
"0.65074754",
"0.6486603",
"0.63901573",
"0.636849",
"0.636849",
"0.62266517",
"0.6216627",
"0.61951077",
"0.6156398",
"0.60539156",
"0.6034088",
"0.6033236",
"0.60269374",
"0.6025492",
"0.60002536",
"0.5983444",
"0.5969103",
"0.59121",
"0.5906413",
"0.5876914",
"0.58731186",... | 0.750053 | 0 |
addSpoilerEvent :: Elem > IO () | function addSpoilerEvent(tr) {
var sps = tr.getElementsByClassName("spoiler_toggle")
if (sps.length > 0) {
verb("Adding " + sps.length + " spoiler events... ")
debu(sps)
}
for (var j = 0; j < sps.length; j++) {
sps[j].addEventListener("click", function(){
var s = th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEventMedia() {\n const media = document.querySelectorAll('img[data-id]');\n media.forEach(elem => {\n elem.style.cursor = 'pointer';\n elem.addEventListener('click', showInfo);\n })\n}",
"function addTimelineEvent(icon, date, title, location, extra){\n $( \".timeline-events\" ).prepend('<li... | [
"0.56635547",
"0.55459464",
"0.5543289",
"0.5508564",
"0.5507176",
"0.5503201",
"0.5483497",
"0.54666483",
"0.5425425",
"0.53650045",
"0.53385794",
"0.5330581",
"0.5330176",
"0.5326942",
"0.53162813",
"0.5316172",
"0.526498",
"0.52542406",
"0.524132",
"0.5238468",
"0.5231292"... | 0.7494945 | 0 |
addQuoteEvent :: Elem > IO () | function addQuoteEvent(tr) {
var q = tr.querySelector(".c_footicons .right [href*='/post/']")
q.className += " beta-highlight"
q.title = "Ctrl-click to quick quote."
// Hint
q.addEventListener("mouseover", hint(q.title))
q.addEventListener("mouseout", function(e) {
var bp = document.que... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addQuoteToDom(saying) {\n saying= \"The Early Bird gets the Worm\";\n console.log('Adding quote to dom: ' + \"The Early Bird Gets the Worm!\");\n const quoteContainer = document.getElementById('saying-container');\n quoteContainer.innerText = saying;\n}",
"function addListenerToLoadQuote() {\n\tva... | [
"0.6339453",
"0.6308386",
"0.6281308",
"0.6225963",
"0.6163535",
"0.6077555",
"0.60108656",
"0.6010058",
"0.59762776",
"0.58465797",
"0.5834843",
"0.58114874",
"0.57614005",
"0.5751757",
"0.569201",
"0.56558025",
"0.5596572",
"0.5578318",
"0.55335855",
"0.5529816",
"0.5526587... | 0.6928032 | 0 |
addPostEvent :: IO () | function addPostEvent() {
var pt = document.querySelector("#c_post-text")
pt.addEventListener("keydown", function(e){
if (e.ctrlKey && e.keyCode === 13) {
var pf = document.querySelector(".exclusivebutton")
pf.submit()
}
})
var btn = document.querySelector("[acc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEvent() {\n sendLog(\"Add Event\")\n selectEvent(0);\n handleShow();\n }",
"addPost(){\n\n }",
"_hookPost(evt) {\n\n let _this = this;\n\n return new BbPromise(function (resolve, reject) {\n\n console.log('-------------------');\n console.log('YOUR S... | [
"0.65003824",
"0.64795744",
"0.644966",
"0.6288961",
"0.62661994",
"0.62380385",
"0.618277",
"0.61477274",
"0.6092645",
"0.6074792",
"0.6047013",
"0.5934377",
"0.5913627",
"0.5877578",
"0.5856354",
"0.5856085",
"0.5855007",
"0.5838486",
"0.58354616",
"0.5834168",
"0.58173704"... | 0.6484348 | 1 |
addQuickMsgEvent :: IO () | function addQuickMsgEvent() {
var qt = document.querySelector("#quickcompose")
qt.addEventListener("keydown", function(e){
if (e.ctrlKey && e.keyCode === 13) {
var pf = document.querySelector(".exclusivebutton")
pf.submit()
}
})
var btn = document.querySelector... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addEvent() {\n sendLog(\"Add Event\")\n selectEvent(0);\n handleShow();\n }",
"function setAddEventHandlerInQuickView() {\n const button = nodeSelectors.quickViewBody.querySelector(selectors.add);\n on('click', button, (event) => handleAddEvent(event));\n }",
"function x... | [
"0.71412647",
"0.66966236",
"0.657007",
"0.6410035",
"0.6344753",
"0.6103981",
"0.60472363",
"0.60353065",
"0.5941853",
"0.5939756",
"0.5898306",
"0.5869787",
"0.584678",
"0.58224905",
"0.58106387",
"0.5758612",
"0.5756159",
"0.5738389",
"0.57363886",
"0.57329917",
"0.5725691... | 0.697374 | 1 |
addHintEvents :: IO () | function addHintEvents() {
var es = document.querySelectorAll("[title]")
for (var i = 0; i < es.length; i++) {
es[i].addEventListener("mouseover", hint(es[i].title))
es[i].addEventListener("mouseout", function(e) {
var bp = document.querySelector("#beta-popup")
bp.parent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bindHintEvents() {\n if (this._canvasJqElem) {\n const thisObj = this;\n\n $(this._canvasJqElem.parent())\n .off(\".scada.chart.hint\")\n .on(\"mousemove.scada.chart.hint touchstart.scada.chart.hint touchmove.scada.chart.hint\", function (event) {\n ... | [
"0.6464689",
"0.6354493",
"0.6314967",
"0.6124462",
"0.6113202",
"0.6073861",
"0.60215497",
"0.60182065",
"0.6006578",
"0.59931",
"0.58196735",
"0.57129276",
"0.571267",
"0.5704419",
"0.5691897",
"0.5675293",
"0.5649026",
"0.55751854",
"0.5571164",
"0.55510837",
"0.55487716",... | 0.6771982 | 0 |
getForum :: IO String | function getForum() {
var url = window.location.pathname.split('/')
return url[1]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchForum(problem) {\n\tconsole.log('fetching forum for problem: ' + problem);\n\t\n\tconst requestURL = '/forum/?problem=' + problem;\n\t$.ajax({\n\t\turl: requestURL,\n\t\ttype: 'GET',\n\t\tdataType: 'JSON',\n\t\tsuccess: (data) => {\n\t\t\tconsole.log(data);\n\t\t\tgenerateForumPosts(data);\n\t\t},\n\... | [
"0.6654755",
"0.6481993",
"0.6192717",
"0.6135289",
"0.59915483",
"0.5964014",
"0.58561724",
"0.5776798",
"0.5677846",
"0.5490437",
"0.5484596",
"0.5445518",
"0.5427077",
"0.5419697",
"0.5404992",
"0.5400867",
"0.5330528",
"0.53244156",
"0.53170377",
"0.52907604",
"0.52697235... | 0.76144737 | 0 |
isForum :: IO Bool | function isForum() {
var url = window.location.pathname.split('/')
return url[2] === "forum"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isReadingBSCThread() {\r\n return !!document.location.href.match(/forum\\/10\\-programmering\\-och\\-digitalt\\-skapande\\/1288777\\-better\\-sweclockers\\/*/i);\r\n}",
"isPrivateThread(thread) {\n return this.getPrivateForums().then(privateForums => {\n if (privateForums.includes(thread.foru... | [
"0.65007323",
"0.6427408",
"0.6201032",
"0.61317945",
"0.58569026",
"0.57098305",
"0.55038863",
"0.55038863",
"0.55038863",
"0.5503383",
"0.5453566",
"0.5429151",
"0.5427581",
"0.53875136",
"0.5358482",
"0.53556615",
"0.535298",
"0.5329196",
"0.53019387",
"0.5264328",
"0.5241... | 0.7898255 | 0 |
isTopic :: IO Bool | function isTopic() {
var url = window.location.pathname.split('/')
return url[2] === "topic"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTopic(topic) {\r\n if (typeof topic !== 'string') {\r\n return false;\r\n }\r\n if (!/^(0x)?[0-9a-f]{64}$/i.test(topic)) {\r\n return false;\r\n }\r\n else if (/^(0x)?[0-9a-f]{64}$/.test(topic) ||\r\n /^(0x)?[0-9A-F]{64}$/.test(topic)) {\r\n return true;\r\n ... | [
"0.7484152",
"0.7484152",
"0.7484152",
"0.681317",
"0.5923264",
"0.5901183",
"0.5761414",
"0.5668811",
"0.5668811",
"0.56239045",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.54829574",
"0.548... | 0.7550616 | 0 |
isHome :: IO Bool | function isHome() {
var url = window.location.pathname.split('/')
verb("isHome: " + url[2] === "home")
return url[2] === "home"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHome() {\n\tvar regex = /^(\\/sobaryton.github.io)?(\\/(index.html)?)?$/i;\n\treturn regex.test(window.location.pathname);\n}",
"function iAmInHome(){\n const path = window.location.pathname.split('/');\n const actualPage = path[path.length-1];\n if(['index.html',''].includes(actualPage)) return tr... | [
"0.75573194",
"0.7197662",
"0.71934414",
"0.7083041",
"0.7083041",
"0.7083041",
"0.7068327",
"0.6838022",
"0.647325",
"0.6227432",
"0.6112986",
"0.5956309",
"0.5928912",
"0.5912797",
"0.5836067",
"0.5836067",
"0.5826808",
"0.58157647",
"0.57799065",
"0.57767785",
"0.5707296",... | 0.7742255 | 0 |
isPost :: IO Bool | function isPost() {
var url = window.location.pathname.split('/')
verb("isPost: " + url[2] === "post")
return url[2] === "post"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get allowsPosting()\n\t{\n\t\treturn true;\n\t}",
"function Post() {}",
"function POST(){\n \n}",
"function isPage(s) {\n var url = window.location.pathname.split('/')\n\n verb(\"isPost: \" + url[2] === s)\n return url[2] === s\n}",
"isValid() {\n return this.validation.isValid && !this.prop... | [
"0.6959671",
"0.6091728",
"0.60732555",
"0.6047881",
"0.59647477",
"0.5956119",
"0.59188396",
"0.5889789",
"0.58792",
"0.58276236",
"0.58245647",
"0.5808822",
"0.58003914",
"0.5800359",
"0.57314306",
"0.5729859",
"0.56878865",
"0.56502175",
"0.56295806",
"0.56281555",
"0.5625... | 0.7485064 | 0 |
forumUpdate :: IO () | function forumUpdate() {
var b = readify('beta-refreshing', false)
if (! b) {
try {
var url = window.location.pathname
console.log(url)
request(url, addTopics)
} catch(e) {
debu(e)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateForumData(id) {\n\tid = id.toString();\n\tif ((id.length > 0) && (GetXmlHttpObject(forumStateChanged))) { \n\t\t// get new data\n\t\tcurRead = \"read\" + id;\n\t\tvar url = \"forums_ajax.php?id=\" + id;\n\t\txmlHttp = GetXmlHttpObject(forumStateChanged); \n\t\txmlHttp.open(\"GET\", url, true); \n\t\... | [
"0.6573144",
"0.6320064",
"0.6163743",
"0.6154464",
"0.6144994",
"0.61186355",
"0.60491884",
"0.6029326",
"0.59555495",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.5927196",
"0.58445865",
"0.58170617",
"0.57772684... | 0.80174255 | 0 |
ignoredUsers :: IO [String] | function ignoredUsers() {
try {
return JSON.parse(localStorage['beta-ignoredusers'])
} catch(e){
debu(e.toString())
return []
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStrippedUsers(){\r\n\t// SECURITY: strip users of passwords before sending to client\r\n\tvar clientList = [];\r\n\tusers.forEach(function(user) {\r\n\t\tclientList.push({nick: user.nick, status: user.status});\r\n\t});\r\n\treturn clientList;\r\n}",
"function users(callback) {\n\tif (_windows) {\n\t... | [
"0.6586643",
"0.6560637",
"0.6435485",
"0.61699736",
"0.6152782",
"0.6112624",
"0.6034561",
"0.59985024",
"0.59754986",
"0.594383",
"0.5900911",
"0.589304",
"0.58510923",
"0.5788767",
"0.57841635",
"0.5784095",
"0.57507676",
"0.57281464",
"0.57257825",
"0.571993",
"0.571993",... | 0.71313477 | 0 |
ignoredPosts :: IO Regex | function ignoredPosts() {
var ms = []
var re = ""
try {
ms = JSON.parse(localStorage['beta-ignoredposts'])
} catch(e){
debu(e.toString())
}
for (var i = 0; i < ms.length; i++){
re += "" + ms[i] + ""
if (i < ms.length - 1) re += '|'
}
verb(re)
if (r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeUnwantedPosts()\r\n{\r\n\tif(removeL)\r\n\t\tremovePosts(listenMatch);\r\n\r\n\tif(removeW)\r\n\t\tremovePosts(wipMatch);\r\n\t\t\r\n\tif(removeP)\r\n\t\tremovePosts(promoMatch);\r\n}",
"function ignore(){\n var b = readify('beta-ignoring', false)\n\n if (! b) {\n verb(\"Ignoring...\"... | [
"0.6083372",
"0.5943533",
"0.5435046",
"0.53198427",
"0.5225917",
"0.51733226",
"0.51358116",
"0.51358116",
"0.5065215",
"0.5053829",
"0.49919668",
"0.49826628",
"0.49706554",
"0.49605012",
"0.49373752",
"0.4936308",
"0.49298817",
"0.49166697",
"0.4885365",
"0.4809868",
"0.48... | 0.7760077 | 0 |
ignoreUI :: IO () | function ignoreUI(){
verb("Creating ignore UI...")
var main = document.getElementById("main")
var ui = speedcore("table", {}, [
"thead", {}, [
"tr", {}, [
"th", { colSpan: "3", textContent: "Full user ignoral" }, []
]
],
"tbody", {}, [
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cleanupUI() {\n\n }",
"function UI(){}",
"function UI(){}",
"function UI() {}",
"function UI() {}",
"function UI() {}",
"function UI() {\n }",
"function HTMLUI () {}",
"function hideGUIForever () {\r\n $('#buttonsPanel')\r\n .add('#player-logo')\r\n .add('#presentation-info... | [
"0.69709444",
"0.6517243",
"0.6517243",
"0.6421569",
"0.6421569",
"0.6421569",
"0.635677",
"0.6122765",
"0.60901135",
"0.599467",
"0.59345114",
"0.5887081",
"0.58775306",
"0.58401865",
"0.58375937",
"0.5824302",
"0.5824302",
"0.5811866",
"0.57980394",
"0.57893944",
"0.577737"... | 0.6721693 | 1 |
addHideButtons :: IO () | function addHideButton(x) {
return null
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _hideOtherButtons(hide){\n\t\t\t$('.btn_addremove').show();\n\t\t\t$('.btn_download').show();\n\t\t\t$('.btn_delete').show();\n\t\t\t\n\t\t\t/*if (hide) {\n\t\t\t\t$('.btn_addremove').hide();\n\t\t\t\t$('.btn_download').hide();\n\t\t\t\t$('.btn_delete').hide();\n\t\t\t}*/\n\t\t}",
"function hideButtons(... | [
"0.73800224",
"0.7368923",
"0.7365593",
"0.72628486",
"0.72521675",
"0.7143686",
"0.7086363",
"0.7079196",
"0.7078308",
"0.7019031",
"0.70170546",
"0.6920767",
"0.6915422",
"0.6901875",
"0.68959194",
"0.68562925",
"0.6841323",
"0.68356186",
"0.6835586",
"0.6821449",
"0.681384... | 0.7807639 | 0 |
Auxiliary method to programmatically select a tab in the UI. | function selectTab() {
var href = tab.href.split('#')[1];
var panel = layout.content_.querySelector('#' + href);
layout.resetTabState_(tabs);
layout.resetPanelState_(panels);
tab.classList.add(layout.CssClasses_.IS_ACTIVE);
panel.classList.add(layout.CssClasses_.IS_ACTIVE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout._content.querySelector('#' + href);\n layout._resetTabState(tabs);\n layout._resetPanelState(panels);\n addClass(tab, layout._CssClasses.IS_ACTIVE);\n addClass(panel, layout._CssClasses.IS_ACT... | [
"0.79709166",
"0.758088",
"0.758088",
"0.758088",
"0.758088",
"0.758088",
"0.7482282",
"0.7397498",
"0.73887813",
"0.73839617",
"0.73191774",
"0.723522",
"0.7125306",
"0.7109845",
"0.7094249",
"0.7065551",
"0.7029428",
"0.69664675",
"0.69320655",
"0.6922655",
"0.69081914",
... | 0.80086505 | 1 |
check the readme box | function clickCheckBox() {
"use strict";
var img = $(".readme div");
var checkBox = $(".readme input");
if(img.hasClass("checked")){
img.removeClass("checked");
checkBox.attr("checked", false);
} else {
img.addClass("checked");
checkBox.attr("checked", true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n inq.prompt(questions).then((res) => {\n // console.log(res);\n\n const licBadge = checkLicense(res);\n const returnMD = mark.generateMarkdown(res);\n // console.log(returnMD);\n\n // function to write README file\n fs.writeFileSync(\"genReadme/README... | [
"0.63580334",
"0.6243299",
"0.61047673",
"0.6087832",
"0.5986865",
"0.5967049",
"0.5926246",
"0.59195536",
"0.59111476",
"0.5901563",
"0.5893151",
"0.58914626",
"0.58904296",
"0.58886665",
"0.58803594",
"0.58652955",
"0.5858263",
"0.5853662",
"0.5849363",
"0.58301663",
"0.582... | 0.7404786 | 0 |
Handles loaded event for iframe: Enables screen sharing functionality to the iframe webpage. Initializes postis. Initializes remote control. | function onload() {
setupScreenSharingForWindow(iframe.contentWindow);
iframe.contentWindow.onunload = onunload;
channel = postis({
window: iframe.contentWindow,
windowForEventListening: window
});
remoteControl.init(
channel,
dialogFactory,
config.handleRemot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function frameLoaded(e) {\n frame.postMessage(JSON.stringify(mainData), frame.url);\n}",
"onLoaded() {\n // Since the iframe runtime runs in user's browser, being loaded doesn't\n // necessarily mean that the runtime has started. Especially on slower\n // mobile devices the runtime initialization can... | [
"0.656728",
"0.64161044",
"0.6266693",
"0.62564355",
"0.6203061",
"0.6132013",
"0.6130303",
"0.6117101",
"0.60723037",
"0.6067614",
"0.5988904",
"0.5883548",
"0.5867995",
"0.58194315",
"0.57998234",
"0.5782715",
"0.576771",
"0.57158345",
"0.5713003",
"0.5707098",
"0.5684889",... | 0.79954785 | 0 |
show successalert depending on alertId | function alertSuccess(alertId, msgString){
// make sure it's clean and empty
$(alertId).text('');
var msg = '<p>'+msgString+'</p>';
$(alertId).append(msg);
$(alertId).slideDown('slow').fadeIn(3000, function(){
setTimeout(function(){
$(alertId)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printSuccess($alert,$id_name){\n\t$(\".alert-area\").append(\"<div class=\\\"alert alert-success\\\" role=\\\"alert\\\">\"+$id_name+\" \"+$alert+\"</div>\");\n}",
"function showAlert(alert_id) {\n hideAlerts();\n $('#' + alert_id).show();\n }",
"function showAlert(alert_id) {\n hideAlerts();... | [
"0.7147274",
"0.70599467",
"0.70599467",
"0.6836692",
"0.67955124",
"0.6750479",
"0.6730928",
"0.667714",
"0.66698575",
"0.66430867",
"0.6632676",
"0.6507609",
"0.64814407",
"0.6466538",
"0.64356077",
"0.6419966",
"0.6419917",
"0.6407226",
"0.6406976",
"0.64034784",
"0.631493... | 0.7123941 | 1 |
Write a function called mostDigits(nums) Given an array of numbers, returns the number of digits in the largest numbers in the list. Example: mostDigits([1234, 56,7]) // 4 mostDigits([1, 1, 11111, 1]) // 5 mostDigits([12, 34, 56, 78]) // 2 | function mostDigits(nums){
let maxDigits = 0;
for (let i = 0 ; i < nums.length; i++){
maxDigits = Math.max(maxDigits, digitCount(nums[i]))
}
return maxDigits;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mostDigits(nums) {\n let maxDigits = 0;\n for (let i = 0; i < nums.length; i++) {\n maxDigits = Math.max(maxDigits, digitCount(nums[i]));\n }\n\n return maxDigits;\n}",
"function mostDigits(arr){\n let max = 0\n for (let i = 0; i<arr.length; i++ ) {\n if ( digitCount(arr[... | [
"0.906443",
"0.88105834",
"0.8802164",
"0.8778703",
"0.87368757",
"0.8722434",
"0.7405091",
"0.71684474",
"0.7122313",
"0.7112326",
"0.70551765",
"0.70310557",
"0.7030994",
"0.69997907",
"0.69810766",
"0.69443387",
"0.69178355",
"0.6889837",
"0.680983",
"0.67676914",
"0.67457... | 0.89932895 | 1 |
You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings taken in the array. Example: longest_consec(["zone", "abigail", "theta", "form", "libe", "zas", "theta", "abigail"], 2) > "abigailtheta" n being the length of the string array, ... | function longestConsec(strarr, k) {
let final = "";
if (strarr.length === 0 || strarr.length < k || k<= 0) {
return final;
}
let temp;
let count = 0;
for (let i=0; i<strarr.length; i++) {
temp = strarr.slice(i,i+k).join("").length;
if (temp > count) {
final = strarr.slice(i,i+k).join("");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function longestConsec(strarr, k) {\n let longest = 0, arr = [], len = strarr.length;\n for (let i = 0; i < len; i++) {\n let af = strarr.slice(i, i + k).join('');\n arr.push(af);\n }\n if (len === 0 || k > len || k <= 0) {\n return '';\n }else return arr.reduce((a, b) => {\n return ... | [
"0.89488894",
"0.84370387",
"0.8377947",
"0.76310986",
"0.7306029",
"0.71729195",
"0.71350676",
"0.70977205",
"0.709457",
"0.7047954",
"0.70225114",
"0.6975029",
"0.69563746",
"0.6890639",
"0.6881371",
"0.68802977",
"0.67384684",
"0.6613184",
"0.6605081",
"0.6601482",
"0.6597... | 0.86560357 | 1 |
Add a second passphrase to an account | function createSecondPassphrase (selectedAccount) {
var bip39 = require('bip39')
var data = { secondPassphrase: bip39.generateMnemonic() }
if (selectedAccount.secondSignature) {
return formatAndToastError(
gettextCatalog.getString('This account already has a second passphrase: ' + s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPrivateKey() {\n var privKey = document.getElementById(\"privKey\").value;\n privKey = privKey.trim();\n var password = document.getElementById(\"password\").value;\n password = password.trim();\n var user_id = document.getElementById(\"pri-name\").value;\n user_id = user_id.trim();\n \n //sett... | [
"0.59729385",
"0.5604176",
"0.55885595",
"0.5559621",
"0.544176",
"0.5436472",
"0.5406492",
"0.5311249",
"0.5299419",
"0.5233565",
"0.5176774",
"0.5155383",
"0.51543796",
"0.5137974",
"0.5124431",
"0.51173306",
"0.5110657",
"0.5104764",
"0.50984246",
"0.50711304",
"0.5057858"... | 0.7171622 | 0 |
You have been tasked with adding an effect to this counter to make it more interesting. Instead of just displaying the count value immediatley when the page loads, we want to create the effect of each digit cycling through its preceding numbers before stopping on the actual value. As a step towards achieving this; you ... | function counterEffect(hitCount) {
var counter = [];
for (var i = 0; i < hitCount.length; i++){
var arrInArr = [];
for (var j = 0; j <= Number(hitCount[i]); j++){
arrInArr.push(j);
}
counter.push(arrInArr);
}
return counter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function counterEffect(hitCount) {\nvar result = [];\nvar myArray = new Array(3)\nfor(var k = 0; k < hitCount.length; k++){\n count = k;\n\tmyArray[k] = new Array()\nfor(var i = 0; i <= hitCount[count]; i ++){\n\tmyArray[k].push(i)\n }\n result.push(myArray[k])\n }\n return result;\n}",
"function startCount... | [
"0.7464413",
"0.599502",
"0.5981016",
"0.5970187",
"0.59643537",
"0.58154756",
"0.5765023",
"0.5728271",
"0.571753",
"0.5695222",
"0.5692252",
"0.56885993",
"0.56652415",
"0.56412697",
"0.5595007",
"0.55896837",
"0.5577638",
"0.5574206",
"0.55641544",
"0.5563052",
"0.55555016... | 0.7718351 | 0 |
Builds the notification handler | function NotificationHandler(setNotification, clearNotification) {
this.setNotification = setNotification;
this.clearNotification = clearNotification;
this.setNotification = setNotification;
this.clearNotification = clearNotification;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notificationCreate(json) {\n if (Notification.isSupported()) {\n elements[json.targetID] = new Notification(json.notificationOptions);\n elements[json.targetID].on('action', (event, index) => { client.write(json.targetID, consts.eventNames.notificationEventActioned, {index: index}) })\n ... | [
"0.6139013",
"0.5788709",
"0.57240415",
"0.56757367",
"0.5649303",
"0.56105614",
"0.5598815",
"0.5528496",
"0.54970443",
"0.54369",
"0.5435583",
"0.539778",
"0.53747135",
"0.531576",
"0.52884096",
"0.527887",
"0.5270288",
"0.5235135",
"0.5232114",
"0.5213487",
"0.5213487",
... | 0.5931282 | 1 |
Creates a new event guard. | function EventGuard(container, userAgent) {
this.container = container;
this.userAgent = userAgent;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createEventCollector() {\n return eventCollectorFactory(autoflow);\n }",
"function NotificationEventFactory() {}",
"constructor() {\n this._events = Object.create(null)\n }",
"function EventClass() {}",
"function createEvent(eventName, value, address) {\n var msg = new builder.Message()... | [
"0.5604755",
"0.5574094",
"0.5486487",
"0.542837",
"0.5265583",
"0.5211736",
"0.5204327",
"0.51761717",
"0.5144935",
"0.5136295",
"0.51106375",
"0.510122",
"0.5095651",
"0.5092335",
"0.5090295",
"0.508119",
"0.50647604",
"0.5031813",
"0.5017951",
"0.50112474",
"0.49898037",
... | 0.61327153 | 0 |
curve factories factory for bezier curve functions | function createBezierCurve(p1, p2, p3, p4) {
return function(t) {
return {
x: bezierPoint(p1.x, p2.x, p3.x, p4.x, t),
y: bezierPoint(p1.y, p2.y, p3.y, p4.y, t)
};
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeBezier(qttAval) {\n\t//qttAval = 0 não existe curva\n\tif(qttAval == 0) return;\n\t//Salva os pontos intermediarios\n\tvar midPoints = new Array();\n\tvar points = getPoints();\n\tmidPoints[0] = new coord(parseInt(points[0].getAttribute('cx')), parseInt(points[0].getAttribute('cy')));\n\tfor(var i = 1... | [
"0.7218481",
"0.7013367",
"0.6968957",
"0.6905469",
"0.68169767",
"0.68023926",
"0.67792374",
"0.6753839",
"0.67528564",
"0.6699823",
"0.6693529",
"0.6683449",
"0.6627606",
"0.66133475",
"0.65898097",
"0.6497905",
"0.64874434",
"0.644345",
"0.6396398",
"0.63909525",
"0.639095... | 0.7868899 | 0 |
factory for piecewise curve functions | function createPiecewiseCurve() {
var fns = arguments;
return function(t) {
var n = fns.length;
// increase the interval from (0, 1) to (0, n)
var tscale = t * n;
// pick the i'th function for the interval (i, i + 1)
var i = constrain(floor(tscale), 0, n - 1);
var fn = fns[i];
// re-no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBezierCurve(p1, p2, p3, p4) {\n return function(t) {\n return {\n x: bezierPoint(p1.x, p2.x, p3.x, p4.x, t),\n y: bezierPoint(p1.y, p2.y, p3.y, p4.y, t)\n };\n };\n}",
"function addCurve(board, func, atts) {\n\tvar f = board.create('functiongraph', [func], atts, {\n\t\tfixed : fa... | [
"0.66004205",
"0.6128032",
"0.6084011",
"0.60153824",
"0.58766866",
"0.5851952",
"0.5823801",
"0.5823801",
"0.5823801",
"0.57957107",
"0.5788611",
"0.5762181",
"0.5760131",
"0.5734331",
"0.5714412",
"0.5711308",
"0.5704448",
"0.5702634",
"0.56973374",
"0.5653253",
"0.55914754... | 0.79168826 | 0 |
Sets the next page URL on the collection from link headers See: This method is looking for a link header with `rel="next"` An set's it as the next page's URL. If it doesn't find a next page, and current page is set by a link header it assumes we are at the last page and deletes the current `next` | function setLinkHeadersPagination(collection, xhr) {
try {
var links = parseLinkHeader(xhr.getResponseHeader('link'));
collection[STATE].set(LINK_BY_HEADER, true);
collection.setPagination(links['next'].href);
} catch (e) {
if (collection[STATE].get(LINK_BY_HEADER)) {
collection.setPagination(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setLinkHeadersPagination(collection, xhr) {\n\t try {\n\t var links = parseLinkHeader(xhr.getResponseHeader('link'));\n\t collection[STATE].set(LINK_BY_HEADER, true);\n\t collection.setPagination(links['next'].href);\n\t } catch (e) {\n\t if (collection[STATE].get(LINK_BY_HEADER)... | [
"0.7182527",
"0.63568765",
"0.62242347",
"0.5985048",
"0.5865611",
"0.58595955",
"0.5748756",
"0.5738651",
"0.5689883",
"0.5618865",
"0.55530053",
"0.5549045",
"0.5506939",
"0.55057687",
"0.54758984",
"0.5468165",
"0.54650927",
"0.5408736",
"0.53785735",
"0.53717643",
"0.5340... | 0.724065 | 0 |
eslint maxstatements: 0, maxparams: 0 Maps each __displayType__ to a basic set of inputOptions. | function defaultOptions(property) {
var type = property.get('__displayType__');
var values = property.get('__possibleValues__');
var name = property.get('name');
var title = property.get('title');
/* eslint complexity: [2, 24] */
var inputOptions = {
type: 'text',
name: name,
label: title || na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get displayOptions() {\n return ['BINDCOMPONENTS', 'BINDNAMES', 'DRAGGABLE', 'KEYBOARD_CAPTURE', 'GLOBALPOS'];\n }",
"function renderFieldType (type, label, input, options){\n if(type === \"select\"){\n return(\n <select {...input} className=\"form-control\">\n {options}\n </select>\n )... | [
"0.5901358",
"0.5686524",
"0.56779814",
"0.5499962",
"0.5409071",
"0.53808343",
"0.5301481",
"0.52683645",
"0.52313113",
"0.523068",
"0.5227359",
"0.5193286",
"0.51752883",
"0.5174304",
"0.51698375",
"0.5122482",
"0.51199645",
"0.5117148",
"0.5117025",
"0.5107917",
"0.5085298... | 0.5947809 | 0 |
Connect the proxy bus object to interface with the bus object of the service | function proxyRemoteConnect() {
client.proxyBusObject = new ClientBusObject(client.busAtt, OBJECT_PATH);
client.proxyBusObject.proxyBusObject.introspectRemoteObjectAsync(null).then(function (introResult) {
if (AllJoyn.QStatus.er_OK == introResult.status) {
OutputLine("Introsp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ClientBusObject(busAtt, busObjectPath) {\n\n this.proxyBusObject = new AllJoyn.ProxyBusObject(busAtt, WELL_KNOWN_NAME, OBJECT_PATH, sessionId);\n\n /* Calls the 'cat' method of the service with two string arguments */\n this.callPingMethod = function callPingMethod() {\n var callerMessage ... | [
"0.62103325",
"0.60327363",
"0.5933316",
"0.58464503",
"0.5802072",
"0.56174344",
"0.56077105",
"0.55413836",
"0.551994",
"0.55150765",
"0.54450756",
"0.5443182",
"0.54404426",
"0.5418845",
"0.5407566",
"0.54031193",
"0.54031044",
"0.5376616",
"0.53597844",
"0.5342531",
"0.53... | 0.77206224 | 0 |
This is the object which acts as a proxy for the service's bus object and handles calls to the 'Ping' method | function ClientBusObject(busAtt, busObjectPath) {
this.proxyBusObject = new AllJoyn.ProxyBusObject(busAtt, WELL_KNOWN_NAME, OBJECT_PATH, sessionId);
/* Calls the 'cat' method of the service with two string arguments */
this.callPingMethod = function callPingMethod() {
var callerMessage = "Hello fr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onping() {\n super.emit(\"ping\");\n }",
"onping() {\n super.emit(\"ping\");\n }",
"Ping() {\n\t\tServer.SendMessage(\"/ping\");\n\t}",
"onping() {\n super.emit(\"ping\");\n }",
"sendPing() {\n this.broadcast('wc:ping');\n }",
"function proxyRemoteConnect() {\n... | [
"0.64958197",
"0.64958197",
"0.64519227",
"0.6450991",
"0.6344432",
"0.6245344",
"0.6229335",
"0.62032676",
"0.61462694",
"0.61462694",
"0.6130739",
"0.6120881",
"0.609043",
"0.58474964",
"0.58328617",
"0.57785743",
"0.57522035",
"0.5721701",
"0.5615972",
"0.55884296",
"0.546... | 0.6768868 | 0 |
This bus listener will handle bus and session events | function ClientBusListener(busAtt) {
this.sessionListener = new AllJoyn.SessionListener(busAtt);
this.busListener = new AllJoyn.BusListener(busAtt);
this.authListener = new AllJoyn.AuthListener(busAtt);
// Authentication mechanism requests user credentials which is a 6 digit pin generated by the
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n /**\n * @type {Bus}\n */\n this._listener = new Bus();\n }",
"afterInitialisation() {\n // Forward initialization event to server\n this.eventBusMaster.on(MASTER_SLAVE_CHANNEL, 'initialized', data => this.eventBusMaster.emit(MASTER_SERVER_CHANNEL, 'init', data));\n ... | [
"0.6404555",
"0.62313133",
"0.6222547",
"0.6142328",
"0.6014165",
"0.60057324",
"0.5894946",
"0.5894685",
"0.58811",
"0.5871725",
"0.58325887",
"0.58247954",
"0.58059424",
"0.5747119",
"0.57258576",
"0.5707546",
"0.57001436",
"0.56998616",
"0.5674317",
"0.5658919",
"0.56518",... | 0.6436031 | 0 |
Decode the web safe base64url string to a hex number (assuming the encoded data was a big endian number). | function decodeWebBase64ToHex(str) {
const bytes = atob(str.replace(/-/g, '+').replace(/_/g, '/'));
let hex = '';
for (let i = 0; i < bytes.length; ++i) {
hex += padLeft(bytes.charCodeAt(i).toString(16), 2, '0');
}
return hex;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n ... | [
"0.6526457",
"0.65104645",
"0.6445873",
"0.6397642",
"0.63908964",
"0.63784796",
"0.635174",
"0.6339257",
"0.63389486",
"0.6338311",
"0.633481",
"0.6276206",
"0.62596005",
"0.6177078",
"0.6177078",
"0.6164313",
"0.6103003",
"0.6057698",
"0.60452193",
"0.6014455",
"0.6009584",... | 0.676849 | 0 |
Adds an additional autoscaling group to this Deployment Group. | addAutoScalingGroup(asg) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_autoscaling_AutoScalingGroup(asg);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.addAutoScalingGroup... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addToGroup(group) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_iam_IGroup(group);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addToGroup);\n }... | [
"0.5990197",
"0.5475694",
"0.5474237",
"0.51450664",
"0.5112676",
"0.5041998",
"0.5035669",
"0.50339717",
"0.48259553",
"0.48244298",
"0.4822276",
"0.47997066",
"0.47797504",
"0.47751904",
"0.4735754",
"0.47304007",
"0.47281712",
"0.46793094",
"0.46701515",
"0.46484354",
"0.4... | 0.78873616 | 0 |
Associates an additional alarm with this Deployment Group. | addAlarm(alarm) {
try {
jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_IAlarm(alarm);
}
catch (error) {
if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
Error.captureStackTrace(error, this.addAlarm);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addalarm(alarmTime) {\n this.currentId++;\n this.alarms.push({id: this.currentId , alarmTime});\n }",
"function createAlarm (alarmName, description, alarmType, alarmPath) {\n return gsm.addAlarm(prefixURI+\"/\"+alarmName, //alarmURI\n description, ... | [
"0.6233843",
"0.5649663",
"0.55633545",
"0.5416366",
"0.5286423",
"0.52456546",
"0.52369434",
"0.52010065",
"0.517763",
"0.513664",
"0.5128458",
"0.50488764",
"0.49723995",
"0.49570012",
"0.4934229",
"0.4926313",
"0.4906128",
"0.48990312",
"0.48950595",
"0.4844485",
"0.483111... | 0.6562033 | 0 |
Creates Session based on Config Values | static createSession () {
var sessionType = null;
var storageDetails = {};
let storageUri = applicationFacade.config.env.SESSION_STORAGE;
if (applicationFacade.config.items.session != null && applicationFacade.config.items.session.storage != null) {
storageUri = applicationF... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSession() {}",
"function createSession(sessionConfig){\n let redisClient = getRedisClient();\n let sessionStore = session({\n secret: sessionConfig.sessionSecret,\n store: new redisStore({ host: sessionConfig.redisConfig.host, \n ... | [
"0.74779284",
"0.687094",
"0.6643381",
"0.6358627",
"0.627735",
"0.6083575",
"0.60190326",
"0.5994178",
"0.5922008",
"0.5896689",
"0.58320946",
"0.58296555",
"0.5793197",
"0.5777264",
"0.5776222",
"0.57613987",
"0.57507074",
"0.57490826",
"0.57490826",
"0.5742333",
"0.5699255... | 0.7120322 | 1 |
Creates a "lamdenWalletGetInfo" CustomEvent to ask the Lamden Wallet for the current information. This will fire the "newInfo" events.on event | getInfo(){
document.dispatchEvent(new CustomEvent('lamdenWalletGetInfo'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInfo(event) {\n getData();\n addCountdown();\n}",
"function EventInfo() { }",
"function EventInfo() { }",
"function changeLInfo(event) {\n // \n event.preventDefault();\n \n // If the addLeistung panel is visible, hide it and show updateLeistung panel\n if($('#addLPanel').is(\":visible... | [
"0.5208761",
"0.49719152",
"0.49719152",
"0.47553676",
"0.47409198",
"0.47128665",
"0.47047225",
"0.46887946",
"0.46592474",
"0.46197253",
"0.45920423",
"0.45636335",
"0.4541398",
"0.45261645",
"0.45245582",
"0.4523909",
"0.4507336",
"0.44873318",
"0.44729587",
"0.44650343",
... | 0.68924767 | 0 |
require Init the Edit Pane by getting all data source types | function initDataSourceEdit(){
DataSourceDwr.initDataSourceTypes(function(response){
if (response.data.types) {
dwr.util.addOptions("dataSourceTypes", response.data.types, "key", "value");
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jTAC_DataTypeEditorOptions() {\r\n}",
"setupDataSourceSelector() {\n $('.data-source').on('change', e => {\n this.resetView();\n\n if (e.target.value === 'category') {\n this.setupCategoryInterface();\n } else {\n this.setupFileInterface();\n }\n });\n }",
"fun... | [
"0.6343233",
"0.62347233",
"0.5993166",
"0.5985382",
"0.58991873",
"0.5869427",
"0.5618394",
"0.5588989",
"0.5576319",
"0.55700254",
"0.5556973",
"0.55333805",
"0.5517997",
"0.5517675",
"0.5509595",
"0.5478262",
"0.54198474",
"0.53891397",
"0.537484",
"0.53663534",
"0.5357032... | 0.8007685 | 0 |
Drop brackets from string | function dropBrackets (value) {
return value.replace(/[(,)]/g, '');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static bracketRemover(inp) {\n return inp\n .replace(/{+.*?}+/g, '')\n .replace(/\\[\\[|\\]\\]/g, '')\n .replace(/<.*?>/g, '')\n .replace(/\\(.*?\\)/g, '')\n .trim();\n }",
"function removeBad (pString) {\n return pString.replace(/ *\\([^)]*\\) ... | [
"0.7113253",
"0.69464415",
"0.68920606",
"0.68216187",
"0.678056",
"0.6602962",
"0.6505043",
"0.64432204",
"0.64430743",
"0.64354444",
"0.64234763",
"0.640546",
"0.6379696",
"0.6375653",
"0.6216264",
"0.6194109",
"0.61833805",
"0.6142815",
"0.61300576",
"0.60493433",
"0.60493... | 0.7488102 | 0 |
Sort entities by fields | function sortEntities (entities) {
return entities.sort((a, b) => {
const key = Object.keys(a).find(key => a[key] !== b[key]);
if (key === undefined) {
return 0;
}
if (a[key] < b[key]) {
return -1;
}
if (a[key] > b[key]) {
return 1;
}
return 0;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"genSortAscendingByField(field) {\n return (a, b) => {\n const valA = a[field].toUpperCase()\n const valB = b[field].toUpperCase()\n let order = 0\n if (valA < valB) order = -1\n if (valA > valB) order = 1\n return order\n }\n }",
"static DEFAULT_SORT_BY_FIELD(){ return \"desc... | [
"0.63975257",
"0.63541305",
"0.61546373",
"0.61453474",
"0.602047",
"0.5960209",
"0.59013784",
"0.5893208",
"0.5867317",
"0.5855318",
"0.5812178",
"0.5810241",
"0.58046716",
"0.58019596",
"0.5798649",
"0.57793736",
"0.5771688",
"0.5770748",
"0.57094157",
"0.56964207",
"0.5689... | 0.6848396 | 0 |
Max to Back Not complete, does not work if Max is the head | maxToBack(){
var runner = this.head;
var max = this.head
var prevnode = this.head
var maxprev = null
while (runner != null) {
if (runner.val > max.val) {
max = runner;
maxprev = prevnode
}
prevnode = runner
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"maxToBack(){\n // your code here\n var runner = this.head\n var max = runner\n while (runner.next != null){\n if (runner.next.value > max.value){\n max = runner.next\n }\n runner = runner.next\n }\n var temp = runner.value\n ... | [
"0.8159032",
"0.74162334",
"0.722825",
"0.7148182",
"0.71408707",
"0.70042986",
"0.6970885",
"0.6946643",
"0.6904137",
"0.6901797",
"0.6892438",
"0.68236613",
"0.6813807",
"0.6715719",
"0.66059196",
"0.66059196",
"0.66059196",
"0.66059196",
"0.66059196",
"0.66059196",
"0.6539... | 0.83104074 | 0 |
Remove Negatives Find and remove any negative value nodes in the list | removeNegatives(){
var runner = this.head
while (runner.next != null){
if (this.head.val <0){
this.head = runner.next
}
else if (runner.next.val < 0){
runner.next = runner.next.next
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeNegatives() {\n if (this.isEmpty()) {\n return this;\n }\n let runner = this.head;\n\n // if there is only 1 node AND that node is neg\n if (this.head.next === null && this.head.data < 0) {\n this.head = null;\n }\n\n while (runner.next !... | [
"0.7303803",
"0.71880317",
"0.6755459",
"0.6573476",
"0.6193452",
"0.61527365",
"0.6151631",
"0.6131259",
"0.60645",
"0.6031302",
"0.60123163",
"0.59284663",
"0.58787316",
"0.58407027",
"0.58250916",
"0.5824622",
"0.5816106",
"0.5784661",
"0.57525796",
"0.5724352",
"0.5686018... | 0.781167 | 0 |
BONUS CHALLENGE: Partition Given a value, find that value in the list Once found, take every value in the list that's LOWER than that value and move those nodes EARLIER (so, on the LEFT side of the found node) Take all the values that are greater and move those nodes later (aka to the RIGHT of the found node) Try makin... | partition(check_value){
var pivot = this.contains(check_value)
var runner = this.head
var lower = new SLL()
var higher = new SLL()
while (runner!= null){
if (runner.val > check_value){
higher.addToFront(runner.val)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function partition(list, value) {\n // Strategy: loop through list creating seperate head and tail lists, relative to value. Then join all together and return it.\n\n let current = list.head,\n found = false,\n smaller = new SinglyList(), // we'll add smaller valued nodes here\n larger = new SinglyList(), // we... | [
"0.7586921",
"0.7100812",
"0.6758712",
"0.66659266",
"0.63684875",
"0.62598544",
"0.6242823",
"0.6151365",
"0.61267793",
"0.60597324",
"0.6037312",
"0.60331905",
"0.594386",
"0.5934349",
"0.5924616",
"0.5910547",
"0.5906434",
"0.5893789",
"0.58656096",
"0.58417696",
"0.582473... | 0.77128637 | 0 |
Rules You must check if some ticket numbers are valid. To be valid, a ticket number must : Contain exactly 6 characters Contain : one letter then one digit then 4 letters 'letter' means a single character, unaccented, uppercase or lowercase, between a and z. Input arguments tickets : an array of string, representing ti... | function nbrValidTickets(tickets) {
return tickets.filter(v => /^[a-z]\d[a-z]{4}$/i.test(v)).length
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isLucky(ticket) {\n if (ticket.length !== 6) {\n return false;\n }\n if ((Number(ticket[0]) + Number(ticket[1]) + Number(ticket[2])) === (Number(ticket[3]) + Number(ticket[4]) + Number(ticket[5]))) {\n return true;\n } else {\n return false;\n }\n}",
"function customL... | [
"0.6661725",
"0.60497874",
"0.59985363",
"0.5723587",
"0.56662",
"0.5545023",
"0.5433387",
"0.5431748",
"0.54253626",
"0.54070055",
"0.53849703",
"0.538402",
"0.53790957",
"0.5372517",
"0.53619486",
"0.53552604",
"0.5353478",
"0.53400147",
"0.53372777",
"0.5327223",
"0.532230... | 0.8020998 | 0 |
Modal to display what's in the shopping cart | function viewCart() {
$(".modal-body").empty();
shoppingCart.forEach(product => {
$(".modal-body").append(
`<div data-name="${product.product_name}">${product.product_name}</div>
<div data-quantity="${product.stock_quantity}">${product.stock_quantity}</div>`
);
});
const tot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCart(cart) {\n var cart_info = \"\";\n for (var key in cart) {\n if (cart.hasOwnProperty(key)) {\n cart_info += key + \" : \" + cart[key] + \"\\n\";\n }\n }\n var modal = document.getElementById(\"modal\");\n modal.style.display = \"block\";\n var modalConten... | [
"0.8163632",
"0.7287613",
"0.7198009",
"0.7144516",
"0.71368235",
"0.70365876",
"0.7030825",
"0.70127916",
"0.6984575",
"0.6984188",
"0.69159615",
"0.6884088",
"0.6884015",
"0.6846386",
"0.67782044",
"0.6758721",
"0.67457736",
"0.67271656",
"0.66952556",
"0.6667707",
"0.66525... | 0.7870261 | 1 |
This is a simple refCount callback. | function refCountCallback() {
if (disposed) {
return;
}
--count;
// If the count becomes 0, then its time to notify the
// listener that the request is done.
if (count === 0) {
cb();
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ReferenceCounter() {\r\n}",
"incrementRefCount() {\n this.refCount_++;\n }",
"increment() {\n this.referenceCount++;\n }",
"function refCount() {\n\t return function refCountOperatorFunction(source) {\n\t return source.lift(new RefCountOperator(source));\n\t };\n\t}",
"f... | [
"0.7876186",
"0.7864978",
"0.6975204",
"0.6656476",
"0.65831614",
"0.6519178",
"0.6463557",
"0.6452445",
"0.6452445",
"0.6402728",
"0.62796944",
"0.6275555",
"0.6227449",
"0.6188664",
"0.6121736",
"0.60832334",
"0.6024416",
"0.59008807",
"0.5883251",
"0.5878972",
"0.586778",
... | 0.8495896 | 0 |
A ModelResponse is a container for the results of a get, set, or call operation performed on a Model. The ModelResponse provides methods which can be used to specify the output format of the data retrieved from a Model, as well as how that data is delivered. | function ModelResponse(subscribe) {
this._subscribe = subscribe;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ModelResponse(subscribe) {\n this._subscribe = subscribe;\n}",
"_createResponseModel() {\n\n }",
"function Response(options) {\n options = options || {};\n\n Message.call(this, options.content, options.headers);\n\n this.status = options.status || 200;\n}",
"function WrappedResponse(msg, hdr,... | [
"0.701792",
"0.597982",
"0.57203937",
"0.53813976",
"0.52600473",
"0.52331585",
"0.5230256",
"0.52221185",
"0.52170056",
"0.52170056",
"0.51850957",
"0.51454854",
"0.50875413",
"0.50064445",
"0.50064445",
"0.50064445",
"0.49911734",
"0.49705315",
"0.4919818",
"0.4908254",
"0.... | 0.6942174 | 1 |
When a bound model attempts to retrieve JSONGraph it should throw an error. | function BoundJSONGraphModelError() {
this.message = BoundJSONGraphModelError.message;
this.stack = (new Error()).stack;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_validateRead () {\n if (this.parent.isNew()) {\n throw CE.ModelRelationException.unSavedTarget('fetch', this.parent.constructor.name, this.related.name)\n }\n\n if (!this.parent[this.fromKey]) {\n logger.warn(`Trying to fetch relationship with ${this.fromKey} as primaryKey, whose value is falsy... | [
"0.5543697",
"0.5524843",
"0.54300195",
"0.5382745",
"0.5224364",
"0.52023005",
"0.51433134",
"0.5116015",
"0.5104399",
"0.50979507",
"0.5011293",
"0.4961452",
"0.49611056",
"0.49552244",
"0.4932982",
"0.49242076",
"0.4855239",
"0.48500797",
"0.4843635",
"0.48429483",
"0.4835... | 0.7317584 | 0 |
Initialize function which will be called on page load. It will reach out to the storage for a layout object and initialize from that state or read the DOM and save current state | function init() {
var layout = getFromStorage();
if (!layout) {
layout = readDOMLayout();
saveToStorage();
return;
}
// Cycle through the layout making DOM reordering as necissary
var i, col, DOMLayout;
DOMLayout = readDOMLayout().slic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n initializeVariables();\n initializeHtmlElements();\n}",
"function init() {\n // Assing variables to all elements used\n getElements(); \n\n // Then, give them the necessary event listeners \n addEventListeners();\n\n // Checking for cached data (in localStorage)\n // Try-catch necessa... | [
"0.68038994",
"0.6803874",
"0.66342777",
"0.6633294",
"0.65006095",
"0.6486685",
"0.64526904",
"0.64405596",
"0.6437257",
"0.6417544",
"0.64174503",
"0.6361761",
"0.63320214",
"0.63320214",
"0.63320214",
"0.63320214",
"0.63320214",
"0.6304636",
"0.6299124",
"0.6273542",
"0.62... | 0.7582069 | 0 |
The javascript and html provided by the Facebook widget to initialize it. Included here instead of manually within the page markup so that we can conditionally initialize it based on the user's scroll position. | function facebookWidgetInit() {
var widgetMarkup = '<div class="fb-page" data-href="https://www.facebook.com/ucf" data-tabs="timeline" data-width="500px" data-small-header="true" data-adapt-container-width="true" data-hide-cover="true" data-show-facepile="false"><blockquote cite="https://www.facebook.com/ucf" class="... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initFacebook(){ //normally called when document is ready (ie. when page loads)\n var js, id = 'facebook-jssdk'; if (document.getElementById(id)) {return;}\n js = document.createElement('script'); js.id = id; js.async = true;\n js.src = \"//connect.facebook.net/en_US/all.js\"; //calls fbAsyncIni... | [
"0.6705466",
"0.61117536",
"0.60446113",
"0.6003367",
"0.60008746",
"0.5988614",
"0.5930138",
"0.59155196",
"0.5837031",
"0.58333725",
"0.58286476",
"0.58227736",
"0.579525",
"0.57952285",
"0.57818425",
"0.57792",
"0.5769957",
"0.5764865",
"0.5762873",
"0.5746015",
"0.5744781... | 0.75796735 | 0 |
Calcul prix total d'un produit | function prixProduitTotal(prix, nombre) {
let ppt = prix * nombre;
return ppt;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculerPrixTotal(nounours) {\n prixPanier = prixPanier += nounours.price;\n}",
"function prixTotal() {\n let total = 0;\n for (let j= 0; j < objPanier.length; j++) {\n total = total + objPanier[j].price * objPanier[j].number;\n }\n let afficheTotal = document.querySelector(\"#total\... | [
"0.8081882",
"0.77115136",
"0.73439324",
"0.734035",
"0.7339253",
"0.71492076",
"0.7127628",
"0.69565403",
"0.69245034",
"0.6910076",
"0.68984395",
"0.6885713",
"0.6864437",
"0.6828203",
"0.6824665",
"0.6820373",
"0.6763049",
"0.6754114",
"0.67538536",
"0.6718147",
"0.6712514... | 0.8079998 | 1 |
Update stored profile. payload needs to have `key` and `value`. | updateProfile(state, payload) {
state[payload.key] = payload.value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateProfile() {}",
"updateProfile(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .patch(`admin/profile/${payload.id}?token=${payload.token}`, payload)\n .then(response => {\n resolve(response);\n })\n .catch(error => {\n reject(error)... | [
"0.71243256",
"0.7040113",
"0.6812389",
"0.67990553",
"0.6790088",
"0.6770516",
"0.67321354",
"0.67143977",
"0.6698398",
"0.6659143",
"0.6612572",
"0.6591931",
"0.6502178",
"0.6498995",
"0.6480957",
"0.6463494",
"0.6432984",
"0.63919055",
"0.63616854",
"0.6358395",
"0.6358332... | 0.8155195 | 0 |
A SchemCanvas is a wrapper around a DOM canvas that handles the adding, removing, joining, and drawing of Components. | function SchemCanvas(elem) {
this.elem = elem;
this.ctx = elem.getContext('2d');
this.selected = null;
this.components = [];
this.eventHandlers = {};
var rect = elem.getBoundingClientRect();
// Prevent right-click menu from showing on canvas.
elem.addEventListener('contextmenu', functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render(){\n //createDom (tag, type, name, value, domClass, id, parent)\n this.containerDom = this.htmlHelper.createDom('div', this.parentDom,this.domClass + '_conatiner')\n this.dom = this.htmlHelper.createDom('canvas', this.containerDom);\n this.dom.style.touchAction=\"none\"; // preve... | [
"0.6375647",
"0.63550586",
"0.6306035",
"0.6241705",
"0.61998415",
"0.6151229",
"0.61054057",
"0.6077106",
"0.6057263",
"0.5998228",
"0.5998228",
"0.59495056",
"0.594627",
"0.59375095",
"0.5935663",
"0.5927173",
"0.59251",
"0.5913328",
"0.58935195",
"0.5887215",
"0.5884063",
... | 0.73447883 | 0 |
initializeDB() setups the connection to the backend and gets the token. parameters: deviceName: (string) | initializeDB(deviceName){
var chk = new Checker("initializeDB");
chk.isProperString(deviceName,"deviceName");
var query = '{"query":"mutation {createDevice(data: {name: \\"' + deviceName + '\\"}) {device {id name context {id} owners {id}} token}}"}';
var thisisme = this
if(deviceName in this.TokenList){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initDB() {\n\t /* to remove database, use window.indexedDB.deleteDatabase('_webauthn'); */\n\t\t\t\treturn new Promise(function(resolve,reject) {\n\t\t\t\t\tvar req = indexedDB.open(WEBAUTHN_DB_NAME,WEBAUTHN_DB_VERSION);\n\t\t\t\t\t// wird auf das Request Objekt das upgradeneeded Event gefeuert... | [
"0.66295797",
"0.66207355",
"0.6527941",
"0.6440982",
"0.63721627",
"0.6301552",
"0.62906367",
"0.6176112",
"0.61535966",
"0.612958",
"0.60963607",
"0.60922176",
"0.6048749",
"0.60321957",
"0.60280055",
"0.6025547",
"0.6016156",
"0.59973025",
"0.59643",
"0.59425014",
"0.59398... | 0.8058852 | 0 |
getContexts() gets the context for a device parameters: deviceName: (string) return: (string): dataReferenceName | getContexts(deviceName){
var chk = new Checker("getContexts");
chk.isProperString(deviceName,"deviceName");
var dataReferenceName = 'contexts';
//build query
var query = '{"query": "query {contexts(types: REGULATOR){id activeSurvey{id title description images{url}}}}"}'; //query build end
var thisisme = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getQuestions(context, deviceName){\n\t\tvar chk = new Checker(\"getQuestions\");\n\t\tchk.isValid(context,\"context\");\n\t\tchk.isProperString(deviceName,\"deviceName\");\n\t\n\t\tvar dataReferenceName = \"questions\";\n\t\tvar thisisme = this;\n\t\tvar query = '{\"query\": \"query {context(contextID: \\\\\"' + c... | [
"0.59896183",
"0.57965976",
"0.5715085",
"0.56199414",
"0.5617096",
"0.54309374",
"0.53837895",
"0.5381825",
"0.5365587",
"0.5359316",
"0.535901",
"0.53483105",
"0.53483105",
"0.53392905",
"0.5292972",
"0.52788335",
"0.52781045",
"0.527517",
"0.52587134",
"0.52587134",
"0.524... | 0.7672533 | 0 |
updateDeviceContext() updates the context for a device parameters: context: (string) deviceName: (string) | updateDeviceContext(context, deviceName){
var chk = new Checker("updateDeviceContext");
chk.isValid(context,"context");
chk.isProperString(deviceName,"deviceName");
var query = '{"query": "mutation {updateDevice(data: {context: \\"'+ context.contextId +'\\"}, deviceID: \\"' + this.TokenList[deviceName].id +
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateContext(context) {\n this.context = context\n }",
"function updateContext(values) {\n setContext({\n ...context,\n ...values\n })\n }",
"function updateContext() {\n\t// Switch the background image of the data – using an image to improve performance\n\tupd... | [
"0.5650498",
"0.55030817",
"0.53164613",
"0.5196652",
"0.5196652",
"0.51760507",
"0.48438677",
"0.47838464",
"0.4776992",
"0.47432664",
"0.47374997",
"0.47308064",
"0.4631861",
"0.46188194",
"0.4538199",
"0.44804487",
"0.44612166",
"0.4449277",
"0.44080824",
"0.44059765",
"0.... | 0.7805962 | 0 |
getPrototypeImages() gets the images parameters: context: (string) deviceName: (string) | getPrototypeImages(context, deviceName){
var chk = new Checker("getPrototypeImages");
chk.isValid(context,"context");
chk.isProperString(deviceName,"deviceName");
var dataReferenceName = "prototypeImages";
var query = '{"query": "query {context(contextID: \\"' + context.contextId +
'\\"){id activeSur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getImages(arg){\n if(!arg){\n return this.images;\n }\n else{\n if(this.images.sized[arg]) return this.images.sized[arg];\n // else this.dev('image not in app');\n }\n }",
"function getDemoList () {\n\treturn defaultImages;\n}",
"pollImages() {\r\n\t\tthis.request.ge... | [
"0.6216743",
"0.608075",
"0.58930045",
"0.5853999",
"0.58366746",
"0.5825917",
"0.57929176",
"0.57247454",
"0.5634929",
"0.5632214",
"0.5586085",
"0.5554038",
"0.55263126",
"0.55205876",
"0.55108136",
"0.5465993",
"0.54341674",
"0.5414568",
"0.54103476",
"0.54070926",
"0.5402... | 0.8290777 | 0 |
getQuestions() gets the questions from the backend parameters: context: (string) deviceName: (string) | getQuestions(context, deviceName){
var chk = new Checker("getQuestions");
chk.isValid(context,"context");
chk.isProperString(deviceName,"deviceName");
var dataReferenceName = "questions";
var thisisme = this;
var query = '{"query": "query {context(contextID: \\"' + context.contextId + '\\"){' +
'act... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getQuestions() {\n $http\n .get(CONFIG.API_BSE_URL + 'resources/ '+ $stateParams.id + '/questions')\n .success(function(response) {\n $scope.questions = response.data.questions;\n });\n }",
"function getQuestions() {\n return fetch(`${DOMAIN}/ap... | [
"0.69611424",
"0.6749931",
"0.6513662",
"0.64140576",
"0.6358507",
"0.6190038",
"0.614804",
"0.6136285",
"0.61257464",
"0.6108363",
"0.6093223",
"0.6082712",
"0.60307276",
"0.60307115",
"0.6030303",
"0.60092926",
"0.5968457",
"0.5945931",
"0.5918584",
"0.59171355",
"0.5912373... | 0.83499587 | 0 |
sendEvalData() sends the evaluated data to the backend parameters: questionID: (string) answer: (string) deviceName: (string) | sendEvalData(questionID, answer, deviceName){
var chk = new Checker("sendEvalData");
chk.isValid(questionID,"questionID");
chk.isValid(answer,"answer");
chk.isProperString(deviceName,"deviceName");
var query = '{"query": "mutation {createAnswer(data:{questionID: \\"' + questionID + '\\" rating:' + answer +... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function send() {\n\t\tconst req = JSON.stringify({\n\t\t\taction: \"Run\",\n\t\t\tcode: codeInput.value.trim(),\n\t\t\tsession: sessionInput.value.trim(),\n\t\t})\n\t\tlet result = session.request(req);\n\t\tgetResultString(result).then(function (str) {\n\t\t\tresultLbl.value = str;\n\t\t});\n\t}",
"function qc... | [
"0.58144265",
"0.56670904",
"0.5661771",
"0.5498475",
"0.5486998",
"0.5416874",
"0.5408125",
"0.5393835",
"0.53908074",
"0.5377767",
"0.5370307",
"0.5290999",
"0.52620995",
"0.51852465",
"0.5170516",
"0.51599115",
"0.5153713",
"0.51100457",
"0.50825274",
"0.5073599",
"0.50566... | 0.8080981 | 0 |
waitForToken() continues when there is a token for a device parameters: deviceName: (string) callback: (token) | waitForToken(deviceName, callback){
var chk = new Checker("waitForToken");
chk.isProperString(deviceName,"deviceName");
var thisisme = this;
var waitforT = setInterval(function(){
var tNew = thisisme.TokenList[deviceName].token;
if(tNew != undefined){
clearInterval(waitforT);
callback(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deviceTokenSuccess(e) {\n\n\t\tTi.App.Properties.setString('app:deviceToken', e.deviceToken);\n\t\tdeviceToken = e.deviceToken;\n\n\t\tpostRegisterDeviceToken(deviceToken);\n\t\tTi.API.info('******** deviceToken *********** ' + deviceToken);\n\n\t}",
"function deviceTokenSuccess(e){\n var servidor;\... | [
"0.6320559",
"0.62564456",
"0.6070867",
"0.5997258",
"0.5924857",
"0.59155506",
"0.59003663",
"0.5844161",
"0.57851064",
"0.5780478",
"0.57260096",
"0.5713694",
"0.5641177",
"0.56160146",
"0.5539513",
"0.5474462",
"0.5472095",
"0.5469811",
"0.5405159",
"0.53954977",
"0.539213... | 0.80106837 | 0 |
waitForData() continues when there data from the backend parameters: dataReference: (string) reference on the data this function is waiting for deviceName: (string) callback: | waitForData(dataReference, deviceName, callback){
var chk = new Checker("waitForData");
chk.isProperString(dataReference,"dataReference");
chk.isProperString(deviceName,"deviceName");
var thisisme = this;
var waitforD = setInterval(function(){
var responseNew = thisisme.ContextData[dataReference];
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function waitForData(){\n if(data.fetching){\n setTimeout(waitForData, 10);\n } else {\n callback(data);\n }\n }",
"callDatabase(dataReference, Token, query, callback){\n\t\tvar chk = new Checker(\"waitForData\");\n\t\tchk.isValid(Token,\"Token\");\n\t\tchk.isProperStr... | [
"0.6842624",
"0.64264536",
"0.61651284",
"0.5819588",
"0.57973146",
"0.5625722",
"0.561869",
"0.5555807",
"0.54436135",
"0.54411274",
"0.5438887",
"0.54164",
"0.5398393",
"0.5388472",
"0.53707844",
"0.53235245",
"0.5317254",
"0.52843094",
"0.52793956",
"0.5273352",
"0.5255653... | 0.8095301 | 0 |
waitForContexts() continues when there are contexts parameters: callback: (token) Token from backend | waitForContexts(callback){
var thisisme = this;
var waitforC = setInterval(function(){
var contextList = thisisme.getGlobalContextList();
if(contextList[1] != undefined){
clearInterval(waitforC);
callback(contextList);
}else{
console.log("leider kein Context");
}
},500); //delay is in mill... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getContexts(deviceName){\n\t\tvar chk = new Checker(\"getContexts\");\n\t\tchk.isProperString(deviceName,\"deviceName\");\n\t\t\n\t\tvar dataReferenceName = 'contexts';\n\t\t//build query\n\t\tvar query = '{\"query\": \"query {contexts(types: REGULATOR){id activeSurvey{id title description images{url}}}}\"}'; //qu... | [
"0.5698378",
"0.5423209",
"0.5387441",
"0.5319434",
"0.52926624",
"0.5289088",
"0.5229342",
"0.5226955",
"0.52236974",
"0.5178663",
"0.51602024",
"0.51585037",
"0.5152152",
"0.5072746",
"0.5053641",
"0.5019342",
"0.50173825",
"0.50140077",
"0.5011502",
"0.4982765",
"0.4908034... | 0.7279433 | 0 |
callDatabase() continues when there are contexts parameters: dataReference: (string) reference on the data this function is waiting for Token: (string) query: (string) callback: | callDatabase(dataReference, Token, query, callback){
var chk = new Checker("waitForData");
chk.isValid(Token,"Token");
chk.isProperString(dataReference,"dataReference");
chk.isProperString(query,"deviceName");
this.ContextData[dataReference] = {};
this.ContextData[dataReference].data = null;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start_db () {\r\n dataref = firebase.database()\r\n read()\r\n}",
"function callback(data) {\n\t\t\tconsole.log('DB Req callback');\n\t\t\tconsole.log(data);\n\t\t}",
"function retrieveData(){\ntrainsDatabase.on(\"value\", getData, error); \n}",
"getData(context, callback) {\n this.initiali... | [
"0.62291795",
"0.6214634",
"0.6181022",
"0.59450847",
"0.5913624",
"0.5887561",
"0.5877865",
"0.5856239",
"0.5792982",
"0.57748216",
"0.5769712",
"0.5749813",
"0.5743507",
"0.5720883",
"0.56989604",
"0.56904006",
"0.5642764",
"0.56232935",
"0.5564451",
"0.5563201",
"0.5537623... | 0.7617169 | 0 |
Function to cluster information when there are too many children inside a single node. | function cluster(children){
var MAX_CHILDREN = 14;
var result = [];
children.sort(function(a, b){
if (a.name < b.name)
return -1;
if (a.name > b.name)
return 1;
return 0;
});
if (children.length > MAX_CHILDREN){
var parents = Math.ceil(children.length/MAX_CHILDREN); // get how many parent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cluster(points) {\n this.initializeCache(points);\n // console.log(this.distanceCache);\n let dendrogram = (new AgglomerativeHierarchy(\n (x, y) => this.distance(x, y)))\n .dendrogram(points);\n\n return dendrogram.levelSetMaximizing(levelSet =>\n this.silhouetteScore.averageSilhouetteSc... | [
"0.6465826",
"0.60166943",
"0.5868121",
"0.58028424",
"0.57240474",
"0.57240474",
"0.57024795",
"0.5620207",
"0.558997",
"0.5551988",
"0.5551988",
"0.5551988",
"0.5551988",
"0.5551988",
"0.55463135",
"0.55043554",
"0.5494641",
"0.543628",
"0.54298943",
"0.5416765",
"0.5406325... | 0.7223663 | 0 |
======================================================================= Knight Movement Calculations ======================================================================= | function calculateKnightMovement(draw, spaceObjectArray, spacePathArray, index, checkCheck) {
var checkObject = new Object();
checkObject.numMoves=0;
checkObject.numCaps=0;
checkObject.moveIndexes=new Array(8);
checkObject.capIndexes=new Array(8);
for(var i=0;i<8;i++) {
checkObject.moveIndexes[i]=-1;
checkObj... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function captureAsKnight(kingPos, color, board){\n let [x0, y0] = kingPos;\n let dx1 = 1;\n let dy1 = 1;\n let dx2 = 2;\n let dy2 = 2;\n\n let m1 = board[getIndex([x0+dx1, y0+dy2])];\n let m2 = board[getIndex([x0-dx1, y0+dy2])];\n let m3 = board[getIndex([x0+dx1, y0-dy2])];\n let m4 = bo... | [
"0.63704973",
"0.63492036",
"0.6113358",
"0.60876215",
"0.6085767",
"0.60801506",
"0.59783477",
"0.59577245",
"0.5911005",
"0.58939195",
"0.58927923",
"0.587528",
"0.58541363",
"0.5850997",
"0.58355093",
"0.58259666",
"0.580531",
"0.5804382",
"0.57994163",
"0.57879955",
"0.57... | 0.6761737 | 0 |
======================================================================= Bishop Movement Calculations ======================================================================= | function calculateBishopMovement(draw, spaceObjectArray, spacePathArray, index, checkCheck) {
var checkObject = new Object();
checkObject.numMoves=0;
checkObject.numCaps=0;
checkObject.moveIndexes=new Array(64);
checkObject.capIndexes=new Array(64);
for(var i=0;i<64;i++) {
checkObject.moveIndexes[i]=-1;
check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function aiPaddleMoveCalculation()\n{\n\n var a = 0;\n var aiTop = 0;\n\n if(ball.directionY < 0)\n {\n a = ball.top + 10;\n }\n else\n {\n a = 600 - (ball.top + 10);\n }\n\n // calculate bounces\n var b = (60 + a + 600);\n var c = 1040 - b;\n\n if(b > 1040) // one... | [
"0.6632879",
"0.6234398",
"0.6114467",
"0.61009",
"0.6070488",
"0.6034559",
"0.6021394",
"0.5981224",
"0.59672",
"0.59613675",
"0.59483886",
"0.5882281",
"0.58769387",
"0.5876745",
"0.58589715",
"0.5830659",
"0.582965",
"0.582465",
"0.58185947",
"0.5817013",
"0.58042073",
"... | 0.6268241 | 1 |
======================================================================= Queen Movement Calculations ======================================================================= | function calculateQueenMovement(draw, spaceObjectArray, spacePathArray, index, checkCheck) {
var checkObject = new Object();
checkObject.numMoves=0;
checkObject.numCaps=0;
checkObject.moveIndexes=new Array(64);
checkObject.capIndexes=new Array(64);
for(var i=0;i<64;i++) {
checkObject.moveIndexes[i]=-1;
checkO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveForward (){\n let t;\n let t1;\n switch(queen.direction){\n case \"N\":\n t=queen.postion.i-1;\n if(t>8 || t<0){\n console.log(\"Not Possible to move\");\n }\n else{\n queen.postion.i=t;\n }\n ... | [
"0.6950307",
"0.6651641",
"0.632116",
"0.61839604",
"0.6135276",
"0.6077821",
"0.6053562",
"0.60532886",
"0.605321",
"0.6051198",
"0.6043024",
"0.59458137",
"0.58588254",
"0.58112174",
"0.57713073",
"0.5741669",
"0.57387614",
"0.57183874",
"0.5643029",
"0.5639714",
"0.5626412... | 0.68003577 | 1 |
======================================================================= King Movement Calculations ======================================================================= | function calculateKingMovement(draw, spaceObjectArray, spacePathArray, index, checkCheck) {
var checkObject = new Object();
checkObject.numMoves=0;
checkObject.numCaps=0;
checkObject.moveIndexes=new Array(8);
checkObject.capIndexes=new Array(8);
for(var i=0;i<8;i++) {
checkObject.moveIndexes[i]=-1;
checkObjec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateKnightMovement(draw, spaceObjectArray, spacePathArray, index, checkCheck) {\n\tvar checkObject = new Object();\n\tcheckObject.numMoves=0;\n\tcheckObject.numCaps=0;\n\tcheckObject.moveIndexes=new Array(8);\n\tcheckObject.capIndexes=new Array(8);\n\tfor(var i=0;i<8;i++) {\n\t\tcheckObject.moveIndex... | [
"0.64843434",
"0.6452954",
"0.613959",
"0.6105106",
"0.60452396",
"0.5997837",
"0.599255",
"0.59620976",
"0.590507",
"0.58909637",
"0.58851075",
"0.58785766",
"0.5877265",
"0.5854892",
"0.5852215",
"0.5834004",
"0.58229434",
"0.58161974",
"0.5784435",
"0.5780353",
"0.5773826"... | 0.70604384 | 0 |
Valida el formato del mensaje acorde al tipo de mensaje. | function validateTypeMessage(message) {
var schema = require('./schemas/' + message.type.toLowerCase() + '.json');
var valid = ajv.validate(schema, message);
if (valid) {
validator.validateMessage(message); // el mensaje es correcto en formato y se envia al validador.
} else {
generateE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkType(strng) {\n switch(opts.type) {\n case 'email':\n var filter=/^[a-zA-Z0-9._]+@.+\\..{2,3}$/;\n if (!(filter.test(strng))) {\n if (opts['messages']['email']) {\n errors.push (opts['mes... | [
"0.6011505",
"0.57659674",
"0.565472",
"0.5632832",
"0.56228375",
"0.55121094",
"0.5462525",
"0.5455812",
"0.5445426",
"0.54356337",
"0.54356337",
"0.5426304",
"0.53845733",
"0.53616095",
"0.53295374",
"0.5318915",
"0.5315011",
"0.5273855",
"0.52695274",
"0.5267016",
"0.52638... | 0.6483895 | 0 |
Genera un mensaje de error de formato invalido y lo envia a encolar en RabbitMQ con maxima prioridad. | function generateErrorMessage(error, message) {
var errorMessage = {
id: ++id,
priority : maxPriority,
type: 'ERROR',
messageId: message.id,
messageType: message.type,
imei: message.imei,
description: error,
timestamp: new Date()
};
logger.lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendErrorMessage(message) {\n\n var errorMessage = {\n id: ++id,\n priority : maxPriority,\n type: 'ERROR',\n messageId: message.id,\n messageType: message.type,\n messageSubType: message.subType || '',\n imei: message.imei,\n description: 'no se ... | [
"0.62445545",
"0.5637479",
"0.5633998",
"0.55370194",
"0.5491188",
"0.5484428",
"0.5484428",
"0.54609215",
"0.539779",
"0.5337417",
"0.5326882",
"0.5305434",
"0.5299642",
"0.5271895",
"0.5232006",
"0.52184725",
"0.52100146",
"0.5205025",
"0.51984936",
"0.51924855",
"0.5188054... | 0.6343288 | 0 |
Does a trap's attack roll. | _doTrapAttack(character, effect) {
return Promise.all([
TrapThemeHelper.getSheetAttr(character, 'ac'),
TrapThemeHelper.rollAsync('1d20 + ' + effect.attack)
])
.then(tuple => {
let ac = tuple[0];
let atkRoll = tuple[1];
ac = ac || 10;
effect.ac = ac;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Trap() {\n\ttrapDC = 10;\n\tswitch(gridArr[OPC.currentPos].trapState) {\n\t\tcase 1: // trap set and waiting\n\t\t\troll = Dice(20);\n\t\t\trollBonus = Math.floor(OPC.abilityScores[4]/2)-5; // add Wisdom modifier\n\t\t\tif(OPC.skills.includes(\"perception\")) { //check to see if perception is a skill\n\t\... | [
"0.6759368",
"0.6086466",
"0.60356325",
"0.60018677",
"0.5898451",
"0.5773341",
"0.57526875",
"0.5706767",
"0.5662135",
"0.5660547",
"0.56239235",
"0.5607954",
"0.55699277",
"0.5545832",
"0.5537326",
"0.5536685",
"0.5513822",
"0.55099434",
"0.5504196",
"0.54817224",
"0.547335... | 0.6702795 | 1 |
Does a trap's save. | _doTrapSave(character, effect) {
return TrapThemeHelper.getSheetAttr(character, SAVE_NAMES[effect.save])
.then(saveBonus => {
saveBonus = saveBonus || 0;
effect.saveBonus = saveBonus;
return TrapThemeHelper.rollAsync('1d20 + ' + saveBonus);
})
.then((saveRoll) => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"save() {}",
"doAutoSave() {\n }",
"function save(){\r\n\tutil.log(\"Data: Saving All...\");\r\n\t//Save Each\r\n\tutil.log(\"Data: Saving Done...\");\r\n}",
"function saveTrial() {\n trace(\"saveTrial: tr = \" + JSON.stringify(tr));\n sendEvent({\n eventType: \"savetrial\",\n data: JSO... | [
"0.64674896",
"0.6307209",
"0.62370795",
"0.623451",
"0.6206494",
"0.6168295",
"0.6046125",
"0.6037997",
"0.6014804",
"0.59867096",
"0.5951167",
"0.59334505",
"0.59309316",
"0.5908249",
"0.58846855",
"0.58465105",
"0.5844083",
"0.5840854",
"0.58364224",
"0.5802713",
"0.578854... | 0.6327035 | 1 |
Loads the '.json' file next to the page into 'pageContext.companion'. Note that this will cause some GraphQL schema warnings while building, but it seems safe to ignore. | function attachCompanion() {
const jsonPath = `${pathWithoutExt}.json`;
if (fs.existsSync(jsonPath)) {
/* eslint-disable global-require */
/* eslint-disable import/no-dynamic-require */
// eslint-disable-next-line no-param-reassign
page.context.companion = require(jsonPath);
/* es... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadPages() {\n this._pages = utility.getJSONFromFile(this._absoluteFile);\n }",
"pageToJson(page) {\n const json = {\n title: page.title,\n excerpt: page.excerpt,\n hidden: page.hidden,\n body: page.content,\n next: {\n pages: [],\n description: \"\",\n },\n ... | [
"0.6866639",
"0.59211546",
"0.58216155",
"0.5785489",
"0.54479283",
"0.5429386",
"0.54208624",
"0.5387295",
"0.5354469",
"0.5338359",
"0.5293962",
"0.5278979",
"0.5270637",
"0.5247182",
"0.52262545",
"0.52239835",
"0.5202697",
"0.5199435",
"0.5199435",
"0.5194587",
"0.5189664... | 0.72810316 | 0 |
Strips unnceessary data and tidies a score object | function clean(scores, baserank) {
var i, len, x, score,
results = [];
for(i=0, len=scores.length; i<len; i++) {
score = scores[i].toObject();
for(x in score) {
if(typeof(score[x]) == "string") {
score[x] = utils.unescape(score[x]);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dedupe(results) {\n const scores = {};\n for (const r of results) {\n scores[r.word] = Math.max(r.score, scores[r.word] || 0);\n }\n return Object.keys(scores).map(word => ({ word, score: scores[word] }));\n}",
"function analyze (allScores, info) {\n\tfor (const userId in allScores) {\n\t\tif (al... | [
"0.5884717",
"0.5847155",
"0.5788436",
"0.5719322",
"0.5653606",
"0.5619486",
"0.55777603",
"0.5527446",
"0.5521917",
"0.5519705",
"0.54935867",
"0.54789245",
"0.5394534",
"0.53910375",
"0.5337004",
"0.5303398",
"0.5278531",
"0.5278436",
"0.52758557",
"0.52727497",
"0.5252428... | 0.6323873 | 0 |
asynchronously puts a new score in an index | function addToIndex(index, highest, newscore, callback) {
var ai, i, len,
found = false;
function nextBlock() {
len = i + 1000;
if(len >= index.scores.length) {
len = index.scores.length;
}
if(i >= len) {
return callback(newscore)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshIndexes() {\n\n if (!indexlist.length) {\n return setTimeout(refreshIndexes, 1000);\n }\n \n var first = indexlist.shift();\n \n // dispose of indexes not used in the last 10 minutes\n if(first.lastused < datetime.now - 600) { \n index[first.hash] = null;\n ... | [
"0.6508965",
"0.6378923",
"0.6359079",
"0.6338593",
"0.62613565",
"0.6219578",
"0.6061579",
"0.59802103",
"0.59735096",
"0.5945894",
"0.5936927",
"0.59022313",
"0.5810844",
"0.5808961",
"0.57868236",
"0.57645655",
"0.5696685",
"0.569592",
"0.5670345",
"0.56568366",
"0.5647481... | 0.6832185 | 0 |
sync root user at start up | syncRootUser() {
this.usermanagement.syncRootUserCb((err, result) => {
err ? console.error('root user could not be synced to the service: ', this.vcap_name, 'errorMsg: ', err.message) : console.info('Root user synced to service: ', this.vcap_name);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initialize_shit(){\n\tif(!user_exists('default')){\n\t\tadd_user('default', '', patients_default);\n\t}\n}",
"init () {\n if (localStorage.users === undefined || !localStorage.encrypted) {\n // Set default user\n let defaultUser = 'DeekshithShetty'\n let defaultUserSalt = genSalt(defau... | [
"0.66632134",
"0.59211284",
"0.5903243",
"0.58900946",
"0.58900946",
"0.58900946",
"0.58900946",
"0.58900946",
"0.58900946",
"0.58683366",
"0.5821231",
"0.5800153",
"0.57736725",
"0.5740642",
"0.57149845",
"0.5709864",
"0.5694318",
"0.5642504",
"0.5609288",
"0.5593896",
"0.55... | 0.74647164 | 0 |
takes json and returns iss | getIss(payload) {
return payload.iss;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toCandidate(json) {\n return cast(JSON.parse(json), r(\"Candidate\"));\n}",
"static toStudent(jsonStudent) {\n let obj = JSON.parse(jsonStudent);\n return new Student(obj.firstName, obj.lastName, obj.age, obj.grades);\n }",
"static fromJSON(schema, json) {\n if (!json)\n th... | [
"0.54485697",
"0.5336659",
"0.53027916",
"0.52153695",
"0.5187646",
"0.5139392",
"0.51006067",
"0.50589484",
"0.505516",
"0.5019642",
"0.49981603",
"0.49823242",
"0.49153134",
"0.48992586",
"0.48849896",
"0.48814642",
"0.4879374",
"0.4848872",
"0.48404834",
"0.4814308",
"0.47... | 0.5700914 | 0 |
The blink Enter word on the start screen | function blinkText(){
if(!blink){
context.font ="30px menuFont";
context.fillStyle = "white";
context.fillText("Press Enter", canvas.width/2-70, canvas.height/2+60);
blink = true;
}
else if(blink){
context.fillStyle = "black";
context.fillRect(canvas.width/2-80, canvas.height/2+33, 200, 35... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pressSpaceBlink() {\n let count = 10;\n count--;\n if (count % 2 == 1) {\n ctx.font = \"25px Roboto Mono\";\n ctx.fillStyle = '#D7DF01';\n ctx.fillText(\"PRESS 'SPACE' TO START\", play.width / 2, play.height / 2);\n }... | [
"0.69504863",
"0.6363976",
"0.6348635",
"0.63200593",
"0.6266365",
"0.62539667",
"0.62440187",
"0.62299037",
"0.62220764",
"0.6206954",
"0.61058843",
"0.60707194",
"0.6041909",
"0.60070455",
"0.5981944",
"0.5962991",
"0.5942242",
"0.5931716",
"0.5922117",
"0.59111625",
"0.588... | 0.67216355 | 1 |
RadioDNS Resolution on topic | function rdnslookup(t){
//topic = t;
if(requestserver == ""){
var jqxhr = $.ajax({ url: "radiovis-webplayer/rdns-lookup.php", type: "GET", data: {'topic': topic} })
.success(function(data) {
if(data.indexOf(":") == -1)
$("#textframe").html("<div style='color:red'>RadioVIS ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DnssecQueryNode(config) {\n\n //Create a new node\n RED.nodes.createNode(this, config);\n var node = this;\n\n // When a input message is received by the node\n this.on(\"input\", function (msg) {\n\n // Create and empty dns response in the output message\n ... | [
"0.55777204",
"0.53986776",
"0.52443594",
"0.52418387",
"0.5194541",
"0.50538814",
"0.50495553",
"0.4938478",
"0.49030212",
"0.4900006",
"0.4887517",
"0.48711076",
"0.4863349",
"0.48597363",
"0.48477668",
"0.48387632",
"0.47642633",
"0.471723",
"0.47151712",
"0.4705082",
"0.4... | 0.71114206 | 0 |
Start visualisation on RadioVIS server | function startVIS(server, port){
visserver = server;
visport = port;
setTimeout(function(){ sndReq("image"); }, 100);
setTimeout(function(){ sndReq("text"); }, 1200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startVisualizer(websiteState) {\n console.log(\"\\nVisualizer started\");\n websiteState.visualizer.active = true;\n syncBeats(websiteState);\n ping(websiteState);\n}",
"function startVisualize() {\n if (selectedHeuristic == undefined && algorithmIndex == undefined) {\n showAlert(\"Pleas... | [
"0.6737944",
"0.64131224",
"0.61749333",
"0.6108844",
"0.6040681",
"0.6020364",
"0.6015423",
"0.59932524",
"0.5962413",
"0.5877786",
"0.58694255",
"0.5850678",
"0.5818709",
"0.5810054",
"0.58085585",
"0.5806785",
"0.5801158",
"0.5799173",
"0.5784569",
"0.57759845",
"0.5754938... | 0.69068664 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.