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 |
|---|---|---|---|---|---|---|
Returns the function that gets information about a form. | function getGetFormInfo(services) {
return function (id) {
// Variables.
var url = services.formulateVars.GetFormInfo;
var params = {
FormId: id
};
// Get form info from server.
return services.formulateServer.get(url, params, function (data) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get form() { return this._internals.form; }",
"function Anthem_GetForm() {\n var form = document.getElementById(Anthem_FormID);\n return form;\n}",
"get form() {\n return this.internals_.form;\n }",
"function getForm() {\n\treturn {\n\t\tpdfServer: document.getElementById(\"pdf_saver\"),\n\t\tpdfCo... | [
"0.6818754",
"0.67420137",
"0.6739344",
"0.67325294",
"0.6600797",
"0.6600797",
"0.65780485",
"0.6417994",
"0.64142346",
"0.63728297",
"0.63083714",
"0.62712365",
"0.6210561",
"0.6210561",
"0.6210561",
"0.6210561",
"0.6204662",
"0.61395687",
"0.60729474",
"0.60571",
"0.604608... | 0.6904003 | 0 |
Returns the function that persists a form on the server. | function getPersistForm(services) {
return function (formData, isNew) {
// Variables.
var url = services.formulateVars.PersistForm;
var data = {
ParentId: formData.parentId,
Alias: formData.alias,
Name: formData.name,
Fields: formData.fields.m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save_Form_LocalStorage_EProof__SID__(pForm,pOut) {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging\n\t//alert(\"eproof.js:save_Form_LocalStorage()-Call\"+this.CR+pOut);\n\t//----Create Object/Instance of EProof__SID__----\n\t// var ... | [
"0.6441257",
"0.6409301",
"0.6248604",
"0.6248604",
"0.62043935",
"0.6083506",
"0.60636526",
"0.5975399",
"0.5832302",
"0.57995033",
"0.5769065",
"0.57271767",
"0.56995225",
"0.5682804",
"0.56740046",
"0.566829",
"0.5640992",
"0.5638285",
"0.56293076",
"0.55977726",
"0.558999... | 0.6433734 | 1 |
Returns the function that deletes a form from the server. | function getDeleteForm(services) {
return function(formId) {
// Variables.
var url = services.formulateVars.DeleteForm;
var data = {
FormId: formId
};
// Send request to delete the form.
return services.formulateServer.post(url, data, function () {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDeleteConfiguredForm(services) {\n return function(conFormId) {\n\n // Variables.\n var url = services.formulateVars.DeleteConfiguredForm;\n var data = {\n ConFormId: conFormId\n };\n\n // Send request to delete the configured form.\n return servi... | [
"0.69291484",
"0.6634909",
"0.64673674",
"0.6173484",
"0.6129628",
"0.60613865",
"0.60247016",
"0.5987337",
"0.59568906",
"0.5955956",
"0.59452915",
"0.594393",
"0.5892231",
"0.5870033",
"0.5859406",
"0.5852593",
"0.5831024",
"0.5811672",
"0.58062476",
"0.57821107",
"0.575054... | 0.74319196 | 0 |
Returns the function that moves a form. | function getMoveForm(services) {
return function (formId, newParentId) {
// Variables.
var url = services.formulateVars.MoveForm;
var data = {
FormId: formId,
NewParentId: newParentId
};
// Send request to persist the form.
return services.fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function z(e,i,t){u(e,i),\"function\"==typeof t&&t(),ti.trigger({type:gi.formmoved,srcindex:e,destindex:i}),ti.trigger(gi.formschanged)}",
"moveF (from, to) {\n this.doMove(Move.convertDefaultNotation(this, from, to))\n this.nextTurn()\n }",
"onApplyMove(move) {}",
"function moveFormStart(fo... | [
"0.60553193",
"0.57355386",
"0.57047665",
"0.5594025",
"0.55509514",
"0.5391951",
"0.5310598",
"0.53024787",
"0.5282903",
"0.5282903",
"0.5257915",
"0.52573454",
"0.52540135",
"0.5252212",
"0.52284354",
"0.5215602",
"0.52090985",
"0.5193143",
"0.5174217",
"0.51635104",
"0.516... | 0.6042526 | 1 |
Returns the function that duplicates a form from the server. | function getDuplicateForm(services) {
return function (formId, parentId) {
// Variables.
var url = services.formulateVars.DuplicateForm;
var data = {
FormId: formId,
ParentId: parentId
};
// Send request to delete the form.
return services.fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"netzkeOnDupInForm() {\n const selModel = this.getSelectionModel();\n const recordId = selModel.getSelection()[0].getId();\n this.netzkeLoadComponent(\"edit_window\", {\n title: \"Duplicate in Form\",\n serverConfig: {\n record_id: recordId\n },\n callback(w) {\n w.show();... | [
"0.60755515",
"0.5822059",
"0.5815009",
"0.5631121",
"0.53628904",
"0.5207346",
"0.51995265",
"0.51978445",
"0.5195418",
"0.5170768",
"0.51623696",
"0.51623696",
"0.51623696",
"0.5124703",
"0.51183206",
"0.51124144",
"0.51008934",
"0.50820994",
"0.5076438",
"0.50441957",
"0.5... | 0.6791771 | 0 |
This is the most important part of this project. This component is the most important parent component because it holds the key state variables namely the array of all the tweets. So every child will either be reading that list or writing to it. So it is this component's job to adequately pass the necessary information... | render() {
return (
<div id="user-profile-component">
<div id="tweet-box" className="row">
<div className="center-block">
<TweetBox addTweetHandler={this.addTweet} />
</div>
</div>
<div id... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render(){\n\n return (\n <Subscribe to={[ UserState ]}>\n {(user) =>{\n if (!this.state.loaded) {\n this.loadTweet(user)\n }\n return (<div >\n <Dashboard user={user}/>\n <div className='post'>\n {this.state.edit ? (<div><div className='te... | [
"0.6823891",
"0.6679757",
"0.65347064",
"0.6297894",
"0.60952276",
"0.5909918",
"0.59061587",
"0.5777718",
"0.576331",
"0.5687782",
"0.5602767",
"0.5600575",
"0.55687517",
"0.55518556",
"0.55391777",
"0.55104625",
"0.54935443",
"0.5493241",
"0.54651546",
"0.5464525",
"0.54585... | 0.791974 | 0 |
Sends an XHR to Loris to load the current canvas as a blob and updates the "Download Current Image" link to point to it in a download attribute | function xhrProcessor() {
if (bcViewer.viewer.workspace.slots.length == 1) {
var slot = bcViewer.viewer.workspace.slots[0];
} else {
// TODO: handle multiple slots
}
var mirWindow = slot.window;
var imgId = mirWindow.focusModules.ImageView.currentImg["label"],
canvasUriBase = 'http://scenery.bc.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadImage() {\n\tlet dataURL = scrambledCanvas.toDataURL('image/png')\n\tthis.href = dataURL\n}",
"function download(){\n document.getElementById(\"downloader\").download = \"image.png\";\n document.getElementById(\"downloader\").href = document.getElementById(\"defaultCanvas0\").toDataURL(\"i... | [
"0.68575054",
"0.6619198",
"0.6538427",
"0.6502226",
"0.643904",
"0.64319",
"0.6427889",
"0.6360007",
"0.62739295",
"0.6243994",
"0.6201245",
"0.6177914",
"0.6093762",
"0.6078353",
"0.6025673",
"0.60193384",
"0.5961022",
"0.59345734",
"0.58894455",
"0.58878154",
"0.58859617",... | 0.7327856 | 0 |
convert the extracted list of system of units to SemObjects objects | function convertSystem() {
// log
log( 'parsing systems of units' );
// results
var resultsAll = [],
resultsPerOnto = {};
// get list of ontologies
var ontos = OntoStore.getOntologies();
// process all ontologies
for( var onto of ontos ) {
// load raw ontology data
var d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getConvertableUnits() {\n const url = `${this.apiUrl}unit?q={\"scaler\":{\"$not\":0}}`;\n const response = await fetch(url, {\n method: 'get',\n headers: {\n 'x-apikey': this.apikey,\n },\n });\n if (response.status >= 400) {\n throw Error(response.statusText);\n }\n... | [
"0.5792666",
"0.5606766",
"0.5604519",
"0.5491021",
"0.5420448",
"0.5291635",
"0.52233076",
"0.50506824",
"0.50159633",
"0.4998853",
"0.4944696",
"0.48400527",
"0.48332143",
"0.4807012",
"0.47908065",
"0.4776",
"0.4771872",
"0.47666278",
"0.47646844",
"0.4737473",
"0.47359404... | 0.7486532 | 0 |
selanjutnya ada fungsi clear kalkulator, jadi fungsi ini akan mereset state / kondisi dari kalkulator jadi kalkulator yang sudah melakukan operasi (penjumlahan/pengurangan) akan berubah seperti awal, dalam kata lain hal ini mirip factory reset di perangkat keras. display number jadi 0, operator jadi null, dan seterusny... | function clearCalculator() {
calculator.displayNumber = '0';
calculator.operator = null;
calculator.firstNumber = null;
calculator.waitingForSecondNumber = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearCalculator() {\n calculator.displayNumber = '0';\n calculator.operator= null;\n calculator.firstNumber= null;\n calculator.waitingForSecondNumber= false;\n}",
"function clear() {\n\n //reset all variables\n firstOperand = 0;\n secondOperand = 0;\n operation = null;\n\n mu... | [
"0.7524467",
"0.74065167",
"0.73908716",
"0.7260414",
"0.7251874",
"0.72213686",
"0.71474373",
"0.70426613",
"0.7023977",
"0.7010808",
"0.6984243",
"0.6945889",
"0.69318604",
"0.6915028",
"0.6914577",
"0.6906588",
"0.68958986",
"0.68847966",
"0.6876023",
"0.686908",
"0.686649... | 0.7464102 | 1 |
disini ada juga, fungsi input digit, singkatnya fungsi ini akan mengubah nilai display number sesuai dengan inputan pengguna jika displaynya itu 0, maka 0 itu akan digantikan digit atau angka inputan. Jadi misalkan 0, akan langsung jadi 5, bukan jadi 05. jika display bukan 0, maka angka itu akan ditambahkan digit. Jadi... | function inputDigit(digit) {
if(calculator.displayNumber === '0') {
calculator.displayNumber = digit;
} else {
calculator.displayNumber += digit;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inputDigit(digit){\n if (calculator.waitingForSecondNumber && calculator.firstNumber === calculator.displayNumber){\n calculator.displayNumber = digit;\n } else {\n if (calculator.displayNumber === \"0\") {\n calculator.displayNumber = digit;\n } else {\n c... | [
"0.6803432",
"0.67247766",
"0.6697528",
"0.66920274",
"0.6691356",
"0.6667557",
"0.65978867",
"0.6597653",
"0.65905505",
"0.65826994",
"0.65732455",
"0.65613484",
"0.65609586",
"0.6548823",
"0.6517405",
"0.6515897",
"0.64868563",
"0.64823353",
"0.64436",
"0.64417017",
"0.6424... | 0.7334441 | 1 |
berikut adalah fungsi inverse number, fungsi ini memiliki fungsi yang sederhana yaitu mengubah nilai angka menjadi negatif / positif misalkan nilai display adalah 1, maka akan berubah menjadi 1, begitu juga sebaliknya. disini terdapat pengecualian yaitu apabila nilai display adalah 0, maka tidak akan terjadi pengubahan... | function inverseNumber() {
if(calculator.displayNumber === '0') {
return;
}
calculator.displayNumber = calculator.displayNumber * -1;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inverseNumber() {\n if(calculator.displayNumber === '0') {\n return;\n }\n calculator.displayNumber =calculator.displayNumber * -1;\n}",
"function inverse()\n {\n currentInput = 1 / currentInput\n displayCurrentInput();\n }",
"function inverteSinal() {\r\n let invertido ... | [
"0.74877506",
"0.6606541",
"0.6434634",
"0.6423594",
"0.63419014",
"0.6329566",
"0.632739",
"0.6283299",
"0.6282029",
"0.62562394",
"0.6253929",
"0.62527883",
"0.61740017",
"0.60816646",
"0.60237354",
"0.6020451",
"0.6014402",
"0.59904724",
"0.59904724",
"0.5967895",
"0.59596... | 0.74173677 | 1 |
handle operator, handle operator disini berfungsi sebagai pengatur kondisi kalkulator dalam kata lain, fungsi ini akan mengubah nilai data dari objek kalkulator. Apabila nilai dari waiting for second number itu masih false (belum melakukan operasi), maka fungsi ini akan mengubah nilai operator, waiting for second numbe... | function handleOperator(operator) {
if (!calculator.waitingForSecondNumber) {
calculator.operator = operator;
calculator.waitingForSecondNumber = true;
calculator.firstNumber = calculator.displayNumber;
//mengatur ulang nilai display number supaya tombol selanjutnya dimulai dari angka pert... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleOperator(operator) {\n if (!calculator.waitingForSecondNumber) {\n calculator.operator = operator;\n calculator.waitingForSecondNumber = true;\n calculator.firstNumber = calculator.displayNumber;\n calculator.displayNumber = '0';\n } else {\n alert('Operator ... | [
"0.7868731",
"0.6752553",
"0.6686499",
"0.6531177",
"0.629424",
"0.6293528",
"0.62738997",
"0.61413485",
"0.61096674",
"0.60830384",
"0.6081699",
"0.60767853",
"0.6056159",
"0.60416746",
"0.59965104",
"0.5969405",
"0.5953905",
"0.59490335",
"0.59280425",
"0.5902105",
"0.58996... | 0.785323 | 1 |
Perform Calculation adalah fungsi yang mengambil nomer pertama lalu melakukan operasi sesuai dengan input user kepada nomer kedua (display number) funsi ini mengecek apakah ada tidaknya nomer pertama dan operator dan menotifikasi user jika belum ada kedua input | function performCalculation() {
if(calculator.firstNumber == null || calculator.operator == null) {
alert('anda belum menetapkan operator');
return;
}
//Melakukan pengecekan operator menggunakan statement "if", dimana user meng input operator "+" maka yang akan terjadi adalah,
//first number ak... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calci() {\n var val1,val2,answer,oper;\n val1=prompt(\"Type first number\");\n oper=prompt(\"Type an operator\");\n val2=prompt(\"Type second number\");\n \n \n if(oper==\"+\"){\n answer=Number(val1)+Number(val2);\n }\n else if(oper==\"/\"){\n answer=Number(val1)/N... | [
"0.7648587",
"0.7491716",
"0.74094194",
"0.73629403",
"0.73483354",
"0.733472",
"0.7312674",
"0.7307702",
"0.72848326",
"0.7226475",
"0.718248",
"0.71664137",
"0.7157253",
"0.71536165",
"0.7148379",
"0.71235543",
"0.71057826",
"0.7099628",
"0.70852953",
"0.70831406",
"0.70232... | 0.7958436 | 0 |
High level overview of classes: GraphStream is a writable stream that takes incoming JSON buffers and parses through them GraphStream contains references to subclasses of the Graph class which is the class responsible for displaying data fed to it by GraphStream GraphStream's graph method returns subclasses of graph ex... | function GraphStream(opts) {
if (!(this instanceof GraphStream)) return new GraphStream(opts)
if (!opts.height || !opts.width) throw new Error('need height and width to initialize graph')
//stream stuff
Stream.call(this)
this.readable = false
this.writable = true
//parsing/buffering stream
this._buffers... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Graph()\r\n{\r\n\r\n // base property fields\r\n this.vert = [];\r\n this.nv = 0;\r\n this.ne = 0;\r\n this.digraph = false;\r\n this.weighted = false;\r\n this.dfs_push = [];\r\n this.bfs_order = [];\r\n this.label = \"\";\r\n this.connectedComp = 0;\r\n this.adjMatrix = ... | [
"0.6266009",
"0.60536337",
"0.57484055",
"0.574688",
"0.569976",
"0.5683844",
"0.5643297",
"0.5569429",
"0.5569429",
"0.5569429",
"0.55529696",
"0.55510765",
"0.5544218",
"0.55298185",
"0.55298185",
"0.5527019",
"0.54983395",
"0.5481706",
"0.54762846",
"0.54745466",
"0.547454... | 0.78260946 | 0 |
This only returns unique sizes | definedSizes() {
const { infoResponse } = this.props;
if (!(infoResponse && infoResponse.json && infoResponse.json.sizes)) return [];
return uniqBy(infoResponse.json.sizes, size => `${size.width}${size.height}`);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSizesForColor(colorIN, variantData){\n sizeCollection = [];\n for(var i=0; i < variantData.length; i++){\n color = variantData[i]['name'].substring(variantData[i]['name']\n .lastIndexOf('-')+1,variantData[i]['name']\n .lastIndexOf('... | [
"0.6238775",
"0.6144875",
"0.6133878",
"0.6117798",
"0.6091464",
"0.60899943",
"0.607961",
"0.607197",
"0.60696995",
"0.6025804",
"0.59870714",
"0.59795153",
"0.5971771",
"0.5952035",
"0.5914709",
"0.5914709",
"0.5914709",
"0.5914709",
"0.5914709",
"0.5879674",
"0.58788604",
... | 0.77119386 | 0 |
Hides any number of individual elements passed as arguments. | function hideElements(...elements) {
for(let i = 0; i < elements.length; i++)
elements[i].style.display = 'none';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hide() {\n if (arguments.length != 0) {\n for (i = 0; i < arguments.length; i++) {\n changeClass(arguments[i],'invisible');\n }\n }\n}",
"function hide () {for (i = 0; i < arguments.length; i++) {var e = $(arguments[i]); if (e) e.style.display = \"none\";}}",
"function hideElements() {\n\... | [
"0.7679911",
"0.72747415",
"0.7023375",
"0.69068366",
"0.69040567",
"0.69040567",
"0.69040567",
"0.6898353",
"0.68004125",
"0.6790706",
"0.6789791",
"0.6789791",
"0.6778347",
"0.6611172",
"0.6592762",
"0.657023",
"0.6563126",
"0.6388851",
"0.6344641",
"0.6302616",
"0.62528056... | 0.73569226 | 1 |
Hides the elements of the collection passed as the argument. | function hideCollectionElements(collection) {
for(let i = 0; i < collection.length; i++)
hideElements(collection[i]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearHide(collection) {\n collection.forEach(list => {\n list.style.display = \"block\";\n });\n}",
"function hideElements() {\n\t\tconst elementsArr = [\n\t\t\t$submitForm,\n\t\t\t$allStoriesList,\n\t\t\t$filteredArticles,\n\t\t\t$ownStories,\n\t\t\t$userProfile,\n\t\t\t$favoritedStories,\n\t\t\t$... | [
"0.739415",
"0.7204081",
"0.71482736",
"0.7124866",
"0.7124866",
"0.7124866",
"0.7101082",
"0.69903344",
"0.69249237",
"0.69110984",
"0.69110984",
"0.688837",
"0.687523",
"0.68737084",
"0.68428147",
"0.68055165",
"0.6798708",
"0.67796016",
"0.6756897",
"0.6683363",
"0.6668899... | 0.80268973 | 0 |
Shows the elements of the collection passed as the argument. | function showCollectionElements(collection) {
for(let i = 0; i < collection.length; i++)
showElements(collection[i]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCollection (array){\n for(let i = 0; i < collection.length; i++){\n console.log(`${collection[i].title} by ${collection[i].artist}, published in ${collection[i].yearPublished}`)\n }\n }",
"function show(el){\n el = getList(el);\n\n for(var i = 0; i<el.length; i++){\n ... | [
"0.68676597",
"0.6524944",
"0.6524944",
"0.64600074",
"0.64594275",
"0.6444057",
"0.6353471",
"0.6332312",
"0.6332312",
"0.6299243",
"0.62026066",
"0.61507857",
"0.6145825",
"0.6130924",
"0.60096055",
"0.6002207",
"0.5996611",
"0.59925616",
"0.59886575",
"0.59855145",
"0.5975... | 0.8215135 | 0 |
Calculates the total event price using a regex to store the price numbes into a variable and ingore the date numbers. Then adds each event price to the total price variable and returns it. | function calculateTotal() {
let totalPrice = 0;
const pattern = /(\d+(?!a)(?!p)(?!2))/;
for(let i = 0; i < $activityCheckboxes.length; i++) {
const eventPrice = $activityCheckboxes[i].parentNode.textContent.match(pattern)[0];
if($activityCheckboxes[i].checked)
totalPrice += parseInt(even... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcPrice(event) {\n\tvar totals = 0\n\n\tif(event) {\n\t\tvar $input = $(event.target),\n\t\t\t$cell = $input.parent().next(),\n\t\t\tcount = $input.val()\n\n\t\t$cell.html('$'+$input.data('price')*count)\n\t}\n\t\n\tvar $inputs = $('#cart input')\n\n\tfor (var i = $inputs.length - 1; i >= 0; i--) {\n\t\... | [
"0.61058015",
"0.59882826",
"0.5894339",
"0.5832103",
"0.57443815",
"0.574006",
"0.5725813",
"0.5693407",
"0.5640608",
"0.56127304",
"0.55528176",
"0.55393124",
"0.55062836",
"0.5505263",
"0.54577",
"0.5452079",
"0.54352236",
"0.54205513",
"0.538762",
"0.53853816",
"0.5341986... | 0.6470457 | 0 |
Returns event day based on regex. | function getEventDay(eventDetails) {
const pattern = '/Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday/';
if(eventDetails.match(pattern) !== null)
return eventDetails.match(pattern)[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEventDateDay(str) {\n\tvar parts = str.split(\" \")[0].split(\"-\");\n\treturn parts[2];\n}",
"day(event, title) {\n return event.title;\n }",
"day(event, title) {\n return event.title;\n }",
"day(event, title) {\n return event.title;\n }",
"static getDateRegex() {... | [
"0.70768154",
"0.6041435",
"0.6041435",
"0.6041435",
"0.59249693",
"0.5895822",
"0.577975",
"0.57306415",
"0.57051957",
"0.56962067",
"0.56962067",
"0.5688555",
"0.56695944",
"0.56212294",
"0.5575568",
"0.55723745",
"0.5556623",
"0.5556184",
"0.5526989",
"0.54895604",
"0.5465... | 0.6745971 | 1 |
Enables checkboxes and resets their color if they match the event day and time passed as arguments. | function enableCheckboxes(eventDay, startTime) {
for(let i = 0; i < $activityCheckboxes.length; i++) {
if($activityCheckboxes[i].parentNode.textContent.includes(startTime) &&
$activityCheckboxes[i].parentNode.textContent.includes(eventDay)) {
$activityCheckboxes[i].disabled = false;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function disableCheckboxes(eventDay, startTime) {\n for(let i = 0; i < $activityCheckboxes.length; i++) {\n if($activityCheckboxes[i].parentNode.textContent.includes(startTime) &&\n $activityCheckboxes[i].parentNode.textContent.includes(eventDay) &&\n !$activityCheckboxes[i].checked) {\n ... | [
"0.7768595",
"0.69571555",
"0.6243781",
"0.6001501",
"0.5974971",
"0.59687465",
"0.59595704",
"0.5951763",
"0.5836758",
"0.57650703",
"0.5688222",
"0.5684809",
"0.56511927",
"0.56511927",
"0.56232584",
"0.5614602",
"0.5610031",
"0.5575867",
"0.55586374",
"0.5536915",
"0.55341... | 0.81115556 | 0 |
Disables checkboxes and sets their color to grey if they match the event day and time passed as arguments. | function disableCheckboxes(eventDay, startTime) {
for(let i = 0; i < $activityCheckboxes.length; i++) {
if($activityCheckboxes[i].parentNode.textContent.includes(startTime) &&
$activityCheckboxes[i].parentNode.textContent.includes(eventDay) &&
!$activityCheckboxes[i].checked) {
$... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableCheckboxes(eventDay, startTime) {\n for(let i = 0; i < $activityCheckboxes.length; i++) {\n if($activityCheckboxes[i].parentNode.textContent.includes(startTime) &&\n $activityCheckboxes[i].parentNode.textContent.includes(eventDay)) {\n $activityCheckboxes[i].disabled = fal... | [
"0.7302497",
"0.69197786",
"0.6319243",
"0.6295392",
"0.61215913",
"0.6104759",
"0.60473186",
"0.59133327",
"0.58581865",
"0.5776875",
"0.57294214",
"0.57180613",
"0.5718013",
"0.5655351",
"0.5653066",
"0.56382084",
"0.563412",
"0.5606266",
"0.5593039",
"0.5590695",
"0.554023... | 0.79294187 | 0 |
Clears previous eventprice total. Creates a new event price paragraph and appends it to the activity registration field. | function showTotalPrice(totalPrice) {
if($('.total-event-price'))
$('.total-event-price').remove();
const p = document.createElement('p');
p.className = 'total-event-price';
p.textContent = 'Total: $' + parseInt(totalPrice);
$activityRegistrationFieldset.append(p);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeThePrice(){\n eventActivities.lastChild.remove();\n totalPrice = calculatePrice();\n let totalPriceCount = document.createElement('h3');\n totalPriceCount.textContent = `total price = $${totalPrice}`;\n eventActivities.appendChild(totalPriceCount);\n \n}",
"function wpbs_clear_pr... | [
"0.6994107",
"0.60694784",
"0.58010143",
"0.56537557",
"0.56409895",
"0.5608331",
"0.5570874",
"0.55597997",
"0.5556912",
"0.55545294",
"0.5554285",
"0.5553394",
"0.55466795",
"0.5544627",
"0.5489172",
"0.5481638",
"0.5425224",
"0.5424521",
"0.5410588",
"0.5406343",
"0.535097... | 0.66705143 | 1 |
Creates and returns an error element based on the element and error message passed as arguments. | function createErrorElement(element, errorMessage, className) {
const errorElement = document.createElement(element);
errorElement.className = className;
errorElement.textContent = errorMessage;
errorElement.style.color = '#cc0000';
errorElement.style.fontWeight = 'bold';
errorElement.style.text... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createErrorElement(name, message, input) {\n let errorElement = createElement(this.errorElement, {\n className: this.errorClass,\n innerHTML: message,\n attrs: { for: name }\n });\n // Create message design if errorOption is message\n if (this.errorOptio... | [
"0.73812294",
"0.672946",
"0.6682165",
"0.66315544",
"0.6588833",
"0.6292683",
"0.62729996",
"0.62433386",
"0.62260026",
"0.6204427",
"0.6181401",
"0.6148375",
"0.6073906",
"0.60695684",
"0.6034893",
"0.5965164",
"0.5932992",
"0.5915108",
"0.5908713",
"0.5897603",
"0.5893439"... | 0.7490325 | 0 |
Transforms existing element into an apparent error element. | function errorizeElement(element, placeholderText){
element.placeholder = placeholderText;
element.style.border = '2px solid #cc0000';
element.previousElementSibling.style.color = '#cc0000';
element.previousElementSibling.style.fontWeight = 'bold';
element.previousElementSibling.style.textShadow =
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MarkElementError(element) {\n element.style.backgroundColor = mxConstantsEx.InPutErrorColor;\n}",
"function ClearElementError(element) {\n element.style.backgroundColor = 'white';\n}",
"function tryUpgradeElementNoInline(element, toClass) {\n try {\n element.upgrade(toClass);\n } catch (e) ... | [
"0.62720126",
"0.5799978",
"0.5768022",
"0.5762558",
"0.57460296",
"0.5736043",
"0.5692934",
"0.56802666",
"0.5669404",
"0.5651577",
"0.5633294",
"0.56111366",
"0.5585243",
"0.558449",
"0.55765784",
"0.5565627",
"0.55505395",
"0.55391455",
"0.5519164",
"0.5518265",
"0.5499012... | 0.59120995 | 1 |
Loops through the errorArray passed as its argument and returns true if an error is present. | function evaluateErrors(errorArray){
for(let i = 0; i < errorArray.length; i++) {
if(errorArray[i] !== '')
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasErrors(fieldsError) {\n return Object.keys(fieldsError).some((field)=> fieldsError[field]);\n}",
"function hasErrors(fieldsError) {\n return Object.keys(fieldsError).some(field => fieldsError[field]);\n}",
"runsHadError() {\n return this.errors.includes(false);\n }",
"hasErrors() {\n ... | [
"0.69369054",
"0.6920284",
"0.6859761",
"0.6805687",
"0.66830575",
"0.66058064",
"0.6593101",
"0.6481392",
"0.6381345",
"0.6307061",
"0.62530214",
"0.6149868",
"0.61015046",
"0.60771596",
"0.6039894",
"0.5973936",
"0.5949568",
"0.5866219",
"0.58652776",
"0.58651835",
"0.58522... | 0.80256075 | 0 |
Resets value of any number of input fields to an empty String. | function resetInputFieldValue(...input) {
for(let i = 0; i < input.length; i++)
input[i].value = '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetFields () {\n this.input.value = '';\n this.output.value = '';\n }",
"function clearFieldValues() {\n for(let field of Object.keys(fields)) {\n fields[field].value = '';\n }\n }",
"static clearFormFields() {\n\n // value equal to empty\n document.querySelecto... | [
"0.81853944",
"0.78535044",
"0.7837947",
"0.774048",
"0.7720778",
"0.76838124",
"0.7661627",
"0.7661627",
"0.76554114",
"0.7609884",
"0.759983",
"0.750822",
"0.74857163",
"0.7483846",
"0.74813586",
"0.74510145",
"0.74319893",
"0.7430592",
"0.7425094",
"0.74226505",
"0.7418982... | 0.7919911 | 1 |
Removes error message, and if no checkboxes are checked, creates and inserts an error message, and formats activity legend as error. Also returns an error message if no boxes are checked. | function validateActivites() {
$('p.invalid-checkbox').remove();
$activityLegend.style.color = '';
$activityLegend.style.textShadow = '';
let isChecked = checkForChecks();
if(!isChecked) {
$activityCheckboxes[0].setCustomValidity(' ');
const p = createErrorElement('p', 'At least one acti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkActivityErrors() {\n\tif (registration.activities.activities.length === 0) {\n\t\t// display error\n\t\tdisplayFieldsetError(document.querySelector('fieldset.activities legend'), 'Please select an Activity');\n\t\t// return error msg\n\t\treturn 'Please select an Activity.';\n\t} else {\n\t\t// remov... | [
"0.68656725",
"0.68037474",
"0.6489122",
"0.6159277",
"0.59661674",
"0.5907137",
"0.58363116",
"0.5667826",
"0.56677306",
"0.56557673",
"0.5645178",
"0.5618464",
"0.5607855",
"0.5584421",
"0.5582249",
"0.5535885",
"0.5533353",
"0.55162823",
"0.5463569",
"0.5449786",
"0.544523... | 0.70558345 | 0 |
This function reduce by 1 the life of every treasure distant less than 50px from the player, if the life is 0 the tresure is destroyed, and the money it contains are launched in every direction | function hitTreasure(){
for (var i = 0; i < play.treasures.length; i++){
var treasure = play.treasures.children[i];
//If the treasure is distant less than 50px from the player
if (play.physics.arcade.distanceBetween(play.player,treasure) < 50){
treasure.data.life--;
game.playsound('hit_sound');
i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"takeDamage() {\n this.tieFighter.forEach(tie => {\n tie.enemyBull.forEach(elm => {\n if (\n (elm.posY < this.player.posY + this.player.playerH) &&\n (elm.posY + elm.height > this.player.posY) &&\n (elm.posX < this.player.posX... | [
"0.6666628",
"0.64140916",
"0.621394",
"0.617981",
"0.6156794",
"0.6093179",
"0.59578896",
"0.5880501",
"0.58520174",
"0.58072984",
"0.5805421",
"0.5801222",
"0.5781318",
"0.5774321",
"0.5770093",
"0.57651424",
"0.57435954",
"0.57216996",
"0.5708651",
"0.5688012",
"0.5686979"... | 0.64573646 | 1 |
PURPOSE: Since we are using the single tick mark as the string delimiter to construct our SQL queries, a string with a tick mark in it will cause a SQL error. Therefore we replace all "'" with "''", which eliminates the possibility of a SQL error. | function sqlSafe (s)
{
var new_s = s;
new_s = replaceAll (new_s, "'", "|");
new_s = replaceAll (new_s, "|", "''");
new_s = replaceAll (new_s, "\"", "|");
new_s = replaceAll (new_s, "|", "''");
return new_s;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addQuotationForStringValues(value) {\n if (!value.startsWith('\"')) {\n value = '\"' + value + '\"';\n }\n return value;\n }",
"function mysqlEscape(str) {\n//logDisplay(str.replace(\"'\",\"''\"));\n\tif (str == null || str == \"null\" || isNumber(str)) {\n\t\treturn str;\n\t}\... | [
"0.6172776",
"0.61670214",
"0.6155959",
"0.614124",
"0.6126209",
"0.61078036",
"0.60836303",
"0.60836303",
"0.60668266",
"0.60646755",
"0.60646755",
"0.6039153",
"0.59676874",
"0.5958253",
"0.5958253",
"0.5958253",
"0.5949934",
"0.5937029",
"0.59222454",
"0.58905834",
"0.5869... | 0.7206951 | 0 |
Returns true if string s is empty or whitespace characters only. | function isWhitespace (s)
{ var i;
// Is s empty?
if (isEmpty(s)) return true;
// Search through string's characters one by one
// until we find a non-whitespace character.
// When we do, return false; if we don't, return true.
for (i = 0; i < s.length; i++)
{
// Check... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function empty(s) {\n return (s ? false : true);\n }",
"function empty(s) {\n return (s ? false : true);\n }",
"function isblank(s)\n {\n for (var I = 0; I < s.length; I++)\n {\n var c = s.charAt(I);\n if ((c != ' ') && (c != '\\n') && (c != '\\t')) return false;\... | [
"0.78848803",
"0.78848803",
"0.78730065",
"0.7706864",
"0.7651264",
"0.7620357",
"0.7612027",
"0.7586085",
"0.75818616",
"0.7560644",
"0.75410414",
"0.7435572",
"0.7366783",
"0.7346889",
"0.7299002",
"0.72932196",
"0.7290127",
"0.72858757",
"0.72858757",
"0.72546494",
"0.7248... | 0.79584324 | 0 |
PURPOSE: Returns true if the string is a valid date number. A method is passed in (1 = month, 2 = day). If the string is nonnumeric, false is passed back. If the day in the date string is greater than 31, false is returned. If the month is greater than 12, an error is returned. | function isDateNumber(strNum,method)
{
var str = new String(strNum);
var i = 0;
if (isNaN(parseInt(str)) || parseInt(str) < 0) return false;
if (method == 2)
if (parseInt(str) > 31)
return false;
if (method == 1)
if (parseInt(str) > 12)
return false;
for (i = 0; i < str.length; i++)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isValidDate(dateString){\n // First check for the pattern\n if(!/^\\d{1,2}\\/\\d{1,2}\\/\\d{4}$/.test(dateString))\n return false;\n\n // Parse the date parts to integers\n var parts = dateString.split(\"/\");\n var day = parseInt(parts[1], 10);\n var month = parseInt(parts[0], 10);\n v... | [
"0.768958",
"0.7563809",
"0.7527334",
"0.7515284",
"0.7502367",
"0.75015223",
"0.74945784",
"0.74514115",
"0.74443907",
"0.74413586",
"0.743607",
"0.7433354",
"0.7394281",
"0.73325396",
"0.7326",
"0.7285313",
"0.7279073",
"0.72713566",
"0.72190756",
"0.7165492",
"0.71086437",... | 0.84446746 | 0 |
const parametroAccion = "accion"; const codeEditar = "EDIT"; const codeAniadir = "ADD"; const codeEliminar = "REMOVE"; Redirecciona a la url de edicion de un usuario | function editarMiUsuario(){
location.href = urlGEstionUsuario + "?" +
parametroAccion + "=" + codeEditar;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fn_acciones(){\n var eje_fun = \"fn_juzgado\"\n if(accion_btn == 2)\n eje_fun = \"fn_anular\";\n else\n if(accion_btn = 3)\n eje_fun = \"fn_finalizar\";\n \n parameters = \n {\n\t\t\"func\":eje_fun,\n\t\t\"empresa\":$(\"#tx_empresa\").val(),\n \"p_rol\":$(... | [
"0.6266449",
"0.62478846",
"0.6094804",
"0.60242105",
"0.60180765",
"0.596976",
"0.5958631",
"0.5926545",
"0.5813498",
"0.5811153",
"0.58043474",
"0.5778555",
"0.57731456",
"0.57421637",
"0.5728583",
"0.5714039",
"0.56980747",
"0.565959",
"0.5653709",
"0.5651821",
"0.56377894... | 0.7604722 | 0 |
TODO: Find out a way to delay multiple calls of this function. the saveFile function will convert our task object into JSON and save it to our file. | function saveFile() {
let json = JSON.stringify(tasks);
fs.writeFileSync(taskFileName, json, "utf-8");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"save () {\n try {\n fs.writeFileSync(this.dataPath, JSON.stringify(this.tasks))\n } catch (error) {\n render.logError(error)\n }\n }",
"function _storeTasks(file, tasks) {\n fs.writeFile(file, JSON.stringify(tasks), 'utf-8', function (err) {\n if(err) {\n throw err;\n ... | [
"0.795944",
"0.7031947",
"0.6976758",
"0.6916845",
"0.682877",
"0.67596895",
"0.6749692",
"0.6739597",
"0.67320067",
"0.6720672",
"0.66624814",
"0.6574284",
"0.65329957",
"0.650997",
"0.6505068",
"0.64931893",
"0.6485141",
"0.6477151",
"0.6471086",
"0.6453748",
"0.6447345",
... | 0.8274456 | 0 |
the number of the problem the user is currently looking at / Generate a problem set containing 10 problems | function generateProblemSet() {
for(let i=0; i < 10; i++) {
// randomly generate a single multiplication problem
// define a problem to hold the values we generate
let problem = {
left: getRandomNumber(10), // should be a random value between 0 and 9
right: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateProblems(question) {\n for (let i = 0; i < question; i++) {\n userState.problems[i] = generateProblemAnswer();\n }\n}",
"function na(num_problems){\n\tconsole.log(\"na function called... with argument of: \" + num_problems);\n\t//local variables\n\tvar counter = 0;\n\t\n\t//dynamically gene... | [
"0.66451764",
"0.6196669",
"0.6165542",
"0.6032382",
"0.59370375",
"0.5879654",
"0.57945126",
"0.5743642",
"0.57400084",
"0.57263905",
"0.57047504",
"0.5683426",
"0.56669134",
"0.5627173",
"0.5605492",
"0.5600271",
"0.55889004",
"0.55741864",
"0.55498713",
"0.5532957",
"0.551... | 0.67879677 | 0 |
called when client chooses to send message: triggers the send listeners (cryptSend and noncryptSend) on the server side and passes it the values in the DOM | function sendMessage(){
var message = messageField.value;
var password = passwordField.value;
var hint = hintField.value;
if (password.length > 0) {
var encryptedMsg = encryptMessage(message,password);
socket.emit('cryptSend', {
message: encryptedMsg,
hint: hint
});
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleSendButton() {\r\n var msg = {\r\n text: document.getElementById(\"text\").value,\r\n target: document.getElementById(\"user\").value,\r\n type: \"message\",\r\n id: clientID, \r\n date: Date.now()\r\n };\r\n sendToServer(msg);\r\n document.getElementById(\"text\").value = \"\";\... | [
"0.657968",
"0.6546369",
"0.6385523",
"0.63273525",
"0.6327119",
"0.62651503",
"0.6242876",
"0.62356836",
"0.623253",
"0.62289536",
"0.6198672",
"0.6186706",
"0.61622244",
"0.61408997",
"0.6140171",
"0.61351943",
"0.6097573",
"0.6091374",
"0.6063565",
"0.605357",
"0.6050102",... | 0.72412306 | 0 |
Show notifications that are within scope and haven't been ssen | function showNotifications() {
$('#docs-notifications > .notification').each(function() {
// Check if the path includes paths defined in the data-scope attribute
// of the notification html element
function inScope(path, scope) {
for(let i = 0; i < scope.length; i++){
if (path.includes(scop... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"notificationsViewed() {\n this.get('notificationsService').notificationsViewed();\n }",
"__scopeOutdatedEvent (sids) {\n this.emit(\"debug\", `scope-outdated-receive sids=${sids.join(\",\")}`)\n this.connections.forEach((conn) => {\n let outdated = {}\n conn.scopes.for... | [
"0.63411593",
"0.6225298",
"0.61570615",
"0.60302615",
"0.5990988",
"0.5989606",
"0.5968873",
"0.5963304",
"0.59151447",
"0.58958024",
"0.58958024",
"0.5815991",
"0.57786906",
"0.5738496",
"0.56565416",
"0.56495756",
"0.5627925",
"0.55795085",
"0.5563057",
"0.5557895",
"0.555... | 0.6506327 | 0 |
Check if the path includes paths defined in the datascope attribute of the notification html element | function inScope(path, scope) {
for(let i = 0; i < scope.length; i++){
if (path.includes(scope[i])) {
return true;
};
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"anyPathChanged(counter, paths) {\n let found = false;\n if (paths) {\n for (let i = 0; i < paths.length; i++) {\n if (this.getValue(`${PATH_TRACKER}.${paths[i]}`, 0) > counter) {\n found = true;\n break;\n }\n }... | [
"0.5672072",
"0.56176615",
"0.5577407",
"0.5462222",
"0.54585946",
"0.53981143",
"0.5377051",
"0.533769",
"0.53058106",
"0.53042746",
"0.52816045",
"0.52529466",
"0.5182663",
"0.51713485",
"0.5154847",
"0.51230484",
"0.51192683",
"0.5103322",
"0.510009",
"0.5099629",
"0.50862... | 0.61459905 | 0 |
Ajax get request that takes a function as a parametre Gets all zipcodes and makes a callback | function fnGetZipcodes(fnCallBack){
var sUrl = "/CMSV1/services/properties/api-get-zipcodes.php";
$.getJSON( sUrl , function( ajData ){
fnCallBack(ajData);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zipcodeFinder (){\n\t\n\tlet zipcodeQueryUrl = 'https://crossorigin.me/https://www.zipcodeapi.com/rest/';\n\tlet zipcodeCity = '/city-zips.json/' + city;\n\tlet zipcodeState = '/'+ state;\n\n\t\n\tlet zipcodeFullQueryUrl = zipcodeQueryUrl + zipcodeKey + zipcodeCity + zipcodeState;\n\t\n\t$.ajax({\n\t\turl... | [
"0.70300466",
"0.6991449",
"0.6985132",
"0.69245523",
"0.6808658",
"0.6769224",
"0.668824",
"0.6656661",
"0.6613518",
"0.65705186",
"0.64563555",
"0.6411977",
"0.64048356",
"0.6255268",
"0.6209752",
"0.6206093",
"0.6078525",
"0.6073844",
"0.6062566",
"0.6048152",
"0.6033487",... | 0.8177034 | 0 |
Ajax get request that takes a function as a parametre Gets all regions and makes a callback | function fnGetRegions(fnCallBack){
var sUrl = "/CMSV1/services/properties/api-get-regions.php";
$.getJSON( sUrl , function( ajData ){
fnCallBack(ajData);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRegions(callback) {\n axios.get(\"https://walletapi.herokuapp.com/borrower/regions\",\n headers).then((response) => {\n callback(response.data)\n }).catch((error) => {\n console.log(error);\n });\n}",
"function getRegionsFromSelectedCountry() {\n\tvar xmlHttp = getAJAXOb... | [
"0.68547934",
"0.68320084",
"0.6658734",
"0.6513841",
"0.643315",
"0.6421115",
"0.63481134",
"0.6301275",
"0.62911487",
"0.6283045",
"0.6091692",
"0.6082573",
"0.59902364",
"0.59894973",
"0.5988104",
"0.59869456",
"0.595324",
"0.5940519",
"0.5926796",
"0.5904856",
"0.5881049"... | 0.8187086 | 0 |
function that fills zipcode dropdowns | function fnPopulateZipDropdowns(ajData){
// template for zipcode option
var sUserTemplate= '<option value="{{zipcode1}}">{{zipcode2}} {{name}}</option>'
// loops though each json element and replace the placeholders
for( var i = 0 ; i < ajData.length ; i++ ){
userTemplate = sUserTemplate;
userTemplate = use... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function alternateconutrycode(){``\n document.getElementById(\"codealternate\").value=\"(+\"+document.getElementById(\"alternatecountrycodedropdown\").value+\")\";\n }",
"function alternateconutrycode(){``\n document.getElementById(\"codealternate\").value=\"(+\"+document.getElementById(\"altern... | [
"0.70685375",
"0.70685375",
"0.70177764",
"0.70177764",
"0.68601567",
"0.67103326",
"0.67009926",
"0.65514696",
"0.65269357",
"0.6526328",
"0.6452911",
"0.6404302",
"0.63723993",
"0.6354383",
"0.6350905",
"0.633495",
"0.63230544",
"0.63212454",
"0.630881",
"0.6305134",
"0.630... | 0.71638715 | 0 |
/// PROPERTY CRUD FUNCTIONS //////////////////////////////////////////// /// GET Function that get specific property by an id the json object is afterwards return though a callback | function fnGetProperty(sPropertyId , fnCallBack){
var sUrl = "/CMSV1/services/properties/api-get.php?id="+sPropertyId;
$.getJSON( sUrl , function( jData ){
}).done( function( jData ){
fnCallBack(jData);
}).fail( function( jData ){
fnCallBack(jData);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async viewProperty(ctx, propertyId) {\n // Create a new Property key for the Property\n const propertyKey = Property.makeKey([propertyId]);\n\n // Fetch Property with given Property IDfrom blockchain\n let existingProperty = await ctx.propertyList\n .getProperty(propertyKey... | [
"0.7013415",
"0.67927474",
"0.67086285",
"0.67086285",
"0.6582364",
"0.6462456",
"0.6461704",
"0.6432693",
"0.6401559",
"0.63959295",
"0.63530785",
"0.6307163",
"0.6223182",
"0.61913496",
"0.6158435",
"0.607937",
"0.5997722",
"0.59665936",
"0.5957093",
"0.59436893",
"0.59247"... | 0.75137085 | 0 |
CREATE Function that takes a propertyform and posts to the api though ajax and returns conformation though a callback | function fnCreateProperty(formData, fnCallBack ){
// var form = new FormData(formData);
// //Display the key/value pairs in a FormData object
// for (var pair of form.entries()) {
// console.log(pair[0]+ ', ' + pair[1]);
// }
var sUrl = "/CMSV1/services/properties/api-create.php";
$.ajax({
"url": sUrl,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnEditProperty(formData, fnCallBack ){\n\n\tvar sUrl = \"/CMSV1/services/properties/api-edit.php\";\n\n\t$.ajax({\n\t\t\"url\": sUrl,\n\t\t\"type\":\"post\",\n\t\t\"data\": new FormData(formData),\n\t\t\"contentType\":false,\n\t\t// \"dataType\": \"json\",\n\t\t\"processData\":false,\n\t\t\"cache\":false\... | [
"0.6613826",
"0.6303328",
"0.6150559",
"0.5976933",
"0.58597016",
"0.584731",
"0.57645154",
"0.5710037",
"0.57022",
"0.564052",
"0.55762637",
"0.5563308",
"0.5559185",
"0.5539819",
"0.5520276",
"0.5518757",
"0.5502173",
"0.55009997",
"0.5441513",
"0.54411983",
"0.5430318",
... | 0.753239 | 0 |
DELETE Function that takes a propertyid and posts to the api though ajax and returns conformation though a callback if the property is deleted or not | function fnDeleteProperty(sPropertyId, fnCallBack ){
$.ajax({
"url":"services/properties/api-delete.php",
"method":"post",
"data": ({ 'id': sPropertyId }),
"dataType":"json"
}).done( function(data){
fnCallBack(data);
}).fail( function(data){
fnCallBack(data);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteProperty(user_id, property_id, callback) {\n let sql = `DELETE FROM property WHERE property_id = ? AND user_id = ?`;\n let inserts = [property_id, user_id];\n connection.query(sql, inserts, function (err, result) {\n if (err) {\n console.log(err);\n console.log(`not able to delete pr... | [
"0.7200281",
"0.68771696",
"0.64574885",
"0.6343517",
"0.6264888",
"0.60819614",
"0.60751617",
"0.60732853",
"0.6071751",
"0.6067213",
"0.60447896",
"0.59939027",
"0.5960059",
"0.5952429",
"0.5935553",
"0.5934463",
"0.5924815",
"0.5915715",
"0.58969754",
"0.58969027",
"0.5886... | 0.837512 | 0 |
/// PROPERTY TABLE FUNCTIONS //////////////////////////////////////////// function that takes array of json object and populates the propertytable for the users | function fnCreateUserPropertyTable(jsProperties){
// property row template
var sProperty = '<tr class="row-property">\
<td class="img-property">\
<div class="img"><img src={{image}}></div>\
</td>\
<td class="lbl-property" id="lbl-property-address">Address:<br><br>{{address}}</td>\
<td class="lbl-property" id="... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnCreatePropertyTableAdmin(jsProperties){\n\n\t// property row template \n\tvar sProperty = '<tr data-id=\"{{id}}\" class=\"row-property\">\\\n\t<td class=\"img-property\">\\\n\t<div class=\"img\"><img src={{image}}></div>\\\n\t</td>\\\n\t<td class=\"lbl-property\" id=\"lbl-property-address\">Address:<br... | [
"0.6232485",
"0.60147697",
"0.59496266",
"0.5923494",
"0.57818055",
"0.5619936",
"0.5565211",
"0.55573946",
"0.55477184",
"0.5519056",
"0.5515814",
"0.5514325",
"0.55054367",
"0.54932255",
"0.5491498",
"0.5488755",
"0.54730505",
"0.54516834",
"0.5410525",
"0.5396487",
"0.5396... | 0.7279335 | 0 |
function that takes array of json object and populates the propertytable for the admin | function fnCreatePropertyTableAdmin(jsProperties){
// property row template
var sProperty = '<tr data-id="{{id}}" class="row-property">\
<td class="img-property">\
<div class="img"><img src={{image}}></div>\
</td>\
<td class="lbl-property" id="lbl-property-address">Address:<br><br>{{address}}</td>\
<td class=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnCreateUserPropertyTable(jsProperties){\n\n\t// property row template \n\tvar sProperty = '<tr class=\"row-property\">\\\n\t<td class=\"img-property\">\\\n\t<div class=\"img\"><img src={{image}}></div>\\\n\t</td>\\\n\t<td class=\"lbl-property\" id=\"lbl-property-address\">Address:<br><br>{{address}}</td>... | [
"0.64168286",
"0.5774488",
"0.5748296",
"0.5693899",
"0.5630448",
"0.56103873",
"0.55731",
"0.5545443",
"0.55105704",
"0.54833925",
"0.5470527",
"0.5455255",
"0.5413137",
"0.5412188",
"0.5391378",
"0.5382714",
"0.53015095",
"0.5283935",
"0.5279862",
"0.52792466",
"0.527838",
... | 0.67800945 | 0 |
Color palette depending on weather | function setColors(weather){
let root = document.documentElement;
if(weather > 25){
root.style.setProperty('--main', '#eb3349');
root.style.setProperty('--secondary', '#f45c43');
}else if(weather < 20){
root.style.setProperty('--main', '#4ca1af ');
root.style.setProperty('--secondary', '#c4e0e5');
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cmap(i) {\n var t = TAU*i/20;\n return [\n // irrational frequencies ensures that no color is repeated\n 255*Math.sin(t), // red\n 255*Math.sin(t*Math.SQRT2), // green\n 255*Math.sin(t*Math.PI) // blue\n ];\n}",
"function getColor(d) {\n switch(d){\n case \"U... | [
"0.66315633",
"0.64365566",
"0.64362735",
"0.64246356",
"0.63692045",
"0.6365385",
"0.62177974",
"0.62009233",
"0.61779404",
"0.6132346",
"0.6124125",
"0.61201113",
"0.6117689",
"0.60937214",
"0.60818505",
"0.6077262",
"0.6062226",
"0.6024303",
"0.60209286",
"0.6018887",
"0.6... | 0.680151 | 0 |
Returns an array of points in world coordinates creating a coarse hull around the prop given in argument The returned array is empty if the prop is not visible or doesn't use bounds How it works: if possible, combine the mapper bounds corners with the prop matrix otherwise, returns the prop bounds corners | function getPropCoarseHull(prop) {
if (!prop.getVisibility() || !prop.getUseBounds()) {
return [];
}
let finestBounds = prop.getBounds();
let finestMatrix = null;
// Better bounds using mapper bounds and prop matrix
const mapper = prop?.getMapper?.();
const mapperBounds = mapper?.getBounds?.();
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPolygonPoints() {\n let angle = getAngleUsingXandY(mouseLoc.x, mouseLoc.y);\n let radiusX = shapedContainer.width;\n let radiusY = shapedContainer.height;\n let polygonPoints = [];\n\n // X = mouseLoc.x + radiusX*sin(angle);\n // Y = mouseLoc.y - radiusY*cos(angle);\n\n for(let i =... | [
"0.54710865",
"0.5380135",
"0.53764284",
"0.5357583",
"0.53425944",
"0.5332885",
"0.5330214",
"0.5320073",
"0.53035915",
"0.5297639",
"0.52837425",
"0.52761984",
"0.5230391",
"0.5223788",
"0.52173513",
"0.52018434",
"0.5109309",
"0.510144",
"0.50976306",
"0.5096372",
"0.50859... | 0.80755514 | 0 |
Show tooltip data value on hover on icons in subscription calendar | function showToolTipOnCalendarIcons (icon, title, TransitTitle, date) {// Y-m-d
//alert (icon); alert (title); alert (TransitTitle); alert (date);
$('.calendarIconTooltip').empty ();
$('.calendarIconTooltip').hide ();
var date = date.split('-');
if (date[2] < 10) {
date[2] = date[2].substrin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function customTooltip(tooltip) {\n \n}",
"function ApexTooltip() { }",
"function updateTooltip(data) {\n\tvar tooltipData = {\n\t\tseries: [\n\t\t{\n\t\t\tcolor: \"transparent\",\n\t\t\tkey: data.sname + \" and \" + data.tname,\n\t\t\tvalue: data.svalue + \" users\"\n\t\t}\n\t\t],\n\t\tpoint: {\n\t\t\tx: w... | [
"0.6717491",
"0.6629199",
"0.658805",
"0.6425093",
"0.640644",
"0.6375974",
"0.6337225",
"0.6337225",
"0.6337225",
"0.63333017",
"0.6314256",
"0.6305671",
"0.6305671",
"0.6305671",
"0.6298241",
"0.62769634",
"0.62491053",
"0.622204",
"0.6197924",
"0.61913747",
"0.61758107",
... | 0.680143 | 0 |
Hide tooltip data value on hoverout on icons in subscription calendar | function hideToolTipOnCalendarIcons () {
$('.calendarIconTooltip').empty();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tipMouseout(d) {\n return tooltip.style(\"visibility\", \"hidden\");\n \n}",
"function mouseoutHandler (d) {\n tooltip.transition().style('opacity', 0);\n }",
"function hideTooltip() {\n\td3.select(\"#tooltip-title\").html(\"\");\n\td3.select(\"#tooltip-author\").html(\"\");\n\td3.select(\"#to... | [
"0.7522199",
"0.7019147",
"0.69809556",
"0.689078",
"0.6846232",
"0.68418616",
"0.68361527",
"0.68361527",
"0.6823043",
"0.67963284",
"0.67056954",
"0.67044914",
"0.66405857",
"0.6596493",
"0.6585908",
"0.6585908",
"0.6585908",
"0.65616286",
"0.6543425",
"0.65428144",
"0.6513... | 0.7521085 | 1 |
Your function will be passed two functions, f and g, that don't take any parameters. Your function has to call them, and return a string which indicates which function returned the larger number. | function whichIsLarger(f, g) {
return f()>g() ? "f": g()>f() ? "g": "neither"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bigger(){\n return function(n){\n if(n>5){\n return \"n is bigger\";\n }\n }\n }",
"function whoIsBigger(num1, num2) {\n return num1 > num2 ? `${num1} is bigger` : `${num2} is bigger`;\n}",
"function higer(a,b){\r\n var c=a+b;\r\n var d=a-b;\r\n return function... | [
"0.7041566",
"0.66381",
"0.6594717",
"0.6454504",
"0.6425403",
"0.6349058",
"0.6339364",
"0.6329143",
"0.62912333",
"0.62556684",
"0.6232662",
"0.61838394",
"0.6156029",
"0.61403745",
"0.6108805",
"0.6108071",
"0.6079709",
"0.60539603",
"0.60308725",
"0.600869",
"0.6002121",
... | 0.7428548 | 0 |
Number Clamp Have the function clamp(value, min, max) take the value parameter being passed and: Return max if value is greater than max. Return min if value is less than min. Return value if neither of these conditions are met. | function clamp(value, min, max){
return value > max ? max : value < min ? min : value
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clamp(number, min, max) {\n return number < min ? min : (number > max ? max : number);\n}",
"function clamp(value, min, max){\n return (value > max ? max : (value < min ? min : value));\n }",
"function clampNumber(number, min, max) {\n return Math.max(min, Math.min(number, max));\n}",
"funct... | [
"0.8712321",
"0.86622316",
"0.862172",
"0.86206",
"0.8603692",
"0.85985094",
"0.8569686",
"0.8567248",
"0.8567248",
"0.8560249",
"0.8541675",
"0.8526435",
"0.8524746",
"0.8522548",
"0.8522548",
"0.84768486",
"0.8475904",
"0.8473808",
"0.84644777",
"0.84638816",
"0.84638816",
... | 0.8697753 | 1 |
Return a mapping between record id and last modified data at directory. Used for update checking. | listItems()
{
let output = {};
for (let file of fs.readdirSync(this.dirname))
{
if (file.match(/\.json$/))
{
let stat = fs.statSync(path.join(this.dirname, file));
if (stat.isFile())
{
output[file.substr(0, file.length - 5)] = stat.mtime;
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAllChangedFileIds() {\n return Object.keys(this.newCodeFileMarkers);\n }",
"get lastModified() {\n return this.getStringAttribute('last_modified');\n }",
"setLastModifiedById(value){this._lastModifiedById=value;return this;}",
"function getLastModified() {\n return DATE;\n}",
"function ... | [
"0.5448557",
"0.5213198",
"0.51845145",
"0.5154434",
"0.50978595",
"0.5059595",
"0.50328887",
"0.5025761",
"0.5007639",
"0.49414217",
"0.4893707",
"0.4892911",
"0.48672888",
"0.48542506",
"0.48447117",
"0.48368794",
"0.48345196",
"0.48066926",
"0.4801475",
"0.47967678",
"0.47... | 0.5347373 | 1 |
MIDDLEWARE for checking for no animal follows match | function noAnimalFollowMatch(req, res, next) {
AnimalFollow.getByIds(req.params.animalId, req.params.userId)
.then(result => {
if(result) {
res.status(400).json({message: "Follow Existing"})
} else {
next()
}
})
.catch(error => {
res.status(500).js... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAnimalFollowMatch(req, res, next) {\n AnimalFollow.getByIds(req.params.animalId, req.params.userId)\n .then(result => {\n if(result) {\n next()\n } else {\n res.status(400).json({message: \"no follow existing\"})\n }\n })\n .catch(error => {\n ... | [
"0.5846308",
"0.5739008",
"0.5656848",
"0.55580604",
"0.55338573",
"0.54452944",
"0.5427722",
"0.5383473",
"0.53603697",
"0.53603697",
"0.52867174",
"0.52641475",
"0.52252775",
"0.52072126",
"0.52072126",
"0.51893955",
"0.51824117",
"0.5148671",
"0.51480246",
"0.5118944",
"0.... | 0.67385435 | 0 |
MIDDLEWARE for checking for existing animal follows | function getAnimalFollowMatch(req, res, next) {
AnimalFollow.getByIds(req.params.animalId, req.params.userId)
.then(result => {
if(result) {
next()
} else {
res.status(400).json({message: "no follow existing"})
}
})
.catch(error => {
res.status(500... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noAnimalFollowMatch(req, res, next) {\n AnimalFollow.getByIds(req.params.animalId, req.params.userId)\n .then(result => {\n if(result) {\n res.status(400).json({message: \"Follow Existing\"})\n } else {\n next()\n }\n })\n .catch(error => {\n r... | [
"0.6529471",
"0.57791686",
"0.55942655",
"0.55321515",
"0.5415244",
"0.53490365",
"0.5339751",
"0.53363585",
"0.53110135",
"0.5222393",
"0.52168",
"0.5171025",
"0.5133824",
"0.5119896",
"0.5073776",
"0.50653505",
"0.5062965",
"0.505275",
"0.50274515",
"0.5015724",
"0.50131774... | 0.6589654 | 0 |
MIDDLEWARE for checking for no shelter follows match | function noShelterFollowMatch(req, res, next) {
ShelterFollow.getFollowsMatchByIds(req.params.shelterId, req.params.userId)
.then(result => {
if(result) {
res.status(400).json({message: "Follow Existing"})
} else {
next()
}
})
.catch(error => {
res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match_existent(storeFront, storePopup){\r\n\t\r\n}",
"enterHandlerConditionNotfound(ctx) {\n\t}",
"matches() {\n return false;\n }",
"function C012_AfterClass_Pool_SearchShower() {\n\tif (!GameLogQuery(CurrentChapter, \"Player\", \"PoolFindClothGag\")) {\n\t\tGameLogSpecificAdd(CurrentChap... | [
"0.57408166",
"0.5571828",
"0.5377713",
"0.53720313",
"0.5364075",
"0.5364075",
"0.53322095",
"0.5240238",
"0.51823944",
"0.5105963",
"0.50760543",
"0.5033729",
"0.5019194",
"0.50147337",
"0.50111663",
"0.49427688",
"0.49355996",
"0.48981145",
"0.48626524",
"0.48280427",
"0.4... | 0.6473512 | 0 |
Send a message to an individual client from the server | function messageClient(msg) {
io.to(socket.id).emit('message_from_server', msg);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendMessage(message, client) {\n}",
"sendMessage(message) {\n client.send(message, 7778, 'localhost')\n }",
"function sendMessage(message) {\n if(!client) {\n console.log(\"Error! Client is not alive\");\n return;\n }\n client.write(message +\";\");\n}",
"function sendMessage(message) {... | [
"0.783794",
"0.7777643",
"0.77559453",
"0.7749853",
"0.7536408",
"0.7463474",
"0.73871255",
"0.7383606",
"0.73826957",
"0.7363048",
"0.7363048",
"0.7334102",
"0.73240536",
"0.73067385",
"0.7283384",
"0.724257",
"0.72397804",
"0.72353387",
"0.72349745",
"0.72046036",
"0.719258... | 0.78241897 | 1 |
Message an individual client from another client | function clientToClient(otherClientID, data) {
io.to(otherClientID).emit('message_to_client', data);
io.to(socket.id).emit('message_to_client', data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function messageClient(msg) {\n\t\tio.to(socket.id).emit('message_from_server', msg);\n\t}",
"function sendMessage(message, client) {\n}",
"sendToClient(message) {\n connectedSockets.forEach(client => {\n if (\n message.to_user == '' ||\n // Fix PrivMSG delivery ... | [
"0.7555658",
"0.7395484",
"0.70993805",
"0.69536155",
"0.6944938",
"0.69336665",
"0.68910605",
"0.68728185",
"0.67277116",
"0.6687333",
"0.66702837",
"0.6659319",
"0.66227716",
"0.66068435",
"0.6575222",
"0.6565822",
"0.6559973",
"0.65572816",
"0.6555275",
"0.6548605",
"0.653... | 0.79543805 | 0 |
Send list of clients to client for viewing | function updateClientList() {
io.sockets.emit('update_client_list', Object.keys(clients));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clientList(user) {\n let names = [];\n console.log(sockets.length)\n sockets.forEach((s) => {\n if (s.name !== user.name) {\n names.push(s.name);\n }\n });\n user.write(`Current Users Online: ${names}`);\n writeToLog(`${user.name} ran clientList Function`)\n}",
"function trySendClientLi... | [
"0.71147984",
"0.69237155",
"0.6883968",
"0.6883968",
"0.6875543",
"0.680215",
"0.6755192",
"0.6745262",
"0.66230935",
"0.66104454",
"0.6602476",
"0.6592431",
"0.65912277",
"0.65760976",
"0.65688914",
"0.6506416",
"0.6505838",
"0.648607",
"0.6475603",
"0.6475603",
"0.64672375... | 0.77951616 | 0 |
Send list of channels to client for viewing | function updateChannelList() {
io.sockets.emit('update_channel_list', Object.keys(groupChannels));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inchat_list_channels() {\n\t$.ajax({\n url: INCHAT_TARGET,\n contentType: \"application/json\",\n dataType: \"json\",\n data: {'method': 'listchannels', 'params': {}, 'id': new Date().getTime()},\n success: function(data) {\n ... | [
"0.71530175",
"0.7079872",
"0.6965194",
"0.6875644",
"0.68094826",
"0.68094826",
"0.67618185",
"0.65882313",
"0.65592384",
"0.65257144",
"0.6519451",
"0.6482072",
"0.64633197",
"0.64463574",
"0.64394164",
"0.6426947",
"0.6373545",
"0.635876",
"0.6329578",
"0.63291943",
"0.632... | 0.73470205 | 0 |
Setup effect and controller for native VR devices (oculus,vive). | setupNativeVR() {
// create the VR-effect for oculus/vive
effect = new THREE.VREffect(this.options.renderer, function (err) {
if (err) {
console.log("Error creating VREffect: ", err);
}
else {
console.log("Created VREffect: ", effect);
}
});
// create the VR-controls for oculus/vive
contr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupMobileVR() {\n\t\tif (!App.config.NO_MOBILEVR) {\n\t\t\teffect = new THREE.StereoEffect(this.options.renderer);\n\t\t\teffect.setSize(window.innerWidth, window.innerHeight);\n\t\t\t// Cardboards eye seperation is 2.5 inch. Divide by 2 for per-eye view.\n\t\t\teffect.separation = 2.5 * 0.0254 / 2;\n\t\t}\n\n\t... | [
"0.767391",
"0.6752373",
"0.6513581",
"0.63874704",
"0.63044864",
"0.6221516",
"0.6193489",
"0.6162354",
"0.60726976",
"0.60363805",
"0.6014335",
"0.60087943",
"0.5991338",
"0.59805703",
"0.59267014",
"0.5911104",
"0.59089005",
"0.589335",
"0.58582115",
"0.5828552",
"0.580626... | 0.79536426 | 0 |
Setup effect and controller for mobile / carboard VR devices | setupMobileVR() {
if (!App.config.NO_MOBILEVR) {
effect = new THREE.StereoEffect(this.options.renderer);
effect.setSize(window.innerWidth, window.innerHeight);
// Cardboards eye seperation is 2.5 inch. Divide by 2 for per-eye view.
effect.separation = 2.5 * 0.0254 / 2;
}
// create device orientation ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupNativeVR() {\n\t\t// create the VR-effect for oculus/vive\n\t\teffect = new THREE.VREffect(this.options.renderer, function (err) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log(\"Error creating VREffect: \", err);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"Created VREffect: \", effect);\n\t\t\t}\n\t\t});\n\n\t\t/... | [
"0.692609",
"0.6662497",
"0.62755",
"0.61984813",
"0.6169554",
"0.6148136",
"0.6087027",
"0.60764545",
"0.60458857",
"0.60308427",
"0.5995502",
"0.5934378",
"0.59246206",
"0.59239924",
"0.59122103",
"0.58811414",
"0.58721274",
"0.5856461",
"0.5854734",
"0.58275354",
"0.581746... | 0.7915615 | 0 |
Orbitcontrols as desktop fallback. | setupDesktopFallback() {
// show warn message if a queryselector is provided
if (typeof App.config.WARN_MESSAGE == 'string') {
Helpers.addClass(App.config.WARN_MESSAGE, 'is-active');
}
// create stereo effect as fake-vr
if (App.config.FAKE_VR_EFFECT) {
this.setupMobileVR();
}
// create orbitcontro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"useOrbitControls() {\n new THREE.OrbitControls(\n Engine.get().getCamera(), Engine.get().getRenderer().domElement);\n }",
"setUpOrbitControls () {\n const controls = new OrbitControls(\n this.camera,\n this.renderer.domElement\n );\n controls.enablePan = false;\n controls.enableZoo... | [
"0.7078728",
"0.68200076",
"0.6237933",
"0.590824",
"0.5719262",
"0.5698077",
"0.56709075",
"0.5613759",
"0.56098205",
"0.56090736",
"0.56090736",
"0.56090736",
"0.55597466",
"0.554994",
"0.543892",
"0.5416962",
"0.54103124",
"0.534658",
"0.5330285",
"0.53185",
"0.53022754",
... | 0.7027984 | 1 |
handle logic for Income caluclation when Schedule 1 is Unchecked | handleSchedule1Unchecked() {
this.objInputFields.bScheduleCDocComplete = false;
this.objInputFields.dLine11 = null;
this.objInputFields.dLine11Adjusted = null;
this.objInputFields.dLine12 = null;
this.objInputFields.dLine12Adjusted = null;
this.objInputFields.dLine13 = nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleAmountChangeSchedule1() {\n\n this.objInputFields.dLine22Adjusted = 0;\n this.objInputFields.dLine22Adjusted = this.objInputFields.dLine11Adjusted + this.objInputFields.dLine12Adjusted + this.objInputFields.dLine13Adjusted +\n this.objInputFields.dLine14Adjusted + this.objInputFields... | [
"0.6436373",
"0.587164",
"0.5784539",
"0.5724455",
"0.56788474",
"0.56705254",
"0.5609712",
"0.5572606",
"0.54843247",
"0.5477477",
"0.5458637",
"0.5439202",
"0.5426197",
"0.5420886",
"0.5413578",
"0.53919166",
"0.5391792",
"0.5351253",
"0.52932364",
"0.5285232",
"0.5263094",... | 0.67466235 | 0 |
Schedule C button is Clicked | handleSchedule() {
this.bShowScheduleC = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function actionOnClick(){\n day +=1;\n game.state.start('brushing');\n\n console.log('click');\n\n }",
"function handleScheduleButton(state){\n switch(state) {\n case \"disabled and hidden\":\n sButton.prop('disabled', true);\n sButton... | [
"0.63420135",
"0.6215921",
"0.6209104",
"0.61763114",
"0.6071951",
"0.5959578",
"0.5906158",
"0.5891015",
"0.58151406",
"0.580436",
"0.5782086",
"0.5774599",
"0.5772103",
"0.5764549",
"0.5763195",
"0.5751892",
"0.57486266",
"0.5741132",
"0.5729516",
"0.5724236",
"0.57225066",... | 0.67664325 | 0 |
set Is Schedule 1 Document value based on Adjusted value | checkSchedule1DocValidity() {
//Set Schedulec Doc complete based on Line12 entered & (Shcedule c enter value)
if (this.scheduleCList.length.size === 0) {
this.objInputFields.bScheduleCDocComplete = false;
this.objInputFields.dLine12Adjusted = 0;
} else if (!this.bLine3Di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveForceEmailScheduling() {\n if (gCalendar && gCalendar.type == \"caldav\") {\n let checkbox = document.getElementById(\"force-email-scheduling\");\n if (checkbox && checkbox.getAttribute(\"disable-capability\") != \"true\") {\n let status = checkbox.getAttribute(\"checked\") == \"true\";\n ... | [
"0.5330477",
"0.53153205",
"0.5265598",
"0.52092457",
"0.51987463",
"0.5140432",
"0.51310325",
"0.509368",
"0.5056053",
"0.50423217",
"0.4963",
"0.49467906",
"0.49112803",
"0.49008104",
"0.48332468",
"0.48226088",
"0.4813699",
"0.48107266",
"0.48095128",
"0.47954014",
"0.4782... | 0.56598413 | 0 |
handleScheduleC edit rows enable/Disable | handleScheduleCLineEnable() {
// Line 3, Lin29 & 31 is not entered enable all rows and updated Line12Ajusted field as zero
if ((this.dLine3Total === 0 || this.dLine3Total === '' || this.dLine3Total === undefined) &&
(this.dLine29Total === 0 || this.dLine29Total === '' || this.dLine29Total ==... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleSchedule() {\n this.bShowScheduleC = true;\n }",
"async function toggleEnable(e){\n const idx = parseInt(e.currentTarget.parentElement.dataset.idx, 10),\n conf = configs[idx],\n enabled = e.currentTarget.parentElement.dataset.enabled !== 'true' // click event changes the state\n\n ... | [
"0.6590993",
"0.6546102",
"0.64173365",
"0.6251948",
"0.62253094",
"0.62149394",
"0.6208364",
"0.61799234",
"0.613386",
"0.61062485",
"0.6105086",
"0.6090008",
"0.60808194",
"0.60712373",
"0.60469425",
"0.60441506",
"0.6037668",
"0.6035563",
"0.6016722",
"0.599043",
"0.599000... | 0.69167566 | 0 |
This method handles delete the ScheduleC rows | handleDelete(event) {
this.startIdx = Number(event.target.dataset.id);
this.scheduleCList.splice(this.startIdx, 1);
//refresh the list after deletion
this.scheduleCList.forEach((elem, idx) => {
elem.iScheduleCIndex = idx; // id starts from 0, 1, 2, 3 etc.
elem.sNu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteCalenderID(){\n\tdb.transaction(function(tx) {\n\t\ttx.executeSql(\"DELETE FROM calendar WHERE ID = \"+theid,\n\t\t\t[],\n\t\t\tfunction(trans, result) {\n\t\t\t\talert(\"Schedule: has been deleted\");\n\t\t\t},\n\t\t\tfunction(trans, error) {\n\t\t\t\t// handle the error\n\t\t\t}\n\t\t)\n\t});\n}/... | [
"0.65874374",
"0.65520394",
"0.632064",
"0.6280544",
"0.6213989",
"0.6201988",
"0.61954355",
"0.61945397",
"0.619007",
"0.61818224",
"0.6151243",
"0.61368555",
"0.6129778",
"0.6067427",
"0.6046084",
"0.60453916",
"0.6014188",
"0.599187",
"0.59803945",
"0.5962071",
"0.5957089"... | 0.72452134 | 0 |
update ScheduleC Total section based on row addition/deletion | updateScheduleCTotalAmount() {
this.dLine3Total = 0;
this.dLine29Total = 0;
this.dLine31Total = 0;
this.scheduleCList.forEach(element => {
this.dLine3Total += element.dLine3;
this.dLine29Total += element.dLine29;
this.dLine31Total += element.dLine31;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateTotalsRow(){\n //this is a blank function to make any update calls for totals...\n }",
"function updateTotal(row) {\n\tvar name = 'a' + row;\n\t// get the correct ID for the total to place total\n\tvar totID = 'T' + row;\n\tvar arr = document.getElementsByName(name);\n\tvar tot = 0;\n\tfor(var i ... | [
"0.6684222",
"0.6523977",
"0.63551784",
"0.60973716",
"0.60504746",
"0.5949691",
"0.59474975",
"0.591568",
"0.59076303",
"0.5816124",
"0.581028",
"0.5792102",
"0.5788283",
"0.57803595",
"0.5752377",
"0.5744456",
"0.57425576",
"0.5706453",
"0.5700601",
"0.5700601",
"0.5698406"... | 0.7565515 | 0 |
in order to refresh Income Document Section, execute this function: | refreshData() {
return refreshApex(this._wiredIncomeDocResult);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateDocument(contentHtml) {\n //$(\"#content\").html(contentHtml);\n var self = this;\n documentService.getTerms(documentModel.documentId).then(function(terms) {\n LHSModel.setTerms(terms);\n console.log(\"Terms return by API\");\n console.log(terms);\n documen... | [
"0.60785264",
"0.59897333",
"0.5786687",
"0.5724943",
"0.56309885",
"0.56136155",
"0.55962753",
"0.557246",
"0.5567061",
"0.5566279",
"0.5563457",
"0.5563186",
"0.5548937",
"0.5524406",
"0.5484435",
"0.54836524",
"0.5459222",
"0.5450089",
"0.5428903",
"0.5421304",
"0.54092723... | 0.6412344 | 0 |
refresh the parent component income info table through child event | refreshIncomeInfo() {
// Creates the event with the data.
const refreshIncomeDetails = new CustomEvent("refreshincomeinfo", {});
// Dispatches the event.
this.dispatchEvent(refreshIncomeDetails);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateChildComponents(args) {\n $resultsHeading.trigger('ma:ResultsHeading:DataUpdated', [args.data.resultsHeading]);\n\n $pagination.trigger('ma:Pagination:DataUpdated', [args.data.pagination]);\n if (args.clearedFilter) {\n $eventFilter.trigger('ma:FormFilter:DataUpdated', [args.cl... | [
"0.62805974",
"0.613055",
"0.6084396",
"0.604248",
"0.6037759",
"0.5977585",
"0.59200233",
"0.59200233",
"0.5888032",
"0.58826816",
"0.58399844",
"0.5830246",
"0.57677853",
"0.5757096",
"0.57219046",
"0.5719918",
"0.5717322",
"0.57036865",
"0.57034546",
"0.57013106",
"0.56954... | 0.6474863 | 0 |
Get the majority class from models predictions | function get_max_class(reply) {
let predictions = [reply.SVM, reply.RNN, reply.BERT]
let occ = predictions.reduce((acc, curr) => (acc[curr] = (acc[curr] || 0) + 1, acc), {})
if (!occ[0]) {
return 1
} else if (!occ[1]) {
return 0
} else {
return (occ[0] > occ[1] ? 0 : ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function classifyVideo() {\n classifier.predict(gotResult);\n // You can also specify the amount of classes detected you want\n // classifier.predict(10, gotResult)\n}",
"function classify() {\n\tclassifier.classify(gotResults);\n}",
"async function predict() {\r\n const prediction = await modelo.pre... | [
"0.6261072",
"0.6178566",
"0.6156217",
"0.61556053",
"0.6144709",
"0.6144709",
"0.60509914",
"0.60398483",
"0.5987466",
"0.5981527",
"0.5980785",
"0.5976839",
"0.5952515",
"0.5944891",
"0.5934016",
"0.5929782",
"0.59204906",
"0.59116006",
"0.58374345",
"0.5836022",
"0.5819865... | 0.72854483 | 0 |
DFS PseudoCode Recursive DFS(vertex): if vertex is empty, return (base case) add vertex to results hash mark vertex as visited for each neighbor in vertex's neighbors: if neighbor is not visited, recursively call DFS on neighbor should accept a starting node create a list to store the end result to be returned at the e... | DFSRecursive(vertex) {
const list = [];
const visited = {};
const adjacencyList = this.adjacencyList;
function dfpHelper(v) {
if (!adjacencyList[v]) {
return;
}
list.push(v);
visited[v] = true;
for (let i = 0; i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dfsRecursive(vertex) {\n // Base case\n if (!vertex) return null;\n\n // Vertex has been visited and added to result\n visited[vertex] = true;\n result.push(vertex);\n\n // For each neighbour of the vertex, perform DFS if not visited\n adjacencyList[vertex].forEach((neighbour) => {\n ... | [
"0.8162516",
"0.7729552",
"0.7699937",
"0.76801306",
"0.7671496",
"0.75269926",
"0.7385819",
"0.7345976",
"0.7317438",
"0.7231658",
"0.7216833",
"0.7136448",
"0.70843273",
"0.7077476",
"0.7046508",
"0.6922015",
"0.68126404",
"0.68108153",
"0.67672044",
"0.67070955",
"0.667441... | 0.8207261 | 0 |
instead of using a callstack to keep track of where we are, use a stack(array) let S be a stack. S.push(Starting vertex) while S is not empty vertex = S.pop() if vertex is not labeled as discovered, visit vertex (add to result list) label vertex as discovered for each of vertex's neighbors, N do S.push(N) func should a... | DFSIterative(start) {
const stack = [];
const result = [];
const visited = {};
stack.push(start);
visited[start] = true;
let next; // so that we don't redeclare a new var every loop
while(stack.length) {
console.log('stack', stack);
next ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"DFSIterative(vertex) {\n // s is a stack we created LIFO, Last in first out;\n const s = [];\n // push s into our stack\n s.push(vertex);\n // Create a results array and a visited object to check if the item has been visited already\n const visited = {};\n const results = [];\n while (s.len... | [
"0.7703745",
"0.75285596",
"0.74091107",
"0.7319932",
"0.731859",
"0.73078215",
"0.72512966",
"0.72189826",
"0.72013247",
"0.7121703",
"0.70365757",
"0.70228654",
"0.6917947",
"0.69028914",
"0.67137504",
"0.6689639",
"0.6675387",
"0.66521084",
"0.6639276",
"0.66049254",
"0.65... | 0.7838194 | 0 |
create multiple of this | static createMultiple(num, ...otherArgs){
if(isNaN(num)) return;
let allEntities = [],
[numRows] = otherArgs;
for(let i=0; i < num; i++){
let speed = Math.floor(Math.random() * 150) + 101*i+1,
c = (i == 0 ? 1 : numRows-2 <= i ? i-1 : i);
allEn... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get multiple() { return this._multiple; }",
"get multiple() { return this._multiple; }",
"get multiple() { return this._multiple; }",
"fromMul(a, b) {\n this[0] = a[0] * b[0];\n this[1] = a[1] * b[1];\n this[2] = a[2] * b[2];\n return this;\n }",
"_group(op, multi) {\n thi... | [
"0.57291776",
"0.57291776",
"0.57291776",
"0.5664799",
"0.5559204",
"0.5525979",
"0.54490995",
"0.53742754",
"0.5329048",
"0.5328664",
"0.5306795",
"0.52850735",
"0.5240049",
"0.5239489",
"0.52261436",
"0.52036726",
"0.51747257",
"0.51535314",
"0.5149543",
"0.5130221",
"0.512... | 0.5795174 | 0 |
Constructor for routing from Home Page to Map Display Page | function HomePage(http, router, modalController) {
this.http = http;
this.router = router;
this.modalController = modalController;
this.rootPage = HomePage_1; //Define the Home Page as the root page
this.stackData = ""; //Global string for holding value returned by database
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initIndexPage() {\n\tinitMapIndexPage();\n}",
"function initRouting(){\n render();\n}",
"function initRouter() {\n router.get(\"/\", function() {\n window.displayPage(\"home\", \"\");\n });\n\n router.get(\"/shows\", function() {\n window.displayPage(\"shows\", \"/shows\");\n });\n\n rou... | [
"0.62952584",
"0.62672824",
"0.61681086",
"0.61088264",
"0.60631496",
"0.6048775",
"0.6027573",
"0.6023585",
"0.600112",
"0.5992606",
"0.59815514",
"0.597957",
"0.5916253",
"0.5913724",
"0.59030133",
"0.5879005",
"0.587227",
"0.5870469",
"0.586636",
"0.5855717",
"0.5849434",
... | 0.64087546 | 0 |
Directs the user to the "Edit Entry" page for this entry | goToEditEntry() {
console.log(this.state.entry);
FlowRouter.go('edit', {_id: this.state.entry._id});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleMemberEdit() {\n var currentMember = $(this)\n .parent()\n .parent()\n .data(\"post\");\n window.location.href = \"/admin?id=\" + currentMember.id;\n }",
"function edit(edit_id) {\n open_form(APP_STATE.current_function, 'UPDATE', edit_id);\n}",
"function edit(req, res, n... | [
"0.67444175",
"0.6707493",
"0.6665524",
"0.66346425",
"0.65987307",
"0.6596563",
"0.6498288",
"0.64797735",
"0.64797735",
"0.64797735",
"0.64797735",
"0.64797735",
"0.64797735",
"0.6473727",
"0.6423293",
"0.6414949",
"0.6400116",
"0.6390975",
"0.6323544",
"0.6320905",
"0.6301... | 0.7052199 | 0 |
Compiles declaration fileds to methods, makes inheritances | function CompileDeclarations () {
function extend (obj, extObj) {
for (var key in extObj) {
if (ReservedDeclarationProperies[key] === 2) continue
if (typeof obj[key] === 'undefined') {
obj[key] = extObj[key]
} else if (typeof extObj[key] === 'function' &&... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeClassInheritence( n, i, a ){\n var o =\"function \"+n+\"(\";\n \n if(a){\n //insere paramentros na funcao\n if( a.length > 1 )\n for( var q=0;q<a.length;q++)\n o+=String.fromCharCode(q); \n else \n o+=String.fromCharC... | [
"0.5914696",
"0.5913924",
"0.5814523",
"0.5758583",
"0.5716874",
"0.5681477",
"0.5608555",
"0.5456703",
"0.54447997",
"0.540414",
"0.53963786",
"0.5376616",
"0.5355182",
"0.5344253",
"0.53302574",
"0.53158504",
"0.5294968",
"0.5291628",
"0.528789",
"0.52715135",
"0.52715135",... | 0.7410339 | 0 |
(experimental) Add a construct to the dependency roots. | add(construct) {
this._dependencyRoots.push(construct);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addDependency(...dependencies) {\n constructs_1.Node.of(this).addDependency(...dependencies);\n }",
"addDependency(...dependencies) {\n constructs_1.Node.of(this).addDependency(...dependencies);\n }",
"constructor(scope, id) {\n /**\n * The set of constructs that form the roo... | [
"0.66295445",
"0.66295445",
"0.58557343",
"0.5653718",
"0.5557072",
"0.5552179",
"0.5447902",
"0.5370043",
"0.53579736",
"0.5305532",
"0.52991605",
"0.52933776",
"0.52897537",
"0.5249302",
"0.5245588",
"0.5201118",
"0.5180799",
"0.5155411",
"0.51530206",
"0.51477325",
"0.5140... | 0.8024828 | 0 |
(experimental) Register `instance` to have the given DependableTrait. Should be called in the class constructor. | static implement(instance, trait) {
// I would also like to reference classes (to cut down on the list of objects
// we need to manage), but we can't do that either since jsii doesn't have the
// concept of a class reference.
instance[DEPENDABLE_SYMBOL] = trait;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get(instance) {\n const ret = instance[DEPENDABLE_SYMBOL];\n if (!ret) {\n throw new Error(`${instance} does not implement DependableTrait`);\n }\n return ret;\n }",
"registerDependencyTo(dependency, required = false) {\n if (this.module) {\n this.modu... | [
"0.5759886",
"0.5482585",
"0.54236364",
"0.53427964",
"0.52794176",
"0.5128806",
"0.51123416",
"0.5037912",
"0.5001224",
"0.49887425",
"0.49347743",
"0.4862051",
"0.48424017",
"0.48154083",
"0.47432566",
"0.47289687",
"0.47240716",
"0.47126085",
"0.46845114",
"0.46625474",
"0... | 0.6979152 | 0 |
(experimental) Return the matching DependableTrait for the given class instance. | static get(instance) {
const ret = instance[DEPENDABLE_SYMBOL];
if (!ret) {
throw new Error(`${instance} does not implement DependableTrait`);
}
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findTrait (trait) {\n if (this.template && this.template[trait]) {\n return this.template[trait];\n }\n\n for (let i = 0; i < this.components.length; i++) {\n const child = this.components[i];\n\n // A Creature doesnt want the stat from a item, or a modifier (r... | [
"0.5358513",
"0.49800134",
"0.49516752",
"0.49397987",
"0.49273458",
"0.48856735",
"0.48155466",
"0.46143404",
"0.46106943",
"0.46083963",
"0.45803416",
"0.45753446",
"0.45605186",
"0.45464286",
"0.4527823",
"0.45219135",
"0.44886643",
"0.44844103",
"0.44844103",
"0.44844103",
... | 0.72084075 | 0 |
Create the google url to be sent to the client. | function urlGoogle() {
const auth = createConnection(); // this is from previous step
const url = getConnectionUrl(auth);
return url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function urlGoogle() {\n\tconst auth = createConnection(); // this is from previous step\n const url = getConnectionUrl(auth);\n\treturn(url);\n}",
"function urlGoogle() {\n const auth = createConnection();\n const url = getConnectionUrl(auth);\n return url;\n}",
"createUrl() {\n let url = this.ur... | [
"0.81544894",
"0.777519",
"0.77348876",
"0.7385607",
"0.71786433",
"0.67538154",
"0.66181314",
"0.65008175",
"0.65008175",
"0.6464953",
"0.64348847",
"0.63787055",
"0.6307233",
"0.63055116",
"0.62403613",
"0.6237963",
"0.6091021",
"0.60733765",
"0.60653245",
"0.60286134",
"0.... | 0.79525155 | 1 |
find years with maximum number of presidents alive and their names | function mostAliveYear(info) {
let table = makePresidentTable(info);
let [minYear, maxYear] = getYearRange(table);
let mostAlive = maxAlive(minYear, maxYear, table);
let allAlives = [];
for(let i = minYear; i <= maxYear; i++) {
let curAlive = totalAlive(i, table);
if(curAlive.length == mostAlive)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_max_value(year) {\n\t\tvar mv = 0\n\t\tfor (i in data) {\n\t\t\tif (display[year].indexOf(data[i]['name']) != -1) {\n\t\t\t\tif (mv < data[i]['internet_population'][year]) {mv = data[i]['internet_population'][year]; }\n\t\t\t}\n\t\t}\n\t\treturn mv;\n\t}",
"function getMaxYear (cijfers) {\n return ... | [
"0.6297644",
"0.5920873",
"0.5857174",
"0.57614046",
"0.5748856",
"0.5736467",
"0.57279646",
"0.57183015",
"0.56444347",
"0.5641141",
"0.56354916",
"0.5603118",
"0.5600862",
"0.558711",
"0.55577403",
"0.55555356",
"0.5548712",
"0.5543754",
"0.5524829",
"0.5521825",
"0.5515330... | 0.7715837 | 0 |
Reduce is only called with 2 arguments, making the first element the default min value. You cannot pass in 0 as default to reduce, as this might return 0 instead of the lowest value. | function minValue(arr) {
return arr.reduce(function(acc,num){
return acc < num ? acc : num;
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Array_min(ary) {\n return ary.reduce((a, b) => Math.min(a, b), ary[0]);\n}",
"function sumOfMinimums(arr) {\n // your code here\n return arr.reduce((acc, el) => (acc += el.sort((a, b) => a - b)[0]), 0);\n}",
"function reduce(arr, accumulator, startValue){\n\tforEach(arr, function(item){\n\t\tif(sta... | [
"0.65192574",
"0.64382446",
"0.63791275",
"0.62285614",
"0.6162118",
"0.6150114",
"0.61497635",
"0.6142569",
"0.6099347",
"0.60829806",
"0.6080548",
"0.60770786",
"0.6049321",
"0.5998347",
"0.59895825",
"0.5970597",
"0.59597105",
"0.5946858",
"0.59131795",
"0.5911718",
"0.590... | 0.69018847 | 0 |
Searches for the right video according to the given video ID | function videoSearch(videoID, array) {
for (var i = 0; i < array.length; i++) {
if (array[i].id === videoID) {
return array[i];
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function findVideo(id, videos) {\n let videoFound;\n const numId = Number(id);\n videos.forEach((video) => {\n if (video.id === numId) { videoFound = video; }\n });\n if (videoFound) { return videoFound; }\n return false;\n}",
"async searchVideo(id){\n let res = await axios.... | [
"0.7878612",
"0.7532908",
"0.7347321",
"0.7089075",
"0.696109",
"0.686517",
"0.6805321",
"0.6761485",
"0.6644126",
"0.66207767",
"0.6597743",
"0.6592322",
"0.6586535",
"0.655391",
"0.653553",
"0.6532313",
"0.6506373",
"0.65050614",
"0.6454923",
"0.64505255",
"0.6444991",
"0... | 0.80852896 | 0 |
Builds a JQL string from the URL arguments sent to the script. | function buildQueryString()
{
var terms = [];
var assignee = args.assignee || user.name; // default to the current user
terms.push("assignee="+assignee);
if (args.duedate && args.duedate.length > 0) {
var dates = args.duedate.split(",");
var i, len = dates.length;
for (i = 0; i < len; i += 1) {
terms.pu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"buildQuery() {\n if ([...this.params.keys()].length === 0) {\n throw new Error('You must specify at least ' + AVAILABLE_QUERY_PARAMS.map(item => `\"${item}\"`).join(', '));\n }\n return this.params.toString();\n }",
"build(){let queryString=\"\";for(const[key,value]of this._que... | [
"0.60227334",
"0.59761375",
"0.59461206",
"0.59341985",
"0.59056276",
"0.5883033",
"0.58728355",
"0.58728355",
"0.58558786",
"0.5843165",
"0.5801273",
"0.57993764",
"0.57475054",
"0.57418394",
"0.57247776",
"0.5702706",
"0.5700836",
"0.56943536",
"0.56715274",
"0.56522834",
"... | 0.67322886 | 0 |
Call initCenter with random arguments, printing out said call | function randCenter() {
/* pick number of elements */
var n = floor(random(112, 145));
/* pick initial angle at which to point elements */
var iri = floor(random(4));
/* pick Perlin noise seeds and interval */
var pnseed = floor(random(256));
var pnunit = floor(random(30, 101));
initCenter(n, iri, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomNewCenter(bot,top,center,many){\n\n}",
"function main()\n{\n initCommand();\n clearSelection();\n global.newRect = true;\n global.x1 = NaN;\n global.y1 = NaN;\n global.x2 = NaN;\n global.y2 = NaN;\n setPromptPrefix(qsTr(\"Specify first corner point or [Chamfer/Fillet]: \"))... | [
"0.66986614",
"0.5834862",
"0.5772878",
"0.56626624",
"0.5588307",
"0.55333644",
"0.54582965",
"0.54290414",
"0.53916466",
"0.53752905",
"0.53739744",
"0.5343007",
"0.53395236",
"0.5326767",
"0.5280048",
"0.52626956",
"0.52434117",
"0.5231151",
"0.5228603",
"0.522326",
"0.522... | 0.72078395 | 0 |
Initialize Center over these parameters. n number of circles iri index of which direction to pnseed seed for generating circle colors from Perlin noise pnunit interval of Perlin noise we generate circle colors from | function initCenter(n, iri, pnseed, pnunit) {
/* pick initial angle at which to point elements */
var ir = irs[mod(floor(iri), irs.length)];
/* seed Perlin noise and define value function */
noiseSeed(pnseed);
var nunit = pnunit / 100;
function fv(i) {
return i < n / 4 ? 255 * noise(map(i, 0, n / 4, 0,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randCenter() {\n /* pick number of elements */\n var n = floor(random(112, 145));\n \n /* pick initial angle at which to point elements */\n var iri = floor(random(4));\n\n /* pick Perlin noise seeds and interval */\n var pnseed = floor(random(256));\n var pnunit = floor(random(30, 101));\n\n ini... | [
"0.7546918",
"0.65007377",
"0.6378012",
"0.6331313",
"0.63086337",
"0.62962717",
"0.62738496",
"0.6230592",
"0.6146483",
"0.60536194",
"0.60481775",
"0.6005893",
"0.5982524",
"0.596207",
"0.59145194",
"0.5874392",
"0.5871364",
"0.5841627",
"0.58232194",
"0.5796233",
"0.578121... | 0.85410255 | 0 |
move each circle, wrapping around drawing surface if necessary | function moveCircles() {
for (var i = 0; i < circles.length; i++) {
var e = circles[i];
e.x = mod(e.x + e.dx, width);
e.y = mod(e.y + e.dy, height);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"draw() {\n context.translate(-512, -512);\n context.clearRect(0, 0, 1024, 1024);\n context.translate(512, 512);\n\n for(let i = this.circles.length - 1; i >= 0; i--) {\n this.circles[i].draw(i, 470 - ((this.circles.length - 1 - i) * (400 / this.circles.length)));\n }\n... | [
"0.6902904",
"0.68982464",
"0.6815087",
"0.67689705",
"0.6745819",
"0.6742889",
"0.67385286",
"0.6728781",
"0.6702165",
"0.66876763",
"0.6655185",
"0.66139257",
"0.6577388",
"0.6537628",
"0.653201",
"0.65196115",
"0.65184516",
"0.6492015",
"0.6482699",
"0.64798665",
"0.641227... | 0.7669832 | 0 |
draw line between overlapping circles | function drawCircleInteractions() {
for (var i = 0; i < circles.length; i++) {
var e1 = circles[i];
for (var j = 0; j < i; j++) {
var e2 = circles[j];
var d = dist(e1.x, e1.y, e2.x, e2.y);
if (d <= dm) { // if overlapping
stroke(
/* average of the two circles' colors */
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawCircle(center, radius, plot){\n var x = radius;\n var y = 0;\n var decisionOver2 = 1 - x; // Decision criterion divided by 2 evaluated at x=r, y=0\n\n while(x >= y){\n lineAlgorithmOversampled(center, new Vector2d( x + center.x, y + center.y), plot);\n lineAlgorithmOversampled(center, new... | [
"0.71201986",
"0.6702063",
"0.66521686",
"0.66192555",
"0.65605986",
"0.65541637",
"0.652481",
"0.65198195",
"0.65163606",
"0.64957595",
"0.64957595",
"0.6479377",
"0.6479004",
"0.64747626",
"0.6466768",
"0.64582014",
"0.6454978",
"0.6449596",
"0.64470226",
"0.6444013",
"0.64... | 0.70434916 | 1 |
return filename for a given channelID | function getSaveFilename(targetChannel) {
return 'last_video_' + targetChannel + '.json'
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatChannelID(channel) {\n channel = channel.substring(channel.lastIndexOf(\"/\") + 1);\n channel = channel.replace(/[_-]/g, \"\");\n if (channel.substring(0, 2) == \"UC\") {\n channel = channel.substring(2);\n }\n return channel;\n}",
"function getFilename(){\n const now = new Date();\n ... | [
"0.59204555",
"0.58344746",
"0.5793252",
"0.5757842",
"0.57488227",
"0.5736147",
"0.56935596",
"0.56672996",
"0.56627584",
"0.56600916",
"0.56582546",
"0.55887544",
"0.55841136",
"0.55259067",
"0.5501855",
"0.5495212",
"0.5434676",
"0.54104143",
"0.5356147",
"0.534029",
"0.53... | 0.70172435 | 0 |
get the rating for the course from the server and adds this to the page | function drawRating() {
var req = new XMLHttpRequest()
req.open("GET", "/reviews/rating/" + courseCode, true);
req.onreadystatechange = function () {
if (req.readyState == 4 && req.status == 200) {
(document.getElementById("rating")).append(document.createTextNode(req.responseText));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Rating(page) {\n\tvar rated = \"<div class='star\" + starValue + \" screen_\" + page + \"_bar bar font-size va-parent ' onclick='ChangeStar(\" + page + \")'><div class='vertical-align center'> \"\n\t\t\t+ questions[0].overallQuestion2 + \" : \" + starValue + \"</div></div>\"\n\treturn rated;\n}",
"func... | [
"0.64408517",
"0.61802286",
"0.61490476",
"0.6134885",
"0.6120287",
"0.6096098",
"0.6028721",
"0.59716517",
"0.5971338",
"0.59653044",
"0.59080774",
"0.5897482",
"0.5856565",
"0.5853073",
"0.57887036",
"0.57504946",
"0.5710044",
"0.57097733",
"0.5694765",
"0.56898886",
"0.565... | 0.7192173 | 0 |
only if the enrollment mode is 'enroll' or 'leave' a button with the relevant text will be added to the page | function addEnrollment() {
if (enrollmentMode == "enroll" || enrollmentMode == "leave") {
btn.textContent = enrollmentMode;
document.getElementById("table").append(btn);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onEnrollButtonPressed_() {\n this.userActed('enroll');\n }",
"function allowEnrolment() {\r\n let courseType = getCourseType() + \"s\";\r\n let enrolmentText = `<div class=\"col-md-6\"><article class=\\\"text-white\\\"><h5>Are you interested?</h5><h6 class=\\\"mt-3\\\">Enrolment Instructions</h6><ol id... | [
"0.62139785",
"0.60480267",
"0.60135794",
"0.59882903",
"0.5952457",
"0.59149414",
"0.5804231",
"0.5795844",
"0.5738681",
"0.56798",
"0.5675229",
"0.5585867",
"0.55525225",
"0.55474406",
"0.5541609",
"0.552719",
"0.55025494",
"0.5490435",
"0.5437286",
"0.5418684",
"0.54005504... | 0.7784571 | 0 |
get all the reviews of this course from the server and then calls drawReviews() | function getReviews() {
var req = new XMLHttpRequest()
req.open("GET", "/reviews/" + courseCode, true);
req.onreadystatechange = function () {
if (req.readyState == 4 && req.status == 200) {
drawReviews(JSON.parse(req.responseText));
}
}
req.send();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_reviews() {\n wkof.include('Apiv2')\n return wkof.ready('Apiv2').then(load_data).then(update_data)\n }",
"function getReviews() {\n\t\tvar query = new Parse.Query(Review);\n\t\tquery.find({\n\t\t\tsuccess:function(results) {\n\t\t\t\tbuildReviews(results);\n\t\t\t}\n\t\t});\n\t}",
... | [
"0.76401913",
"0.75325406",
"0.72974056",
"0.7259327",
"0.7257082",
"0.7166428",
"0.71543455",
"0.70662445",
"0.69083524",
"0.6908303",
"0.6863892",
"0.6842719",
"0.6774123",
"0.67595214",
"0.6547943",
"0.65375084",
"0.6534331",
"0.6465192",
"0.6388361",
"0.63451135",
"0.6338... | 0.8156451 | 0 |
loops trough the array of recieved reviews and calls for every review drawReview() | function drawReviews(reviews) {
for (var i = 0; i < reviews.length; i++) {
drawReview(reviews[i]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayReviews(reviewsArray) {\n for (elem of reviewsArray) {\n \n let newComment = $(\"<div>\");\n newComment.addClass(\"mt-4\");\n\n let commentName = $(\"<h4>\");\n commentName.text(elem.reviewer_name);\n\n let commentRating_Verified = $(\"<h5>\");\n commentRating_... | [
"0.7308652",
"0.72857404",
"0.69685555",
"0.6663425",
"0.6532478",
"0.6529982",
"0.6376297",
"0.63128906",
"0.6238047",
"0.62090236",
"0.61775744",
"0.61762255",
"0.61349493",
"0.61274695",
"0.6121973",
"0.60823596",
"0.6070641",
"0.6059231",
"0.6057898",
"0.60438776",
"0.601... | 0.86893755 | 0 |
adds an textnode with the given text to the element body | function addTextNode(text, body) {
body.append(document.createTextNode(text));
body.append(document.createElement("br"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertTextNode(element, text){\n\t\telement.appendChild(doc.createTextNode(text));\n\t}",
"appendText(text) {\n const trimmedText = text.trim();\n if (trimmedText.length === 0) {\n // Whitespace around element tags is ignored\n return;\n }\n this.addChild('text', undefined, [decode... | [
"0.76666915",
"0.7523858",
"0.73474234",
"0.7344975",
"0.7285151",
"0.6980482",
"0.6950609",
"0.6869988",
"0.6853758",
"0.6813365",
"0.68114156",
"0.6791871",
"0.6791871",
"0.6791871",
"0.6791871",
"0.6791871",
"0.6791871",
"0.67653495",
"0.676504",
"0.6752552",
"0.67454195",... | 0.8209106 | 0 |
PboardGet Get the board values. | function PboardGet(x, y)
{
return board[x * 7 + y];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getBoard() {\n return this.cloneBoard(this.board);\n }",
"get values() { return __classPrivateFieldGet(this, _boardCore).copy().values; }",
"getBoard(){\n return this._board;\n }",
"get(posn) {\n\t\tif (!this.outOfBounds(posn)) {\n\t\t\treturn this.board[posn.x][posn.y];\n\t\t} else {\n\t\t\t//... | [
"0.6627714",
"0.64657414",
"0.6272889",
"0.6207662",
"0.61271703",
"0.6118939",
"0.608606",
"0.60731244",
"0.6048085",
"0.60470724",
"0.5948934",
"0.59221214",
"0.5886951",
"0.5886951",
"0.58714575",
"0.5851395",
"0.5836191",
"0.580196",
"0.5788007",
"0.574235",
"0.5617028",
... | 0.7103663 | 0 |
PboardSet Set the board values. | function PboardSet(x, y, value)
{
board[x * 7 + y] = value;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setBoard(board){\n this._board = board;\n }",
"function setUpBoard () {\n makeCrystalScores();\n makeCrystalButtons();\n }",
"function setGameBoard() {\n\n console.log(\"setting up game board\");\n\n center = getCenter(getActivePopulation());\n\n sortPeople(); // sort the people i... | [
"0.61943936",
"0.5718858",
"0.5705452",
"0.56880414",
"0.5686946",
"0.56597245",
"0.56482697",
"0.55835634",
"0.5571738",
"0.5569262",
"0.5487567",
"0.54613",
"0.5452272",
"0.544132",
"0.5437762",
"0.5433829",
"0.5394784",
"0.532944",
"0.5328332",
"0.5323572",
"0.52984923",
... | 0.6553234 | 0 |
Practicing call Back Function | function call_back(name,age,work){
console.log("Hello ",name);
console.log("Your age is ", age);
work();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function callBackOne() {\n console.log(`good morning puson`);\n}",
"function a(callBack) {\n setTimeout(() => { callBack('hello'); }, 2000);\n return 'Sorry, not available yet';\n }",
"callback() {}",
"get Callback() {}",
"function example(callBack, name) {\n console.log(callBack, name)\n co... | [
"0.72983223",
"0.6826143",
"0.6757667",
"0.6756209",
"0.66934264",
"0.6660063",
"0.6615459",
"0.6551586",
"0.65382004",
"0.65034777",
"0.64988786",
"0.64720184",
"0.6448989",
"0.6415154",
"0.64014894",
"0.6382215",
"0.6364252",
"0.6349631",
"0.63279814",
"0.63258815",
"0.6262... | 0.73204345 | 0 |
public id: number; public task: string; public status: boolean; constructor | constructor(id, task, status) {
//this.id = id;
//this.task = task;
//this.status = status;
//no code required tsc ewilltake care of assigning values
this.id = id;
this.task = task;
this.status = status;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(tId, t_Name, t_status) {\n this.taskID = 0;\n this.taskID = tId;\n this.taskName = t_Name;\n this.taskStatus = false;\n // in case if user explicitly provide status\n if (t_status) {\n this.taskStatus = t_status;\n }\n // in case if use... | [
"0.7977777",
"0.77809906",
"0.72080135",
"0.7188866",
"0.7150664",
"0.7120511",
"0.7080853",
"0.70252734",
"0.69916975",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",
"0.6963234",... | 0.86625296 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.