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 |
|---|---|---|---|---|---|---|
this function create an object with the params offset and limit get the params from the query object finally, the variables are deleted from the query | function getLimit(query) {
let area = {
offset: 0,
limit: 999
};
if (query.offset && query.limit) {
area.offset = parseInt(query.offset);
area.limit = parseInt(query.limit);
}
else if (query.limit) {
area.limit = parseIn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"paginate(){\n const { page, limit } = this.queryString; // extract page and limit from queryString\n // ex: /api/v1/tours?page=2&limit=10 ==> displaying page nb 2 with 10 documents max per page\n // in this case => 1-10: page 1, 11-20: page 2, 21-30: page 3 .....\n const pageNb = page... | [
"0.6372927",
"0.5908493",
"0.58513117",
"0.58379227",
"0.5828706",
"0.5790462",
"0.5696664",
"0.5675305",
"0.5669959",
"0.56458473",
"0.5645422",
"0.5642444",
"0.5629294",
"0.56236887",
"0.56073445",
"0.5579707",
"0.5537181",
"0.55256784",
"0.54950756",
"0.5431497",
"0.541674... | 0.61553323 | 1 |
Returns true if user is signedin. Otherwise false and displays a message. | function checkSignedInWithMessage() {
// Return true if the user is signed in Firebase
var auth = firebase.auth();
if (auth.currentUser) {
return true;
}
// Display a message to the user using a Toast.
var data = {
message: 'You must sign-in first',
timeout: 2000
};
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isUserSignedIn() {\n return !!getAuth().currentUser;\n}",
"function checkSignedInWithMessage() {\n // Return true if the user is signed in Firebase\n if (isUserSignedIn()) {\n return true;\n }\n\n // Display a message to the user using a Toast.\n var data = {\n message: 'You must sign-in f... | [
"0.7614611",
"0.75671184",
"0.75671184",
"0.75671184",
"0.75671184",
"0.75671184",
"0.7550406",
"0.7509224",
"0.7490422",
"0.74823636",
"0.7474222",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"0.74081296",
"... | 0.7856032 | 0 |
globally disconnect the transport singleton | static async disconnect() {
if (transportInstance) {
transportInstance.device.close();
transportInstance.emit("disconnect");
transportInstance = null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disconnect(){}",
"disconnect () {\n // close all data tunnel\n this.userTunnel.off();\n this.messageTunnel.off();\n this.channelStatusTunnel.off();\n this.removeAllListeners();\n }",
"disconnect() {\n if (this.proto == 'tcp') {\n this._api.disconnect(this.socketId);\n }\n }",
"dis... | [
"0.74819183",
"0.7364717",
"0.7262036",
"0.724483",
"0.71432817",
"0.7087121",
"0.70697844",
"0.70232177",
"0.7011998",
"0.6987563",
"0.6983895",
"0.69701046",
"0.69550264",
"0.69550264",
"0.69550264",
"0.6938142",
"0.6893209",
"0.6879317",
"0.68383294",
"0.68100834",
"0.6805... | 0.8290568 | 0 |
console.log(commonFactors(12, 50)); // => [ 1, 2 ] console.log(commonFactors(6, 24)); // => [ 1, 2, 3, 6 ] console.log(commonFactors(11, 22)); // => [ 1, 11 ] console.log(commonFactors(45, 60)); // => [ 1, 3, 5, 15 ] | function commonFactors(num1, num2) {
var num1Factors = factors(num1);
var num2Factors = factors(num2);
var result = [];
for (var i = 0; i < num1Factors.length; i++) {
var ele1 = num1Factors[i];
for (var j = 0; j < num2Factors.length; j++) {
var ele2 = num2Factors[j];
if (ele1 === ele2) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commonFactors(num1, num2) {\n const factors = []\n let max\n max = num1 > num2 ? num1 : num2\n for (let i = max; i >= 1; i--) {\n if (num1 % i === num2 % i) {\n factors.push(i)\n }\n }\n return factors\n}",
"function getAllFactorsFor(remainder) {\n var factors = [], i;\n\n for (i ... | [
"0.80860066",
"0.7043932",
"0.6961537",
"0.6935603",
"0.6929406",
"0.68412507",
"0.682427",
"0.68009824",
"0.67616856",
"0.6755075",
"0.67288685",
"0.67189944",
"0.66998464",
"0.6686891",
"0.6661834",
"0.666178",
"0.66584784",
"0.66477895",
"0.6585599",
"0.6580189",
"0.656920... | 0.7398729 | 1 |
Array Low To High Properties | function arrayLowToHigh(low, high) {
const array = []
for (let i = low; i <= high; i++) {
array.push(i)
}
return array
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrayLowToHigh(low, high) {\r\n array = [];\r\n for (let i = low; i <= high; i++) {\r\n array.push(i);\r\n }\r\n return array;\r\n}",
"function lowToHighArray(low, high) {\n const array = [];\n for (let i = low; i <= high; i++) {\n array.push(i);\n }\n return array;\n}",
"fun... | [
"0.6643878",
"0.6406629",
"0.6385321",
"0.6362588",
"0.62651134",
"0.60984564",
"0.60970163",
"0.6051107",
"0.6020824",
"0.6008323",
"0.6002189",
"0.59307283",
"0.5760856",
"0.57242024",
"0.5675082",
"0.567505",
"0.5622667",
"0.55906487",
"0.557459",
"0.55579525",
"0.55508643... | 0.6462715 | 1 |
Creates a list of paragraph elements comparing each airline | function FindFlights() {
//Make sure the output div is empty each time this is called
output.innerHTML = "";
//Create a list for each airline and generate prices for the destinations selected
for (i = 0; i < airlines.length; i++) {
//This generates the proper html elements so the CSS can style ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toArrayofParagraphs(ArrayofLines){\n \n var currentParagraph=[];\n for(var i=0;i<ArrayofLines.length;i++){\n if(ArrayofLines[i].length>1){\n \n currentParagraph.push(ArrayofLines[i]);\n console.log(i,'y',currentParagraph,ArrayofLines[i].len... | [
"0.62561554",
"0.5674376",
"0.5397406",
"0.5388342",
"0.53667456",
"0.5246143",
"0.5239946",
"0.52327913",
"0.5223066",
"0.52078044",
"0.52059984",
"0.51736325",
"0.5167411",
"0.5138263",
"0.5110998",
"0.5088187",
"0.5051371",
"0.5051371",
"0.50279987",
"0.49931118",
"0.49831... | 0.5719428 | 1 |
console.log(num.length); // 20, should be 21 if counting missing number missing 1 is the default state create loop using lowest number in the array The indexOf() method returns the position of the first occurrence of a specified value in a string/array. method returns 1 if the value to search for never occurs | function missingNumber(num) {
var missing = -1;
for (var i = 0; i <= num.length - 1; i++) {
if (num.indexOf(i) === -1) {
missing = i;
}
}
return missing;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function missingNum(arr) {\n for (let i = 1; i <= 10; i++) {\n if (! arr.includes(i)) return i;\n // @HINT: maybe reduce computational effort\n }\n}",
"function findMissingNum(arr) {\n let missing = [];\n let arrLength = Math.max.apply(Math, arr);\n let newArr = arr.filter(function(num) {\n ... | [
"0.76829726",
"0.717134",
"0.71532696",
"0.7100256",
"0.7090452",
"0.7032017",
"0.701155",
"0.69838864",
"0.6975292",
"0.6963315",
"0.68261117",
"0.6818879",
"0.67453647",
"0.6718882",
"0.6696672",
"0.66792864",
"0.6670591",
"0.6628991",
"0.65900916",
"0.6575949",
"0.65668017... | 0.73256904 | 1 |
prompt user to select media stream then pass to video element and play | async function selectMediaStream() {
try {
// mediaStream awaits until user selects what media to share
const mediaStream = await navigator.mediaDevices.getDisplayMedia();
// selected video on media stream loaded into video element's src then played
videoElement.srcObject = mediaStream;
videoEl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function selectMediaToStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoElement.srcObject = mediaStream;\n playVideo();\n } catch (error) {\n console.log(error);\n }\n}",
"async function selectStream () {\n try {\n const mediaStream = a... | [
"0.74714184",
"0.72273517",
"0.71473837",
"0.7109143",
"0.70698345",
"0.7056556",
"0.7029798",
"0.69341964",
"0.6915602",
"0.68972147",
"0.6877805",
"0.6870695",
"0.686206",
"0.68508023",
"0.68470234",
"0.68235356",
"0.679132",
"0.6753911",
"0.6746098",
"0.6735101",
"0.673455... | 0.749705 | 0 |
On Click handler to add new Note | onClick(e) {
this.insertNewNote(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addButtonClick(){\n\t\tvar note = Note();\n\t\tstorage.push(note);\n\t\tdisplayNotes();\n\n\t}",
"function addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}",
"function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNot... | [
"0.8360695",
"0.8218896",
"0.8080708",
"0.8053139",
"0.78563666",
"0.7804001",
"0.7789222",
"0.77616775",
"0.7705269",
"0.7699571",
"0.7679568",
"0.76752096",
"0.7600781",
"0.75680906",
"0.75326014",
"0.7478887",
"0.74331325",
"0.73649746",
"0.7344767",
"0.733436",
"0.7331475... | 0.8632392 | 0 |
handle select input for month and year | handleSelectChange(e) {
// check if target is year or month
if (e.target.name == "month") {
this.setState({
month: e.target.value
});
}
if (e.target.name == "year") {
this.setState({
year: e.target.value
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_yearSelected(event) {\n const year = event.value;\n this.yearSelected.emit(this._dateAdapter.createDate(year, 0, 1));\n let month = this._dateAdapter.getMonth(this.activeDate);\n let daysInMonth = this._dateAdapter.getNumDaysInMonth(this._dateAdapter.createDate(year, month, 1));\n ... | [
"0.7248959",
"0.7248959",
"0.7239745",
"0.72071964",
"0.72071964",
"0.7138114",
"0.7039744",
"0.69945264",
"0.6957944",
"0.68880904",
"0.6791831",
"0.67615795",
"0.66572756",
"0.6645375",
"0.65991646",
"0.65991646",
"0.65579706",
"0.6550004",
"0.6550004",
"0.6542629",
"0.6513... | 0.7321272 | 0 |
handle input from the topic & description | handleTextChange(e) {
// check if it's the topic or the name
if (e.target.name == "topic") {
this.setState({
topic: e.target.value
});
}
if (e.target.name == "description") {
this.setState({
description: e.target.value
});
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processTopic() {\n let input = this.topic\n resetError(input)\n if (isEmpty(input)) {\n this.valid = false\n } else\n input.success = true\n }",
"function getTopic(topic){\n\n\t\t// Get correct title and subtitle\n\t\tif (topic === ... | [
"0.6679342",
"0.58236974",
"0.5755766",
"0.563143",
"0.56161463",
"0.5591073",
"0.55344564",
"0.55197585",
"0.55172276",
"0.5514617",
"0.5507053",
"0.5446084",
"0.54340875",
"0.5432178",
"0.54232234",
"0.5390052",
"0.53842986",
"0.53743595",
"0.53509164",
"0.53433883",
"0.531... | 0.6676008 | 1 |
take array of arrays and return array Alphabetically arranged. why to use is: to check the chrs faster. | function alfa (arr){
for (var i = 0; i< arr.length;i++){
arr[i].sort();
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function groupAnagrams(array) {\n var words = [];\n var output = [];\n\n for (let i = 0; i < array.length; i++) {\n words.push([array[i].split('').sort().join(''), array[i]]);\n }\n\n words.sort(matrixSort);\n\n for (let x = 0; x < words.length; x++) {\n output.push(words[x][1]);\n }\n\n console.log(... | [
"0.7089307",
"0.6959477",
"0.6767763",
"0.6582958",
"0.64670193",
"0.64380264",
"0.6430953",
"0.6426051",
"0.6419363",
"0.6419066",
"0.62640357",
"0.62589645",
"0.62169623",
"0.6205304",
"0.6197042",
"0.6170327",
"0.61603713",
"0.61489904",
"0.6134558",
"0.6132777",
"0.613142... | 0.7243103 | 0 |
resets the number of cities | function AutocompleteCitiesReset(){
_AutocompleteCities = new Array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AutocompleteCitiesReset() {\n _AutocompleteCities = new Array();\n}",
"function clearSavedCities() {\n searchedCities.empty()\n}",
"function ChangeCity() {\n cfi.ResetAutoComplete(\"AirportSNo\");\n cfi.ResetAutoComplete(\"TerminalSNo\");\n}",
"static numberOfCities() {\n\t\treturn desti... | [
"0.72558856",
"0.6852256",
"0.61966926",
"0.61709994",
"0.6021541",
"0.5923785",
"0.5923785",
"0.5923785",
"0.5923785",
"0.59132504",
"0.5896956",
"0.5889784",
"0.5842483",
"0.5833221",
"0.5832828",
"0.58204764",
"0.5760612",
"0.5756625",
"0.57273525",
"0.5698439",
"0.5685904... | 0.70638126 | 1 |
gets or sets the global catalog id | function journalID(catalog_id){
if(typeof catalog_id == 'undefined') return global_catalog_id;
else global_catalog_id = catalog_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CatalogID(catalog_id) {\n if (typeof catalog_id == 'undefined')\n return global_catalog_id;\n else\n global_catalog_id = catalog_id;\n}",
"function getCategoryId (id) {\n window.categoriaid = id //Guardo el id de la categoria en global\n }",
"function get_catalog_id() {\... | [
"0.829413",
"0.612106",
"0.5932852",
"0.5921585",
"0.58959883",
"0.58649135",
"0.56343156",
"0.5554238",
"0.5510323",
"0.55052996",
"0.5480475",
"0.546347",
"0.54091245",
"0.54059356",
"0.531064",
"0.52749825",
"0.5261418",
"0.5256428",
"0.5223427",
"0.52126503",
"0.5207358",... | 0.70883155 | 1 |
Deobfuscate emailadress in a single object. | deobfuscateElement(element) {
const $element = $(element);
let output = '';
if (typeof $element.data(this.elementPhoneDataName) === 'undefined') {
const emailStartObfuscated = $element.data(this.dataStart);
const emailEndObfuscated = $element.data(this.dataEnd);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deobfuscateMails() {\n var elements = document.querySelectorAll('[href*=\"mailto:\"]');\n if (elements != null && elements != 'undefined') {\n for (var i = 0; i < elements.length; i++) {\n var href = elements[i].getAttribute('href');\n var content = e... | [
"0.62055355",
"0.5750205",
"0.56690305",
"0.5659663",
"0.549842",
"0.5464057",
"0.51809204",
"0.5178788",
"0.5004665",
"0.49833396",
"0.4934276",
"0.49027315",
"0.48730105",
"0.48605075",
"0.48346314",
"0.4793707",
"0.47805345",
"0.4744722",
"0.47330064",
"0.46751517",
"0.465... | 0.62445456 | 0 |
fonction de l'equation de simpson n = nombre de pas | function simpson(bornInf, bornSup, n, fonction, omegam0, omegalambda0, Or){
S = 0;
var somme1 = 0.0;
var somme2 = 0.0;
var h = (bornSup-bornInf)/n;
var xk1 = bornInf+h;
var xk2 = bornInf+2.0*h;
for (i=1; i<n; i+=2){
somme1+=fonction(xk1, omegam0, omegalambda0, Or);
somme2+=fonction(xk2,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sph_neumann(n, x) {\r\n var ret = Math.sqrt(Math.PI / (2 * x));\r\n ret *= cyl_neumann(n + .5, x);\r\n return ret;\r\n}",
"function moyenne (n) {\n\tfor (var i = 0; i < n; i++) {\n\t\tnote = parseInt(prompt(\"Entrez vos notes\"));\n\t\tmoyenne_total = moyenne_total + note;\n\t\tmoyenne_general ... | [
"0.6727793",
"0.650862",
"0.6234",
"0.60935736",
"0.60664016",
"0.6066135",
"0.6036115",
"0.6030732",
"0.59995383",
"0.5985569",
"0.5971859",
"0.5967436",
"0.5965245",
"0.5952113",
"0.5952113",
"0.5952113",
"0.5952113",
"0.5952113",
"0.5952113",
"0.5952113",
"0.5952113",
"0... | 0.73998404 | 0 |
Listener of changing in product list | function handleListUpdate(changes){
changes.forEach(function(change){
var newObject = change.object;
newObject.showTo('#product-list', startNumProd, finishNumProd);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onListchange ( event ) {\n alert(\"list changed!\");\n }",
"function updateProductList(){\r\n if(shop.products){\r\n container.innerHTML = '';\r\n for(var i = 0; i < shop.products.length; i++){\r\n container.append(productElement(shop.products[i]));\... | [
"0.73134875",
"0.7083825",
"0.66508853",
"0.663534",
"0.6601645",
"0.65983456",
"0.65944993",
"0.6557345",
"0.6494044",
"0.6430248",
"0.6404826",
"0.63914293",
"0.6385878",
"0.6369964",
"0.6317882",
"0.6263398",
"0.62579864",
"0.62535083",
"0.6247382",
"0.62437606",
"0.623821... | 0.74188006 | 0 |
TODO: set focus trong table Author: NDANH 29/8/2019 | setFocusOnTable() {
$("#tableDialogBody input").first().focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EztableLstTab(tbl, ide, idf) {\n $(tbl).on(\"keypress\", ide, function (e) {\n \n var keyCode = e.keyCode || e.which;\n if (keyCode == 9) {\n e.preventDefault();\n $(this).closest('tr').next('tr').find(idf).focus();\n ... | [
"0.729123",
"0.71425873",
"0.69616675",
"0.6928878",
"0.6753991",
"0.66090304",
"0.6565632",
"0.6560005",
"0.6560005",
"0.6560005",
"0.6560005",
"0.6550705",
"0.6392707",
"0.6323061",
"0.6271304",
"0.62626404",
"0.6259529",
"0.6243854",
"0.6206657",
"0.6182453",
"0.61675245",... | 0.7761304 | 0 |
When the browser does not support any of the APIs that we're using for messaging, just present an empty api that does just gives warnings regarding the lack of support. | function noop() {
console.warn('Hermes messaging is not supported.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function messagingApi()\n{\n\n}",
"_sdkCompatibility() {\n // WebSocket\n // http://caniuse.com/#feat=websockets\n var canCreateWebSocket = 'WebSocket' in window;\n console.log('Native WebSocket capability: ' +\n canCreateWebSocket);\n\n if (!canCreateWebSocket) {\n throw new Error('No W... | [
"0.7168934",
"0.652412",
"0.62264967",
"0.62253875",
"0.6028786",
"0.5948064",
"0.587088",
"0.58705854",
"0.58214086",
"0.58206284",
"0.58206284",
"0.58206284",
"0.5815243",
"0.5815243",
"0.574438",
"0.5736856",
"0.5722865",
"0.5722865",
"0.5722865",
"0.5722865",
"0.5722865",... | 0.7356213 | 0 |
Returns true if the current plug is switchable | get isSwitchable() {
return true; // we know no plugs that aren't switchable
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isFeatureSwitchEnabled(key) {\n\t\tif (isB2BUser()) {\n\t\t\treturn false;\n\t\t}\n\t\treturn key && sessionStorage.getItem(key) == 1;\n\t}",
"turnOn() {\r\n return this.operatePlug({ onOff: true });\r\n }",
"function isEnabled() {\n return (tracker.currentWidget !== null &&\n ... | [
"0.63010734",
"0.6175901",
"0.60956776",
"0.6042457",
"0.59273094",
"0.59211385",
"0.5901562",
"0.5901562",
"0.5901562",
"0.5873437",
"0.5863983",
"0.58199936",
"0.580979",
"0.5805798",
"0.57541007",
"0.5656268",
"0.5656268",
"0.56482947",
"0.56389856",
"0.55748874",
"0.55527... | 0.7892119 | 0 |
================================= Simplified API access Ensures this instance is linked to a tradfri client and an accessory | ensureLink() {
if (this.client == null) {
throw new Error("Cannot use the simplified API on devices which aren't linked to a client instance.");
}
if (!(this._accessory instanceof accessory_1.Accessory)) {
throw new Error("Cannot use the simplified API on plugs which... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initAccessory() {\n return new Accessory(this.getName(), this.getUuid(), this.api.hap.Accessory.Categories.THERMOSTAT);\n }",
"function AccessControlService() {\n }",
"constructor(environment, state) {\n /**\n * @category Utility\n */\n this.units = lib_1.units;\n\n const _state = t... | [
"0.55426687",
"0.5351839",
"0.5255599",
"0.5255204",
"0.5241723",
"0.52338713",
"0.52127755",
"0.5204082",
"0.5171579",
"0.5145034",
"0.50808316",
"0.5052769",
"0.4994227",
"0.49497917",
"0.4934793",
"0.49250504",
"0.49235263",
"0.4914275",
"0.4909977",
"0.49080074",
"0.49024... | 0.6468287 | 0 |
Turn this plug on | turnOn() {
return this.operatePlug({ onOff: true });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enable () {\n this.hook.enable()\n }",
"onEnable() {}",
"enable() {\n this._enabled = true;\n }",
"static turnOn(pix){\r\n\t\tpix.on = true;\r\n\t}",
"enable() {\n this.enabled_ = true;\n }",
"function turnOn() {\n $buttons.prop('disabled', false);\n updateScore();\n }",
"enabl... | [
"0.7044575",
"0.6872335",
"0.68371207",
"0.6787306",
"0.67231506",
"0.6540276",
"0.6499587",
"0.6454703",
"0.64230746",
"0.63228416",
"0.62256014",
"0.6214474",
"0.6211969",
"0.61992264",
"0.61821324",
"0.6093317",
"0.6089738",
"0.60805666",
"0.6058682",
"0.6052336",
"0.60328... | 0.7590844 | 0 |
Turn this plug off | turnOff() {
return this.operatePlug({ onOff: false });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }",
"disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }",
"disable () {\n this.hook.disable()\n }",
"off() {\n\t\tthis._lamps.off();\n\t}",
"function ... | [
"0.73131776",
"0.73131776",
"0.7108397",
"0.707063",
"0.7048113",
"0.69332975",
"0.6915547",
"0.6883276",
"0.6856756",
"0.6791836",
"0.67874235",
"0.67682046",
"0.67601395",
"0.67351764",
"0.67316824",
"0.67185843",
"0.6693478",
"0.66608375",
"0.66509473",
"0.6606496",
"0.659... | 0.80497515 | 0 |
Toggles this plug on or off | toggle(value = !this.onOff) {
return this.operatePlug({ onOff: value });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toggle() {\n this.enabled = !this.enabled;\n }",
"turnOn() {\r\n return this.operatePlug({ onOff: true });\r\n }",
"toggle(){this.off=!this.off}",
"onToggle() {\r\n this.toggle = !this.toggle;\r\n }",
"turnOff() {\r\n return this.operatePlug({ onOff: false });\r\n }"... | [
"0.76674443",
"0.7581375",
"0.7556857",
"0.7414573",
"0.73820204",
"0.730118",
"0.7299745",
"0.72531325",
"0.70650065",
"0.70180863",
"0.7008995",
"0.70019925",
"0.6945918",
"0.68884027",
"0.68884027",
"0.68884027",
"0.6861511",
"0.6831369",
"0.6824907",
"0.6808764",
"0.67896... | 0.768286 | 0 |
Delete a node edges | deleteEdge(sourceNodeId, targetNodeId, edgeLabel) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"removeEdge(g, e) { }",
"removeEdge(g, e) { }",
"function delete_relatededges(_node, _edges, _edges_tangents){\r\n\tvar currentid = _node.id;\r\n\tfor (var i=0; i<_edges.length; i++){\r\n\t\tvar tempedge=edges[i];\r\n\t\tif (_edges[i].power === 2){\r\n\t\t\tif (_edges[i].startid === currentid || _edges[i].endid... | [
"0.75857323",
"0.75857323",
"0.74011075",
"0.7295806",
"0.7236985",
"0.7222818",
"0.6904689",
"0.68702817",
"0.68702817",
"0.68702817",
"0.68702817",
"0.68702817",
"0.68702817",
"0.6854593",
"0.67740166",
"0.67419523",
"0.67116034",
"0.6672204",
"0.66629803",
"0.6600766",
"0.... | 0.7746625 | 0 |
When starting, start listening to events | start() {
this.registerListeners();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function start () {\n listen()\n}",
"function start () {\n console.info('CALLED: start()');\n bindEvents();\n }",
"function start() {\n listen();\n}",
"start() {\n this._.on('request', this.onRequest.bind(this));\n this._.on('error', this.onError.bind(this));\n this._.on('listen... | [
"0.78426564",
"0.78072757",
"0.7783317",
"0.7756823",
"0.728964",
"0.72875303",
"0.7254858",
"0.7228036",
"0.7191078",
"0.7190611",
"0.71894336",
"0.71425766",
"0.7037627",
"0.7035921",
"0.69943565",
"0.6887698",
"0.6869248",
"0.6849511",
"0.68442756",
"0.6836032",
"0.6831702... | 0.8315822 | 0 |
Listen to Business events. For each of them, we simply write the whole Business instance to the writer. | registerListeners() {
const business = this.application.business;
const callback = () => { this.writeBusiness(); };
business.on('newOrder', callback);
business.on('orderChange', callback);
business.on('update', callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"writeBusiness() {\n\t\tthis.writer.write(this.application.business);\n\t}",
"_emitNewEvents() {\n logger.log({level: 'info', type: 'service', message: 'Emitting new service events'});\n\n if (!this.primaryDeployment) return;\n\n if (!this.eventsAfter) {\n this.eventsAfter = this.primaryDeployment.c... | [
"0.66725904",
"0.5256211",
"0.5215611",
"0.50786215",
"0.5016529",
"0.5003512",
"0.4986763",
"0.49847943",
"0.4926536",
"0.49001852",
"0.488484",
"0.4874045",
"0.4863332",
"0.4843622",
"0.48372188",
"0.48102877",
"0.47873145",
"0.4771545",
"0.47636607",
"0.47592923",
"0.47514... | 0.6853293 | 0 |
Writes the whole Business instance to the Writer | writeBusiness() {
this.writer.write(this.application.business);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"writing() {\n dataWriter(this);\n }",
"write() {\n const json = this.toJson()\n for (let i = 0; i < this._stores.length; i++) {\n this._stores[i].write(json)\n }\n }",
"function Writer () {\n\t this.cache = {};\n\t }",
"function Writer () {\n\t this.cache = {};\n\t }",
"function ... | [
"0.6312102",
"0.57848907",
"0.5415139",
"0.5415139",
"0.5349225",
"0.52773064",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5268644",
"0.5244697",
"0.5236905",
... | 0.85388964 | 0 |
update the value on the blockchain with whatever is in the text box when the update message button is clicked | function updateMessage(){
// get the value of the input box
let newMessage = $('#message-input').val();
// if there is a value..
if(newMessage && newMessage.length > 0){
// create a transaction to the blockchain from the contract creator address
instance.update.se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update() {\n sendMessage(document.getElementById(\"input\").value);\n }",
"function updateMoney(message) {\n let cashInput = $(\"#cash-in-system\");\n cashInput.val(message);\n}",
"function changeDataBotMessage(value) {\n var bot_message = botMessageElement();\n bot_message.val(v... | [
"0.75164145",
"0.7049176",
"0.6655852",
"0.65475494",
"0.6542572",
"0.65169483",
"0.64885426",
"0.64295655",
"0.6340879",
"0.62840164",
"0.62707174",
"0.6248057",
"0.62363106",
"0.6193501",
"0.6151608",
"0.61377704",
"0.613645",
"0.6094196",
"0.60913926",
"0.6087749",
"0.6087... | 0.7548876 | 0 |
Callback once app.json and manifest.json have loaded. | function appLoaded() {
var lang = fetchLanguage(),
data = fetchData();
$.when(lang, data).then(startApp, appStartError);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function appLoad(){\n console.log('*App Loaded*')\n watchForm();\n}",
"function loadApp() {\n firebaseUtils.listenToAuthStatus(logIn, logOut);\n}",
"load(){\n\n\t\tfor(var moduleName in this.ControllerManifest){\n\n\t\t\tLog.info(\"Loading app module {}\", moduleName);\n\n\t\t\tvar thisModuleManifest = this... | [
"0.6212605",
"0.6180463",
"0.61467475",
"0.6071432",
"0.5980812",
"0.5900411",
"0.5869636",
"0.58129084",
"0.5785577",
"0.5778951",
"0.577321",
"0.5766941",
"0.575505",
"0.5724506",
"0.57070947",
"0.56479543",
"0.56076753",
"0.55811334",
"0.5566813",
"0.5548697",
"0.5526689",... | 0.63858336 | 0 |
Creates courses if the Courses Mongo collection is empty | function createDefaultCourses() {
Course.find({}).exec(function(err, collection) {
if(collection.length === 0) {
Course.create({name: 'C# for sociopaths', featured: true, published: new Date('1/1/2015'), tags: ['C#']});
Course.create({name: 'C# for mothers', featured: false, publ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveCourses(courses){\n\tlet index = 0\n\tlet length = courses.length\n\tfor(let i=0; i<courses.length; i++){\n\t\tcoursesDb.insert({\n\t\t\tid: courses[i].id,\n\t\t\tmentor: courses[i].mentor,\n\t\t\tcompleted: courses[i].completed,\n\t\t\tstart_date: courses[i].start_date,\n\t\t\ttitle: courses[i].title... | [
"0.7017443",
"0.639408",
"0.61477804",
"0.6094449",
"0.60814464",
"0.6050003",
"0.60035807",
"0.5978196",
"0.59498703",
"0.5946926",
"0.5922652",
"0.59175897",
"0.5902262",
"0.58835405",
"0.5863199",
"0.58604574",
"0.58088493",
"0.57689005",
"0.57346934",
"0.57231104",
"0.572... | 0.6933679 | 1 |
Accept a POST in CSV format; append that line to the worksheet specified in URL. Send the post request to $url?sheet=SHEET_NAME. The body of the post request will be parsed and appended to SHEET_NAME. Find the $url in the "Run > Publish as web app" menu. | function doPost(e) {
var contents = e.postData.contents;
var sheetName = e.parameter['sheet'];
// Append to spreadsheet
appendLines(sheetName, contents);
var params = JSON.stringify(e);
return ContentService.createTextOutput(params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function postSheetData( e ) {\n\n // Get current spreadsheet data\n var ss = SpreadsheetApp.getActiveSpreadsheet() ;\n var sheet = ss.getSheets()[0];\n var range = sheet.getDataRange();\n var data = range.getValues() ; \n var sData = data + '' ;\n\n // Debug\n Logger.log( sData ) ; \n\n // Post the dat... | [
"0.6388683",
"0.6314279",
"0.615172",
"0.6074035",
"0.6045788",
"0.5985751",
"0.59102845",
"0.571949",
"0.5687509",
"0.56687653",
"0.5665026",
"0.5661083",
"0.5646408",
"0.5646139",
"0.55850846",
"0.5561366",
"0.55322164",
"0.5523929",
"0.5444319",
"0.5436462",
"0.5424226",
... | 0.6565451 | 0 |
Parse a csvencoded string and append each line to a the named worksheet worksheet (string): Name of the worksheet csvLine (string): A piece of CSV data, for example "12, abc, 12.3%". | function appendLines(worksheet, csvData) {
var ss = SpreadsheetApp.openById("13_BUd7WJlA8Z9B5Vc-5tyf3vyRUYmIx67sDz7ZmyPG4");
var sheet = ss.getSheetByName(worksheet);
var rows = Utilities.parseCsv(csvData);
for ( var i = 0; i < rows.length; i++ ) {
sheet.appendRow(rows[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseCSV(rawData) {\n\tvar rawRows = rawData.split(\"\\n\");\n\tvar csv = [];\n\tvar row = [];\n\tfor (var rowIndex = 0; rowIndex < rawRows.length; rowIndex++) {\n\t\tvar currentRow = rawRows[rowIndex].split(\",\");\n\t\tvar cell = \"\";\n\t\tvar in_quotes = false;\n\t\tfor (var cellIndex = 0; cellIndex <... | [
"0.5673121",
"0.56443876",
"0.5612408",
"0.5587087",
"0.55686796",
"0.55498844",
"0.54282844",
"0.5336546",
"0.5304875",
"0.526234",
"0.5245219",
"0.52403355",
"0.5230547",
"0.5176185",
"0.5165689",
"0.51436466",
"0.5143389",
"0.50949955",
"0.5074077",
"0.5067966",
"0.5059681... | 0.61051977 | 0 |
Converts string input to a camel cased version of itself. For example:toStyleCase("zindex"); returns "zIndex" toStyleCase("borderbottomstyle"); returns "borderBottomStyle" | function toStyleCase(s)
{
for(var exp = toStyleCase.exp; exp.test(s); s = s.replace(exp, RegExp.$1.toUpperCase()) );
return s;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function camelCaseCSS(str) {\n return str.replace(/\\-([a-z])/g, \n\t\t function (whole, section) {\n\t\t\t return section.toUpperCase();\n\t\t });\n }",
"function cssCase(str) {\n return str.replace(/[A-Z]/g, '-$&').toLowerCase();\n}",
"function cssCase(str) {\n return str.replace(/[A-Z]... | [
"0.7633682",
"0.73894155",
"0.73894155",
"0.73860204",
"0.73792976",
"0.7357206",
"0.7356858",
"0.72822315",
"0.72701335",
"0.72369766",
"0.72227013",
"0.7222612",
"0.7222612",
"0.721222",
"0.720334",
"0.7202686",
"0.7202686",
"0.7192322",
"0.7184866",
"0.7183961",
"0.7167287... | 0.7883635 | 0 |
return page size with or without scroll taking into consideration | function getPageSize(boolWithScroll,oDoc)
{
if(oDoc==undefined)oDoc = document;
var win = window;
var intWidth = 0;
var intHeight = 0;
if(boolWithScroll==undefined)boolWithScroll=false;
if (win.innerHeight && win.scrollMaxY)
{
//-- Firefox
var intScrollY = (boolWithScroll)?win.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ___getPageSize() {\r\n var xScroll, yScroll;\r\n if (window.innerHeight && window.scrollMaxY) {\r\n xScroll = window.innerWidth + window.scrollMaxX;\r\n yScroll = window.innerHeight + window.scrollMaxY;\r\n } else if (document.body.scrollHeigh... | [
"0.7474278",
"0.74303657",
"0.7420087",
"0.73886657",
"0.73108655",
"0.7280787",
"0.71866614",
"0.7147933",
"0.71071434",
"0.71014905",
"0.70746166",
"0.70505893",
"0.7043679",
"0.70075166",
"0.6958626",
"0.6938179",
"0.68388784",
"0.677705",
"0.6775864",
"0.6700453",
"0.6656... | 0.74534523 | 1 |
get elemen that mouse vent came from | function getMouseFromElement(e)
{
if (!e) var e = window.event;
var relTarg = e.relatedTarget || e.fromElement;
return relTarg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMouseToElement(e) \r\n{\r\n\tif (!e) var e = window.event;\r\n\tvar relTarg = e.relatedTarget || e.toElement;\r\n\treturn relTarg;\r\n}",
"function mousePositionElement(e, el) {\n var mousePosDoc = mousePositionDocument(e); // var target = mouseTarget(e);\n\n var target = el;\n var targetPos = fin... | [
"0.7076972",
"0.6648375",
"0.6648375",
"0.6489292",
"0.6431799",
"0.6431799",
"0.63863516",
"0.6380356",
"0.63607544",
"0.6319252",
"0.63033444",
"0.62934095",
"0.6230446",
"0.6220426",
"0.62094706",
"0.619493",
"0.6178079",
"0.61728585",
"0.61728585",
"0.61657494",
"0.616233... | 0.71910334 | 0 |
get element that mouse event is going to | function getMouseToElement(e)
{
if (!e) var e = window.event;
var relTarg = e.relatedTarget || e.toElement;
return relTarg;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMouseFromElement(e) \r\n{\r\n\tif (!e) var e = window.event;\r\n\tvar relTarg = e.relatedTarget || e.fromElement;\r\n\treturn relTarg;\r\n}",
"function GetElementClicked(e)\n{\n var targ;\n\tif (!e) var e = window.event\n\tif (e.target) targ = e.target\n\telse if (e.srcElement) targ = e.srcElement... | [
"0.7787944",
"0.72574705",
"0.70078963",
"0.7000845",
"0.7000845",
"0.69596684",
"0.6902296",
"0.68317753",
"0.68103784",
"0.67940694",
"0.6700045",
"0.66764754",
"0.66764754",
"0.6675568",
"0.6675568",
"0.6627394",
"0.66240245",
"0.6609274",
"0.65892375",
"0.65334225",
"0.65... | 0.7895223 | 0 |
16.02.2006 NWJ return parent owner of an element identified by tag (TABLE / TR / DIV / BODY etc) | function get_parent_owner_by_tag(oEle, strTag)
{
if (oEle.parentNode)
{
if (oEle.parentNode.tagName==strTag) return oEle.parentNode;
return get_parent_owner_by_tag(oEle.parentNode, strTag);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_parent_owner_by_tag(oEle, strTag)\r\n{\r\n\tif (oEle.tagName==strTag) return oEle;\r\n\r\n\tif (oEle.parentNode)\r\n\t{\r\n\t\treturn get_parent_owner_by_tag(oEle.parentNode, strTag);\r\n\t}\r\n\treturn false;\r\n}",
"function findParent( element, parentTag ) {\n while ( element.parentNode ) {\... | [
"0.83596164",
"0.7534976",
"0.7530737",
"0.7448827",
"0.74422854",
"0.74099416",
"0.74039406",
"0.73856187",
"0.7369888",
"0.73464763",
"0.73425484",
"0.73304003",
"0.72510856",
"0.7206134",
"0.71833324",
"0.7175881",
"0.71509355",
"0.71151644",
"0.7061723",
"0.6981302",
"0.6... | 0.8365765 | 0 |
16.02.2006 NWJ return parent owner of an element identified by att | function get_parent_owner_by_att(oEle, strAtt)
{
if(oEle.getAttribute==undefined)return null;
if (oEle.getAttribute(strAtt)!=null) return oEle;
if (oEle.parentNode)
{
return get_parent_owner_by_att(oEle.parentNode, strAtt);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_parent_owner_by_att(oEle, strAtt)\r\n{\r\n\tif (oEle.getAttribute(strAtt)!=null) return oEle;\r\n\r\n\tif (oEle.parentNode)\r\n\t{\r\n\t\treturn get_parent_owner_by_att(oEle.parentNode, strAtt);\r\n\t}\r\n\treturn false;\r\n}",
"function get_parent_owner_by_tag(oEle, strTag)\r\n{\r\n\tif (oEle.tagNa... | [
"0.883894",
"0.7583833",
"0.7462496",
"0.7201787",
"0.71936715",
"0.7104796",
"0.6915264",
"0.6902296",
"0.65013343",
"0.64787275",
"0.64787275",
"0.64787275",
"0.64787275",
"0.64787275",
"0.64787275",
"0.64310694",
"0.64226764",
"0.641736",
"0.6356947",
"0.63565797",
"0.6243... | 0.8811202 | 1 |
16.02.2006 NWJ return parent owner of an element identified by id | function get_parent_owner_by_id(oEle, strID)
{
if (oEle.id==strID) return oEle;
if (oEle.parentNode)
{
return get_parent_owner_by_id(oEle.parentNode, strID);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_parent_owner_by_id(oEle, strID)\r\n{\r\n\tif (oEle.id==strID) return oEle;\r\n\r\n\tif (oEle.parentNode)\r\n\t{\r\n\t\treturn get_parent_owner_by_id(oEle.parentNode, strID);\r\n\t}\r\n\treturn false;\r\n}",
"get owner() {\n return this.parent || this._owner || IdHelper.fromElement(this.forElement... | [
"0.86404794",
"0.7734389",
"0.76699084",
"0.7500676",
"0.7484066",
"0.7384577",
"0.7316527",
"0.72421306",
"0.717244",
"0.71509486",
"0.71286476",
"0.7001227",
"0.7001227",
"0.69907904",
"0.6912776",
"0.6895499",
"0.68527055",
"0.6847355",
"0.6812662",
"0.67980814",
"0.677636... | 0.8590763 | 1 |
16.02.2006 NWJ return child of parent by name | function get_parent_child_by_name(oEle, strID)
{
if (oEle==null) return null;
if (oEle.id==strID) return oEle;
for(var x=0;x<oEle.childNodes.length;x++)
{
if(oEle.childNodes[x].name==strID)return oEle.childNodes[x];
var testEle = get_parent_child_by_name(oEle.childNodes[x], strID);
if(testEle!=null)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findChildByName(childName, parentElement) {\n if (isFolder(parentElement)) {\n for (var i = 0; i < parentElement.children.length; i++) {\n if (parentElement.children[i].name === childName) {\n return parentElement.children[i];\n }\n ... | [
"0.72001755",
"0.7127166",
"0.71239585",
"0.7051369",
"0.70321995",
"0.701598",
"0.701598",
"0.701598",
"0.66223145",
"0.66184014",
"0.6571119",
"0.6538086",
"0.63386375",
"0.63295877",
"0.6314512",
"0.6314512",
"0.6309505",
"0.62900066",
"0.6281734",
"0.6280174",
"0.6266012"... | 0.7488878 | 0 |
04.06.2004 NWJ given node and html insert that html into the node (used for creating elements) | function insertBeforeEnd(node,html)
{
if(node.insertAdjacentHTML)
{
node.insertAdjacentHTML('beforeEnd', html);
}
else
{
//--
//-- netscape way of inserting html ()
var r = node.ownerDocument.createRange();
r.setStartBefore(node);
var parsedHTML = r.createContextualFragment(html);
no... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function replaceHtml(oldNode, html) {\n var newNode = oldNode.cloneNode(false);\n newNode.innerHTML = html;\n oldNode.parentNode.replaceChild(newNode, oldNode);\n return newNode;\n}",
"function insertHTML(html, n) {\r\n\r\n var browserName = navigator.appName;\r\n\r\n\t if (browserName == \"Microsoft Intern... | [
"0.7249111",
"0.69098747",
"0.6884263",
"0.68784136",
"0.6581375",
"0.6531178",
"0.6509866",
"0.64486897",
"0.641003",
"0.6389256",
"0.6389152",
"0.63017213",
"0.6263627",
"0.62603164",
"0.62427604",
"0.62316006",
"0.6167378",
"0.6121217",
"0.6118693",
"0.6106174",
"0.609498"... | 0.6966169 | 1 |
append session to a url | function _append_swsession(strURL)
{
var strPrefix = (strURL.indexOf("&")>-1)?"&":"?";
strURL += strPrefix + "sessid=" + app._swsessionid;
return strURL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addSessionStorage(oldUrl, newUrl){\n let newResult = { 'user': oldUrl, 'api': newUrl };\n\n //chequeo si existe algo ya almacenado\n if(sessionStorage.result){\n result = JSON.parse(sessionStorage.getItem('result'));\n } else {\n //creo un array para almacenar los resultados de c... | [
"0.6116703",
"0.5952583",
"0.59315735",
"0.59277195",
"0.5882789",
"0.58037925",
"0.57989615",
"0.57600594",
"0.56978273",
"0.5655031",
"0.5641654",
"0.5612055",
"0.5568985",
"0.5557513",
"0.555429",
"0.55531186",
"0.5527389",
"0.5518588",
"0.5505172",
"0.55014294",
"0.549722... | 0.72935593 | 0 |
XML BASED FUNCTIONS return text from xml node | function xmlText(oNode)
{
if(oNode==null)return "";
if(oNode.text)return oNode.text;
if(typeof(oNode.textContent) != "undefined") return oNode.textContent;
if(oNode.nodeValue && oNode.nodeValue!="") return oNode.nodeValue;
if(oNode.firstChild)
{
return oNode.firstChild.nodeValue;
}
return... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getTextFromNode(node){\n var out = \"\";\n if (node.type === \"tag\"){\n for (child of node.children){\n out += Article.getTextFromNode(child);\n }\n } else if (node.type === \"text\"){\n out += node.data;\n } else {\n co... | [
"0.74116915",
"0.7246238",
"0.70311487",
"0.69528514",
"0.6930813",
"0.6912316",
"0.6897205",
"0.6897205",
"0.6897205",
"0.6897205",
"0.6897205",
"0.6897205",
"0.6843806",
"0.6726137",
"0.6722368",
"0.66184455",
"0.65853804",
"0.6579308",
"0.6567974",
"0.6541751",
"0.6505525"... | 0.7768358 | 0 |
prepare a value for sql on the client side. | function PrepareForSQL(strValue)
{
return PrepareForSql(strValue)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prepareValue (value) {\n if (value === undefined) return ''\n\n if (value === null) return 'NULL'\n\n return mysql.escape(value)\n }",
"function displayFriendlyPreparedBy(value){\n return value === undefined ? \"\"\n : value === null ? \"\"\n : value === 'null' ? \"\"\n ... | [
"0.75590897",
"0.62731826",
"0.5880654",
"0.5693208",
"0.5674802",
"0.5581234",
"0.556687",
"0.55308956",
"0.5523135",
"0.54113835",
"0.5360058",
"0.52880424",
"0.5256169",
"0.5217233",
"0.521169",
"0.52080214",
"0.5130161",
"0.5124083",
"0.50730485",
"0.5064636",
"0.5060853"... | 0.7011342 | 1 |
return text for type i.e doc = Microsoft Word Document | function getFileTypeInformation(strType)
{
var strText = strType;
switch(strType.toLowerCase())
{
case "doc":
strText = "Microsoft Word Document";
break;
case "txt":
strText = "Text Document";
break;
case "png":
strText = "Image - Portable Network Graphic";
break;
case "gif":
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get type () { return this._doc.type; }",
"function determineDocType(type) {\n\t\n\tconsole.log(\"Type: \" + type);\n\t\n\tif (type == 'jpg' || type == 'jpeg' || type == 'png' || type == 'bmp') {\n\t\tesindex = 'images';\n\t}\n\telse if (type == 'mp4' || type == 'wmv' || type == 'avi' || type == 'mov') {\n\t\tesi... | [
"0.6885357",
"0.66602147",
"0.6589781",
"0.6356005",
"0.61184186",
"0.6098986",
"0.60722935",
"0.60354316",
"0.59041995",
"0.59041995",
"0.587356",
"0.5786021",
"0.57842904",
"0.5745375",
"0.5720105",
"0.5645468",
"0.5595822",
"0.5568791",
"0.55601853",
"0.55526906",
"0.54864... | 0.6848754 | 1 |
check if clicked element in right hand corder box (for dates and profile selectors etc | function _clicked_ele_trigger(oEle,e)
{
if(isNaN(e))
{
var mLeft = app.findMousePos(e)[0];
}
else
{
var mLeft = e;
}
var eleMaxRight = oEle.offsetWidth + app.eleLeft(oEle);
var eleMinRight = eleMaxRight - 16;
if((mLeft>eleMinRight)&&(mLeft<eleMaxRight))
{
return true;
}
return fals... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isClicked(e,ifrm) \r\n{\r\n\tif (document.layers) \r\n\t{\r\n\t\tvar clickX = e.pageX;\r\n\t\tvar clickY = e.pageY;\r\n\t\tvar t = ifrm;\r\n\t\tif ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) return true;\r\n\t\t\telse return false;\r\n\t}\r\n... | [
"0.63256925",
"0.62982446",
"0.62750506",
"0.6273159",
"0.6273159",
"0.6146145",
"0.6129499",
"0.61064225",
"0.6055613",
"0.602639",
"0.6004318",
"0.59876376",
"0.59458804",
"0.5907108",
"0.59021515",
"0.5883509",
"0.5843743",
"0.5842962",
"0.5835819",
"0.5835439",
"0.5829727... | 0.63265944 | 0 |
Provides formatting functions for Timers. Display formats for timers are a little different from what moment.js provides, so we have custom logic here. This specifically supports `TimerController`. | function TimerFormatter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}",
"function formatTime() {\n\n // get whole minutes\n var minutes = Math.floor(timer / 60);\n\n // get remaining seconds\n var seconds = timer % 60;\n\n // add l... | [
"0.7520724",
"0.70227206",
"0.6487883",
"0.64781845",
"0.64781845",
"0.64426154",
"0.64159656",
"0.63218635",
"0.6315695",
"0.6296342",
"0.62872154",
"0.6286745",
"0.6283566",
"0.61927414",
"0.6182691",
"0.6177351",
"0.6164569",
"0.61609054",
"0.61494416",
"0.6140104",
"0.613... | 0.8049371 | 0 |
function downloads up to len size_to_read bytes from the object's data stream. It returns the data_read in bytes and number of bytes read Input : Buffer (Buf), Buffer length (Int) Output : ReadResult (Int) | async read(buffer,length){
var bytesread = await uplink.download_read(this.download,buffer,length).catch((error) => {
errorhandle.storjException(error.error.code,error.error.message);
});
return bytesread;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async readFromStream(buffer, offset, length) {\n const readBuffer = this.s.read(length);\n if (readBuffer) {\n buffer.set(readBuffer, offset);\n return readBuffer.length;\n }\n else {\n const request = {\n buffer,\n offset,\... | [
"0.6522203",
"0.64015245",
"0.6271243",
"0.62610793",
"0.6225303",
"0.6197651",
"0.61378455",
"0.61025405",
"0.5851421",
"0.58321565",
"0.57962596",
"0.5730973",
"0.57268",
"0.5686536",
"0.56430584",
"0.56204784",
"0.561653",
"0.561653",
"0.56010324",
"0.5590925",
"0.55754614... | 0.74592185 | 0 |
function returns information about the downloaded object. Input : None Output : ObjectInfo (Object) | async info(){
var objectInfo = await uplink.download_info(this.download).catch((error) => {
errorhandle.storjException(error.error.code,error.error.message);
});
return objectInfo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInfo(object) {\n fetch(`https://api.flickr.com/services/rest/?method=flickr.photos.getExif&api_key=${flickKey}&format=json&nojsoncallback=1&photo_id=${object.id}`)\n .then(r => r.json())\n .then(j => j.photo)\n .then(getExif)\n .then(drawInfo);\n}",
"async function fetc... | [
"0.6394801",
"0.6003802",
"0.59183925",
"0.5843692",
"0.57139224",
"0.56994563",
"0.56675684",
"0.5607012",
"0.55550176",
"0.54734397",
"0.54136956",
"0.53986245",
"0.5396638",
"0.5383874",
"0.5383412",
"0.53616893",
"0.53365785",
"0.53364456",
"0.53267986",
"0.53239924",
"0.... | 0.74138254 | 0 |
function closes the download. Input : None Output : None | async close(){
await uplink.close_download(this.download).catch((error) => {
errorhandle.storjException(error.error.code,error.error.message);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exit() {\n stopDownloading();\n setData = {};\n downloadedPhotos = {};\n window.close();\n}",
"stopDownload() {\n\t\tif(this.downloadInProgress && !this.pendingQuit) {\n\t\t\tthis.extpipeObj.Quit();\n\t\t}\n\t}",
"function deleteDownload() {\n stopDownload();\n }",
"function endDownload() {\... | [
"0.69622535",
"0.68582416",
"0.66865283",
"0.645997",
"0.62876517",
"0.626261",
"0.62424517",
"0.60953635",
"0.60817176",
"0.60797656",
"0.60470265",
"0.600941",
"0.5978717",
"0.59680796",
"0.59669834",
"0.5953518",
"0.5933446",
"0.5911167",
"0.59068453",
"0.58924705",
"0.586... | 0.7671955 | 0 |
get single garment by slug name. used in collections | getGarment(slug) {
return new Promise((resolve, reject) => {
Vue.http.get(API_ROOT + API_VERSION + 's-h_garments/' + slug).then(
response => {
resolve(response.body)
},
response => {
reject(response)
}
)
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSingleGarment(slug) {\n return new Promise((resolve, reject) => {\n Vue.http.get(API_ROOT + API_VERSION + 's-h_garments/?slug=' + slug).then(\n response => {\n resolve(response.body[0])\n },\n response => {\n reject(response)\n }\n )\n })\n }",
"f... | [
"0.74341977",
"0.60164636",
"0.57436854",
"0.560542",
"0.5579297",
"0.55393034",
"0.5519478",
"0.54497075",
"0.5360022",
"0.5342505",
"0.53389853",
"0.53333867",
"0.52461416",
"0.52113163",
"0.5198991",
"0.51925606",
"0.5177842",
"0.5058911",
"0.5051984",
"0.50378966",
"0.503... | 0.68761563 | 1 |
get single garment by slug name | getSingleGarment(slug) {
return new Promise((resolve, reject) => {
Vue.http.get(API_ROOT + API_VERSION + 's-h_garments/?slug=' + slug).then(
response => {
resolve(response.body[0])
},
response => {
reject(response)
}
)
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getGarment(slug) {\n return new Promise((resolve, reject) => {\n Vue.http.get(API_ROOT + API_VERSION + 's-h_garments/' + slug).then(\n response => {\n resolve(response.body)\n },\n response => {\n reject(response)\n }\n )\n })\n }",
"function getRoom... | [
"0.7128957",
"0.59790456",
"0.57103944",
"0.5708075",
"0.55851495",
"0.55788296",
"0.5555421",
"0.5444686",
"0.5374706",
"0.5305091",
"0.5300398",
"0.529161",
"0.5235715",
"0.51597506",
"0.5116106",
"0.51068085",
"0.50839967",
"0.5077052",
"0.50730747",
"0.5062744",
"0.505380... | 0.75877285 | 0 |
Helper functions Creates a timeout that is started and resetted by calling the returned function. | function createTimeout(timeout, fun) {
var tid;
return function() {
if (tid != null)
clearTimeout(tid);
tid = setTimeout(fun, timeout);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static timeout(t) {\n if ( !(typeof t === 'undefined' ))\n _timeout = t;\n else\n return _timeout;\n }",
"constructor(timeout) {\n this.initialTimeout = timeout\n this.reset()\n }",
"function setupTimeoutTimer() {\n updateTimeoutInfo(undefined);\n }",
"constructor(timeou... | [
"0.6934551",
"0.68621546",
"0.6802569",
"0.67518485",
"0.6358014",
"0.63222206",
"0.63222206",
"0.62702084",
"0.62003267",
"0.61655986",
"0.6160901",
"0.61266756",
"0.6118894",
"0.61083204",
"0.60520583",
"0.604638",
"0.6040159",
"0.6017094",
"0.5982227",
"0.5982227",
"0.5982... | 0.73964053 | 0 |
Initializes an empty buffer with the provided properties. | constructor(props) {
super(props);
this.bytes = Buffer.alloc(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(initializer) {\n if (typeof initializer === 'number') {\n this.buf = Buffer.alloc(initializer);\n this.size = 0;\n this.maxSize = initializer;\n } else {\n this.buf = initializer;\n this.size = this.maxSize = initializer.length;\n }\n this.pos = 0;\n }",
"constru... | [
"0.7089455",
"0.7085109",
"0.66623455",
"0.65796965",
"0.65796965",
"0.65027857",
"0.6267338",
"0.6182023",
"0.6145859",
"0.61408466",
"0.61105543",
"0.6104162",
"0.6100621",
"0.6039449",
"0.60280025",
"0.6025077",
"0.5949356",
"0.58974594",
"0.58778524",
"0.5869487",
"0.5866... | 0.7357167 | 0 |
Process the passed arguments and send them to monitor execution. Receive: arguments to be processed | function monitorInputProcess(args)
{
//<METRIC_STATE>
var metricState = args[0].replace('"', '');
var tokens = metricState.split(',');
var metricsExecution = new Array(7);
for (var i in tokens)
metricsExecution[i] = (tokens[i] === '1');
//<HOST>
var hostname = args[1];
//<PORT>
var port = args[2];
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function monitorInput(args)\n{\n\targs = args.slice(2);\n\tif(args.length != 4)\n\t\tthrow new InvalidParametersNumberError();\n\t\n\tmonitorInputProcess(args);\n}",
"function processCommandLineArguments(args) {\n // We use a simple version of this so that nodeHostInvoke.js and\n // ptolemy/cg/kernel/gener... | [
"0.6472889",
"0.6426984",
"0.6334983",
"0.6131007",
"0.6033498",
"0.58815527",
"0.58743674",
"0.5664558",
"0.55471873",
"0.5443188",
"0.5441396",
"0.5395615",
"0.53738797",
"0.53738797",
"0.53575146",
"0.53562534",
"0.5353975",
"0.5311606",
"0.53084934",
"0.52968466",
"0.5295... | 0.64610934 | 1 |
OUTPUT METRICS Send metrics to console Receive: metrics list to output | function output(metrics)
{
for (var i in metrics)
{
var out = "";
var metric = metrics[i];
out += metric.id;
out += "|";
out += metric.value;
out += "|";
console.log(out);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"logDevices() {\n console.group('Inputs Ports');\n for (i = 0; i < WebMidi.inputs.length; i++) {\n console.log(i + ': ' + WebMidi.inputs[i].name);\n }\n console.groupEnd();\n\n console.group('Output Ports');\n for (i = 0; i < WebMidi.outputs.length; i++) {\n console.log(i + ': ' + WebMid... | [
"0.6049507",
"0.59732294",
"0.58821154",
"0.5655443",
"0.55189574",
"0.5455683",
"0.54367954",
"0.53530675",
"0.533482",
"0.5334049",
"0.5298885",
"0.52800757",
"0.5267334",
"0.52292913",
"0.52191746",
"0.5214259",
"0.516729",
"0.5155355",
"0.51540107",
"0.5153467",
"0.515208... | 0.6678268 | 0 |
Function for loading a new game | function LoadGame() {
// Your code goes here for loading a game
print("Complete this method in Singleplayer.js");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadGame(){\n\t// images\n\tbgImage.src = \"images/backgframe_480.jpg\";\n\tdude.src = \"images/person.png\";\n\tscrollImage.src = \"images/scroll.png\";\n\t\n\t// required buttons\n \tpauseButtonImage.src = \"images/gmenub1.png\";\n\t\n \tpauseButtonImage2.src = \"images/gpauseButton.png\";\n\t\n\t// tes... | [
"0.7385042",
"0.7285769",
"0.72010636",
"0.71642005",
"0.7113576",
"0.71080714",
"0.71021366",
"0.70936304",
"0.7058863",
"0.70349437",
"0.70214295",
"0.6981754",
"0.69815046",
"0.697536",
"0.69371766",
"0.6893648",
"0.68917614",
"0.6846763",
"0.6845609",
"0.68403715",
"0.681... | 0.738183 | 1 |
Format the string displaying the names of the authors of the book according to how many authors were found | formatAuthors() {
// Get the authors array
let authorsArray = this.props.book.authors;
// To store the final, desired string displaying all the author names
let authorsString = '';
if (authorsArray === undefined) {
authorsString = 'Authors unknown'
} else if (authorsArray.length === 1) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStringForAuthors (authors){\n let tempstr = '';\n authors.forEach((a, index) => { \n tempstr += `Author ${index + 1}: \\t ${a.firstName} ${a.lastName} \\n \\t\\t ${a.thumbnailURL} \\n`; \n });\n return tempstr;\n}",
"displayAuthor(authors){\r\n\t\tif(authors === undefined || auth... | [
"0.764091",
"0.6649602",
"0.6562374",
"0.65089655",
"0.65080696",
"0.64395005",
"0.6389214",
"0.63029367",
"0.6292713",
"0.62665623",
"0.6256806",
"0.6214899",
"0.61614674",
"0.6159818",
"0.61204433",
"0.6106183",
"0.60890496",
"0.60890496",
"0.60523957",
"0.6013154",
"0.5997... | 0.79375494 | 0 |
Determine the thumbnail URL. If the book doesn't have one, then use a default missing cover thumbnail image. | determineThumbnail() {
if (this.props.book.imageLinks && this.props.book.imageLinks.smallThumbnail) {
return `${this.props.book.imageLinks.smallThumbnail}`;
} else {
return `${process.env.PUBLIC_URL + '/images/missing-thumbnail.PNG'}`;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getThumbnail(book) {\n let thumbnailUrl = book.volumeInfo && book.volumeInfo.imageLinks && book.volumeInfo.imageLinks.smallThumbnail;\n return thumbnailUrl ? thumbnailUrl.replace(/^http:\\/\\//i, 'https://') : '';\n }",
"function photo() {\n //check if exist data imageLinks\n if(b... | [
"0.80788475",
"0.7200462",
"0.6873524",
"0.6629199",
"0.6617552",
"0.6603349",
"0.6546695",
"0.641231",
"0.6246978",
"0.6197686",
"0.61658424",
"0.6075983",
"0.60660386",
"0.6010708",
"0.5816931",
"0.5809752",
"0.5785718",
"0.5647669",
"0.5646945",
"0.5640693",
"0.5596575",
... | 0.8066967 | 1 |
This is a ChargeItem resource | static get __resourceType() {
return 'ChargeItem';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function purchaseItem() {}",
"function purchaseItem() {}",
"function purchaseItem() {}",
"function purchaseItem() {}",
"function purchaseItem() {}",
"function purchaseItem() {}",
"function GroceryItem(name, amount) \r\n{\r\n\tthis.name = name;\r\n\tthis.amount = amount;\r\n\tthis.purchased = false;\r\n... | [
"0.5894622",
"0.5894622",
"0.5894622",
"0.5894622",
"0.5894622",
"0.5894622",
"0.5648718",
"0.5484754",
"0.54675967",
"0.5387236",
"0.5333316",
"0.53112227",
"0.53035223",
"0.5302685",
"0.5288763",
"0.5273987",
"0.5266557",
"0.52520853",
"0.52283317",
"0.5225073",
"0.5141063"... | 0.68486315 | 0 |
Factor overriding the factor determined by the rules associated with the code. | get factorOverride() {
return this.__factorOverride;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function correctionFactor(){var args=Array.prototype.slice.call(arguments);return args.reduce(function(prev,next){var mp=multiplier(prev),mn=multiplier(next);return mp>mn?mp:mn;},-Infinity);}",
"function correctionFactor()\n\t\t\t{\n\t\t\t\tvar args = Array.prototype.slice.call(arguments);\n\t\t\t\treturn args.r... | [
"0.5878745",
"0.58135915",
"0.58052796",
"0.5788322",
"0.5788322",
"0.5788322",
"0.57853013",
"0.5661849",
"0.56220883",
"0.56220883",
"0.56220883",
"0.5621827",
"0.5621827",
"0.5621827",
"0.5621827",
"0.5621827",
"0.56106776",
"0.55528325",
"0.5544092",
"0.55208665",
"0.5305... | 0.61195886 | 0 |
If the list price or the rule based factor associated with the code is overridden, this attribute can capture a text to indicate the reason for this action. | get overrideReason() {
return this.__overrideReason;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get adjustmentReason () {\n\t\treturn this._adjustmentReason;\n\t}",
"get actionReason () {\n\t\treturn this._actionReason;\n\t}",
"get rationale () {\n\t\treturn this._rationale;\n\t}",
"function FairUseRationale() {\n\tif((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && documen... | [
"0.5724172",
"0.55355036",
"0.5340904",
"0.530332",
"0.5286042",
"0.5233523",
"0.5186967",
"0.51800877",
"0.5173163",
"0.51236737",
"0.5121449",
"0.50029266",
"0.4983257",
"0.496685",
"0.496685",
"0.4934042",
"0.4908173",
"0.4903868",
"0.48763767",
"0.48728192",
"0.4825481",
... | 0.556414 | 1 |
Date the charge item was entered. | get enteredDate() {
return this.__enteredDate;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get date () {\n\t\treturn this._date;\n\t}",
"get date () {\n\t\treturn this._date;\n\t}",
"get date () {\n\t\treturn this._date;\n\t}",
"get date () {\n\t\treturn this._date;\n\t}",
"get date () {\n\t\treturn this._date;\n\t}",
"get date () {\n\t\treturn this._date;\n\t}",
"date(e){\n this.appD... | [
"0.62318534",
"0.62318534",
"0.62318534",
"0.62318534",
"0.62318534",
"0.62318534",
"0.61872196",
"0.6114762",
"0.59980243",
"0.59980243",
"0.59980243",
"0.59980243",
"0.59980243",
"0.59980243",
"0.59347636",
"0.5764034",
"0.57629645",
"0.5718637",
"0.5711898",
"0.5705992",
"... | 0.6742161 | 0 |
Account into which this ChargeItems belongs. | get account() {
return this.__account;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get account () { return this.API.getAccount(this.address) }",
"get accounts() {\n return this._accounts;\n }",
"setAccount(value) {\n super.put(\"account\", value);\n }",
"account() {\n return new Account(this.getSDK(), this.getToken());\n }",
"function Account(client) {\n this.c... | [
"0.58699346",
"0.5868376",
"0.5849384",
"0.5717767",
"0.5658527",
"0.5637474",
"0.557768",
"0.5544751",
"0.55243903",
"0.551478",
"0.5508563",
"0.5493351",
"0.5482408",
"0.546822",
"0.54634386",
"0.54378134",
"0.54122186",
"0.54122186",
"0.5381869",
"0.53416586",
"0.5301547",... | 0.6066888 | 0 |
Does this weapon spawn have a weapon to take for player | get hasWeapon() {
return !this._on_cooldown
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"canUseWeapon(w)\n {\n // if eqWeap == -1 then this.weapons[eqWeap] -> undefined\n let r = true;\n if (w === undefined)\n return false\n else if (this.hasSkill(\"noncombatant\"))\n r = false;\n else if (w !== null && w.pref !== null && this.name != w.pref)\n r = false;\n return r;... | [
"0.7258765",
"0.71342665",
"0.69203556",
"0.6920133",
"0.67882156",
"0.67380995",
"0.6657983",
"0.6656907",
"0.6575814",
"0.64953524",
"0.6473418",
"0.6467065",
"0.64578664",
"0.63861454",
"0.6385953",
"0.63085014",
"0.6247578",
"0.6216316",
"0.6188491",
"0.6187268",
"0.61186... | 0.7396367 | 0 |
Initiates the weapon spawn cooldown and redraws it | TakeWeapon() {
this._on_cooldown = true
this._PaintSpawn()
this._last_use = Date.now()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ResetWeapon() {\n this._on_cooldown = false\n this._PaintSpawn()\n }",
"function GoOnCooldown() {\n\tonCooldown = true;\n\tSetImage(\"cooldown\");\n\tChangeKanaText(this.hirigana);\n\tthis.timeLastUsed = Time.time;\n\thudAbilities.timeLastUsed = Time.time;\n\t//Invoke(\"GoOffCooldown\", cooldown);\n}",
... | [
"0.71401083",
"0.68967754",
"0.6811699",
"0.66451585",
"0.6620004",
"0.66138464",
"0.6533706",
"0.64390326",
"0.6429527",
"0.6229924",
"0.614204",
"0.6129137",
"0.6114393",
"0.6056919",
"0.6011555",
"0.59719175",
"0.59620464",
"0.5917012",
"0.5911823",
"0.58627814",
"0.584037... | 0.75481415 | 0 |
send data to arduino | function sendToSerial(data) {
console.log("sending to serial: " + data);
port.write(data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendData() {\n // convert the value to an ASCII string before sending it:\n serialPort.write(brightness.toString());\n console.log('Sending ' + brightness + ' out the serial port');\n }",
"function sendData() {\n // convert the value to an ASCII string before sending i... | [
"0.77489036",
"0.764968",
"0.75694907",
"0.73627406",
"0.7314773",
"0.7211767",
"0.7110675",
"0.71080595",
"0.69916576",
"0.6887998",
"0.681804",
"0.6688028",
"0.66840094",
"0.6670208",
"0.6661536",
"0.66518563",
"0.6637692",
"0.65704393",
"0.65472484",
"0.64847004",
"0.64576... | 0.8176265 | 0 |
eslintdisableline react/preferstatelessfunction when initial state username is not null, submit the form to load users | componentDidMount() {
if (this.props.username && this.props.username.trim().length > 0) {
this.props.onSubmit();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_inputUser(username){\n this.setState({username:username})\n //this.username == \"\";\n\n }",
"componentDidMount() {\n if (this.props.username && this.props.username.trim().length > 0) {\n this.props.onSubmitForm();\n }\n }",
"handleSubmit(event) {\n // Stop the default form submit browse... | [
"0.7392178",
"0.7092353",
"0.7005561",
"0.6994366",
"0.6962494",
"0.694809",
"0.6924822",
"0.69241107",
"0.6912058",
"0.6908522",
"0.69064677",
"0.6897307",
"0.68587464",
"0.68531406",
"0.68471247",
"0.6831197",
"0.68275195",
"0.68063885",
"0.6785373",
"0.6774029",
"0.6750898... | 0.7107039 | 1 |
This function is executed if the above call is successful It replaces the contents of the 'message' element with the user name | function onGetUserNameSuccess() {
$('#message').append('<p>Hello ' + user.get_title() + user.get_email()+'</p>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }",
"function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }",
"function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }",
"fun... | [
"0.7576585",
"0.7576585",
"0.7576585",
"0.7576585",
"0.73536116",
"0.6967103",
"0.68805075",
"0.68635225",
"0.68258953",
"0.6765899",
"0.66507244",
"0.65929073",
"0.6575806",
"0.6524618",
"0.651199",
"0.64848816",
"0.64797735",
"0.64638835",
"0.6455026",
"0.6448979",
"0.64488... | 0.7625308 | 0 |
search subject by name | function searchByName(name) {
removeAllChild("search_display");
for (var i = 0; i < lst.length; i++) {
if (lst[i].name.includes(name))
addOneSubject(lst[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchName(name){\n var nameABC = change_alias(name).toLowerCase();\n for(let contact of listContact)\n {\n if(change_alias(contact.Name).toLowerCase().indexOf(nameABC)!== -1)\n console.log(contact);\n }\n}",
"function getSearchResult(subject, searchQuery) {\n defer = $q.defer();\... | [
"0.6428664",
"0.6401064",
"0.6335223",
"0.6193272",
"0.6167519",
"0.60860187",
"0.60284936",
"0.5955105",
"0.59342915",
"0.58798105",
"0.57814395",
"0.5764866",
"0.5725635",
"0.57164395",
"0.57126355",
"0.56463474",
"0.56459934",
"0.56395316",
"0.5633474",
"0.56320447",
"0.56... | 0.8184011 | 0 |
Get current config for user | function getConfig() {
var session = store.get('session');
return session.config
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserConfig() {\n // If the global config is not defined, load it from the file system.\n if (userConfig === null) {\n // The full path to the configuration file.\n var configPath = path.join(getRepoBaseDir(), USER_CONFIG_FILE_PATH);\n // Set the global config object.\n ... | [
"0.74080914",
"0.672794",
"0.6719625",
"0.6699218",
"0.66712606",
"0.66683215",
"0.66594636",
"0.6631863",
"0.65538704",
"0.6404812",
"0.6367725",
"0.63433325",
"0.63146013",
"0.6251875",
"0.6250547",
"0.6249417",
"0.6203619",
"0.6202636",
"0.6197801",
"0.61920923",
"0.618264... | 0.67719877 | 1 |
Share current user configuration | function shareConf() {
saveSession()
storeConfigBackend(getConfig(), (result) => {
if (result.succeed) {
var url = window.location.protocol + "//" + window.location.host + "?conf=" + result.hash
$('#shareLinkModal').modal('show');
$('#share-link-input').val(url);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserConfig() {\n // If the global config is not defined, load it from the file system.\n if (userConfig === null) {\n // The full path to the configuration file.\n var configPath = path.join(getRepoBaseDir(), USER_CONFIG_FILE_PATH);\n // Set the global config object.\n ... | [
"0.632067",
"0.6110198",
"0.6015441",
"0.600447",
"0.5948131",
"0.59376127",
"0.5831707",
"0.5826689",
"0.5799068",
"0.57873267",
"0.5776359",
"0.5740378",
"0.57145655",
"0.5688188",
"0.56791097",
"0.56791097",
"0.56791097",
"0.56791097",
"0.56791097",
"0.56791097",
"0.567737... | 0.6377021 | 0 |
Build a human summary for current user configuration | function buildHumanSummary(config) {
var summary = "# Logstash configuration summary\n"
summary += "\n## Input\n"
summary += "\n### Data sample\n"
if(config.input_data.trim().length == 0) {
summary += "\n> No data provided\n"
} else {
summary += "\n```\n"
summary += config.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function summarizeUser(userName, userAge, userHasHobby){\n return (\n 'Name is ' + userName +\n ', age is ' + userAge +\n ', and the user has hobbies : ' + userHasHobby\n );\n}",
"describe() { return this._userMetrics; }",
"function getUserStatistics() {\n var getUserStatUrl =... | [
"0.6002524",
"0.5611119",
"0.55987865",
"0.55077535",
"0.5467898",
"0.5465485",
"0.54372114",
"0.5400447",
"0.5398816",
"0.53501606",
"0.5345484",
"0.53137296",
"0.5305613",
"0.52903724",
"0.52774763",
"0.52362525",
"0.5235434",
"0.5217091",
"0.5207075",
"0.5190253",
"0.51866... | 0.632941 | 0 |
function displaying the structures found in the data folder (and in the data object) receiving as argument code and including it in the HTML of the display | function displayData(dataStructure) {
editorDisplay.innerHTML = `<pre class="display--data"><code>${dataStructure}</code></pre>`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render(files, code, summary) {\n files.sort()\n files_ = files;\n code_ = code;\n summary_ = summary;\n var buffer = \"\";\n var last_pkg = null;\n\n // compute percent for files and packages. Tally information per package, by\n // tracking total lines covered on any file in the package\n\n for (... | [
"0.6439746",
"0.6420498",
"0.6394839",
"0.6394839",
"0.62132114",
"0.6105128",
"0.6098603",
"0.60693",
"0.597209",
"0.59564024",
"0.59382546",
"0.5927122",
"0.5907685",
"0.5870798",
"0.58566874",
"0.58497924",
"0.58493704",
"0.58318657",
"0.5807251",
"0.57418245",
"0.574143",... | 0.67501205 | 0 |
function called in response to a click event on one of the buttons in the data folder retrieving the datavalue attribute and populating the HTML with the matching data structure | function handleData(target) {
const dataValue = target.getAttribute('data-value');
displayData(`const ${dataValue} = ${JSON.stringify(data[dataValue], null, 10)}`);
// function highlighting the selected button
handleActive(target);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addDataToViewDataButton() {\n // loops through each match selected_team was in\n for (let match_id in stand_data[selected_team]) {\n // match is an object\n let match = stand_data[selected_team][match_id];\n // traverses through each question in match and adds result to View Data Button\n tr... | [
"0.6318738",
"0.609104",
"0.601177",
"0.6006118",
"0.59535015",
"0.5946081",
"0.5826049",
"0.5808803",
"0.57986414",
"0.5797989",
"0.5751422",
"0.57504016",
"0.572342",
"0.57150024",
"0.5709912",
"0.5683199",
"0.5654445",
"0.56509763",
"0.5617926",
"0.5617926",
"0.5603652",
... | 0.63557523 | 0 |
function displaying the exercises found in the exercises folder (and in the exercises object) receiving as argument the value wrapped in between backticks and injecting it in the display | function displayExercise(exerciseStructure) {
editorDisplay.innerHTML = `
<div class="display--exercise">
${exerciseStructure}
</div>
`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAllExercisesPage(){\n showExercisesPage(exercises, '/exercises');\n}",
"function displayExercise() {\n pickRandomExercise();\n displayBox.innerHTML = `${output.reps} <span class=\"multiplier\">×</span> ${output.exercise}`;\n}",
"function buildAndShow () {\n\tsectionNameContainer.innerText = ex... | [
"0.62609947",
"0.60954416",
"0.6048812",
"0.57041633",
"0.55791974",
"0.5547291",
"0.55028164",
"0.5465681",
"0.54575497",
"0.5457072",
"0.5452173",
"0.54195416",
"0.5409195",
"0.53758395",
"0.5369208",
"0.53260475",
"0.5304782",
"0.5286457",
"0.52758986",
"0.5267258",
"0.524... | 0.70235175 | 0 |
Author: John Herring Create Write Back Html (Signal Write Control) Summary: Create Signal Write Object, Used to write value changes from radio Buttons Implementation: This must be called for each radio button set required Inputs: Variable Type Description Required RB_Wrt_DivID String Div ID which is included in the Sig... | function CreateRadioButtonWriteBackHtml(RB_Wrt_DivID,SignalName)
{
var SignalID=(SignalName.replace(".","_"));
SignalID=(SignalID.replace("@",""));
var prmN = "<param name=\"";
var val = " value=\"";
var RadioWriteBackHtml= "<object" + " classid=\"clsid:B86708D4-7557-4AFB-86E0-CB6F58BAF19A\"" + " id=\"" + Si... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function report_writeControlActionsHeading()\n{\n WRITE(\"\");\n WRITE(\"*********************\");\n WRITE(\"Control Actions Taken\");\n WRITE(\"*********************\");\n Frpt.contents += \"\\n\";\n}",
"function defineControlPanelInnerHTML() {\r\n\r\n// CONTROL PANEL\r\n\r\nfirstLineLabelsHTML... | [
"0.57206315",
"0.56686175",
"0.5562836",
"0.5556806",
"0.55540204",
"0.55444944",
"0.5495192",
"0.54437685",
"0.542675",
"0.5421334",
"0.54194677",
"0.5380551",
"0.5361093",
"0.5355408",
"0.53223693",
"0.5240988",
"0.52385426",
"0.5219011",
"0.517337",
"0.5171287",
"0.5126359... | 0.7227735 | 0 |
Author: John Herring Disable Radio Button ("Grey Out") Summary: This Disables all RadioButtons in a set, Used by functions and script to turn off the radio buttons while value is unknown (Startup and Update Pending) Implementation: This is called by the script and RB Functions Inputs: Variable Type Description Required... | function DisableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved
{
for (sLoop=Low;sLoop<High;sLoop++)
{
document.getElementById(RB_DivID+sLoop).disabled=1;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EnableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved\n{\n\n for (sLoop=Low;sLoop<High;sLoop++)\n {\n document.getElementById(RB_DivID+sLoop).disabled=0;\n }\n}",
"function frmCareTrackingprogramARTended(rdoARTpEndedY, rdoARTpEndedN, rdo... | [
"0.70418394",
"0.67249846",
"0.65139663",
"0.63866746",
"0.6324247",
"0.62972575",
"0.628403",
"0.6241047",
"0.62339157",
"0.62163013",
"0.6210344",
"0.6197493",
"0.61602306",
"0.61454713",
"0.61300117",
"0.6129992",
"0.6115688",
"0.6115061",
"0.6090243",
"0.60618",
"0.606107... | 0.747558 | 0 |
Author: John Herring Enable Radio Button (Allow Input, Trigger Click Event) Summary: This Disables all RadioButtons in a set, Used by functions and script to turn off the radio buttons while value is unknown (Startup and Update Pending) Implementation: This is called by the script and RB Functions Inputs: Variable Type... | function EnableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved
{
for (sLoop=Low;sLoop<High;sLoop++)
{
document.getElementById(RB_DivID+sLoop).disabled=0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DisableRadioButton(Low,High,RB_DivID)// This greys out the radio buttons until the value can be retrieved\n{\n\n for (sLoop=Low;sLoop<High;sLoop++)\n {\n document.getElementById(RB_DivID+sLoop).disabled=1;\n }\n}",
"function frmCareTrackingprogramARTended(rdoARTpEndedY, rdoARTpEndedN, rdoCa... | [
"0.73734283",
"0.6768886",
"0.6423675",
"0.6381207",
"0.63627285",
"0.63442725",
"0.6311423",
"0.6271402",
"0.6249175",
"0.6207519",
"0.6188234",
"0.6174951",
"0.61343575",
"0.60998553",
"0.6094503",
"0.607634",
"0.6069642",
"0.6050392",
"0.60382074",
"0.6036399",
"0.6024607"... | 0.71187603 | 1 |
Set Radio Button "Checked" Author: John Herring Set Radio Button "Checked" Summary: This Function Sets a Radio Button Checked this should be used by applications that Do Not interact with RTU Signals use instead UpdateRadioButton which is signal "Aware" Implementation: This is called by the script and RB Functions Inpu... | function SetCheckedRadioButton(RB_DivID,Value)
{
document.getElementById(RB_DivID + Value).checked = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRadioButtonR(){\t\r\n\tif (polygon) {\r\n\t\tconsole.log(\"a\")\r\n\t\tdocument.getElementById('r1').checked = \"checked\";\r\n\t\t//document.getElementById('r2').checked = \"unchecked\";\r\n\t}else{\r\n\t\tconsole.log(\"b\")\r\n\t\tdocument.getElementById('r2').checked = \"checked\";\r\n\t\t//document... | [
"0.6956176",
"0.6753326",
"0.66908336",
"0.66626906",
"0.6590258",
"0.65428644",
"0.6448621",
"0.642374",
"0.6408241",
"0.6382626",
"0.6284636",
"0.627887",
"0.6261711",
"0.62271315",
"0.6216299",
"0.62008834",
"0.6158295",
"0.61353576",
"0.6117534",
"0.6108819",
"0.6102821",... | 0.78254986 | 0 |
Author: John Herring Check Arrays Programmer Help Summary: Programmer Help checks the two arrays that configure the Text and Numbers for the radiobuttons Implementation: This is called by the script and RB Functions Inputs: Variable Type Description Required TxtArray Array Text Array Containing Text for Radio Buttons Y... | function CompareArrays(TxtArray, ValArray, ID)
{
if (TxtArray != ValArray)
{
var newVariable = " Declaration RadioText and RadioValue SHOULD contain the same number of text / number pairs";
alert("Control ID " + ID + newVariable);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveAnswer(){\n \n var answerArray=new Array(counter)//counter //answerArray=counter,solution,required,degree\n for(var i=0;i<answerArray.length;i++){\n answerArray[i]=new Array(2);\n }\n \n //alert(\"answerArray \"+answerArray.length)\n var questionText=document.getElem... | [
"0.5885829",
"0.58208644",
"0.5794934",
"0.56070507",
"0.5598715",
"0.5550131",
"0.5542665",
"0.5537791",
"0.5514167",
"0.5490522",
"0.54902077",
"0.5482401",
"0.54553217",
"0.5452091",
"0.5449308",
"0.54430133",
"0.54344076",
"0.5423686",
"0.5394534",
"0.5390134",
"0.5340148... | 0.73767436 | 0 |
Tree and accounts management | function openTree(){
var module ={};
module.name = 'accounts';
module.title = getLang('accounts');
module.div = '#account_main_td';
module.data = 'tree';
loadModule(module);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildAccountTree() {\n var accountTree = { id: \"accounts\", name: \"Accounts\", children: [] };\n\n \n accounts.forEach(function(account) {\n addIfChild(accountTree, account);\n });\n \n\n return accountTree;\n }",
"function initializeAccountInfo() {\n var accountInfo = {};\n... | [
"0.71867925",
"0.6173943",
"0.6056641",
"0.5913788",
"0.58057594",
"0.560966",
"0.55278695",
"0.5505399",
"0.5485203",
"0.5439546",
"0.5408099",
"0.5393346",
"0.5392092",
"0.5363494",
"0.5262171",
"0.5255932",
"0.52365035",
"0.5225921",
"0.5213197",
"0.5179611",
"0.51490265",... | 0.6860154 | 1 |
find list item in navbar by its name. | function findTranslationsListItem(translationsListItemName) {
const nav = document.querySelector("nav");
if (null == nav) {
return null;
}
const ul = nav.querySelector("ul");
if (null == ul) {
return null;
}
const listItems = ul.querySelectorAll("li");
if (null == listI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findNavItem(el,target) {\n\tExt.Ajax.request({\n\t\turl: \"com/parser.cfc\",\n\t\tparams: {method:\"getPageID\",returnformat:\"json\",identifier:el,target:target},\n\t\tsuccess: manageNav\n\t});\t\n}",
"function findItemByFieldName(list, name, value) {\n var index = findIndexByFieldName(l... | [
"0.5993533",
"0.5975098",
"0.596733",
"0.5829188",
"0.58218694",
"0.5820335",
"0.56697524",
"0.5660127",
"0.56197125",
"0.55525684",
"0.5533182",
"0.5526052",
"0.54756933",
"0.5474559",
"0.54145014",
"0.5406571",
"0.5386848",
"0.535505",
"0.53546745",
"0.53536147",
"0.5353567... | 0.7054383 | 0 |
Spotify This Song portion | function renderSpotifyThisSong() {
//If no song is provided then your program will default to "The Sign" by Ace of Base.
if (!search) {
search = "The+Sign";
}
spotify.search({ type: "track", query: search }, function (err, response) {
// If the code experiences any errors it will log t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function spotifyThis(songTitle) {\n spotify.search({\n type: 'track',\n query: songTitle\n }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n //return the Artist, Song Name, Perview Link and Album Name. \n console.log(`${mainDivider}\\n${'Artist Na... | [
"0.79142",
"0.78473634",
"0.7705921",
"0.76950395",
"0.7657827",
"0.7648825",
"0.7642504",
"0.7635603",
"0.76285356",
"0.7619065",
"0.7599834",
"0.75580806",
"0.7546594",
"0.75436306",
"0.75297946",
"0.75091326",
"0.75055945",
"0.7501908",
"0.7464799",
"0.74383074",
"0.742006... | 0.79008627 | 1 |
Load category create form and error messages | load() {
const div = document.getElementById('createCategory')
if (div == null) { return }
creatErrorTag()
createFormSumbission()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function manageCategories(){\n \n //determine clicked button \n switch(this.id){\n case 'add-category':\n \n //get category name input\n var categoryName = ($(\"input[name='newCategoryName']\").val()).trim(); \n \n //check if user input is val... | [
"0.6434687",
"0.63981605",
"0.63685066",
"0.6332768",
"0.63076574",
"0.6258051",
"0.6250775",
"0.6242046",
"0.62368584",
"0.6235375",
"0.59929883",
"0.5992557",
"0.5973251",
"0.5954382",
"0.5932176",
"0.5908757",
"0.59083086",
"0.5900942",
"0.5887479",
"0.58575094",
"0.583035... | 0.77904576 | 0 |
Returns the OCR method to be used for a particular language. All latintext lanuages return "rekognize", everything else returns "tesseract". | function getOCRMethodBySourceLanguage(srcLang) {
const latinLangs = ['auto', 'czech', 'danish', 'dutch', 'english', 'finnish', 'french', 'german', 'indonesian', 'italian', 'polish', 'portugese', 'spanish', 'swedish', 'turkish'];
if (latinLangs.includes(srcLang.toLowerCase()) && imageTranslateApp.pdf == false) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getOCRSupportedLanguagesAsync() {\n return __awaiter(this, void 0, void 0, function* () {\n const url = `${app_config_1.CopyleaksConfig.API_SERVER_URI}/v3/miscellaneous/ocr-languages-list`;\n const headers = {\n 'Content-Type': 'application/json',\n 'User-... | [
"0.5849795",
"0.5843842",
"0.58022946",
"0.5722459",
"0.5696092",
"0.5472849",
"0.5439047",
"0.54256046",
"0.54127544",
"0.5369687",
"0.53119004",
"0.5290536",
"0.5283779",
"0.5247644",
"0.5238991",
"0.52184474",
"0.5211983",
"0.51896",
"0.51837915",
"0.5180386",
"0.5158492",... | 0.82569987 | 0 |
Make an OCR request to the backend which uses some 3rd party API. In particular the backend uses Amazon Rekognition for now, but the frontend shouldn't need to know those details. | function backendOCR(base64Image, imageWidth, imageHeight) {
ocrReq({image: base64Image})
.then(lines => {
lines.lines = lines;
for (var idx = 0; idx < lines.lines.length; idx++) {
lines.lines[idx].bbox.x0 = Math.round(lines.lines[idx].bbox.x0 * imageWidth);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function checkForTextDetection(base64) {\n\nreturn await\n fetch('https://vision.googleapis.com/v1/images:annotate?key=AIzaSyBcX1IYn6jGU-mTOLoRXT03slD20ZJjgak', {\n method: 'POST',\n body: JSON.stringify({\n \"requests\": [\n {\n \"image\": {\n \"content\": base64\n ... | [
"0.6289856",
"0.6036137",
"0.5937973",
"0.5914487",
"0.5814056",
"0.5802589",
"0.56942475",
"0.5553049",
"0.5472343",
"0.5469572",
"0.5445444",
"0.5411291",
"0.5369433",
"0.5293092",
"0.5269261",
"0.5263671",
"0.5261906",
"0.5257474",
"0.52398974",
"0.52395314",
"0.5205802",
... | 0.64843607 | 0 |
Pass the OCR result here and process the detected segments appropriately. | function handleOCRResult(result) {
const destLang = document.getElementById('language-dest-select').value;
const srcLang = document.getElementById('language-src-select').value;
console.log('Destination langauge: ' + destLang);
console.log('Source language: ' + srcLang);
const boundingBoxes = {}; /... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ocrRoutine(imageData) {\r\n var ocrResults = callFuckingAPI(imageData);\r\n var words = extractAllWords(ocrResults);\r\n var boxes = generateBoxObjects(words);\r\n var sorted = sortByY(boxes);\r\n var aligned = calculateAlignments(sorted);\r\n var lines = squash(aligned);\r\n var parsedLines = pars... | [
"0.624712",
"0.58708155",
"0.5827043",
"0.5761522",
"0.5699912",
"0.56428504",
"0.52387816",
"0.5217737",
"0.5193425",
"0.5188902",
"0.51438683",
"0.51438683",
"0.5133014",
"0.5128019",
"0.51085234",
"0.5088055",
"0.5081085",
"0.5078504",
"0.5072597",
"0.50635314",
"0.5053154... | 0.6203788 | 1 |
f :: [(Sym, Expr)] > [Define] | function f(b) {
return Parser.Define(b.elements);//inding);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dsgr_define(ast) {\n\t\tif (ast.children[0].text==\"define\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"Invalid define\");\n\t\t\t}\n\t\t\t// Function define sugar\n\t\t\tif (!util.is_leaf(ast.children[1])) {\n\t\t\t\tvar lambda_ar... | [
"0.5597213",
"0.5206511",
"0.50836134",
"0.5012972",
"0.49896094",
"0.4946336",
"0.4943372",
"0.491056",
"0.49066767",
"0.49042577",
"0.49042577",
"0.48859864",
"0.4872491",
"0.48161754",
"0.48106468",
"0.47749093",
"0.4761773",
"0.4756027",
"0.47464344",
"0.47302255",
"0.472... | 0.60137194 | 0 |
Executes when the extensions loaded every time the app start. | initExtension() {
return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initExtensions() {\n //\tInvoke \"before\" hook.\n this.trigger('initExtensions:before');\n //\tConvert array to object with array.\n if (type(this.opts.extensions) == 'array') {\n this.opts.extensions = {\n all: this.opts.extensions\n };\n }... | [
"0.67504835",
"0.67249906",
"0.6669881",
"0.6635896",
"0.6503482",
"0.64756876",
"0.64508855",
"0.64489186",
"0.64348304",
"0.641937",
"0.6387614",
"0.63645244",
"0.63629454",
"0.63489425",
"0.630805",
"0.62480736",
"0.6244289",
"0.62328327",
"0.62283844",
"0.6208138",
"0.620... | 0.67707765 | 0 |
selecting all the games which are of the category "awaited" | function getAwaitedGames() {
let xmlContent = "";
fetch("https://gamezone.ninja/Resources/games.xml").then((response) => {
response.text().then((xml) => {
xmlContent = xml;
let parser = new DOMParser();
let xmlDOM = parser.parseFromString(xmlContent, "application/xml");
let games = xmlDO... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getCategories() {\n //get categories from API\n const res = await axios.get('https://jservice.io/api/categories?count=100')\n\n //categories to be returned.\n let result = []\n\n //keeps track of which categories have already been selected to avoid duplicated.\n let ... | [
"0.5245131",
"0.5197031",
"0.51728344",
"0.5104838",
"0.5032745",
"0.502098",
"0.50167",
"0.49656564",
"0.4924143",
"0.49239203",
"0.4908673",
"0.48793224",
"0.4862502",
"0.48588097",
"0.48559198",
"0.4852968",
"0.48501077",
"0.4833821",
"0.4827141",
"0.48214695",
"0.47820178... | 0.5531385 | 0 |
Helper function used in the preprocess call for drag/drop boards Sets the id of all 'li' elements to cat,board,childof for use in the $_POST back to the xmlcontroller | function setBoardIds()
{
// For each category of board
$("[id^=category_]").each(function() {
var cat = $(this).attr('id').split('category_'),
uls = $(this).find("ul");
// First up add drop zones so we can drag and drop to each level
if (uls.length === 1)
{
// A single empty ul in a category, this can... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fn_movealllistitems(leftlist,rightlist,id,userid)\n{\t\n\tif(id == 0)\n\t{\n\t\t$(\"div[id^=\"+leftlist+\"_]\").each(function()\n\t\t{ \n\t\t\tvar clas = $(this).attr('class');\n\t\t\tvar temp = $(this).attr('id').replace(leftlist,rightlist);\n\t\t\t\n\t\t\t$(this).attr('id',temp);\n\t\... | [
"0.5809011",
"0.5678616",
"0.56779975",
"0.5660606",
"0.5593637",
"0.5520027",
"0.5481056",
"0.5480607",
"0.5427404",
"0.5420471",
"0.5419936",
"0.5413005",
"0.5403025",
"0.5390055",
"0.53616977",
"0.5348532",
"0.5339024",
"0.533704",
"0.53346455",
"0.532562",
"0.52953756",
... | 0.78472817 | 0 |
when we open any webpage, if any ad's come, we will close it | async function closeAd(url) {
try {
const browser = await puppeteer.launch({
headless: false,
slowMo: 50, // for slowing a bit
defaultViewport: null, // null the default viewport
args: ["--start-maximized"], // for full screen
});
console.lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeAd(){\r\nhideLayer('coverad');\r\n}",
"function _close(){\n $.webview.url = \"\";\n $.win.close();\n}",
"function hideAd(){\r\n\t\tvar ad = find(\"//iframe\", XPFirst);\r\n\t\tif (ad) ad.style.display = 'none';\r\n\t}",
"function homePage() {\r\n //-- Kill ads\r\n noAds('home');\r\n}",
... | [
"0.6528285",
"0.63760537",
"0.6362799",
"0.6016817",
"0.60166764",
"0.60020095",
"0.5990633",
"0.59654284",
"0.59391385",
"0.587998",
"0.5850677",
"0.5843495",
"0.58319557",
"0.574371",
"0.56692785",
"0.5653568",
"0.5650363",
"0.56430763",
"0.5634806",
"0.5615445",
"0.5613168... | 0.6440987 | 1 |
new xaxis based on new xlinscale | function initXaxis(xLinScale, xAxis) {
var bottomAx = d3. axisBottom(xLinScale);
xAxis.transition()
.duration(1000)
.call(bottomAx);
return xAxis;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateXScale(xData,curXAxis){\n var xLineraScale = d3.scaleLinear()\n .domain([d3.min(xData, d=> d[curXAxis]),d3.max(xData, d=> d[curXAxis])])\n .range([0,chartWidth]);\n return xLineraScale; \n\n}",
"function updateXscale(data, chosen_x_axis) {\n var x_scale = d3.scaleLinear... | [
"0.7620917",
"0.74574435",
"0.7295982",
"0.7261585",
"0.72515714",
"0.72424734",
"0.7216801",
"0.715902",
"0.7136097",
"0.7123373",
"0.7084097",
"0.705522",
"0.70550513",
"0.7039497",
"0.70332",
"0.7015694",
"0.7014856",
"0.701442",
"0.7013564",
"0.7009487",
"0.7003562",
"0... | 0.75153404 | 1 |
function to change the image src and alt attributes upon clicking the button | function changeImage(){
//confirm onclick is working
console.log('user clicked the button')
//change the image source to that of a pygmy owl
image.setAttribute('src', 'img/nopo.jpg')
//change the alt attribute to read 'pygmy owl'
image.setAttribute('alt', 'pygmy owl')
//change class to suit pygmy photo
image.cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeImage(e) {\n e.preventDefault();\n alert('entered changeImage()');\n newImg = 'dog';\n image.setAttribute('alt', 'Adorable Puppy');\n image.setAttribute('src', `images/${newImg}.jpg`);\n caption.innerHTML = image.getAttribute('alt');\n}",
"function imgClick(event) {\n modal.style.display ... | [
"0.7302668",
"0.7082382",
"0.70316386",
"0.69717175",
"0.6961068",
"0.6895961",
"0.6881492",
"0.68645734",
"0.6855446",
"0.6829927",
"0.68026686",
"0.67583317",
"0.6747737",
"0.6731539",
"0.67211217",
"0.66919136",
"0.6651698",
"0.66416407",
"0.6623315",
"0.6604149",
"0.65990... | 0.7983228 | 0 |
Apply visibility to style layers that fits the filter function. | applyLayoutVisibility() {
const { visible } = this;
const { mbMap } = this.mapboxLayer;
if (!mbMap) {
return;
}
const style = mbMap.getStyle();
if (!style) {
return;
}
if (this.styleLayersFilter) {
const visibilityValue = visible ? 'visible' : 'none';
for (let... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onChangeVisible() {\n const { mbMap } = this.mapboxLayer;\n if (!mbMap) {\n return;\n }\n const currentLayer = this.getCurrentLayer();\n const filterRegex = new RegExp(`^ipv_(${currentLayer})$`);\n this.getDvLayers()?.forEach((stylelayer) => {\n mbMap.setLayoutProperty(\n stylela... | [
"0.7464933",
"0.69427204",
"0.6806239",
"0.6620304",
"0.645473",
"0.64380306",
"0.64138776",
"0.6204068",
"0.61427385",
"0.60933876",
"0.6075729",
"0.60612994",
"0.6050295",
"0.59828174",
"0.5950291",
"0.59157336",
"0.5903434",
"0.58687407",
"0.58304435",
"0.57860607",
"0.578... | 0.76074404 | 0 |
plugin detection for IE | function hasIEPlugin(name){
try {
new ActiveXObject(name);
return true;
} catch (ex){
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasIEPlugin(name){\r\n try {\r\n new ActiveXObject(name);\r\n return true;\r\n } catch (ex){\r\n return false;\r\n }\r\n}",
"function vpb_IE_detected()\n{\n var ua = window.navigator.userAgent;\n var old_ie = ua.indexOf('MSIE ');\n var new_ie = ua.indexOf('Trident/... | [
"0.78473973",
"0.7165533",
"0.7100029",
"0.7001705",
"0.69932526",
"0.6990312",
"0.6990312",
"0.6990312",
"0.6990312",
"0.6990312",
"0.6990312",
"0.6990312",
"0.69807273",
"0.6948592",
"0.6948592",
"0.69396037",
"0.6924312",
"0.6904215",
"0.68984824",
"0.68972945",
"0.6844151... | 0.7862901 | 0 |
detect quicktime for all browsers | function hasQuickTime(){
var result = hasPlugin("QuickTime");
if (!result){
result = hasIEPlugin("QuickTime.QuickTime");
}
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasQuickTime() {\n var result = hasPlugin(\"QuickTime\");\n if (!result){\n result = hasIEPlugin(\"QuickTime.QuickTime\");\n }\n return result;\n}",
"function now() {\r\n return window.performance.now();\r\n}",
"now() {\n return window.performance.now();\n }",
"function u(e){retu... | [
"0.6580741",
"0.61871743",
"0.6001974",
"0.58428663",
"0.58310497",
"0.5818512",
"0.5809273",
"0.5809273",
"0.5799265",
"0.5799265",
"0.5791248",
"0.57296723",
"0.5677882",
"0.5655739",
"0.56378466",
"0.5621445",
"0.5618422",
"0.5581474",
"0.55777466",
"0.55746603",
"0.556664... | 0.6655557 | 0 |
Interpolate from WellPoints to Hexes Using Turf | function createHexes(wellPoints) {
hexLayer.clearLayers();
var interpShape = document.querySelector('input[name="shape"]:checked').value;
console.log(interpShape);
var interpUnits = document.querySelector('input[name="units"]:checked').value;
console.log(interpUnits);
var options = {gridTy... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"threeHex(hR) {\n hR = hR || this.R\n \n let minT = this._minT\n let majT = this._majT\n let noise = (x,y)=>{\n return this._noise.noise3D(x, y, 0)\n }\n const HEIGHTS = {\n \"deepWater\": {base:-1, d:0, peak: 0},\n \"shallowWater\": {base:0, d:0, peak: 0},\n ... | [
"0.58326495",
"0.5672862",
"0.5608623",
"0.5596735",
"0.5581578",
"0.55636567",
"0.5536953",
"0.5474493",
"0.54620004",
"0.54448026",
"0.54272306",
"0.5399277",
"0.5380373",
"0.53780913",
"0.53716016",
"0.5352292",
"0.5343764",
"0.5337634",
"0.5311541",
"0.5296596",
"0.528420... | 0.69922644 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.