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 |
|---|---|---|---|---|---|---|
8. The distance between two cities (in km.) is input through the keyboard. Write four functions to convert and print this distance in meters, feet, inches and centimeters. | function distance() {
var distance = Number(prompt(" Distance between Two Cities in Km : "));
alert(" Distance in Meters : " + distance / 1000 + " \n Distance in foot" + distance / 3280.84 + "\n in inches : " + distance / 39370.1 + " \n in centimeters : " + distance / 100000);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function distance() {\n var input = +prompt(\"Enter distance in KM\");\n function meter() {\n var meter = input * 1000;\n return meter;\n }\n\n function feet() {\n var feet = input * 3280.84;\n return feet;\n }\n\n\n function inches() {\n var inches = input * 39... | [
"0.75296277",
"0.67702544",
"0.67179674",
"0.66866857",
"0.6679903",
"0.6635542",
"0.6618774",
"0.6594511",
"0.6550087",
"0.6543235",
"0.65300316",
"0.6523691",
"0.6522587",
"0.6515938",
"0.64867705",
"0.64718497",
"0.6462999",
"0.64613754",
"0.6457829",
"0.6457469",
"0.64551... | 0.7575154 | 0 |
Toggles the visibility of the add raid dialog box. | function toggleAddDialog()
{
raidApp.addDialogContainer.classList.toggle('visible');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAtomicRaidus() {\n atomicText.show();\n ionicText.hide();\n}",
"function onAddTeamClick() {\n $(\"#registerButtons\").hide();\n $(\"#registerTeam\").show();\n}",
"function openNewAccount() {\n document.getElementById(\"addNewButton\").style.display = \"block\";\n }",
"fun... | [
"0.60003257",
"0.595811",
"0.59015256",
"0.58869594",
"0.58550435",
"0.5837372",
"0.5796722",
"0.57622516",
"0.5677214",
"0.56697094",
"0.5594195",
"0.55909073",
"0.557295",
"0.5564463",
"0.55619544",
"0.55504286",
"0.5549698",
"0.55416584",
"0.5524545",
"0.5515268",
"0.54996... | 0.6643492 | 0 |
Event handler for butDialogAdd, adds the selected raid to the list. | function addLocation()
{
// Hide the dialog
toggleAddDialog();
//Arène
const select = document.getElementById('selectRaidToAdd');
const selected = select.options[select.selectedIndex];
//Position GPS
const geo = selected.value;
//Nom de l'arène
const arene = selected.textContent;
//Heure du Raid
const clo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function agregarItem(){\n \t$('#divListado1').show();\n \tif($('#material').val() == ''){\n \t\talert('ingrese un producto por favor');\n \t}else if($('#cant').val() == ''){\n \t\talert('por favor ingrese una cantidad');\t\n \t}else{\n \t\tif(existeMaterialEnTabla()){\n \t\t\tsumarCantidadA... | [
"0.54219407",
"0.52663046",
"0.5256905",
"0.5244794",
"0.5239603",
"0.51920944",
"0.51873124",
"0.5184945",
"0.51793987",
"0.5177392",
"0.5149768",
"0.51267743",
"0.50973165",
"0.5087142",
"0.5082419",
"0.5046657",
"0.5046477",
"0.5037896",
"0.502538",
"0.5021467",
"0.4993439... | 0.59239537 | 0 |
Initialize the app, gets the list of raid from local storage, then renders the initial data. | function init()
{
// Get the raid list, and update the UI.
raidApp.selectedLocations = loadRaidList();
updateData();
// Set up the event handlers for all of the buttons.
document.getElementById('butRefresh').addEventListener('click', updateData);
document.getElementById('butAdd').addEventListener('click', toggl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n /** Gets and stores Entries from LocalStorage. */\n let LocalStorageEntries = localStorage.getItem('entries');\n LocalStorageEntries = JSON.parse(LocalStorageEntries);\n /** If there are entries in LocalStorage */\n if(LocalStorageEntries && LocalStorageEntries.entries.length... | [
"0.59323996",
"0.56871825",
"0.5675425",
"0.5674934",
"0.56538576",
"0.56501347",
"0.5582662",
"0.55604446",
"0.5547809",
"0.5547011",
"0.5534667",
"0.5527577",
"0.550921",
"0.54886526",
"0.5472485",
"0.54695433",
"0.5443766",
"0.5434545",
"0.539543",
"0.5377688",
"0.5361831"... | 0.56945276 | 1 |
daadwerkelijk de btw btw berekenen | function btwBerekenen() {
//Uit feedback kwam dat de volgende berekening niet juist is uitgevoerd, aanpassen
btwBedrag = totaalBedrag / 121 * 21;
// Om het btw bedrag te krijgen deel ik het bedrag inclusief btw door 121 en dan keer 21.
totaalBedragZonderBtw = totaalBedrag - btwBedrag;
// Bij de volgende stap ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function twinkle() {\n result = httpGet('/mailbox/twinkle');\n}",
"function tweetIt(txt) {\n\n\tvar tweet = {\n\t\tstatus: txt\n\t}\n\n\t//Makes the bot account post a status update.\n\tT.post('statuses/update', tweet, tweeted);\n\n\t//Nested function that logs strings to the console. Makes it easier to see\n... | [
"0.6218108",
"0.56186426",
"0.5607528",
"0.55779076",
"0.55600214",
"0.552879",
"0.5497817",
"0.54709226",
"0.5465514",
"0.54314667",
"0.5391672",
"0.5379998",
"0.53415924",
"0.531658",
"0.53089863",
"0.52769256",
"0.52655977",
"0.52647316",
"0.5253586",
"0.5221723",
"0.52140... | 0.56884825 | 1 |
formulieren, divjes & variabelen resetten | function resetForm() {
btwResult.innerHTML = "";
totaalZonderBtwResult.innerHTML = "";
result.innerHTML = "";
bedragInput.value = "";
totaal.value = "";
totaalBedrag = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetear(){\n resultado.innerHTML = \"0\";\n operandoa = 0;\n operandob = 0;\n operacion = \"\";\n control_punto = 0;\n }",
"function resetFormularioNuevaParada(){\n frmPanelNuevaParada.getForm().reset();\n Ext.get('latParada').dom.innerHTML = '0.0';\n Ext.... | [
"0.67659736",
"0.6640162",
"0.66134346",
"0.65528035",
"0.65280336",
"0.6521241",
"0.6515523",
"0.6472782",
"0.64632297",
"0.6454967",
"0.64483726",
"0.64163154",
"0.64109564",
"0.63575697",
"0.6344303",
"0.6288361",
"0.6284798",
"0.6259696",
"0.62535155",
"0.62505877",
"0.62... | 0.6872335 | 0 |
Check whether the given account code field is valid | function isAcctValid(field, num) {
return !isNaN($(field).val()) && ($(field).val().length == num || $(field).val() == "");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static accountIsValid(account) {\n return true;\n }",
"function validateCodeField(code) {\n if (code.length > 10) {\n return false;\n }\n return true;\n}",
"function cekAccountNumber(field){\r\n\tvar accountNumber = /^[0-9][0-9]*$/;\r\n\tif(field.match(accountNumber)) {\r\n\t\treturn true;\... | [
"0.7226829",
"0.70322907",
"0.6692173",
"0.66273445",
"0.6592543",
"0.6539768",
"0.64986086",
"0.64312786",
"0.6426978",
"0.64251643",
"0.61999506",
"0.6185829",
"0.6064935",
"0.6051408",
"0.5996565",
"0.5996565",
"0.5965037",
"0.596227",
"0.5940497",
"0.59356654",
"0.5926284... | 0.70928335 | 1 |
Check that the given account field has the given number of numbers in it | function isAcctGood(field, num) {
return !isNaN($(field).val()) && $(field).val().length == num;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAcctValid(field, num) {\n return !isNaN($(field).val()) && ($(field).val().length == num || $(field).val() == \"\");\n }",
"function cekAccountNumber(field){\r\n\tvar accountNumber = /^[0-9][0-9]*$/;\r\n\tif(field.match(accountNumber)) {\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
... | [
"0.74425566",
"0.71586734",
"0.66198236",
"0.64107907",
"0.6394325",
"0.6137887",
"0.6123114",
"0.58878505",
"0.5843415",
"0.57970756",
"0.5787231",
"0.57865644",
"0.57701",
"0.57300895",
"0.57172066",
"0.565221",
"0.56517977",
"0.56340253",
"0.5628937",
"0.56218076",
"0.5609... | 0.78187835 | 0 |
Check if all account fields are empty | function isAcctAllEmpty() {
return $("#acctCode1CP").val() == "" && $("#acctCode2CP").val() == "" && $("#acctCode4CP").val() == "" &&
$("#acctCode5CP").val() == "" && $("#acctCode6CP").val() == "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function allFieldsAreEmpty() {\n\t\n\tif (\n\tdocument.getElementById(\"net-sales\").value == \"\" && \n\tdocument.getElementById(\"20-auto-grat\").value == \"\" &&\n\tdocument.getElementById(\"event-auto-grat\").value == \"\" &&\n\tdocument.getElementById(\"charge-tip\").value == \"\" &&\n\tdocument.getElementByI... | [
"0.7424617",
"0.7100695",
"0.6996133",
"0.6884646",
"0.6821586",
"0.6818323",
"0.6804034",
"0.679246",
"0.6787676",
"0.6777605",
"0.67608184",
"0.67560697",
"0.6727968",
"0.6720983",
"0.6710236",
"0.6706763",
"0.66526717",
"0.6649611",
"0.6576145",
"0.656723",
"0.65627354",
... | 0.8189654 | 0 |
atribuir zero ao vetores do escalonamento e translacao aos tres eixos | function zerarEixos (){
eixoTransladar[0] = 0;
eixoTransladar[1] = 0;
eixoTransladar[2] = 0;
eixoEscalar[0] = 0;
eixoEscalar[1] = 0;
eixoEscalar[2] = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zerarTransformacao () {\n botaoT = 0; \n botaoS = 0;\n botaoR = 0;\n}",
"function reestablece(){\n colector = \"0\";\n operacion = \"\";\n operador0 = 0;\n operador1 = 0;\n resultado = 0;\n iteracion = 0;\n }",
"function unDoIVAGastosVenta(IVAxGtos,costoDesProd,IVA) {\n\nvar nvoI... | [
"0.7072811",
"0.6000572",
"0.5937992",
"0.58426064",
"0.58335453",
"0.5795253",
"0.57789534",
"0.577218",
"0.5715374",
"0.5709285",
"0.5706147",
"0.5677101",
"0.56067055",
"0.5595527",
"0.5586363",
"0.5584008",
"0.5581596",
"0.5580311",
"0.557516",
"0.55574065",
"0.5549408",
... | 0.71572745 | 0 |
This will update the house state acccording to passed update parameters. | updateHouseFromState(component){
var state_manager = this,
house = state_manager.state.house,
promise;
if (!house) {
promise = Promise.resolve();
} else if (state_manager.state.dataset === 'energy' && !state_manager.matchesEnergyState()){
promise = state_manager.setHouseEnergyFromSta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setParams(params){\n var state_manager = this,\n url, house, params;\n if (state_manager.update_in_progress) return false;\n state_manager.update_in_progress = true;\n\n params = Object.assign({}, state_manager.state, params);\n if (params.house_id){\n house = state_manager.houses.find((h)... | [
"0.657095",
"0.627396",
"0.62181234",
"0.6190987",
"0.6131534",
"0.60751915",
"0.605665",
"0.5965384",
"0.5955696",
"0.59434247",
"0.58862865",
"0.5886038",
"0.5868046",
"0.58601344",
"0.58038276",
"0.5797452",
"0.57857",
"0.5774026",
"0.57545376",
"0.5752158",
"0.5750917",
... | 0.6581733 | 0 |
ITERATION BUTTON ON CLICK HANDLER | function iteration_button_onclick(clicked_id) {
location.href = "/view/iteration";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleButton() {}",
"_buttonClickHandler() { }",
"handleClick() {}",
"buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} els... | [
"0.6839906",
"0.6758388",
"0.6748291",
"0.671693",
"0.67093885",
"0.65899754",
"0.6576874",
"0.6537178",
"0.6492638",
"0.64111495",
"0.6411078",
"0.6410307",
"0.640575",
"0.640229",
"0.6377328",
"0.6345447",
"0.63105553",
"0.6290757",
"0.62893724",
"0.6267743",
"0.6257519",
... | 0.6807116 | 1 |
Sends the email to Michael's Place staff and displays the 'program' route. | sendEmail() {
this.validationController.validate().then(errors => {
if (errors.length === 0) {
var email = this;
this.api.email.sendToStaff(this.subject, this.message)
.then(function() {
log.debug('Email sent succesfully. R... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function main () {\n // send mail with defined transport object\n transporter.sendMail({\n from: email, // sender address\n to: 'melphelps@live.co.uk', // list of receivers\n subject: 'Client Enquiry', // Subject line\n html: message\n }, function (err) {\n i... | [
"0.6621051",
"0.61131954",
"0.6046412",
"0.6018046",
"0.60006016",
"0.5984907",
"0.5932313",
"0.58432806",
"0.5807088",
"0.5785041",
"0.5773173",
"0.57508785",
"0.57466805",
"0.5690841",
"0.5673886",
"0.56491405",
"0.56066424",
"0.56039256",
"0.5562241",
"0.5558806",
"0.55561... | 0.6178181 | 1 |
A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. Those numbers for which this proc... | function happyNumber(n) {
while(n !== 1) {
n = n.toString().split('').map(a => a*a).reduce((x, y) => (x + y))}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isHappy(n){\n let a = n.toString();\n let sum = 0;\n for (let digit of a) {\n let product = digit * digit;\n sum += product;\n }\n if (sum === 1) {\n return true;\n } else {\n return isHappy(sum);\n }\n}",
"function isHappy(n) {\n let set = new Set()\n while(n != 1) {\n let... | [
"0.75011486",
"0.7327769",
"0.6792056",
"0.660205",
"0.641511",
"0.6352151",
"0.627131",
"0.62252057",
"0.61079353",
"0.604535",
"0.6023613",
"0.59819746",
"0.5981953",
"0.5979863",
"0.597401",
"0.59496266",
"0.59410703",
"0.588869",
"0.58883226",
"0.588421",
"0.5867044",
"... | 0.8048565 | 0 |
salva um registro no IndexedDb | function addDataIndexedDb(dataJson){
var date = dataJson.date;
var description = dataJson.description;
var value = dataJson.value;
var transaction = db.transaction([constDbObject],"readwrite");
transaction.oncomplete = function(event) {
console.log("Sucesso :)");
};
transaction.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveSauvegarde(id,nbCoupe,aireAtteinte,temps,score) {\n // création d'un objet contenant les données\n // il sert d'\"enregistrement\" dans la base\n var sauvegarde = {\n\t\tid:id,\n nbCoupe: nbCoupe,\n aireMinimaleAtteinte: aireAtteinte,\n\t\ttemps:temps,\n\t\tscore:score\n }... | [
"0.7209134",
"0.6605569",
"0.65379083",
"0.65260077",
"0.64393204",
"0.63649654",
"0.634962",
"0.627919",
"0.61195225",
"0.61022764",
"0.6100517",
"0.60938764",
"0.6090512",
"0.6067234",
"0.60637563",
"0.6039262",
"0.6038369",
"0.60263157",
"0.6017888",
"0.60032165",
"0.60007... | 0.6615429 | 1 |
limpa todos os registros do IndexedDb | function removeAllRegistrosIndexedDb() {
registros = [];
var request = db.transaction([constDbObject], "readwrite")
.objectStore(constDbObject)
.clear();
request.onsuccess = function(event) {
fillTable(registros);
drawGraficos(registros);
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async index ( where = {} ) {\n const registers = await db[this.model].findAll({ where: { ...where } });\n if(!registers)\n throw Errors.NotFoundException('register not found')\n return registers\n }",
"function cargaDatos(){\n\tdb.transaction(cargaRegistros, errorDB);\n}",
"f... | [
"0.5880776",
"0.5798108",
"0.57289743",
"0.56941795",
"0.56633705",
"0.5647115",
"0.56012094",
"0.55770797",
"0.54943573",
"0.5468644",
"0.54613817",
"0.5458838",
"0.54465926",
"0.5445279",
"0.5422482",
"0.54109645",
"0.54062253",
"0.5398846",
"0.5372704",
"0.53624684",
"0.53... | 0.66978467 | 0 |
This function analyzes the type of a boolean expression node and checks if it is allowed. It can recurse when checking nested logical operators, so that only the outermost expressions are reported. | function checkNode(node, isRoot = false) {
// prevent checking the same node multiple times
if (checkedNodes.has(node)) {
return false;
}
checkedNodes.add(node);
// for logical operator, we also check its operands
if (node.ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseBooleanExpr() {\n CST.addBranchNode(\"BooleanExpression\");\n if (match([\"T_openList\"], false, false)) {\n parseExpr();\n if (match([\"T_boolop\"], false, false)) {\n parseExpr();\n if (match([\"T_closeList\"], false, false)) {\n log(\"Boolea... | [
"0.7288744",
"0.6997681",
"0.6723497",
"0.662752",
"0.6444368",
"0.62344176",
"0.6067088",
"0.60571134",
"0.6034402",
"0.5916351",
"0.58508396",
"0.57930696",
"0.57920396",
"0.57920396",
"0.5711017",
"0.55161",
"0.5497234",
"0.54703325",
"0.5462327",
"0.53916526",
"0.5377291"... | 0.7363708 | 0 |
Check union variants for the types we care about | function inspectVariantTypes(types) {
const variantTypes = new Set();
if (types.some(type => tsutils.isTypeFlagSet(type, ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.VoidLike))) {
variantTypes.add('nullish');
}
if (types.some(type => tsut... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function containsUnion( pwf ) {\n if( typeof pwf == 'number' ) {\n return false;\n } else {\n return (('op' in pwf) && (pwf.op == 'U')) || containsUnion( pwf.op1 ) || containsUnion( pwf.op2 );\n }\n }",
"function extractUnionInfo(ctx, idlType, errPrefix) {\n const seen = {\n s... | [
"0.64827573",
"0.62005866",
"0.6098891",
"0.5889174",
"0.58012545",
"0.57996345",
"0.57996345",
"0.5683944",
"0.56431204",
"0.56211275",
"0.5612902",
"0.55170196",
"0.5504773",
"0.5504773",
"0.5487926",
"0.5476923",
"0.5476866",
"0.5476866",
"0.5476866",
"0.5476866",
"0.54735... | 0.70339906 | 0 |
2. Create a constructor function called `Dog` that sets a property on itself within the constructor. The property should be called `says` and the value should be `life is ruff` DONE | function Dog(){
this.says = 'life is ruff'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Dog () {\n this.legs = 4;\n this.bark = function() {\n return 'arf arf;;\n }\n }",
"function Dog (breed) {\n this.breed = breed;\n}",
"function Dog (breed) {\n this.breed = breed;\n}",
"function Dog (breed) {\n this.breed = breed;\n}",
"f... | [
"0.74398655",
"0.7401345",
"0.73636514",
"0.73636514",
"0.73636514",
"0.73636514",
"0.72722626",
"0.7203767",
"0.7194559",
"0.7180483",
"0.7175434",
"0.7175424",
"0.7175424",
"0.717116",
"0.71687704",
"0.7153247",
"0.714996",
"0.7149823",
"0.7143825",
"0.71397036",
"0.7120623... | 0.8282548 | 0 |
4. Create a constructor called `KeepSecret`. The constructor function itself should accept a parameter called `secret` it should store this in a private variable (use a closure). Add a method to the prototype that is called `squeal` that returns the secret string. DONE | function KeepSecret(secret) {
this.secret = secret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makesecret() {\n secret = makerandword(); }",
"function createSecretHolder(secret) {\n let secr = secret;\n let obj = {\n getSecret: function() {\n return secr;\n },\n setSecret: function(s) {\n secr = s;\n }\n }\n\n return obj;\n}",
"function createSecr... | [
"0.77774686",
"0.7397415",
"0.7242398",
"0.7206933",
"0.7100086",
"0.6714597",
"0.6598306",
"0.64396524",
"0.62731177",
"0.6253335",
"0.6126397",
"0.6120165",
"0.605057",
"0.5921582",
"0.5865497",
"0.58446383",
"0.5805677",
"0.57992554",
"0.5787509",
"0.577822",
"0.57578784",... | 0.81052107 | 0 |
threeline2d normalizes the dashposition along lines based on point index, not geometric distance. this overwrites that behavior. | function _fixLine2DDistances (lineGeom) {
const distAttr = lineGeom.getAttribute("lineDistance");
if (distAttr) {
const posArr = lineGeom.getAttribute("position").array;
const distArr = distAttr.array;
let totalDist = 0;
const tmpA = new Vector3();
const tmpB = new Vector3();
for (let ai=1; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalToLine(line){\r\n var vec = sub(line.p2, line.p1);\r\n var newVec = normalTo(vec);\r\n return normalize(newVec);\r\n}",
"function makeNormalizedLine(p0, p1) {\n var a, b, c, toString;\n a = p1.y - p0.y;\n b = p0.x - p1.x;\n c = a*p1.x + b*p1.y;\n \n toString ... | [
"0.57762873",
"0.55524695",
"0.55094326",
"0.54340774",
"0.53997064",
"0.5353648",
"0.5349044",
"0.5273151",
"0.5259148",
"0.52504265",
"0.5246135",
"0.524062",
"0.52261645",
"0.5208733",
"0.52063787",
"0.52063787",
"0.5196581",
"0.5195464",
"0.5155396",
"0.514865",
"0.513194... | 0.6270585 | 0 |
Extend tty.Server to override middleware setup | function MyServer() {
this.canonical = options.canonical;
return TTYServer.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MiddleMan() {\n this._server = http.createServer(this._onRequest.bind(this));\n this._proxyServer = httpProxy.createProxyServer({});\n this._handlers = [];\n}",
"__prepareServer () {\n\n\t\tthis.server.inject(`sharedLogger`, sharedLogger);\n\n\t\tthis.server.mount(`/health-check`, (req, res) => res.r... | [
"0.6300785",
"0.6186253",
"0.6150104",
"0.61436576",
"0.6127923",
"0.60946846",
"0.6089851",
"0.60636204",
"0.60511065",
"0.60152376",
"0.5985307",
"0.5980225",
"0.5950251",
"0.5947655",
"0.5933516",
"0.593279",
"0.5930175",
"0.59157693",
"0.59107006",
"0.5880162",
"0.5877274... | 0.67672527 | 0 |
The driver application features an array of image URLs, setting of the main title & subtitle, and creation of individual slides for each image. | function main() {
var images = [
'http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
'http://www.google.com/services/images/phone-animation-results_2x.png',
'http://www.google.com/services/images/section-work-card-img_2x.jpg',
'http://gsuite.google.com/img/icons/produc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function main() {\n var images = [\n 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',\n 'http://www.google.com/services/images/phone-animation-results_2x.png',\n 'http://www.google.com/services/images/section-work-card-img_2x.jpg',\n 'http://gsuite.google.com/img/i... | [
"0.7255615",
"0.6701538",
"0.6493436",
"0.62895447",
"0.627597",
"0.6230609",
"0.61865693",
"0.6151827",
"0.60887355",
"0.601292",
"0.5989343",
"0.5983578",
"0.59632605",
"0.5953698",
"0.5951431",
"0.5932212",
"0.59025717",
"0.58852196",
"0.58429545",
"0.5817123",
"0.58061314... | 0.74116576 | 0 |
HTTP Upload Appender for ngLogCustom module Uploads the logs that have a log level >= minLevel to postUrl in the specified interval. No uploads happen if no suitable logs have been produced. | function CatHttpLogAppender($http,
$interval,
$log,
config,
HTTP_LOGGER_NAME,
LOG_LEVEL_ORDER) {
var logger = $log.Logger(HTTP_LOGGER_NAME);
if (typeof config.postUrl === '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _writeLogsToServer(logLevel, loggingUrl) {\n var dataToSend;\n\n dataToSend = {\n logLevel: logLevel\n , logData : app.cache.logData\n };\n app.cache.logData = [];\n $.ajax({\n type: 'POST'\n , url: loggingUrl\n , data: dataToSend\n });\... | [
"0.54674697",
"0.51025254",
"0.49999103",
"0.49235183",
"0.47931123",
"0.47719052",
"0.4761062",
"0.47472373",
"0.46536362",
"0.4648227",
"0.46080893",
"0.455697",
"0.45363548",
"0.45363548",
"0.45363548",
"0.4526551",
"0.44752958",
"0.44590628",
"0.44590628",
"0.44584626",
"... | 0.71909446 | 0 |
gestire ordine in base ai valori | function ordina(){
for (var i = 0; i<persone.length; i++){
var minimoFinOra = i;
for(var j=i+1; j<persone.length; j++){
if(persone[j].altezza<persone[minimoFinOra].altezza){
minimoFinOra = j;
}
}
// Salvo il valore minimo
var tmp = persone[i];
persone[i] = persone[minimoFinOra];
persone[mi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function afase_luna(njd){\n\n // calcola l'angolo di fase della luna per la data (njd)\n // gennaio 2012\n\n var dati_luna=pos_luna(njd); // recupero fase/elongazione (1)\n var dati_sole=pos_sole(njd);\n\n var elongazione1=dati_luna[4]; // elongazione in gradi sessadecimali.\n va... | [
"0.55788004",
"0.54666215",
"0.54242295",
"0.5423678",
"0.5421097",
"0.53369373",
"0.5245887",
"0.52254087",
"0.5220401",
"0.5202418",
"0.51871294",
"0.51262957",
"0.512494",
"0.5070953",
"0.5052998",
"0.5047292",
"0.5030834",
"0.50111616",
"0.49746653",
"0.4942044",
"0.49388... | 0.5561543 | 1 |
getEmailFromLocalStorage function gets the user email from local storage, it returns false if value is not found in local storage. email is stored as email in local storage | function getEmailFromLocalStorage() {
if (localStorage.getItem("email")) {
return localStorage.getItem("email");
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_user_email(){ return localStorage['logged_in_as']; }",
"function checkAccount() {\n console.log(localStorage);\n if (localStorage.getItem(\"email\") === null) {\n\n } else {\n existingAccount = true;\n }\n}",
"function isEmailUnique() {\n\n var email = document.getElementById(\... | [
"0.7614653",
"0.7370305",
"0.7315754",
"0.67491454",
"0.6708699",
"0.66201174",
"0.6543067",
"0.652607",
"0.64364916",
"0.64181274",
"0.640039",
"0.63077223",
"0.6306384",
"0.6305968",
"0.6297027",
"0.62538064",
"0.62161314",
"0.6205636",
"0.61839736",
"0.61826116",
"0.617723... | 0.88203657 | 0 |
getRecipesFromLocalStorage function gets the saved recipes from local storage, it returns false if value is not found in local storage. recipe is stored as recipe in local storage | function getRecipesFromLocalStorage() {
if (localStorage.getItem("recipes")) {
recipes = localStorage.getItem("recipes");
return JSON.parse(recipes);
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getData() {\n var data = [];\n if (typeof(Storage) !== \"undefined\") {\n data = localStorage.getItem(\"recipes\");\n if (data !== null) {\n data = JSON.parse(data);\n } else {\n data = mockData;\n }\n } else {\n console.log(\"WARNING: no local storage, cannot save r... | [
"0.7369242",
"0.70015085",
"0.685982",
"0.6499887",
"0.6338447",
"0.6327309",
"0.62800825",
"0.6271402",
"0.62226397",
"0.6222276",
"0.62205327",
"0.6188178",
"0.61537135",
"0.61517423",
"0.61320984",
"0.6112645",
"0.6092996",
"0.6090652",
"0.60802317",
"0.60758847",
"0.60276... | 0.88765395 | 0 |
setUserLocalStorage function sets the username, email values to local storage | function setUserLocalStorage(username, email) {
localStorage.setItem("username", username);
localStorage.setItem("email", email);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token\", currentUser.loginToken);\n localStorage.setItem(\"username\", currentUser.username);\n }\n }",
"function syncCurrentUserToLocalStorage() {\n if (currentUser) {\n localStorage.setItem(\"token... | [
"0.7715453",
"0.7715453",
"0.7715453",
"0.7715453",
"0.7715453",
"0.7715453",
"0.7651826",
"0.76277274",
"0.76040643",
"0.75565594",
"0.75184935",
"0.7391666",
"0.73473936",
"0.73104584",
"0.7219108",
"0.72054136",
"0.71536237",
"0.70849776",
"0.7067868",
"0.7016784",
"0.7010... | 0.89102155 | 0 |
Stores recipes and length in the local storage | function setRecipeFromLocalStorage(recipe) {
var recipes = localStorage.getItem("recipes");
recipes = JSON.parse(recipes);
console.log(recipes);
console.log(recipe + " to be added");
if (recipes == null) {
var recipes = [];
recipes[0] = recipe;
console.log(recipes);
var index = 1;
localSto... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"saveNewRecipe() {\n if (this.state.newestRecipe.recipeName && this.state.newestRecipe.ingredients) {\n let recipes = this\n .state\n .recipes\n .slice();\n recipes.push({recipeName: this.state.newestRecipe.recipeName, ingredients: this.state.newestRecipe.ingredients});\n loca... | [
"0.681646",
"0.6704981",
"0.6697677",
"0.63790077",
"0.6320328",
"0.63082176",
"0.6302978",
"0.6230274",
"0.6208092",
"0.61903894",
"0.6142571",
"0.612609",
"0.6118722",
"0.6106649",
"0.6089457",
"0.60274816",
"0.6006594",
"0.5909437",
"0.5909046",
"0.5908755",
"0.5895762",
... | 0.72961426 | 0 |
this method should be supported in RXJS 2 public patients: Observable> = this._patients.asObservable(); | constructor(patientBackendService) {
this.patientBackendService = patientBackendService;
this._patients = new Rx_1.BehaviorSubject(immutable_1.List([]));
this._patientFormPage = new Rx_1.BehaviorSubject(PatientFormPage.Details);
this._showC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get patients () {\n\t\treturn this._patients;\n\t}",
"getObservable()\n {\n return this.subject.asObservable();\n }",
"function Observable() {\n\t/**\n\t * Lista di osservatori che richiedono di essere notificati ad un cambiamento di stato.\n\t * @type {Array.<Observer>}\n\t * @private\n\t */\n\tthis.obse... | [
"0.69550824",
"0.61484927",
"0.5973468",
"0.583888",
"0.5726242",
"0.56862605",
"0.56724006",
"0.5556667",
"0.541952",
"0.5415404",
"0.53977174",
"0.52335817",
"0.51911044",
"0.518723",
"0.51717466",
"0.51546496",
"0.5144299",
"0.514183",
"0.514183",
"0.514183",
"0.514183",
... | 0.6391625 | 1 |
Formats the contact info | function formatItem(contact) {
return contact.Name + ' [' + contact.Alias + '] | ' + contact.Team + ' | Hobbies: '+ contact.Hobbies;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertContactToString(item) {\n objString += '|{';\n objString += '\"type\": \"' + item.type + '\",';\n objString += '\"id\": \"' + item.id + '\",';\n objString += '\"firstName\": \"' + item.firstName + '\",';\n objString += '\"lastName\": \"' + item.lastName + '\",';\n... | [
"0.63130903",
"0.62241745",
"0.6199052",
"0.6186122",
"0.6171605",
"0.58700246",
"0.58234555",
"0.5822236",
"0.5800665",
"0.57151634",
"0.5708914",
"0.5675894",
"0.5675191",
"0.5667201",
"0.56052315",
"0.55989873",
"0.5587502",
"0.55674446",
"0.55618584",
"0.5540813",
"0.5538... | 0.7048042 | 0 |
get the list of contacts (each index is an entry) | function getContacts() {
return contacts;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContacts() {\n return contacts;\n }",
"contactList() {\n\t if (Session.get(\"searchName\") != \"\") {\n\t\tvar searchString = Session.get(\"searchName\");\n\t\treturn Template.contacts.__helpers[\" findContact\"](searchString);\n\t }\n\t else\n\t\treturn Contacts.fi... | [
"0.83700484",
"0.79109913",
"0.76827186",
"0.7411142",
"0.7411142",
"0.73865044",
"0.72450215",
"0.71513414",
"0.71374464",
"0.7053995",
"0.70517385",
"0.7032372",
"0.7021278",
"0.69623154",
"0.6917967",
"0.68560165",
"0.6765175",
"0.6759798",
"0.6744462",
"0.6718358",
"0.670... | 0.8267165 | 1 |
Function that would park a vehicle to the nearest entry point. accepts a vehicle object as a paramater. returns a List of where the vehicles is parked (A,B,C) and the parking slot object | park_vehicle(vehicle) {
//Initial Loop through the list of parking slots
for(var i=0 ; i<this.sizes.length; i++) {
//check if the slot is occupied and if the vehicle size is SMALL
//Small vehicles can park either of the three, Small, Medium, Large Parking Slot
if(vehi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nearestParcel(place, parcels) {\n let routes = {};\n for (let parcelIndex in parcels) {\n routes[parcelIndex] = findRoute(roadGraph, place, parcels[parcelIndex].place)\n }\n\n let shortestRoute;\n for(let x in routes) {\n if(shortestRoute == undefined || routes[x].length < routes[shortestRoute]... | [
"0.64993197",
"0.6336433",
"0.55648494",
"0.5564525",
"0.54301274",
"0.5417086",
"0.53659356",
"0.52854806",
"0.5267247",
"0.52330995",
"0.5229277",
"0.5125344",
"0.5106067",
"0.50674766",
"0.50449854",
"0.5040505",
"0.49897933",
"0.49877164",
"0.49752247",
"0.49747247",
"0.4... | 0.75456023 | 0 |
Function that would unpark a vehicle. accepts a vehicle object as a paramater. returns the total parking fee amount for how long the vehicle stayed at the parking slot. | unpack_vehicle(vehicle) {
//Loops through the parking slots.
for(var i = 0; i < this.sizes.length; i++) {
//check if the parking slot is occupied and there is a vehicle parked.
if(this.sizes[i].occupied && this.sizes[i].vehicle !== undefined) {
//check if the vehi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unPark(){\n setDetail(selected, 'lat', 0);\n setDetail(selected, 'lng', 0);\n setDetail(selected, 'adress', '');\n clearMarkers();\n }",
"function carLeaving(car){\n car.timeRemaining--;\n if (car.remainingElectricity <= 0){ //car is fully fuelled\n //Prevents cars th... | [
"0.5062176",
"0.4862876",
"0.48605102",
"0.4858638",
"0.48046634",
"0.47867355",
"0.47271547",
"0.47139263",
"0.46507627",
"0.44915405",
"0.44779438",
"0.4468146",
"0.43742844",
"0.4372816",
"0.4326032",
"0.4316641",
"0.43007958",
"0.4283456",
"0.42807347",
"0.4271828",
"0.42... | 0.5479308 | 0 |
The string returned by the "getNodeValue()" method for an Element Node is null. | function hc_nodeelementnodevalue() {
var success;
var doc;
var elementNode;
var elementValue;
doc = load("hc_staff");
elementNode = doc.documentElement;
elementValue = elementNode.nodeValue;
assertNull("elementNodeValue",elementValue);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }",
"function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\";\n }",
"function eltText(node) {\n return node.textContent || node.innerText || node.nodeValue || \"\"... | [
"0.6444224",
"0.6444224",
"0.6444224",
"0.6444224",
"0.6444224",
"0.6444224",
"0.6393919",
"0.6361848",
"0.61373246",
"0.6120681",
"0.6119781",
"0.6024086",
"0.5964991",
"0.5961994",
"0.5906481",
"0.5892821",
"0.58725256",
"0.58251286",
"0.5750651",
"0.575056",
"0.575056",
... | 0.6501883 | 0 |
Get selected text on Title button click | function getSelectedText1() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection) {
text = document.selection.createRange().text;
}
if (tFlag === 0) {
var a = String('<title id="' + text + '">');
data_arr.push(a);
tF... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSelectedText() {\n return window.getSelection().toString();\n }",
"function getSelectedText() {\n return getSelectedTextAndRange()[0];\n}",
"function getSelectedText() {\n var text = \"\";\n if (typeof window.getSelection != \"undefined\") {\n text = window.getSelection().toStr... | [
"0.7160881",
"0.69038504",
"0.68798363",
"0.6838814",
"0.6703329",
"0.6686906",
"0.6686906",
"0.65892845",
"0.6555423",
"0.65261877",
"0.6504765",
"0.6497718",
"0.6451045",
"0.6429562",
"0.64286363",
"0.6407339",
"0.6403446",
"0.6402466",
"0.6397058",
"0.6316844",
"0.6309171"... | 0.7067919 | 1 |
Renders the correct button for the payment screen depending on what kind of user is using the button (non registered, registered but not premium, registered and premium) | renderButton(planName) {
if (this.props.user) {
// If the user is already premium let them know!
if (!isNil(this.props.user.plan))
return <button
onClick={() => {
this.props.pushAlert('info', 'Already Subscribed', 'You are alrea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reviewButtonDisplay() {\n // Check user type\n console.log(\"isBusinessOwner()\", isBusinessOwner);\n if (isBusinessOwner == \"true\") {\n console.log(\"is a business owner\");\n hideElement(\"review-button\");\n } else {\n // Set saved ratings for the pop up and click open if it is a user \n... | [
"0.6542581",
"0.63429713",
"0.6242841",
"0.62422943",
"0.62125885",
"0.6202621",
"0.6165143",
"0.61620194",
"0.6141722",
"0.61381066",
"0.6030694",
"0.59838",
"0.59441376",
"0.5930966",
"0.5884081",
"0.58815604",
"0.5863927",
"0.58572143",
"0.58392096",
"0.5814357",
"0.581182... | 0.74037564 | 0 |
this.props.sounds is a dictionary of action => Expo.Audio.Sound object see loadSounds() in App.js to see what actions are possible | playSound(action) {
try {
this.props.sounds[action].playAsync();
this.props.sounds[action].setPositionAsync(0);
} catch (err) {
console.log("Could not play", action)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadDefaultSounds() {\n Object.keys(this.defaultSounds).forEach((key) => {\n this.loadSound(key, this.defaultSounds[key]);\n });\n }",
"handleMusicButtonClicked(musicButtonId){\n let buttons = [...this.state.buttons];\n\n\n if(this.props.mappingSound){\n buttons[musicButtonId... | [
"0.7028121",
"0.6894463",
"0.66668814",
"0.66233325",
"0.6544734",
"0.643667",
"0.6420641",
"0.6401536",
"0.6377672",
"0.6365446",
"0.63530886",
"0.63278306",
"0.6322497",
"0.6277754",
"0.6257085",
"0.6210725",
"0.6206442",
"0.61829025",
"0.6148332",
"0.61385065",
"0.6084578"... | 0.76544875 | 0 |
fungsi untuk menghapus suffix seperti ku, mu, kah, dsb | function Del_Inflection_Suffixes(kata,selesai){
var kataAsal = kata;
if(kata.match(/([km]u|nya|[kl]ah|pun)$/i)){ // Cek Inflection Suffixes
var __kata = kata.replace(/([km]u|nya|[kl]ah|pun)$/i,'');
selesai(__kata);
}else{
selesai(kataAsal);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Del_Derivation_Suffixes(kata,selesai){\n\tvar kataAsal = kata;\n\tvar sam=kata\n\tif(kata.match(/(i|an)$/i)){ // Cek Suffixes\n\t\n\tvar __kata = sam.replace(/(i|an)$/i,'');\n\t\tcekKamus(__kata,function(bool){\n\t\t\tif(bool){\n\t\t\t\t\n\t\t\t\tselesai(__kata)\t\n\t\t\t}else if(kata.match(/(kan)$/i)){\n... | [
"0.6774202",
"0.63700324",
"0.62904674",
"0.6241091",
"0.6215754",
"0.61038715",
"0.60492355",
"0.6048907",
"0.5952882",
"0.58750904",
"0.58620465",
"0.58020526",
"0.57999474",
"0.5745012",
"0.57399106",
"0.573591",
"0.5735891",
"0.567243",
"0.5658479",
"0.56445414",
"0.55860... | 0.68171924 | 0 |
Cek Prefix Disallowed Sufixes (Kombinasi Awalan dan Akhiran yang tidak diizinkan) | function Cek_Prefix_Disallowed_Sufixes(kata){
if(kata.match(/^(be)[a-zA-Z]+(i)/)){ // be- dan -i
return true;
}
if(kata.match(/^(se)[a-zA-Z]+(i|kan)/)){ // se- dan -i,-kan
return true;
}
if(kata.match(/^(di)[a-zA-Z]+(an)/)){ // di- dan -an
return true;
}
if(kata.match(/^(me)[a-zA-Z]+(an)/)){ // me- d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cleanPrefix(prefix) {\n if (!prefix) {\n return this;\n }\n this.input = this.input.replace(new RegExp(`^${prefix}[-_]?`, 'i'), '');\n return this;\n }",
"startsWith(c){ return false }",
"startsWith(c){ return false }",
"getPrefixCode() {\n return \"\";\n }",
"... | [
"0.62969595",
"0.58671004",
"0.58671004",
"0.57943285",
"0.5714892",
"0.564559",
"0.55580175",
"0.5534085",
"0.5529474",
"0.5527311",
"0.5524464",
"0.5518711",
"0.5513337",
"0.55102795",
"0.5503454",
"0.5497291",
"0.5481376",
"0.54566014",
"0.5450117",
"0.5434705",
"0.5426948... | 0.74927485 | 0 |
Hapus Derivation Suffixes ("i", "an" atau "kan") | function Del_Derivation_Suffixes(kata,selesai){
var kataAsal = kata;
var sam=kata
if(kata.match(/(i|an)$/i)){ // Cek Suffixes
var __kata = sam.replace(/(i|an)$/i,'');
cekKamus(__kata,function(bool){
if(bool){
selesai(__kata)
}else if(kata.match(/(kan)$/i)){
__kata=sam.replace(/(kan)$/i,'')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Del_Derivation_Prefix(kata,selesai){\n\tvar kataAsal = kata;\nvar __kata,__kata__=\"\"\n\t/* —— Tentukan Tipe Awalan ————*/\nif(kata.match(/^(di|[ks]e)/)){ // Jika di-,ke-,se-\n __kata = kata.replace(/^(di|[ks]e)/,'');\n \n cekKamus(__kata,function(data){\n\t if(data){\n\t\tselesai(__kata)\n\t }e... | [
"0.61835456",
"0.6115167",
"0.58595675",
"0.57735646",
"0.5762797",
"0.5756832",
"0.5739361",
"0.57145274",
"0.55978703",
"0.5582833",
"0.553381",
"0.55188006",
"0.5515095",
"0.5513158",
"0.5513158",
"0.5513158",
"0.55076826",
"0.55005306",
"0.5477976",
"0.5473025",
"0.544467... | 0.67878103 | 0 |
Hapus Derivation Prefix ("di", "ke", "se", "te", "be", "me", atau "pe") | function Del_Derivation_Prefix(kata,selesai){
var kataAsal = kata;
var __kata,__kata__=""
/* —— Tentukan Tipe Awalan ————*/
if(kata.match(/^(di|[ks]e)/)){ // Jika di-,ke-,se-
__kata = kata.replace(/^(di|[ks]e)/,'');
cekKamus(__kata,function(data){
if(data){
selesai(__kata)
}else{
Del_Derivatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDerivacaoAFND(der, terminal){\n while(der.charAt(0) != \"}\"){\n /**\n * IGUAL AO FND\n */\n var regra = \"([a-zA-Z]|[0-9]|_)\\\\:\\\\[\";\n var reg = new RegExp(regra);\n var letra = der.match(reg);\n if(letra[1] == \"_\") letra[1] = \"\";\n ... | [
"0.6107145",
"0.5719765",
"0.5620241",
"0.5559519",
"0.5518969",
"0.55171746",
"0.55019695",
"0.55002034",
"0.54467845",
"0.5441924",
"0.54122806",
"0.54108983",
"0.53885466",
"0.5377489",
"0.5347215",
"0.53189534",
"0.531698",
"0.52942127",
"0.52942127",
"0.5292685",
"0.5285... | 0.6622089 | 0 |
Refresh the max height set on the element. This may be useful if resizing the window and the content height changes. | function refresh() {
element.style.maxHeight = element.scrollHeight + 'px';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updateHeight () {\n const height = document.body.scrollHeight\n if (height === this._lastHeight) {\n return\n }\n \n this._lastHeight = height\n this._sendMessage('height', { height: height })\n }",
"function setHeight() {\n $('.voyage').css('height',... | [
"0.7306204",
"0.71844196",
"0.7093979",
"0.69578004",
"0.68034196",
"0.67750686",
"0.6749046",
"0.668914",
"0.6688762",
"0.6638899",
"0.66354924",
"0.66154706",
"0.6495037",
"0.64909416",
"0.647521",
"0.6473164",
"0.6432447",
"0.64289296",
"0.64289296",
"0.64289296",
"0.64056... | 0.79652953 | 0 |
Fix Subtitles Octopus to work with embedded YouTube videos TODO: Fix subtitles position in fullscreen mode | function subResize(event) {
var e_sub = subtitles.canvas;
var e_vid = player.elements.wrapper;
e_sub.style.display = "block";
e_sub.style.top = 0;
e_sub.style.position = "absolute";
e_sub.style.pointerEvents = "none";
e_sub.width = e_vid.clientWidth * 2;
e_sub.height = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySubtitles_sync(current_time){\n if (current_subtitle == null){\n subtitles_textbox[0].innerHTML = \" \";\n subtitles_textbox[1].innerHTML = \" \";\n subtitles_textbox[2].innerHTML = \" \";\n subtitles_textbox[3].innerHTML = \" \";\n subtitles_textbox[4].innerHTML... | [
"0.6343375",
"0.62633234",
"0.62324286",
"0.6225659",
"0.6173732",
"0.6172417",
"0.6156412",
"0.6145753",
"0.60456",
"0.5974248",
"0.59478223",
"0.59293264",
"0.58953816",
"0.5854956",
"0.5776911",
"0.57645357",
"0.5731814",
"0.56288713",
"0.56268555",
"0.5614632",
"0.561342"... | 0.65505075 | 0 |
Fetch courses from database paginated | fetchCourses(page = 1) {
axios.get(`${utilities.backendUrl}/courses`, {params: {page: page}})
.then((res) => {
this.setState({
courses: res.data.courses.content,
pagination: res.data.courses,
pageNumbers: res.data.pageNumber... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getCourses(){\r\n const pageNumber = 2;\r\n const pageSize=10;\r\n \r\n const courses= await Course\r\n .find({ author : 'Mosh', isPublished :true})\r\n .skip( (pageNumber-1) * pageSize )\r\n //formula for pagination is pagenumber-1 * pagesize\r\n .limit(10)\r\n .sort({name: 1})\r\n //.sel... | [
"0.7596734",
"0.7292198",
"0.7196835",
"0.7181529",
"0.712476",
"0.70222247",
"0.6977866",
"0.69531447",
"0.69484216",
"0.6920709",
"0.68820125",
"0.68610084",
"0.68605316",
"0.68555677",
"0.68537855",
"0.6726301",
"0.67253274",
"0.67029",
"0.6701172",
"0.6679708",
"0.6664878... | 0.7368527 | 1 |
== ENTITY (QUESTION) == | function QuestionEntity(key, content, contentExtended, replies) {
Entity.call(key);
this.content = content;
this.contentExtended = contentExtended;
this.replies = replies;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get Question() {}",
"set Question(value) {}",
"function Question(questionContent){\n this.questionContent = questionContent;\n this.correct = [];\n this.incorrect = [];\n}",
"function whatIsQuestion() {\n\n if(anonymousvotingAddr.state() > 0) {\n var q = anonymousvotingAddr.question();\n docu... | [
"0.62489855",
"0.60239494",
"0.59625596",
"0.592345",
"0.59078705",
"0.58567667",
"0.5844578",
"0.5829245",
"0.58070093",
"0.5799393",
"0.5758112",
"0.57523143",
"0.57484645",
"0.5739653",
"0.5723298",
"0.56927073",
"0.5662957",
"0.5657268",
"0.5656958",
"0.56536615",
"0.5622... | 0.61487424 | 1 |
Takes the response from api calls to the cart and replaces the clients cart render with the new cart html supplied. Note: this is some horribly dirty corner cutting hackery of which I am not proud. Don't judge me. | async function _reRenderCartWithResponse(response)
{
// Do nothing if not 200
if (response.status !== 200)
return;
// Convert response stream to text, which will contain the current html state of the cart
let text = await response.text();
// Remove the current cart from the nav
let cart = document.getEl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCart() {\n\n\t$('contentMinicart').innerHTML = \"<div align='center' class='zajax_loading'>Loading... Please Wait<\\/div>\";\n\tnew Effect.Highlight($('contentMinicart'));\n\t\n\t// this gets called by handleResponse (which is in zoovy.js)\n var postBody = 'm=RenderElement&format=WRAPPER&docid='+D... | [
"0.6977778",
"0.6943263",
"0.66290593",
"0.66050214",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6599",
"0.6541971",
"0.650137",
"0.64912754",
"0.64... | 0.771274 | 0 |
function calc no. of days between a and b, where a and b are javascript Date objects | function calc_days(a, b) {
const utc1 = new Date(a);
const utc2 = new Date(b);
return Math.floor(utc2 - utc1) / (1000 * 60 * 60 * 24);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dateDiffInDays (a, b) {\n const [ua, ub] = [a, b].map(day => dayjs.utc(day))\n return Math.abs(ua.diff(ub, 'day'))\n }",
"function daysBetween(a, b) {\n return msBetween(a, b) / timeDay;\n}",
"function date_diff_in_days(a, b) {\r\n // Discard the time and time-zone information.\r\n var ut... | [
"0.8302511",
"0.81981695",
"0.7805908",
"0.77297056",
"0.7704199",
"0.76929665",
"0.76888126",
"0.76831985",
"0.7681067",
"0.7677767",
"0.76520884",
"0.76479703",
"0.76404226",
"0.7637147",
"0.7636541",
"0.7632426",
"0.76313245",
"0.7629804",
"0.7629804",
"0.7626156",
"0.7624... | 0.8609098 | 0 |
calc the total cost of booking, where a: checkin date, b: checkout date, guest: no. of guest | function calc_cost(a, b, guest) {
return charges.room * calc_days(a, b) * guest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hotelCost(daysStayed) {\n \n var bill = 0;\n\n if (daysStayed <= 10) {\n bill = daysStayed * 100;\n }\n\n else if (daysStayed <= 20) {\n var firstTenDays = 10 * 100;\n var remainingDays = daysStayed - 10;\n var secondTenDays = remainingDays * 80;\n bil... | [
"0.6683849",
"0.65344673",
"0.651842",
"0.6461001",
"0.64443684",
"0.64442825",
"0.64321315",
"0.6377069",
"0.6370537",
"0.6354152",
"0.6337194",
"0.6335726",
"0.6293818",
"0.62724084",
"0.62679267",
"0.62661564",
"0.6265695",
"0.626075",
"0.6239874",
"0.6223532",
"0.6214679"... | 0.78296095 | 0 |
Removes a player from the static Player list and ensures all of its sprites are removed from the stage | remove() {
Player.container.children.forEach(child => {
if(child.parentId === this.id) {
this.removeSprite(child);
}
});
delete Player.list[this.id];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeFrom (stage) {\n const curStage = stage\n\n curStage.sprites = stage.sprites.filter((item) => item !== this)\n this.element ? this.element = this.element.delete(this) : null\n }",
"remove() {\n player.dispose();\n }",
"function removePlayer(playerId) {\n players[playerId].destroy... | [
"0.7016824",
"0.69998425",
"0.6850728",
"0.68462914",
"0.6831723",
"0.6747511",
"0.667538",
"0.66536015",
"0.66535246",
"0.66224766",
"0.66014886",
"0.657225",
"0.6538771",
"0.65382755",
"0.65297294",
"0.6465769",
"0.6419924",
"0.64103353",
"0.6400125",
"0.6395308",
"0.633717... | 0.72922325 | 0 |
make the call to multiple promises: build with the array of ids an array of Promises (promisesCharacters) and pass it as a parameter to Promise.all(). await stops the execution of the programme until all promises are resolved => to control order in which characters are printed catch() in case an error occurs | async function getCharacters() {
const ids = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
console.log(`Enter async function getCharacters`);
const promisesCharacters = ids.map((id) => getACharacter(id));
try {
const characters = await Promise.all(promisesCharacters);
getCharacterInfo(characters);
console.log(`F... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function obtenerPersonajes(){\nvar ids=[1,2,3,4,5,6,7]\n\nvar promesas = ids.map(id=> obtenerPersonaje(id))\n\n//wait detiene la ejecucion de la funcion hasta que se hayan cargado todas las promesas\ntry{\n \n var personajes= await Promise.all(promesas)\n console.log(personajes)\n\n}catch(id){\n ... | [
"0.69176096",
"0.66328067",
"0.5978529",
"0.5929018",
"0.58466816",
"0.5792999",
"0.57180554",
"0.568625",
"0.56752545",
"0.56085414",
"0.5603807",
"0.55285937",
"0.5508913",
"0.5497215",
"0.54959226",
"0.5481018",
"0.5458446",
"0.5438956",
"0.54383725",
"0.542291",
"0.541415... | 0.7807619 | 0 |
initializes map on load and calls createMapMarker() to add markers based on shopsDisplayed() observablearray | function initializeMap() {
var shops = shopsDisplayed();
var mapOptions = {
disableDefaultUI: true
};
map = new google.maps.Map(document.getElementById('map'), mapOptions);
window.mapBounds = new google.maps.LatLngBounds();
// only one infoWindow exists. the associated marker and content
// is upd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initMap() {\n logger('function initMap is called');\n map = new gmap.Map(document.getElementById('map'), {\n center: {\n lat: 22.451754,\n lng: 114.164387\n },\n zoom: defaultZoomLevel\n });\n model.markers.forEach(function (marker) {\n cre... | [
"0.7323835",
"0.7270853",
"0.72463936",
"0.71446145",
"0.70189357",
"0.6992802",
"0.6972206",
"0.69712347",
"0.69669515",
"0.69409823",
"0.69131714",
"0.68986726",
"0.68898875",
"0.68787456",
"0.6870806",
"0.6844252",
"0.68072796",
"0.6802365",
"0.67992234",
"0.6797496",
"0.6... | 0.8138911 | 0 |
this function loops over the array of gifs it creates a new div and gives it a class with the value of the color it also adds an event listener for a click for each card | function createDivsForGifs(gifArray) {
for (let gif of gifArray) {
// create a new div
const newDiv = document.createElement("div");
// give it a class attribute for the value we are looping over
newDiv.classList.add(gif);
// call a function handleCardClick when a div is clicked on
newDiv.ad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleCardClick(event) { \n //function to compare our gifs - this is not run until it is called down below\n function compareGifs() {\n //this takes off the last 2 items in the array\n let lastTwoClassNames = prevClassNames.splice(-2, 2);\n let lastTwoImgs = prevImgs.splice(-2, 2);\n //if t... | [
"0.73713493",
"0.72860456",
"0.71533114",
"0.70987505",
"0.7067794",
"0.7000341",
"0.6916905",
"0.68823457",
"0.686729",
"0.6833573",
"0.6821674",
"0.68133575",
"0.67722875",
"0.67624426",
"0.67609423",
"0.6760265",
"0.6758539",
"0.6724928",
"0.67146146",
"0.6710704",
"0.6709... | 0.76511043 | 0 |
function to compare our gifs this is not run until it is called down below | function compareGifs() {
//this takes off the last 2 items in the array
let lastTwoClassNames = prevClassNames.splice(-2, 2);
let lastTwoImgs = prevImgs.splice(-2, 2);
//if the class names in the array prevClassNames both match each other, then stop this function
if(lastTwoClassNames.every(item => i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imgType (mq) {\n if (mq.matches) {\n isFH = true; \n // loop through any existing gif images and changed the source accordingly \n $.each($(\".gifImg\"), function (indexInArray, valueOfElement) { \n // check state of image \n var imgState = $(this).attr(\"data... | [
"0.68838567",
"0.64994514",
"0.6420622",
"0.64168394",
"0.6323241",
"0.628868",
"0.6280043",
"0.62442607",
"0.62251776",
"0.62213475",
"0.620583",
"0.61726606",
"0.6164443",
"0.6106054",
"0.60524964",
"0.6035315",
"0.6017658",
"0.60094637",
"0.59845436",
"0.59831065",
"0.5978... | 0.7510298 | 0 |
Arrows & texts in Survival | function drawArrowSurvival(id) {
d3.select(id).selectAll("*").remove();
var width = window.innerWidth,
height = window.innerHeight;
var svg = d3.select(id).append("svg")
.attr("width", width)
.attr("height", height)
.style("background-color", "none");
/*************** text ***************... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMoveText(inversion: int) {\n\tvar tutorialObject = new GameObject();\n\tvar tutorialScript = tutorialObject.AddComponent(\"tutorial\");\n\ttutorialScript.transform.parent = tutorialFolder.transform;\n\ttutorialScript.name = \"tutorial\";\n\t\n\tif(inversion==1) {\n\t\tvar GreenButtons = Instantiate(Re... | [
"0.5392506",
"0.53231794",
"0.53023297",
"0.5256254",
"0.5181773",
"0.51395273",
"0.5098388",
"0.50710505",
"0.50655866",
"0.5060152",
"0.5040382",
"0.4990973",
"0.49849492",
"0.49813646",
"0.49786443",
"0.49189332",
"0.49183005",
"0.48829696",
"0.48519155",
"0.4849562",
"0.4... | 0.6107528 | 0 |
Arrows & texts in Mosaic | function drawArrowMosaic(id) {
d3.select(id).selectAll("*").remove();
var width = window.innerWidth,
height = window.innerHeight;
var svg = d3.select(id).append("svg")
.attr("width", width)
.attr("height", height)
.style("background-color", "none");
/******************** text ************... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function title() {\n\n push();\n imageMode(CORNER);\n image(titleImage,0,0,windowWidth,windowHeight);\n textFont(\"Times New Roman\");\n textSize(40);\n text(\"THE CODED \\nMULTIDISCIPLINARY GALLERY\",width*0.56,height*0.3);\n textSize(20);\n fill(0);\n text(\"Huyen Tran Pham\",width*0.56,height*0.6);\n ... | [
"0.5933043",
"0.5884716",
"0.5651212",
"0.5386183",
"0.5303151",
"0.52982795",
"0.5297597",
"0.52888525",
"0.52416676",
"0.52181846",
"0.52181846",
"0.51386786",
"0.5099768",
"0.5093868",
"0.5093269",
"0.5070248",
"0.5067706",
"0.5057337",
"0.50546694",
"0.5054431",
"0.505328... | 0.65496075 | 0 |
Kyle (smarter than Kenny) notes that the chance of one disaster is totally unrelated to the chance of another. Change whatHappensToday() function to create whatReallyHappensToday(). In this new function test for each disaster independently, instead of assuming exactly one disaster will happen. In other words, with this... | function whatReallyHappensToday() {
var disasterList = [];
var probV = Math.random();
var probT = Math.random();
var probE = Math.random();
var probB = Math.random();
var probM = Math.random();
if(probV < .1) {
disasterList.push("volcano");
}
if(probT < .15) {
disasterList.push("tsunami");
}
if(probE < .... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whatHappensToday()\n{\n if(Math.random() < .10)\n {\n console.log(\"Volcano\");\n }\n else if(Math.random() < .25)\n {\n console.log(\"Tsunami\");\n }\n else if(Math.random() < .45)\n {\n console.log(\"Earthquake\");\n }\n else if(Math.random() < .70)\n ... | [
"0.7124124",
"0.6948477",
"0.67502844",
"0.64645886",
"0.644446",
"0.6412381",
"0.63871306",
"0.6360583",
"0.63191956",
"0.62751853",
"0.6123786",
"0.60578465",
"0.60187405",
"0.5966319",
"0.5935633",
"0.5931142",
"0.5900738",
"0.5851019",
"0.58366275",
"0.5823409",
"0.579422... | 0.81828016 | 0 |
Function to: Convert Area of both an input and select field respectively, In acre, are, hectare, square centimetre, square foot, square inch and square metre | function area() {
let area1 = document.querySelector('#area1').value;
let area2 = document.querySelector('#area2').value;
let number3 = document.querySelector('#number3').value;
let number4 = document.querySelector('#number4').value;
let a1 = document.querySelector('#a1');
let a2 = document.querySelector('#... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function area1()\r\n{\r\n\tif(document.getElementById(\"unit_choice1\").value == 'Millimeter square')\r\n\t\t{\r\n\t\t\tarea1_mili();\r\n\t\t}\r\n\t\telse if(document.getElementById(\"unit_choice1\").value == 'Centimeter square')\r\n\t\t{\r\n\t\t\tarea1_centi();\r\n\t\t}\r\n\t\telse if(document.getElementById(\"un... | [
"0.65108895",
"0.6389132",
"0.6261295",
"0.62412846",
"0.6157844",
"0.60843605",
"0.60590386",
"0.5983903",
"0.5972536",
"0.5959429",
"0.5904052",
"0.59027493",
"0.58981663",
"0.58933437",
"0.5889928",
"0.5879049",
"0.58689576",
"0.5866034",
"0.5851052",
"0.584",
"0.57859963"... | 0.66444266 | 0 |
Function to: Convert Length of both an input and select field respectively, In millimetre, centimetre, metre, kilometre, inch, foot, yard, mile, nautical mile and mil. | function length() {
let length1 = document.querySelector('#length1').value;
let length2 = document.querySelector('#length2').value;
let number5 = document.querySelector('#number5').value;
let number6 = document.querySelector('#number6').value;
let l1 = document.querySelector('#l1');
let l2 = document.queryS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lengthConverter(source, val) {\n val = parseFloat(val);\n const inputMM = document.getElementById(\"inputMM\");\n const inputCM = document.getElementById(\"inputCM\");\n const inputM = document.getElementById(\"inputM\");\n const inputKM = document.getElementById(\"inputKM\");\n if (sour... | [
"0.7440335",
"0.6479733",
"0.62919277",
"0.60019636",
"0.5945859",
"0.59364307",
"0.5902121",
"0.5810735",
"0.57813394",
"0.5775421",
"0.572361",
"0.57185185",
"0.5710336",
"0.5691401",
"0.5650522",
"0.563562",
"0.56193745",
"0.56063247",
"0.5576135",
"0.5564385",
"0.5554327"... | 0.65137213 | 1 |
Function to: Convert Volume of both an input and select field respectively, In Gallon(US), Gallon(UK), Litre, Millilitre, Cubic centimetre, Cubic metre, Cubic inch and Cubic foot. | function volume() {
let volume1 = document.querySelector('#volume1').value;
let volume2 = document.querySelector('#volume2').value;
let number7 = document.querySelector('#number7').value;
let number8 = document.querySelector('#number8').value;
let v1 = document.querySelector('#v1');
let v2 = document.queryS... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertKg() {\n if (dropdown.value === 'pounds') {\n let weight = inputWeight.value;\n weight = (weight/2.2).toFixed(2)\n output.innerHTML = `${(weight)} kilograms`\n }\n if(dropdown.value ==='kg') {\n let weight = inputWeight.value;\n weight = (weight*2.2).toFi... | [
"0.68932325",
"0.64586395",
"0.62665313",
"0.6262426",
"0.6248041",
"0.62196213",
"0.6160559",
"0.6159115",
"0.61394286",
"0.61120194",
"0.610697",
"0.6106194",
"0.60706687",
"0.604081",
"0.60245955",
"0.595941",
"0.5947516",
"0.5941338",
"0.59041065",
"0.5861589",
"0.5855340... | 0.6887563 | 1 |
Function to: Convert Mass of both an input and select field respectively, In Ton, Ton(UK), Ton(US), Pound, Ounce, Kilogram and Gram. | function mass() {
let mass1 = document.querySelector('#mass1').value;
let mass2 = document.querySelector('#mass2').value;
let number9 = document.querySelector('#number9').value;
let number10 = document.querySelector('#number10').value;
let m1 = document.querySelector('#m1');
let m2 = document.querySelector(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function KmtoAll() {\r\n const Kmval = parseFloat(inputKilometer.value);\r\n const Hmval = Kmval * 10;\r\n const Damval = Kmval * 100;\r\n const Mval = Kmval * 1000;\r\n const Dmval = Kmval * 10000;\r\n const Cmval = Kmval * 100000;\r\n const Mmval = Kmval * 1000000;\r\n inputHectometer.val... | [
"0.6134209",
"0.6113179",
"0.61018246",
"0.59592134",
"0.5891011",
"0.5838199",
"0.583523",
"0.58315885",
"0.58278257",
"0.57952136",
"0.57436806",
"0.5697952",
"0.56706965",
"0.5599147",
"0.55180794",
"0.55139494",
"0.54781574",
"0.5450734",
"0.54403347",
"0.5410485",
"0.540... | 0.62435937 | 0 |
Should using most recent car data for California to Calculate the trip cost | function getTripCost (length, carData, time) {
//cpg =: cost per gallon
var cpg = null;
(carData['fuelType']);
var metersToMiles = function(length){
return length / 1609.34;
}
var com_mpg = +carData["Epa Combined Mpg"] ;
var city_mpg = +carData["Epa City Mpg"] ;
var high_mpg = +carData["Epa Highw... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcTransportationCost(flightsPerYear, busMilesPerDay,\n trainMilesPerDay, carMilesPerDay,\n carMilesPerGallon) {\n let averageFlightDistanceMiles = 3000; // 3000 miles being the medium haul flight limit based on https://en.wikipedia.org/wik... | [
"0.67887825",
"0.616396",
"0.614407",
"0.6094872",
"0.6058516",
"0.6029038",
"0.60235673",
"0.6007812",
"0.59823835",
"0.59815145",
"0.5969748",
"0.5904598",
"0.5862254",
"0.5851282",
"0.58166486",
"0.5816389",
"0.5811665",
"0.58106875",
"0.5807029",
"0.5783529",
"0.5781079",... | 0.6859435 | 0 |
Here we are using the same logic of counting in both the components. We are duplicating the code. We can use the concept of LIFTING THE STATE UP but that is only possible in the current scenario where ButtonCounter and HoverCounter have same parent Example But in other scenario where the components may not have the sam... | function Example() {
return (
<div>
<ButtonCounter />
<br />
<HoverCounter />
</div>
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Counter(props) {\n const count = props.parentCount;\n const setCount = props.parentSetCount;\n /* const [count, setCount] = useState(0); */ /* stateArray has two elements: stateArray[0] is the value we store, stateArray[1] is the function that we use to change the value \n it can the be destru... | [
"0.6973765",
"0.6894091",
"0.6801001",
"0.678876",
"0.675476",
"0.67252487",
"0.66865134",
"0.66388065",
"0.6595614",
"0.65876096",
"0.65853024",
"0.6569971",
"0.65233666",
"0.6485844",
"0.6483722",
"0.64820516",
"0.6445651",
"0.6429833",
"0.64071256",
"0.6387333",
"0.6327409... | 0.7710295 | 0 |
functions for transforming opinion(s) to Html code | function opinion2html(opinion) {
//in the case of Mustache, we must prepare data beforehand:
opinion.createdDate = new Date(opinion.created).toDateString();
//get the template:
const template = document.getElementById("mTmplOneOpinion").innerHTML;
//use the Mustache:
//const htmlWOp = Mustache.rende... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verse1() {\n let output = ''\n output = '<p>In the heart of Holy See</p>' +\n '<p>In the home of Christianity</p>' +\n '<p>The Seat of power is in danger</p>'\n\n return output\n}",
"toHTML ( theMode, sigDigs , params) {}",
"function OLover2HTMLshow(quo){\r\r\n var so=OLoverHTML... | [
"0.6306691",
"0.6161154",
"0.59423804",
"0.59075797",
"0.58257955",
"0.5784069",
"0.5768201",
"0.57210326",
"0.57195795",
"0.56941193",
"0.56693196",
"0.5649801",
"0.561515",
"0.5606914",
"0.5604092",
"0.5603173",
"0.5572509",
"0.5561534",
"0.5554751",
"0.5542017",
"0.5518682... | 0.63442564 | 0 |
swagger_pointname: the endpoint of swagger (for specifying the schema within the swagger2 file) Uses Swagger v2 swagger_pointname example: '/businesscurrentaccounts', | function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) {
let swaggerjson = swagger_filecontent;
// validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname);
// let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses', '200',... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n super();\n this.name = 'serverless-plugin-swagger-endpoints';\n }",
"function hello(req, res) {\n // variables defined in the Swagger document can be referenced using req.swagger.params.{parameter_name}\n //var name = req.swagger.params.name.value || 'stranger';\n\n}",
"onSwagg... | [
"0.6110735",
"0.5859485",
"0.5848763",
"0.56770724",
"0.5558211",
"0.55102384",
"0.5417477",
"0.52908945",
"0.5237259",
"0.52311194",
"0.52173626",
"0.517776",
"0.5167958",
"0.51644236",
"0.5094158",
"0.5092385",
"0.5081248",
"0.5066106",
"0.498042",
"0.49226943",
"0.49119768... | 0.630345 | 0 |
old interface: Schema_from_swagger_yaml(require('./wellknown.swagger.yaml')); Schema_from_swagger_yaml(yaml_file_content) | function Schema_from_swagger(schema_content) {
'use strict';
// use new
this.resolve = (input_json_obj) => {
//const schema = getSwaggerV2Schema(schema_content, '/default_endpoint')
const schema = schema_content;
const ok = schemaValidator(schema, input_json_obj);
if (ok) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSwaggerV2Schema(swagger_filecontent, swagger_pointname) {\n\n let swaggerjson = swagger_filecontent;\n // validate_data_static(swagger_pointname, ()=>'swagger_pointname missing: '+swagger_pointname);\n // let schema = lookupPathInJson(swaggerjson, ['paths', swagger_pointname, 'get', 'responses... | [
"0.6788131",
"0.6291001",
"0.627871",
"0.6187575",
"0.6134092",
"0.5878334",
"0.5633782",
"0.5613062",
"0.5537598",
"0.5500399",
"0.54908156",
"0.5447068",
"0.5434033",
"0.5412732",
"0.5399147",
"0.5391997",
"0.5381167",
"0.53721017",
"0.5370661",
"0.53672606",
"0.5301931",
... | 0.7307377 | 0 |
grafana will call this function and pass a callback function. execute the callback with your dashboard once it's ready | function asyncGraph(callback) {
var dashboard = {};
window.setTimeout(function() {
callback(dashboard);
}, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callback(){\n console.log(\"Charts Data Executed\");\n}",
"function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}",
"function onWidgetInitialized(dashboard, args) {\n //\tHooking to ready/destroyed events\n ... | [
"0.66811186",
"0.58476686",
"0.5845754",
"0.5784398",
"0.567192",
"0.5643497",
"0.5628917",
"0.5628917",
"0.5628917",
"0.5628917",
"0.5628917",
"0.55949146",
"0.5519947",
"0.5493057",
"0.54734033",
"0.5454622",
"0.5405336",
"0.53836596",
"0.53830934",
"0.53577733",
"0.5350956... | 0.6254712 | 1 |
reset the key file in the beginning of every month | function resetKeyFile(){
startTime = new Date();
var month = startTime.getMonth() + 1;
var year = startTime.getFullYear();
var date = startTime.getDate();
if((month > keyInfo.updateMonth || year > keyInfo.updateYear) && date >1 ){
console.log("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetFile() {\n fs.writeFileSync(DATASTORE_FILENAME, JSON.stringify({\n 'users': {},\n 'notifications': {}\n }))\n}",
"function resetWkbk() {\n workbook.revertAllAsync();\n }",
"async reset () {\n let keys = await this.client.zRange(this.ZSET_KEY, 0, -1);\n await this.s... | [
"0.58668953",
"0.561359",
"0.5587326",
"0.5567813",
"0.5566154",
"0.5477541",
"0.5417211",
"0.54039294",
"0.5378549",
"0.53601503",
"0.5350594",
"0.53137445",
"0.5281797",
"0.5107134",
"0.50998724",
"0.508927",
"0.5067068",
"0.5057745",
"0.5057745",
"0.50276",
"0.5025315",
... | 0.8331846 | 0 |
Checks the currently focused element of the document and will enter insert mode if that element is focusable. | function enterInsertModeIfElementIsFocused() {
// Enter insert mode automatically if there's already a text box focused.
// TODO(philc): Consider using document.activeElement here instead.
var focusNode = window.getSelection().focusNode;
var focusOffset = window.getSelection().focusOffset;
if (focusNode && fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"if (!node.contains(document.activeElement)) {\n node.focus();\n }",
"hasFocus() {\n if (ie) {\n let node = this.root.activeElement;\n if (node == this.dom)\n return true;\n if (!node || !this.dom.contains(node))\n return false;\n while (node && this.dom != node && thi... | [
"0.6649512",
"0.64950323",
"0.6388412",
"0.6388412",
"0.6388412",
"0.6388412",
"0.6388412",
"0.6388412",
"0.6388412",
"0.6274966",
"0.62441874",
"0.6206417",
"0.620398",
"0.6192266",
"0.6175595",
"0.6147924",
"0.6128395",
"0.6114575",
"0.61063015",
"0.60964894",
"0.60964894",... | 0.8227385 | 0 |
Asks the background page to persist the zoom level for the given domain to localStorage. | function saveZoomLevel(domain, zoomLevel) {
if (!saveZoomLevelPort)
saveZoomLevelPort = chrome.extension.connect({ name: "saveZoomLevel" });
saveZoomLevelPort.postMessage({ domain: domain, zoomLevel: zoomLevel });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restoreOptions(){\r\n chrome.storage.local.get({\r\n zoomFactor: 1.0\r\n }, function(items){\r\n document.getElementById('zoom-factor').value = parseFloat(items.zoomFactor.toFixed(2));\r\n document.getElementById(\"zoom-percentage\").innerHTML = Math.round(items.zoomFactor * 100... | [
"0.6347569",
"0.60518104",
"0.589043",
"0.5695572",
"0.56647485",
"0.5611295",
"0.5580931",
"0.5572764",
"0.5561502",
"0.5559303",
"0.5553714",
"0.55410075",
"0.54979324",
"0.5477195",
"0.5449793",
"0.54494435",
"0.5441498",
"0.5437589",
"0.54327095",
"0.5404099",
"0.5399655"... | 0.7473462 | 0 |
Returns true if the element is focusable. This includes embeds like Flash, which steal the keybaord focus. | function isFocusable(element) { return isInputOrText(element) || element.tagName == "EMBED"; } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function focusable(element) {\n\t\t\t\t\t// Use the defined focusable checker when possible\n\t\t\t\t\tif ($.expr[':'].focusable) {\n\t\t\t\t\t\treturn $.expr[':'].focusable;\n\t\t\t\t\t}\n\t\n\t\t\t\t\tvar isTabIndexNotNaN = !isNaN($.attr(element, 'tabindex')),\n\t\t\t\t\t nodeName = element.nodeName && elemen... | [
"0.77805924",
"0.77609503",
"0.7703886",
"0.7479171",
"0.74658275",
"0.732273",
"0.7255446",
"0.7227287",
"0.72002697",
"0.71984595",
"0.71633047",
"0.71633047",
"0.71633047",
"0.71633047",
"0.7161074",
"0.7154766",
"0.7136588",
"0.7121359",
"0.7070783",
"0.7070783",
"0.70707... | 0.84320706 | 0 |
Sets the clicked on button in top nav to active | function setNavActive() {
$('.nav-a.active').toggleClass('active');
$(this).toggleClass('active');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleActive() {\n // On first render\n if (element.find(\"a\").attr(\"href\").indexOf($location.path()) >= 0) {\n element.addClass(\"active\");\n }\n else {\n element.removeClass(\"active\");\n }\n }",
"function... | [
"0.6968783",
"0.6938113",
"0.68505067",
"0.6844241",
"0.6789033",
"0.6783069",
"0.6775138",
"0.67592806",
"0.66775686",
"0.6647133",
"0.6647133",
"0.6636395",
"0.6616018",
"0.65706956",
"0.65584445",
"0.6557393",
"0.6556527",
"0.65522313",
"0.6543197",
"0.6541593",
"0.6526025... | 0.7003854 | 0 |
Sets selected menu item to active | function setMenuActive() {
$('.menu-li.active').toggleClass('active');
$(this).toggleClass('active');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCurrentMenuItem() {\n var activePageId = $('.page.active').attr('id');\n // set default nav menu\n $('.vs-nav a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');\n }",
"setActive(menuItem) {\n if (this.activeItem =... | [
"0.76044244",
"0.7429572",
"0.7429572",
"0.7259269",
"0.70615494",
"0.7054481",
"0.7020118",
"0.6979382",
"0.69325376",
"0.6882961",
"0.6882961",
"0.6882961",
"0.68644553",
"0.68334115",
"0.6811759",
"0.6799273",
"0.6761201",
"0.6716108",
"0.67077816",
"0.6668017",
"0.6642498... | 0.7510343 | 1 |
Removes any additional added changes to menu and sets menu to right | function setMenuRight() {
removeMenuChanges();
$('.menu').addClass('menu-right');
$('.window').addClass('window-menu-right');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeMenuChanges() {\n let menu = document.getElementById('resizable');\n\n if (menu.style.right) {\n menu.style.right = null;\n }\n if (menu.style.left) {\n menu.style.left = null;\n }\n\n $('.menu').removeClass('menu-left');\n $('.menu').removeClass('menu-right');\n $(... | [
"0.7147932",
"0.7004216",
"0.6714349",
"0.6509055",
"0.64456993",
"0.640683",
"0.6341509",
"0.6341391",
"0.6314558",
"0.6283051",
"0.6283051",
"0.6283051",
"0.62635094",
"0.6233958",
"0.6103202",
"0.607581",
"0.6064757",
"0.6061353",
"0.60591567",
"0.60373396",
"0.60236144",
... | 0.8001773 | 0 |
Removes any prior added changes to the menu due to resizing or nav selection | function removeMenuChanges() {
let menu = document.getElementById('resizable');
if (menu.style.right) {
menu.style.right = null;
}
if (menu.style.left) {
menu.style.left = null;
}
$('.menu').removeClass('menu-left');
$('.menu').removeClass('menu-right');
$('.window').remove... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span>... | [
"0.66702044",
"0.66484255",
"0.6647768",
"0.66096056",
"0.66072303",
"0.6554772",
"0.65308267",
"0.6492136",
"0.6454294",
"0.6343421",
"0.6317668",
"0.630887",
"0.6273935",
"0.6241688",
"0.6180856",
"0.6145567",
"0.6072706",
"0.6031134",
"0.6022506",
"0.6005267",
"0.6003781",... | 0.7978572 | 0 |
Sets menu to left side | function setMenuLeft() {
removeMenuChanges();
$('.menu').addClass('menu-left');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showOnLeftSubMenu() {\r\n\t\t\t\r\n\t\t\t// Show on left class for minimal styling.\r\n\t\t\t$('#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul').each(function () {\r\n\t\t\t\t\r\n\t\t\t\t$(this).removeClass('on-left-side');\r\n\t\t\t\t\r\n\t\t\t\tif ($(this).offset().left + $(this).outerWidth()... | [
"0.739949",
"0.7246403",
"0.7057252",
"0.7042962",
"0.695572",
"0.695572",
"0.695572",
"0.6851523",
"0.67294085",
"0.6717853",
"0.6677837",
"0.66075015",
"0.65854055",
"0.6577361",
"0.6538951",
"0.6534131",
"0.65103406",
"0.6505403",
"0.65028065",
"0.64169276",
"0.6393186",
... | 0.8560616 | 0 |
MENU BOTTOM Hides side menu | function hideSideMenu() {
$('.menu').addClass('hidden');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideOrShowMenus(){\n\tresizeSidebar(\"menu\");\n}",
"function disableMenu()\r\n{\r\n\tif (typeof top.menu == \"undefined\" && typeof top.menu.divContain == \"undefined\")\r\n\t\treturn -1;\r\n\ttop.menu.divContain.style.visibility = \"visible\";\r\n\treturn 0;\r\n}",
"function menuHide() {\n ui.lan... | [
"0.6851475",
"0.6823965",
"0.6640691",
"0.6632173",
"0.6527594",
"0.64515966",
"0.6439914",
"0.6384937",
"0.6383023",
"0.6374779",
"0.63484186",
"0.63368857",
"0.6255914",
"0.6218215",
"0.62005925",
"0.61936975",
"0.6181428",
"0.61752415",
"0.61665326",
"0.61537594",
"0.61384... | 0.69680154 | 0 |
add any needed code to ensure that the smurfs collection exists on state and it has data coming from the server Notice what your map function is looping over and returning inside of Smurfs. You'll need to make sure you have the right properties on state and pass them down to props. | componentDidMount() {
this.getSmurfs()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n this.props.getSmurfs();\n }",
"FetchSmurfs() {\n axios\n .get(`${baseUrl}`)\n .then(res => {\n this.setState({ smurfs: res.data });\n })\n .catch(err => {\n console.log(console.log(err));\n this.setState({ errorMessage: err.statusText });\n ... | [
"0.63221604",
"0.6131576",
"0.59023124",
"0.5834316",
"0.5821248",
"0.57196486",
"0.5716349",
"0.5657892",
"0.56429493",
"0.56177115",
"0.55641407",
"0.5518442",
"0.549542",
"0.5489891",
"0.548708",
"0.5474417",
"0.54593337",
"0.5457613",
"0.54330695",
"0.5429547",
"0.5425852... | 0.629228 | 1 |
START Fill Applicant Publications | function ApplicantPublications_GenerateButton(){
var clickEvent = function (e) {
ApplicantPublications_FillForm();
}
var inputBootstrap = createBootstrapButtonElement('GM Fill Form', 'NEWPortal_ApplicantExperience_FillButton');
inputBootstrap.onclick = clickEvent;
insertAfter(document.getElementById('save'), i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function takeSelectedApplicant() {\n\tofferToApplicant = getURLParameter(\"AID\");\n\n\tvar username = tmpApplicantUserName; // wird in function\n\t// markOfferSelected(id)\n\t// initialisiert\n\n\t// alert(\"username: \"+username);\n\n\tconnect(\"/hiwi/Provider/js/takeSelectedApplicant\", \"aid=\"\n\t\t\t+ offerT... | [
"0.5320105",
"0.52702105",
"0.5175638",
"0.51134676",
"0.51078737",
"0.50882065",
"0.5069123",
"0.50587296",
"0.50564486",
"0.5038789",
"0.5028549",
"0.5018491",
"0.5016163",
"0.49958947",
"0.49903733",
"0.49903733",
"0.49795118",
"0.49791926",
"0.49716425",
"0.49691746",
"0.... | 0.55660033 | 0 |
ShiftRegister Constructor size: the size of the register (size of the array). | function ShiftRegister(size) {
var self = this;
if(!(self instanceof ShiftRegister)){ return new ShiftRegister(size); }
self.register = [];
for(var i=0; i<size; i++){
self.register.push("*");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gen_op_neon_rshl_s8()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s8});\n}",
"set size(value) {}",
"function Stack(size) {\n this.array = new Array(size);\n this.index = 0;\n this.size = size;\n}",
"function gen_op_neon_rshl_s64()\n{\n gen_opc_ptr.push({func:op_neon_rshl_s64});\n}",
"functio... | [
"0.49744785",
"0.48931238",
"0.48767668",
"0.4842523",
"0.4811722",
"0.47866863",
"0.47811702",
"0.4776734",
"0.476981",
"0.4703187",
"0.46999106",
"0.46663585",
"0.46489987",
"0.4638917",
"0.46156093",
"0.45934215",
"0.45885175",
"0.45855165",
"0.4582117",
"0.45732978",
"0.4... | 0.77090603 | 0 |
Node Constructor label: a string for simple Node with no children or an object from which the root node of the tree will be derived provided lfn and cfn label and callbacck functions provided. lfn: the label callback function, which must return a string label. Ignored if label is a string cfn: the children callback fun... | function Node(label, lfn, cfn){
var self = this;
if(!(self instanceof Node)){ return new Node(label, lfn, cfn); }
if(typeof label === 'string' && label.length > 0){
self.tedlabel = label;
self.tedchildren = [];
}else if(typeof label === 'object' && !! lfn && ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Tree(label, left, right) {\n this.label = label;\n this.left = left;\n this.right = right;\n}",
"function NodeLabels (view)\r\n{\r\n if (arguments.length > 0) {\r\n\tthis.init(view);\r\n }\r\n}",
"function componentLabeledNode () {\n\n /* Default Properties */\n var color = \"st... | [
"0.5902229",
"0.58443695",
"0.5790681",
"0.5682147",
"0.56478506",
"0.5490255",
"0.5396654",
"0.53645897",
"0.5319086",
"0.5309116",
"0.5309116",
"0.5309116",
"0.5309116",
"0.53013283",
"0.5296153",
"0.52926195",
"0.52926195",
"0.52858377",
"0.5273435",
"0.5257659",
"0.524771... | 0.8305698 | 0 |
Profile Constructor root: the root Node p: the p value in the PQGram algorithm q: the q value in the PQGram algorithm | function Profile(root, p, q){
var self = this;
if(!(self instanceof Profile)){ return new Profile(root, p, q); }
p = p || 2;
q = q || 3;
var ancestors = new ShiftRegister(p);
self.list = [];
self.profile(root, p, q, ancestors);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tree_init(q) {\n\n // create tree object\n var tree = {};\n\n // initialize with vertex for given configuration\n tree.vertices = [];\n tree.vertices[0] = {};\n tree.vertices[0].vertex = q;\n tree.vertices[0].edges = [];\n\n // create rendering geometry for base location of vertex ... | [
"0.60794765",
"0.57156295",
"0.55959386",
"0.55622625",
"0.5356073",
"0.5319002",
"0.5309989",
"0.52788013",
"0.52269065",
"0.52200717",
"0.520604",
"0.5194858",
"0.515756",
"0.51566315",
"0.51359355",
"0.5121302",
"0.5121302",
"0.5121302",
"0.5074427",
"0.498923",
"0.4982330... | 0.6848942 | 0 |
Passing to joke to Speech RSS API | function tellMeTheJoke(joke){
VoiceRSS.speech({
key: myApiKey,
src: joke,
hl: 'en-us',
v: 'Linda',
r: 0,
c: 'mp3',
f: '44khz_16bit_stereo',
ssml: false
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tellJoke(){\n VoiceRSS.speech({\n key: ttsKey,\n src: ttsText,\n hl: 'en-au',\n v: 'Isla',\n r: 0, \n c: 'mp3',\n f: '44khz_16bit_stereo',\n ssml: false \n });\n}",
"function tellMe(joke) {\n console.log(\"tell me:\", joke);\n VoiceRSS.spee... | [
"0.6840803",
"0.66703016",
"0.6548111",
"0.5944141",
"0.58900213",
"0.5836894",
"0.5807144",
"0.5767292",
"0.57666403",
"0.5684609",
"0.56813335",
"0.56622195",
"0.56609184",
"0.5648582",
"0.56401145",
"0.56367505",
"0.5625478",
"0.5609449",
"0.55985266",
"0.5562859",
"0.5534... | 0.6842132 | 0 |
will only return renderComponent() if user and project in state are not empty | render() {
return this.state.user && this.state.project ? (this.renderComponent()) : (null)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n const { user, isLoading } = this.props.auth;\n\n if (isLoading) {\n return <h2>Loading...</h2>;\n }\n // If not logged in, or not an admin\n else if (!user || !user.admin) {\n return <h2>Access Denied</h2>\n }\n // If an admin, loa... | [
"0.69052917",
"0.6794691",
"0.65550876",
"0.65221965",
"0.6459171",
"0.64046776",
"0.63583696",
"0.62141234",
"0.6169709",
"0.61350214",
"0.60774046",
"0.60668135",
"0.6029844",
"0.6024428",
"0.60036284",
"0.60029817",
"0.6000732",
"0.5994649",
"0.5980764",
"0.5979243",
"0.59... | 0.8589135 | 0 |
easily recognized function that performs ajax request to yelp | function updateYelpResults() {
yelpAjax(searchFor(), searchNear()); // get all the needed info
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function yelpAjax(searchFor, searchNear) {\n\n /*\n *\tKeys and other tokens needed to access the Yelp API via OAuth\n *\tIn a non-Udacious scenario this would have to be moved\n * to a server side script and therefore actually be \"secret\"\n */\n\n var auth = {\n consumerKey: \"2M-JW... | [
"0.80259824",
"0.7259638",
"0.71454036",
"0.7136725",
"0.6946509",
"0.6932895",
"0.6802767",
"0.67177415",
"0.667314",
"0.6638775",
"0.6633248",
"0.6614379",
"0.6594534",
"0.65781236",
"0.65308106",
"0.6443712",
"0.6391026",
"0.6384631",
"0.63841033",
"0.63374674",
"0.6321644... | 0.73869216 | 1 |
Handles changing mapShift vars in responsive manner using matchMedia | function reformatOnSize() {
if (window.matchMedia("(min-width: 680px)").matches) { // for "big" screen
mapShift = {
right: 0.08,
up: 0.04
};
scrollAdjustment = 0;
map.setZoom(12);
$('#map').removeClass("fixed");
} else if (window.matchMedia("(orien... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setMapWidth() {\n\t\tlet windowWidth = window.innerWidth;\n\t\tswitch(true) {\n\t\t\tcase windowWidth >= 1200:\n\t\t\t\tthis.mapWidth = 950;\n\t\t\t\tthis.scale = 950;\n\t\t\t\treturn;\n\t\t\tcase windowWidth >= 992:\n\t\t\t\tthis.mapWidth = 850;\n\t\t\t\tthis.scale = 850;\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\... | [
"0.6471649",
"0.6148041",
"0.6101379",
"0.601778",
"0.57190514",
"0.5696023",
"0.56730974",
"0.56509477",
"0.56487",
"0.56459767",
"0.5623758",
"0.56216943",
"0.55983377",
"0.5597752",
"0.5582185",
"0.55764437",
"0.55618364",
"0.5555578",
"0.55130863",
"0.5501862",
"0.5493917... | 0.61953574 | 1 |
the magical helper function (no longer necessary in GSAP 3.3.1 because it was added as ScrollTrigger.batch())... | function batch(targets, vars) {
let varsCopy = {},
interval = vars.interval || 0.1,
proxyCallback = (type, callback) => {
let batch = [],
delay = gsap.delayedCall(interval, () => {callback(batch); batch.length = 0;}).pause();
return sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function throttledScrollEvents() {\n\n }",
"function onScroll() {\r\n requestTick();\r\n}",
"get [scrollTarget]() {\n return this[ids].grippedContent;\n }",
"function mkdOnWindowScroll() {\n \n }",
"OnBatchModified() { this.Trigger(\"BatchModified\", new tp.DataTableEventArgs()); }",
... | [
"0.63193184",
"0.6062122",
"0.6035587",
"0.5993228",
"0.59437275",
"0.59001255",
"0.59001255",
"0.58774984",
"0.58774984",
"0.58609354",
"0.58545446",
"0.58199054",
"0.58199054",
"0.58199054",
"0.58199054",
"0.58199054",
"0.58127123",
"0.58052737",
"0.5772822",
"0.5761358",
"... | 0.66137916 | 0 |
In order to reveal, we need to hide the items intitally. Hence, hideInitially | hideInitially() {
this.itemsToReveal.addClass("reveal-item");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hideInitially() {\n this.itemsToReveal.addClass('reveal-item');\n }",
"hideInitially() { \n this.itemsToReveal.addClass(\"reveal-item\");\n }",
"hideInitially() {\n \tthis.itemsToReveal.addClass(\"reveal-item\"); \n }",
"hideOffscreenElements() {\n const startIndex = Math.floor(-(t... | [
"0.8195007",
"0.810957",
"0.810708",
"0.6901322",
"0.6866264",
"0.67496663",
"0.67422456",
"0.67120814",
"0.6707221",
"0.666634",
"0.66180766",
"0.6616379",
"0.6606463",
"0.66037613",
"0.6603125",
"0.6598453",
"0.65854293",
"0.65812165",
"0.6576137",
"0.65582377",
"0.65582377... | 0.8259329 | 0 |
Service (business) methods for managing Configuration objects | function ConfigurationService(repository) {
this._repository = repository;
//
//Expose CRUD operations from the repository
// (except for 'save' which is extended)
var methods = ['find', 'findById', 'count', 'remove'];
methods.forEach(function(name) {
this[name] = function() {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"configure(config) {\n this._connectionResolver.configure(config);\n this._maxKeySize = config.getAsIntegerWithDefault('options.max_key_size', this._maxKeySize);\n this._maxExpiration = config.getAsLongWithDefault('options.max_expiration', this._maxExpiration);\n this._maxValue = config.... | [
"0.61953366",
"0.61824375",
"0.6179578",
"0.61625993",
"0.61218184",
"0.6116961",
"0.61028445",
"0.6094872",
"0.6082392",
"0.6071588",
"0.601267",
"0.595566",
"0.5953155",
"0.5927944",
"0.59223247",
"0.59223247",
"0.5870329",
"0.58645236",
"0.5831196",
"0.5827349",
"0.5814776... | 0.6203163 | 0 |
true Write a function that can add a 'check digit' to make an invalid number, a valid luhn number. input: string output: string + one char algorithm: first check if already a luhn number. Return string if true. IF not: append 0 and return luhnRemainder function. Subtract remainder from 10 use that number as the check. | function addCheck(string) {
var check, remainder;
if (luhn(string)) return string;
remainder = luhnRemainder(string + '0');
check = 10 - remainder;
return string + check;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeValidLuhn(string) {\n if (typeof string !== 'string' || (!string)) return false;\n\n if (luhn(string)) return string;\n string = string.replace(/\\D/g, '');\n string += '0';\n\n while (!luhn(string)) {\n string = string.split('').map(Number);\n string[string.length - 1] += 1;\n string = ... | [
"0.7908186",
"0.78932077",
"0.77553475",
"0.7624451",
"0.7589165",
"0.75804675",
"0.747386",
"0.73762405",
"0.7339043",
"0.7315871",
"0.7314682",
"0.72844744",
"0.72812366",
"0.72812366",
"0.7256185",
"0.71417147",
"0.7120658",
"0.71036524",
"0.70523024",
"0.66744727",
"0.662... | 0.84438974 | 0 |
1 2 3 4 e a 5 1 5 6 7 8 > f b 6 2 a b c d > g c 7 3 e f g h h d 8 4 1(0,0) < e(3,0) < h(3,3) < 4(0,3) 2(0,1) < a(2,0) < g(3,2) < 8(1,3) Solution: Do it layer by layer. For each pixel in the layer, rotate 4 together each iteration. | function rotate(matrix) {
let n = matrix.length;
// iterate through layers (aka the squares). There're 2 in a 4x4 matrix
for (let x = 0; x < n/2; x++) {
// need to -1 because we don't need to rotate element at y=n-x. It's rotated with y=x
for (let y = x; y < n - x - 1; y++) {
let top = matrix[x][y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotateImage(a) { \n let len = a.length\n for (i = 0; i < len; i++, len--) { \n let end = len - 1; \n for ( j = i; j < end; j++) { \n let tail = a.length - j - 1; \n\n let temp = a[i][j]; \n a[i][j] = a[tail][i]; \n a[tail][i] = a[end][tail]; \n a[end][tail] =... | [
"0.70343316",
"0.651586",
"0.6397351",
"0.6237829",
"0.6226968",
"0.6163556",
"0.61477894",
"0.6134421",
"0.61145854",
"0.60882944",
"0.60759276",
"0.60710603",
"0.60678595",
"0.606537",
"0.6027852",
"0.6010915",
"0.59576553",
"0.58569235",
"0.5853839",
"0.5814309",
"0.580789... | 0.65559876 | 1 |
Function to initilaze completion store | function initializeStore({ completions }) {
const { completionStore } = self;
let generatedCompletions = [];
if (completions && completions.length) {
for (var i = 0; i < completions.length; i++) {
const itemOfCompletion = completions[i];
/**
* If user skip task... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeStore({ completions, predictions }) {\n const cs = self.completionStore;\n cs.initRoot(self.config);\n\n // eslint breaks on some optional chaining https://github.com/eslint/eslint/issues/12822\n /* eslint-disable no-unused-expressions */\n predictions?.forEach(p => {\n ... | [
"0.6746584",
"0.6413835",
"0.6200534",
"0.5876315",
"0.58358663",
"0.58286315",
"0.58186936",
"0.5818093",
"0.5818093",
"0.5805773",
"0.56839013",
"0.56818384",
"0.56811106",
"0.56766653",
"0.5661163",
"0.5655732",
"0.5649185",
"0.56266135",
"0.56047136",
"0.56047136",
"0.558... | 0.79691344 | 0 |
This is the function to allow the player to type in the selected cell | function writeCell(event) {
// Starts the timer once the player types their first entry
startTimer();
// Allows the player to delete their entries with backspace and keeps the player from inputing extraneous keys like the letter keys
if (event.key == "Backspace") {
selectedCell.textContent = "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectCell() {\n let highlighting = false;\n\n // Allow player to place a token in a cell.\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.highlight !== null) {\n highlighting = true;\n cell.highlight = null;\n cell.owner = playerTurn;\n\n if (c... | [
"0.65119404",
"0.6465278",
"0.6291497",
"0.6275184",
"0.6210165",
"0.6157138",
"0.614593",
"0.6003313",
"0.5975697",
"0.5974436",
"0.5893369",
"0.5876473",
"0.586638",
"0.58629787",
"0.5849246",
"0.58461416",
"0.5831539",
"0.58177626",
"0.5804896",
"0.5764776",
"0.57490695",
... | 0.67068934 | 0 |
Will retrieve all features (it's directory) inside the folder features. | _fetchModules(){
var directories = fs.readdirSync('./features/');
for (let directory of directories){
if (!directory.includes('.')) { //means is a directory
this._requireModules('./features/' + directory, directory);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFeatures() {\n let filesGlob = 'e2e/features/**/*.feature';\n let files = glob.sync(filesGlob);\n return _.sortedUniq(files);\n }",
"function Features(baseUrl, path) {\n if (path === void 0) { path = \"features\"; }\n return _super.call(this, baseUrl, path) || this;\n }",
"async f... | [
"0.6948308",
"0.6406881",
"0.59143454",
"0.5875625",
"0.5875625",
"0.584231",
"0.5812367",
"0.5620149",
"0.55529916",
"0.5527651",
"0.5497239",
"0.5496281",
"0.5475285",
"0.5438347",
"0.5433545",
"0.54192626",
"0.5404455",
"0.53642446",
"0.53452283",
"0.5341213",
"0.5338877",... | 0.66896826 | 1 |
extract score from the RT page by parsing the responseText as a document | function parse_score_from_page(resp) {
var parser = new DOMParser();
var doc = parser.parseFromString(resp, "text/html");
score = doc.getElementsByClassName(score_class_name);
alert(score[0].innerText);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function regex_score_from_page(resp) {\n var reg = /<span class=\"meter-value superPageFontColor\"><span>([0-9]+)<\\/span>%<\\/span>/;\n matches = resp.match(reg);\n if (matches) {\n // something was read\n return matches[1];\n } else {\n return null;\n }\n}",
"function parseR... | [
"0.6602257",
"0.5934881",
"0.58977073",
"0.58546126",
"0.5853684",
"0.57777536",
"0.5749384",
"0.5618302",
"0.5531622",
"0.55277014",
"0.5490527",
"0.54724354",
"0.5417775",
"0.5382771",
"0.53827345",
"0.5369796",
"0.5356507",
"0.5337116",
"0.53354067",
"0.5303587",
"0.526821... | 0.7336652 | 0 |
extract score from the RT page by using a regex directly on the responseText string | function regex_score_from_page(resp) {
var reg = /<span class="meter-value superPageFontColor"><span>([0-9]+)<\/span>%<\/span>/;
matches = resp.match(reg);
if (matches) {
// something was read
return matches[1];
} else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_score_from_page(resp) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(resp, \"text/html\");\n score = doc.getElementsByClassName(score_class_name);\n alert(score[0].innerText);\n}",
"function cb(err,response,html){\n if(err){\n console.log(\"Error: \"+err);\n ... | [
"0.6781171",
"0.57471776",
"0.5534867",
"0.54832387",
"0.5479493",
"0.5408177",
"0.5329979",
"0.5320748",
"0.5273399",
"0.52583045",
"0.52325165",
"0.52165055",
"0.52106667",
"0.51950043",
"0.5164515",
"0.5160843",
"0.514278",
"0.513841",
"0.5128742",
"0.51139593",
"0.5082966... | 0.7222925 | 0 |
transforms a netflix title to a form that can be recognized by Rotten Tomatoes i.e. all lowercase and underscores instead of spaces | function transform_title(title) {
return title.toLowerCase().replace(/ /g, "_");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }",
"function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n ... | [
"0.76036656",
"0.76036656",
"0.7403169",
"0.7398343",
"0.73685473",
"0.71056426",
"0.7051153",
"0.6883731",
"0.6878643",
"0.68730444",
"0.6864358",
"0.6853551",
"0.6803316",
"0.6795982",
"0.6780726",
"0.67515326",
"0.6741295",
"0.6737461",
"0.6723154",
"0.6712556",
"0.668471"... | 0.78623956 | 0 |
gets the score HTML elem from a boboverlay element | function get_score_elem(overlay) {
score = overlay.getElementsByClassName("match-score");
if (score.length > 0) {
return score[0];
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_score_from_page(resp) {\n var parser = new DOMParser();\n var doc = parser.parseFromString(resp, \"text/html\");\n score = doc.getElementsByClassName(score_class_name);\n alert(score[0].innerText);\n}",
"function game_score(score) {\n var score_text = document.querySelector(\"#scor... | [
"0.6844799",
"0.62210095",
"0.6122035",
"0.60941136",
"0.6088753",
"0.6002295",
"0.5914622",
"0.5889037",
"0.58729726",
"0.58698",
"0.58690095",
"0.5837149",
"0.5828991",
"0.5795911",
"0.5795783",
"0.5793955",
"0.5789068",
"0.57757604",
"0.5750832",
"0.5750774",
"0.5749296",
... | 0.7224918 | 0 |
Returns the inner nullable variation of this type. | nullable() {
return this.ofType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNullableType(type) {\n\t return type instanceof GraphQLNonNull ? type.ofType : type;\n\t}",
"function nullable(S) {\n return new Struct({\n type: `${S.type} | null`,\n schema: S.schema,\n validator: (value, ctx) => {\n return value === null || ctx.check(value, S);\n }\n });\n}",
... | [
"0.55777466",
"0.5364237",
"0.5364237",
"0.5360343",
"0.5250729",
"0.5250729",
"0.5250729",
"0.52478653",
"0.52389145",
"0.5202061",
"0.51071477",
"0.5099812",
"0.5099812",
"0.5082126",
"0.5044347",
"0.50037664",
"0.5000987",
"0.49891302",
"0.49857545",
"0.49708968",
"0.49587... | 0.65310913 | 0 |
recursive add all station | function AddStationRec(arr, i){
if(i >= arr.length) return AddStationDataRec(dataArray,0);
var station = arr[i];
PowerStation.findOneAndUpdate({ '_id': station._id}, {'$setOnInsert': station}, {upsert: true}, function(){
AddStationRec(arr, i+1);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAll() {}",
"function addStationNames(){\n\n\tvar stations = getWMATAStations(getStationID);\n}",
"addAll(items) {\n if (items.length == 0) throw new Error(green('No data provided when adding a new node! [from: addAll()]'))\n\n for (let i = 0; i < items.length; i++) {\n this.addNode(items... | [
"0.6013721",
"0.5909386",
"0.5846324",
"0.58290803",
"0.5708793",
"0.5704133",
"0.5518948",
"0.54638314",
"0.53950274",
"0.536793",
"0.53492403",
"0.53479505",
"0.5338488",
"0.5211997",
"0.5202065",
"0.5154406",
"0.5100737",
"0.51006615",
"0.50508976",
"0.50264364",
"0.502091... | 0.6195411 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.