Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Sort Claim Trans Report GridBy krishna on 21082015
function SortClaimTransReportGrid(event) { //var reportingType = $("#hdReportType").val(); //var corporateId = $("#CorporateId").val(); var url = "/Reporting/SortClaimTransReportGrid"; var fromDate = ($("#txtFromDate").val()); var tillDate = ($("#txtTillDate").val()); //var isAll = $('#ShowAllRecords').prop('checked') ? true : false; var displayby = $("#ddlDisplayBy").val(); //var userId = $("#ddlUsers").val(); if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?fromDate=" + fromDate + "&tillDate=" + tillDate + "&displayby=" + displayby + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#ReportingGrid").empty(); $("#ReportingGrid").html(data); //ReportingGrid }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SortTerritorySalesNumbers() {\n\n //sort the territories in descending order based on percent\n if (vm.chartType == 'month') {\n vm.territorySalesNumbers.sort(function (a, b) { return b.percent - a.percent }); //descending order\n }\n //sort the territories in ascending order ba...
[ "0.63935214", "0.63682437", "0.6264131", "0.62157047", "0.62157047", "0.6157495", "0.6152399", "0.6000931", "0.5979099", "0.59532887", "0.5934743", "0.5927989", "0.5921012", "0.5921012", "0.5920199", "0.59020525", "0.5896896", "0.5895919", "0.58934885", "0.58916897", "0.58877...
0.5698924
42
Sort payor Aging Report GridBy krishna on 21082015
function SortPayorAgingReport(event) { var url = "/Reporting/AgeingReport"; var reportingType = $("#hdReportType").val(); var reportingTypeId = reportingType; var date = $("#txtFromDate").val(); if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?reportingTypeId=" + reportingTypeId + "&date=" + date + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#ReportingGrid").empty(); $("#ReportingGrid").html(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sorted(sheet){\n sheet.sort(masterCols.end_time+1).sort(masterCols.start_time+1).sort(masterCols.date+1);\n}", "function SortTerritorySalesNumbers() {\n\n //sort the territories in descending order based on percent\n if (vm.chartType == 'month') {\n vm.territorySalesNumbers.sort(func...
[ "0.6504127", "0.640528", "0.6334616", "0.6298504", "0.6190906", "0.61694986", "0.61459124", "0.6128156", "0.611957", "0.60901916", "0.60901916", "0.6079723", "0.6054569", "0.6046542", "0.6036809", "0.60220426", "0.601608", "0.6012693", "0.6011818", "0.5989218", "0.5970164", ...
0.56294435
87
Sort payor Recancilation Report GridBy krishna on 21082015
function SortRecancilationReportGrid(event) { var url = "/Reporting/ReconciliationReport"; var reportingTypeId = $("#hdReportType").val(); var date = ($("#txtFromDate").val()); var viewtype = $('#ddlViewType').val(); if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?reportingTypeId=" + reportingTypeId + "&date=" + date + "&viewtype=" + viewtype + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#ReportingGrid").empty(); $("#ReportingGrid").html(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sorted(sheet){\n sheet.sort(masterCols.end_time+1).sort(masterCols.start_time+1).sort(masterCols.date+1);\n}", "function SortTerritorySalesNumbers() {\n\n //sort the territories in descending order based on percent\n if (vm.chartType == 'month') {\n vm.territorySalesNumbers.sort(func...
[ "0.64861214", "0.64245445", "0.62959456", "0.6258747", "0.6190727", "0.61366796", "0.6132196", "0.6121353", "0.61201197", "0.61201197", "0.6119845", "0.6070209", "0.6054736", "0.6054736", "0.60409963", "0.6018277", "0.60131776", "0.5991308", "0.5990959", "0.59777683", "0.5976...
0.56888205
77
Sort Revenu Forcast Report GridBy krishna on 21082015
function SortRevenuForcastReportGrid(event) { var url = "/Reporting/SortRevenuForcastReportGrid"; var fromDate = ($("#txtFromDate").val()); var tillDate = ($("#txtTillDate").val()); if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?fromDate=" + fromDate + "&tillDate=" + tillDate + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#ReportingGrid").empty(); $("#ReportingGrid").html(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sorted(sheet){\n sheet.sort(masterCols.end_time+1).sort(masterCols.start_time+1).sort(masterCols.date+1);\n}", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key ...
[ "0.6658878", "0.64940864", "0.64940864", "0.6457299", "0.6368116", "0.6337518", "0.6261937", "0.6259716", "0.6259716", "0.62582433", "0.6255065", "0.6252116", "0.6243151", "0.6231449", "0.6199003", "0.6179316", "0.61751175", "0.6123937", "0.6123574", "0.61011386", "0.60417867...
0.0
-1
Sort Journal Entry Support Report GridBy krishna on 27082015
function JournalEntrySupportReportGrid(event) { var url = "/Reporting/JournalEntrySupportReportGrid"; var fromDate = ($("#txtFromDate").val()); var tillDate = ($("#txtTillDate").val()); var displayby = $("#ddlDisplayBy").val(); if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?fromDate=" + fromDate + "&tillDate=" + tillDate + "&displayby=" + displayby + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#ReportingGrid").empty(); $("#ReportingGrid").html(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sorted(sheet){\n sheet.sort(masterCols.end_time+1).sort(masterCols.start_time+1).sort(masterCols.date+1);\n}", "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAccessed);\n\t\tvar date2 = D...
[ "0.6761737", "0.6714283", "0.64194363", "0.63139695", "0.63139695", "0.61838955", "0.6150372", "0.6116759", "0.6111793", "0.61062837", "0.6103657", "0.6054413", "0.6054413", "0.605033", "0.6039964", "0.60375875", "0.60352343", "0.6026433", "0.60260594", "0.6017911", "0.600996...
0.0
-1
Bind Payor Dropdown into Daily charge report
function BindInsuranceCompaniesData(selector) { $.getJSON("/Insurance/GetInsuranceCompaniesDropdownData", {}, function (data) { BindInsuranceDropdownData(data, selector, ""); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function donate_percent_select(obj) \n { \n $('#charity_dropdownlist').show(); \n $('.donate_percent_store').val(obj); \t \n }", "function selectPrepayment(){\n\tvar controller = View.controllers.get('prepaymentCtrl');\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause('...
[ "0.6204069", "0.583995", "0.58145845", "0.5770826", "0.5630573", "0.55587304", "0.5543544", "0.5539035", "0.5520777", "0.5500686", "0.54380906", "0.5429863", "0.5419066", "0.5408831", "0.5387183", "0.536202", "0.53559476", "0.53504604", "0.53453034", "0.5333551", "0.5328292",...
0.0
-1
Imagine you have an array of numbers. Write an algorithm to remove all numbers less than 5 from the array. DO NOT use Array's builtin .filter() method here; write the algorithm from scratch.
function filter(arr){ const newArr = []; for (let i=0; i < arr.length; i++) { if (arr[i] >= 5) { newArr.push(arr[i]) } } return newArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_lt_5(arr) {\n\tlet ret = [];\n\tfor (var i = 0; i < arr.length; ++i) {\n\t\tif (!(arr[i] < 5)) \n\t\t\tret.push(arr[i]);\n\t}\n\treturn ret;\n}", "function filterArray(arr) {\n let i = 0;\n while (i < arr.length) {\n if (arr[i] < 5) {\n arr.splice(i, 1);\n } else {\n i++;\n }...
[ "0.8324944", "0.8156904", "0.77726126", "0.77141345", "0.75892025", "0.758", "0.75763077", "0.747585", "0.74276733", "0.7390613", "0.7303901", "0.7189917", "0.7060253", "0.7006998", "0.6960707", "0.6922297", "0.687955", "0.68570757", "0.6847892", "0.6801743", "0.6780585", "...
0.7516278
7
///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// Function: settingDialog Usage: create the main dialog Input: settings to initialize the dialog with , ExportInfo object Return: true if ok, false if cancel
function settingDialog(exportInfo) { dlgMain = new Window("dialog", strTitle); dlgMain.orientation = 'column'; dlgMain.alignChildren = 'left'; // -- top of the dialog, first line dlgMain.add("statictext", undefined, strLabelDestination); // -- two groups, one for left and one for right ok, cancel dlgMain.grpTop = dlgMain.add("group"); dlgMain.grpTop.orientation = 'row'; dlgMain.grpTop.alignChildren = 'top'; dlgMain.grpTop.alignment = 'fill'; // -- group contains four lines dlgMain.grpTopLeft = dlgMain.grpTop.add("group"); dlgMain.grpTopLeft.orientation = 'column'; dlgMain.grpTopLeft.alignChildren = 'left'; dlgMain.grpTopLeft.alignment = 'fill'; // -- the second line in the dialog dlgMain.grpSecondLine = dlgMain.grpTopLeft.add("group"); dlgMain.grpSecondLine.orientation = 'row'; dlgMain.grpSecondLine.alignChildren = 'center'; dlgMain.etDestination = dlgMain.grpSecondLine.add("edittext", undefined, exportInfo.destination.toString()); dlgMain.etDestination.preferredSize.width = StrToIntWithDefault( stretDestination, 160 ); dlgMain.btnBrowse= dlgMain.grpSecondLine.add("button", undefined, strButtonBrowse); dlgMain.btnBrowse.onClick = btnBrowseOnClick; // -- the third line in the dialog dlgMain.grpThirdLine = dlgMain.grpTopLeft.add("statictext", undefined, strLabelStyle); // -- the fourth line in the dialog dlgMain.etStyle = dlgMain.grpTopLeft.add("edittext", undefined, exportInfo.style.toString()); dlgMain.etStyle.alignment = 'fill'; dlgMain.etStyle.preferredSize.width = StrToIntWithDefault( stretDestination, 160 ); // -- the fifth line in the dialog dlgMain.cbSelection = dlgMain.grpTopLeft.add("checkbox", undefined, strCheckboxSelectionOnly); dlgMain.cbSelection.value = exportInfo.selectionOnly; // the right side of the dialog, the ok and cancel buttons dlgMain.grpTopRight = dlgMain.grpTop.add("group"); dlgMain.grpTopRight.orientation = 'column'; dlgMain.grpTopRight.alignChildren = 'fill'; dlgMain.btnRun = dlgMain.grpTopRight.add("button", undefined, strButtonRun ); dlgMain.btnRun.onClick = btnRunOnClick; dlgMain.btnCancel = dlgMain.grpTopRight.add("button", undefined, strButtonCancel ); dlgMain.btnCancel.onClick = function() { var d = this; while (d.type != 'dialog') { d = d.parent; } d.close(cancelButtonID); } dlgMain.defaultElement = dlgMain.btnRun; dlgMain.cancelElement = dlgMain.btnCancel; dlgMain.grpBottom = dlgMain.add("group"); dlgMain.grpBottom.orientation = 'column'; dlgMain.grpBottom.alignChildren = 'left'; dlgMain.grpBottom.alignment = 'fill'; dlgMain.pnlHelp = dlgMain.grpBottom.add("panel"); dlgMain.pnlHelp.alignment = 'fill'; dlgMain.etHelp = dlgMain.pnlHelp.add("statictext", undefined, strHelpText, {multiline:true}); dlgMain.etHelp.alignment = 'fill'; // in case we double clicked the file app.bringToFront(); dlgMain.center(); var result = dlgMain.show(); if (cancelButtonID == result) { return result; } // get setting from dialog exportInfo.destination = dlgMain.etDestination.text; exportInfo.style = dlgMain.etStyle.text; exportInfo.selectionOnly = dlgMain.cbSelection.value; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function settingDialog(exportInfo) { //设置对话框\n\n\tvar brush,\n\t\tdestination,\n\t\tresult,\n\t\ttestFolder;\n\n\tdlgMain = new Window('dialog', strTitle);\n\n\t// match our dialog background color to the host application\n\tbrush = dlgMain.graphics.newBrush(dlgMain.graphics.BrushType.THEME_COLOR, 'appDialogBackgr...
[ "0.83063394", "0.7474406", "0.6514149", "0.63470656", "0.6144442", "0.6022726", "0.5980467", "0.59690773", "0.5906276", "0.5866956", "0.5866837", "0.58417386", "0.5814656", "0.5791883", "0.5779246", "0.5757548", "0.5751364", "0.57504123", "0.5745105", "0.5728416", "0.57019114...
0.7999531
1
Function: btnRunOnClick Usage: routine is assigned to the onClick method of the run button Input: checks the dialog params and closes with the dialog with true Return: , dialog is closed with true on success
function btnRunOnClick() { // check if the setting is properly var destination = dlgMain.etDestination.text; if (destination.length == 0) { alert(strAlertSpecifyDestination); return; } var testFolder = new Folder(destination); if (!testFolder.exists) { alert(strAlertDestinationNotExist); return; } // find the dialog in this auto layout mess var d = this; while (d.type != 'dialog') { d = d.parent; } d.close(runButtonID); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRunButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(runButtonID);\n}", "function runOperation() {\n\tsetConfig();\n\tcreatePrints();\n\trunDialog.close();\n}", "function ClickOnStartContinue()\n{\n if(Btn_Start_Continue.Exists)\n {\n Btn_Start_Continue.ClickButton()\n Log...
[ "0.71719664", "0.6129805", "0.6078865", "0.6034298", "0.596392", "0.58390397", "0.5809481", "0.5804938", "0.57655156", "0.57511175", "0.57294905", "0.57183695", "0.57056075", "0.567636", "0.5615213", "0.5606421", "0.56009555", "0.5593158", "0.55565405", "0.5554577", "0.554519...
0.6612402
1
Function: btnBrowseOnClick Usage: routine is assigned to the onClick method of the browse button Input: pop the selectDialog, and get a folder Return: , sets the destination edit text
function btnBrowseOnClick() { var defaultFolder = dlgMain.etDestination.text; var testFolder = new Folder(dlgMain.etDestination.text); if (!testFolder.exists) defaultFolder = "~"; var selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder); if (selFolder != null) { dlgMain.etDestination.text = selFolder.fsName; } dlgMain.defaultElement.active = true; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onBrowseButtonPress(){\n\tvar defaultFolder = dlgMain.grpDestination.field.text;\n\tvar testFolder = new Folder(defaultFolder);\n\tif (!testFolder.exists) {\n\t\tdefaultFolder = \"~\";\n\t}\n\tvar selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder);\n\tif ( selFolder != null ) {\n\t\...
[ "0.80689317", "0.71014553", "0.69558316", "0.6892214", "0.6866621", "0.6721307", "0.6530963", "0.6507591", "0.65049386", "0.64399964", "0.6425381", "0.64203185", "0.64085335", "0.64076823", "0.6369404", "0.63565904", "0.63387996", "0.6298164", "0.6255021", "0.6253249", "0.608...
0.84480196
0
Function: ExportInfo Usage: object for holding the dialog parameters Input: Return: object holding the export info
function ExportInfo() { this.destination = new String(""); this.selectionOnly = false; this.style = new String(strStyle); try { this.destination = Folder(app.activeDocument.fullName.parent).fsName; } catch(someError) { // do nothing, stop error propagation only } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ui_settingsDialog(exportInfo) {\n\n\t// Configure the dialog\n\tvar res = String(\" \\\n\t\tdialog { \\\n\t\t\ttext: '\"+strTitle+\"', \\\n\t\t\torientation: 'column', \\\n\t\t\talignChildren: 'left', \\\n\t\t\tgrpDestination: Group { \\\n\t\t\t\tlabel: StaticText { text: '\"+ escapeString(strLabelDestina...
[ "0.69108146", "0.6871796", "0.6547925", "0.6397909", "0.6269094", "0.61239517", "0.60223556", "0.59475535", "0.5934391", "0.58898175", "0.583196", "0.5742452", "0.5728104", "0.5722974", "0.57212543", "0.57168704", "0.5666863", "0.5636692", "0.56313735", "0.56248724", "0.56095...
0.7097998
0
Function: getTempFolder Usage: create a temp folder using random numbers Input: none Return: a new blank folder to put files in temporarily
function getTempFolder() { var tempLocation; var folder = Folder.temp; // File(exportInfo.destination).parent; while(true) { // set temporary folder with random name tempLocation = folder.toString() + "/temp" + Math.floor(Math.random()*10000); var testFolder = new Folder(tempLocation); if (!testFolder.exists) { testFolder.create(); break; } } return tempLocation; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findRandomTemporaryDirectory() {\n const randomName = crypto.randomBytes(32).toString('hex')\n const temporaryPath = path.join(libraryBasePath, randomName)\n if (fs.existsSync(temporaryPath)) {\n return findRandomTemporaryDirectory()\n }\n\n return temporaryPa...
[ "0.7303385", "0.72429144", "0.7017715", "0.6708041", "0.6699022", "0.648603", "0.64061487", "0.6265706", "0.62408775", "0.60809445", "0.6061852", "0.5997148", "0.5990174", "0.59865415", "0.59748805", "0.59659344", "0.589774", "0.5894593", "0.5851076", "0.5811833", "0.57738626...
0.84796
0
Function: zeroSuppress Usage: create a string padded with 0's Input: num and number of digits to pad Return: zero padded num
function zeroSuppress (num, digit) { var tmp = num.toString(); while(tmp.length < digit) tmp = "0" + tmp; return tmp }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numToStringWithPadZero() {\n\tvar num = arguments[0];\n\tvar digit = arguments[1];\n\tvar val1 = \"\" + num\n\tvar val2 = (\"0000000000\" + num).slice(-digit);\n\tval2 = (val2.length < val1.length) ? val1 : val2;\n\treturn val2;\n}", "function padWithZero(num) {\n return num < 10 ? '0' + num : '' + n...
[ "0.841871", "0.82628506", "0.8061993", "0.8052125", "0.80427045", "0.80145466", "0.7983799", "0.7948988", "0.7932916", "0.79249775", "0.7906941", "0.78899914", "0.78859526", "0.7878335", "0.787548", "0.786565", "0.7863768", "0.7833128", "0.78153783", "0.7814603", "0.7810033",...
0.8162486
2
Function: objectToDescriptor Usage: create an ActionDescriptor from a JavaScript Object Input: JavaScript Object (o) Pre process converter (f) Return: ActionDescriptor NOTE: Only boolean, string, and number are supported, use a pre processor to convert (f) other types to one of these forms.
function objectToDescriptor (o, f) { if (undefined != f) { o = f(o); } var d = new ActionDescriptor; var l = o.reflect.properties.length; for (var i = 0; i < l; i++ ) { var k = o.reflect.properties[i].toString(); if (k == "__proto__" || k == "__count__" || k == "__class__" || k == "reflect") continue; var v = o[ k ]; k = app.stringIDToTypeID(k); switch ( typeof(v) ) { case "boolean": d.putBoolean(k, v); break; case "string": d.putString(k, v); break; case "number": d.putDouble(k, v); break; default: throw( new Error("Unsupported type in objectToDescriptor " + typeof(v) ) ); } } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function descriptorToObject (o, d, f) {\r\n\tvar l = d.count;\r\n\tfor (var i = 0; i < l; i++ ) {\r\n\t\tvar k = d.getKey(i); // i + 1 ?\r\n\t\tvar t = d.getType(k);\r\n\t\tstrk = app.typeIDToStringID(k);\r\n\t\tswitch (t) {\r\n\t\t\tcase DescValueType.BOOLEANTYPE:\r\n\t\t\t\to[strk] = d.getBoolean(k);\r\n\t\t\t\t...
[ "0.62795913", "0.58345985", "0.5788902", "0.57155055", "0.57155055", "0.5026582", "0.49509013", "0.49452564", "0.4928153", "0.47949854", "0.47505236", "0.46887055", "0.46710858", "0.46704477", "0.4661458", "0.4661458", "0.4661458", "0.4661458", "0.4661458", "0.46578354", "0.4...
0.8270871
0
Function: descriptorToObject Usage: update a JavaScript Object from an ActionDescriptor Input: JavaScript Object (o), current object to update (output) Photoshop ActionDescriptor (d), descriptor to pull new params for object from JavaScript Function (f), post process converter utility to convert Return: Nothing, update is applied to passed in JavaScript Object (o) NOTE: Only boolean, string, and number are supported, use a post processor to convert (f) other types to one of these forms.
function descriptorToObject (o, d, f) { var l = d.count; for (var i = 0; i < l; i++ ) { var k = d.getKey(i); // i + 1 ? var t = d.getType(k); strk = app.typeIDToStringID(k); switch (t) { case DescValueType.BOOLEANTYPE: o[strk] = d.getBoolean(k); break; case DescValueType.STRINGTYPE: o[strk] = d.getString(k); break; case DescValueType.DOUBLETYPE: o[strk] = d.getDouble(k); break; case DescValueType.INTEGERTYPE: case DescValueType.ALIASTYPE: case DescValueType.CLASSTYPE: case DescValueType.ENUMERATEDTYPE: case DescValueType.LISTTYPE: case DescValueType.OBJECTTYPE: case DescValueType.RAWTYPE: case DescValueType.REFERENCETYPE: case DescValueType.UNITDOUBLE: default: throw( new Error("Unsupported type in descriptorToObject " + t ) ); } } if (undefined != f) { o = f(o); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function objectToDescriptor (o, f) {\r\n\tif (undefined != f) {\r\n\t\to = f(o);\r\n\t}\r\n\tvar d = new ActionDescriptor;\r\n\tvar l = o.reflect.properties.length;\r\n\tfor (var i = 0; i < l; i++ ) {\r\n\t\tvar k = o.reflect.properties[i].toString();\r\n\t\tif (k == \"__proto__\" || k == \"__count__\" || k == \"_...
[ "0.75533724", "0.6569119", "0.5526549", "0.51103747", "0.5047909", "0.4884658", "0.48834768", "0.4799259", "0.4798489", "0.4789828", "0.47839227", "0.47755012", "0.47672334", "0.47672334", "0.4724588", "0.46902186", "0.46416414", "0.4628304", "0.45911044", "0.4453492", "0.443...
0.718284
1
Function: main Usage: the main routine for this JavaScript Input: Return:
function main() { if (app.documents.length <= 0) { if ( DialogModes.NO != app.playbackDisplayDialogs ) { alert(strAlertDocumentMustBeOpened); } return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script } // create our default params var exportInfo = new ExportInfo(); // look for last used params via Photoshop registry, getCustomOptions will throw if none exist try { var d = app.getCustomOptions("a4cda978-47c8-4a1c-9cec-03e8e81273e8"); descriptorToObject(exportInfo, d); } catch(e) { // it's ok if we don't have any options, continue with defaults } // see if I am getting descriptor parameters descriptorToObject(exportInfo, app.playbackParameters); if ( DialogModes.ALL == app.playbackDisplayDialogs ) { if (cancelButtonID == settingDialog(exportInfo)) { return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script } } try { var docName = app.activeDocument.name; tempLocation = getTempFolder(); var compsName = new String("none"); var compsCount = app.activeDocument.layerComps.length; if (compsCount <= 1) { if ( DialogModes.NO != app.playbackDisplayDialogs ) { alert (strAlertNoLayerCompsFound); } return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script } else { app.activeDocument = app.documents[docName]; docRef = app.activeDocument; var tempFileList = new Array(); var orgRulerUnits = app.preferences.rulerUnits; // save unit app.preferences.rulerUnits = Units.PIXELS; var exportFileCount = 0; for (compsIndex = 0; compsIndex < compsCount; compsIndex++) { var compRef = docRef.layerComps[compsIndex]; if (exportInfo.selectionOnly && !compRef.selected) continue; // selected only compRef.apply(); var duppedDocument = app.activeDocument.duplicate(); if ((numClipSize < duppedDocument.width.value)||(numClipSize < duppedDocument.height.value)) { var wRatio = duppedDocument.width.value / numClipSize; var hRatio = duppedDocument.height.value / numClipSize; var ratio = Math.max(wRatio, hRatio); duppedDocument.resizeImage(duppedDocument.width/ratio, duppedDocument.height/ratio); } var fileNameBody = zeroSuppress(compsIndex+1, 2); // starting 01 fileNameBody += "_" + compRef.name; fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|]/g, "_"); // '/\:*?"<>|' -> '_' if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120); var tempFile = tempLocation + "/" + fileNameBody + ".psd"; tempFileList[exportFileCount] = tempFile; exportFileCount++; tempFile = new File(tempFile); if (null != compRef.name) duppedDocument.info.title = compRef.name; if (null != compRef.comment) duppedDocument.info.caption = compRef.comment; duppedDocument.saveAs(tempFile); duppedDocument.close(); } app.preferences.rulerUnits = orgRulerUnits; // restore unit // run Web Photo Gallery galleryOptions = new GalleryOptions(); galleryOptions.layoutStyle = exportInfo.style; galleryOptions.addSizeAttributes = true; galleryOptions.preserveAllMetadata = true; galleryOptions.bannerOptions.siteName = docName; galleryOptions.imagesOptions.resizeImages = true; galleryOptions.imagesOptions.dimension = 450; galleryOptions.imagesOptions.includeFilename = true; galleryOptions.imagesOptions.caption = true; galleryOptions.imagesOptions.includeTitle = true; galleryOptions.thumbnailOptions.includeFilename = true; galleryOptions.thumbnailOptions.caption = true; galleryOptions.thumbnailOptions.includeTitle = true; app.makePhotoGallery(Folder(tempLocation), Folder(exportInfo.destination), galleryOptions); // delete temporary files for (compsIndex = 0; compsIndex < exportFileCount; compsIndex++) { tempFile = new File(tempFileList[compsIndex]); tempFile.remove(); } // delete temprary folder var tempFolder = new Folder(tempLocation); tempFolder.remove(); // run Adobe Media Gallery in Bridge (not working yet) // var bt = new BridgeTalk; // bt.target = "bridge"; // var file = File (exportInfo.destination).toSource () // bt.body = "try { app.browseTo (" + file + "); app.bringToFront(); AMG.createPanel(); app.document.setWorkspace(\" + strAMG + \");} catch(e) { ; }"; // bt.send(); } // save off our last run parameters var d = objectToDescriptor(exportInfo); d.putString( app.charIDToTypeID( 'Msge' ), strMessage ); app.putCustomOptions("a4cda978-47c8-4a1c-9cec-03e8e81273e8", d); app.playbackDisplayDialogs = DialogModes.ALL; // make another one so Photoshop can track them correctly var dd = objectToDescriptor(exportInfo); dd.putString( app.charIDToTypeID( 'Msge' ), strMessage ); app.playbackParameters = dd; } catch (e) { if ( DialogModes.NO != app.playbackDisplayDialogs ) { alert(e); } return 'cancel'; // quit, returning 'cancel' (dont localize) makes the actions palette not record our script } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main(input) {\r\n var output = \"Hello World\";\r\n return output;\r\n}", "function Main()\n {\n \n }", "function main(){\n\t\n}", "function main(){\n\n\n}", "function main() {\n\n}", "function main(){\r\n}", "function main() {\n}", "function main(){\n//CODE//\n}", "function ...
[ "0.7000626", "0.6741264", "0.67318445", "0.66546476", "0.66390234", "0.66322666", "0.6577525", "0.62832606", "0.59694755", "0.5940942", "0.58815306", "0.5829162", "0.58088267", "0.5776068", "0.5772464", "0.57669795", "0.5762144", "0.5762144", "0.57428277", "0.5739481", "0.571...
0.0
-1
Function: StrToIntWithDefault Usage: convert a string to a number, first stripping all characters Input: string and a default number Return: a number
function StrToIntWithDefault( s, n ) { var onlyNumbers = /[^0-9]/g; var t = s.replace( onlyNumbers, "" ); t = parseInt( t ); if ( ! isNaN( t ) ) { n = t; } return n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function strToIntWithDefault(s, n) { //把字符串转换为数字\n\n\tvar onlyNumbers = /[^0-9]/g,\n\t\tt = s.replace(onlyNumbers, '');\n\n\tt = parseInt(t, 10);\n\n\tif (!isNaN(t)) {\n\t\tn = t;\n\t}\n\n\treturn n;\n}", "function TryParseInt(str, defaultValue){\n var retValue = defaultValue;\n if(str != null){\n i...
[ "0.82995236", "0.6905283", "0.67226857", "0.66155624", "0.66009635", "0.65952545", "0.6586593", "0.6560997", "0.6512591", "0.64873964", "0.6486105", "0.64746135", "0.6465985", "0.6452506", "0.6438687", "0.6436834", "0.6375978", "0.6341577", "0.63101", "0.6306241", "0.6300914"...
0.83300906
0
Takes a lock object, and sends a request to that lock to unlock
function unlock_lock(lock, callback) { let str = JSON.stringify({ Action: "TOGGLE" }) send_command(lock, str) callback(f.hacker.verb()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async unlock() {\n\t\tif (this.lock_status_id === 2) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(1);\n\t\tawait this.await_event('status:UNLOCKED');\n\t}", "unlock() {\n this.locked = 0\n }", "unlock() {\n this.isLocked = false;\n this.refreshState();\n }", "unlock() {\n Atomics....
[ "0.6994963", "0.66803813", "0.66722", "0.66555375", "0.66543484", "0.6508819", "0.639839", "0.615003", "0.6100489", "0.6085905", "0.60403425", "0.59574896", "0.5905636", "0.58783865", "0.5866898", "0.5821947", "0.5785694", "0.5782023", "0.5712773", "0.5666819", "0.564414", ...
0.6942008
1
Takes a lock object, and sends a request to that lock to lock
function lock_lock(lock, callback) { unlock_lock(lock, callback) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleLock(type) {\n\t\t\t//onLockRecived make the locking action according to the status of the object\n\t\t\treturn getLockingObject(type, onLockRecieved)\n\t\t}", "function requestLock() {\n if (lockCounter === 0) {\n setLocked(true);\n }\n\n ++lockCounter;\n }", "async lock() {\n\t\...
[ "0.6738588", "0.6687186", "0.6448882", "0.617401", "0.6134786", "0.60740334", "0.59426516", "0.5894992", "0.5809874", "0.5785804", "0.5784109", "0.5723217", "0.5699051", "0.5655578", "0.5643722", "0.56219935", "0.56038", "0.55876756", "0.5558139", "0.55291355", "0.55010533", ...
0.608611
5
Change the key in the lock
function set_key(lock, key, callback) { let str = JSON.stringify({ Action: "SET", Attribute: "KEY", Value: key }) send_command(lock, str) callback(f.hacker.ingverb()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_lock(key) {\n const me = this;\n\n debug(`${me._lock.name}: ${key}`);\n\n if (me.keyLockCounterMap.has(key)) {\n let counter = me.keyLockCounterMap.get(key);\n\n me.keyLockCounterMap.set(key, ++counter);\n\n if (counter === 1) {\n me.emit(`_lock...
[ "0.77031463", "0.74883825", "0.69310194", "0.69310194", "0.68847847", "0.671262", "0.671262", "0.64303166", "0.6417072", "0.6380194", "0.6293282", "0.6256375", "0.62321454", "0.6222232", "0.6220157", "0.6196766", "0.61607355", "0.6144532", "0.6116945", "0.6116496", "0.6088341...
0.7386674
2
To check for presence of diamond on click
function checkForDiamond (e) { let elementToCheck = e.srcElement let elementPosition = elementToCheck.getBoundingClientRect() let elementPositionObj = { cellPositionTop: parseInt(elementPosition.top), cellPositionLeft: parseInt(elementPosition.left) } elementToCheck.classList.remove('unknown') score.textContent = 'Score : ' + (--initialScore) if (elementToCheck.classList.contains('diamond')) { elementToCheck.parentNode.style['background-color'] = '#78e08f' /* When all diamonds are uncovered display score using modal */ if (diamondsUncovered === 7) { let score = document.getElementById('final-score') score.textContent = 'Your score : ' + initialScore toggleModal() } ++diamondsUncovered console.log('You just found a diamond') // arrayOfDiamonds.splice(arrayOfDiamonds.indexOf(elementPositionObj), 1) // debug } else { /* To display arrow according to location of the nearest diamond */ elementToCheck.parentNode.style['background-color'] = '#2e383a' let dynamicDistanceArray = findTheNearestDiamond(elementPositionObj) let closestDiamondIndex = dynamicDistanceArray.indexOf(Math.min(...dynamicDistanceArray)) let diamondPosition = arrayOfDiamonds[closestDiamondIndex] let typeOfArrow = findTypeOfArrow(elementPositionObj, diamondPosition) elementToCheck.classList.add('arrow') elementToCheck.style['transform'] = arrowDirections[typeOfArrow] setTimeout(() => elementToCheck.classList.remove('arrow'), 1000) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDiamond(elem, diamondPos) {\n\n /** If the square is already checked, then don't check again*/\n if(elem.classList.contains(\"done\") || this.gameOver)\n {\n return;\n }\n\n let isDiamond = false;\n let x = elem.getAttribute(\"x\");\n let y = elem.getAttribute(\"y\");\n let dIndex...
[ "0.68239886", "0.6273277", "0.6249081", "0.60598344", "0.60344017", "0.60270023", "0.6007742", "0.599134", "0.5991333", "0.5940339", "0.58954006", "0.58666563", "0.5865667", "0.58490616", "0.58330333", "0.58104396", "0.575806", "0.5751387", "0.5733285", "0.5723229", "0.570578...
0.70848995
0
Returns a distance array which consists of the distances between clicked square and other diamonds
function findTheNearestDiamond (diamondPositionObj) { let distanceArr = arrayOfDiamonds.map((item, index, arr) => { return parseInt(Math.sqrt(Math.pow((item.cellPositionLeft - diamondPositionObj.cellPositionLeft), 2) + Math.pow((item.cellPositionTop - diamondPositionObj.cellPositionTop), 2))) }) return distanceArr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDistances(){\n\tvar distances = [];\n\tfor (var i = 0; i < totalRows; i++){\n\t\tvar row = [];\n\t\tfor (var j = 0; j < totalCols; j++){\n\t\t\trow.push(Number.POSITIVE_INFINITY);\n\t\t}\n\t\tdistances.push(row);\n\t}\n\treturn distances;\n}", "function calculateDistance(colorArray1, colorArray2) ...
[ "0.6039615", "0.6030681", "0.60086817", "0.59741986", "0.5694039", "0.5683206", "0.5597102", "0.5486985", "0.54858464", "0.54730743", "0.5404417", "0.53587824", "0.5328117", "0.53021824", "0.52473867", "0.52273417", "0.51848537", "0.5177725", "0.51615024", "0.5110903", "0.508...
0.5909111
4
calling function for both the functions
function makeSound(key){ switch (key) { case 'w': let tom1 = new Audio('sounds/tom-1.mp3') tom1.play() break; case 'a': let tom2 = new Audio('sounds/tom-2.mp3') tom2.play(); break; case 's': let tom3 = new Audio('sounds/tom-3.mp3') tom3.play(); break; case 'd': let tom4 = new Audio('sounds/tom-4.mp3') tom4.play(); break; case 'j': let snare = new Audio('sounds/snare.mp3') snare.play(); break; case 'k': let crash = new Audio('sounds/crash.mp3') crash.play(); break; case 'l': let kick = new Audio('sounds/kick-bass.mp3') kick.play(); break; default: } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callFunctions(first, second) {\r\n closeOther(first);\r\n toggleCurrent(second);\r\n updateParentHeight(second);\r\n }", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r...
[ "0.71949387", "0.66635066", "0.6433996", "0.6366737", "0.6276401", "0.61572295", "0.6127252", "0.60882986", "0.60882986", "0.6084967", "0.60178185", "0.600189", "0.5977548", "0.5971491", "0.5971491", "0.59416133", "0.59416133", "0.59416133", "0.59416133", "0.59416133", "0.594...
0.0
-1
Reduce in arrow function.
function sum(array) { return array.reduce((total, value) => total + value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myReduceFunc() {\n \n\n\n}", "function Left$prototype$reduce(f, x) {\n return x;\n }", "function reduce(f) {\n return function(initial) {\n return function(foldable) {\n return Z.reduce (function(y, x) { return f (y) (x); },\n initial,\n ...
[ "0.7973644", "0.750279", "0.7308012", "0.727485", "0.7261351", "0.7259934", "0.7258326", "0.7195359", "0.7187892", "0.7151761", "0.7146615", "0.71292865", "0.71198344", "0.70248187", "0.7003854", "0.6997505", "0.69620275", "0.6954464", "0.6928549", "0.69235003", "0.69234884",...
0.0
-1
`parse()` Parse a UUID into it's component bytes
function parse(s, buf, offset) { var i = (buf && offset) || 0, ii = 0; buf = buf || []; s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { if (ii < 16) { // Don't overflow! buf[i + ii++] = _hexToByte[oct]; } }); // Zero out remaining bytes if string was short while (ii < 16) { buf[i + ii++] = 0; } return buf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseUUID(uuid) {\n if (typeof uuid !== 'string') {\n throw new TypeError('Invalid type for UUID, expected string but got ' + typeof uuid);\n }\n if (!UUID_RX.test(uuid)) {\n throw new TypeError('Invalid format for UUID: ' + uuid);\n }\n let v;\n const arr = new Uint8Array(...
[ "0.738674", "0.65055895", "0.64881945", "0.64618963", "0.64618963", "0.60098433", "0.5891451", "0.57581913", "0.57415444", "0.572715", "0.572715", "0.57225263", "0.5704413", "0.56958705", "0.56658226", "0.56658226", "0.56658226", "0.56658226", "0.56658226", "0.56658226", "0.5...
0.0
-1
`unparse()` Convert UUID byte array (ala parse()) into a string
function unparse(buf, offset) { var i = offset || 0, bth = _byteToHex; return bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + '-' + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]] + bth[buf[i++]]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rawGetStrUuid4(binUuid4)\n{\n\tif(!rawIsSafeEntity(binUuid4) || !(binUuid4 instanceof Buffer)){\n\t\tbinUuid4 = rawGetBinUuid4();\n\t}\n\tvar\tparsed\t= binUuid4.toString('hex').match(/(.{8})(.{4})(.{4})(.{4})(.{12})/);\n\tparsed.shift();\t\t\t\t\t\t\t\t// first element is all, then skip it.\n\tvar\tstrUu...
[ "0.6609696", "0.6562299", "0.65571743", "0.65571743", "0.6553086", "0.65395963", "0.65146357", "0.6503958", "0.6492749", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "0.64734745", "...
0.6470601
56
See for API details
function v1(options, buf, offset) { var i = buf && offset || 0; var b = buf || []; options = options || {}; var clockseq = options.clockseq != null ? options.clockseq : _clockseq; // UUID timestamps are 100 nano-second units since the Gregorian epoch, // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. var msecs = options.msecs != null ? options.msecs : new Date().getTime(); // Per 4.2.1.2, use count of uuid's generated during the current clock // cycle to simulate higher resolution clock var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs) var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; // Per 4.2.1.2, Bump clockseq on clock regression if (dt < 0 && options.clockseq == null) { clockseq = clockseq + 1 & 0x3fff; } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // time interval if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { nsecs = 0; } // Per 4.2.1.2 Throw error if too many uuids are requested if (nsecs >= 10000) { throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); } _lastMSecs = msecs; _lastNSecs = nsecs; _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch msecs += 12219292800000; // `time_low` var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; b[i++] = tl >>> 24 & 0xff; b[i++] = tl >>> 16 & 0xff; b[i++] = tl >>> 8 & 0xff; b[i++] = tl & 0xff; // `time_mid` var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; b[i++] = tmh >>> 8 & 0xff; b[i++] = tmh & 0xff; // `time_high_and_version` b[i++] = tmh >>> 24 & 0xf | 0x10; // include version b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low` b[i++] = clockseq & 0xff; // `node` var node = options.node || _nodeId; for (var n = 0; n < 6; n++) { b[i + n] = node[n]; } return buf ? buf : unparse(b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "obtain(){}", "function API(){}", "function API(){}", "private internal function m248() {}", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "protected ...
[ "0.64539295", "0.628222", "0.6083875", "0.6083875", "0.58966196", "0.58931714", "0.5843906", "0.5807617", "0.56874675", "0.55977154", "0.55894995", "0.55894995", "0.5536012", "0.54927725", "0.547576", "0.5461862", "0.5457917", "0.54515964", "0.54515964", "0.54515964", "0.5451...
0.0
-1
`v4()` Generate random UUID See for API details
function v4(options, buf, offset) { // Deprecated - 'format' argument, as supported in v1.2 var i = buf && offset || 0; if (typeof(options) == 'string') { buf = options == 'binary' ? new BufferClass(16) : null; options = null; } options = options || {}; var rnds = options.random || (options.rng || _rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = (rnds[6] & 0x0f) | 0x40; rnds[8] = (rnds[8] & 0x3f) | 0x80; // Copy bytes to buffer, if provided if (buf) { for (var ii = 0; ii < 16; ii++) { buf[i + ii] = rnds[ii]; } } return buf || unparse(rnds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateUUIDv4() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}", "generateUUIDv4()\n\t{\n\t\tlet tmpBuffer = new Array(16);\n\t\tva...
[ "0.8774061", "0.8716146", "0.8656419", "0.86425877", "0.8622066", "0.8619174", "0.86123294", "0.8610929", "0.86079603", "0.85691327", "0.85302216", "0.85225886", "0.8518848", "0.8504304", "0.8488843", "0.84795076", "0.847476", "0.84740543", "0.8469278", "0.84679675", "0.84658...
0.0
-1
What cells can be visited from this one?
canVisit() { return Object.values(this.neighbors()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cellsOnNetwork(){\n\t\tvar px = this.C.cellborderpixels.elements, i,j, N, r = {}, t\n\t\tfor( i = 0 ; i < px.length ; i ++ ){\n\t\t\tt = this.C.pixti( px[i] )\n\t\t\tif( r[t] ) continue\n\t\t\tN = this.C.neighi( px[i] )\n\t\t\tfor( j = 0 ; j < N.length ; j ++ ){\n\t\t\t\tif( this.C.pixti( N[j] ) < 0 ){\n\t\t\t\t\...
[ "0.67409444", "0.6673161", "0.66108906", "0.6591361", "0.6543554", "0.6543554", "0.6458335", "0.6430142", "0.6423112", "0.6395068", "0.6393324", "0.63762707", "0.63733196", "0.6347578", "0.63344353", "0.6320828", "0.6310552", "0.6296505", "0.6278692", "0.6262051", "0.62351334...
0.6528849
6
Is it a vertical ('|') or horizontal ('') door?
get direction() { return (this.cell1.row == this.cell2.row) ? '|' : '-' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isVertical(position) {\n return position === 'left';\n }", "function getHorizontalOrVerticalDirection(objA, objB) {\n // return 'vertical'; // Always return 'vertical' for non-square bricks\n // Todo: fix code for rectangle bricks\n const aY = objA.top + objA.height / 2;\n const aX = objA.left + ...
[ "0.658331", "0.6143999", "0.6124292", "0.6055029", "0.6055029", "0.58494407", "0.5818332", "0.5816079", "0.58129877", "0.57674754", "0.57621396", "0.57557154", "0.57332575", "0.56753385", "0.5630216", "0.5616625", "0.56162643", "0.5565261", "0.5547247", "0.55349183", "0.55238...
0.59138054
5
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Same as native getBoundingClientRect, except it takes into account parent offsets if the element lies within a nested document ( or like).
function getActualBoundingClientRect(node) { var boundingRect = node.getBoundingClientRect(); // The original object returned by getBoundingClientRect is immutable, so we clone it // We can't use extend because the properties are not considered part of the object by hasOwnProperty in IE9 var rect = {}; for (var k in boundingRect) { rect[k] = boundingRect[k]; } if (node.ownerDocument !== document) { var _frameElement = node.ownerDocument.defaultView.frameElement; if (_frameElement) { var frameRect = getActualBoundingClientRect(_frameElement); rect.top += frameRect.top; rect.bottom += frameRect.top; rect.left += frameRect.left; rect.right += frameRect.left; } } return rect; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBoundingClientRect(element) {\n var el, parent, top;\n if (element.getBoundingClientRect != null) {\n return element.getBoundingClientRect();\n }\n top = 0;\n el = element;\n while (el) {\n top += el.offsetT...
[ "0.789098", "0.70748264", "0.6951972", "0.6888808", "0.68809354", "0.6875931", "0.6875931", "0.6861521", "0.68422866", "0.68422866", "0.68422866", "0.68422866", "0.6836078", "0.6817178", "0.6805481", "0.68034786", "0.6781113", "0.6781113", "0.67718244", "0.67718244", "0.67718...
0.0
-1
get list of all indexers
async function getAllIndexers() { const url = getIndexerUrl(); const indexerList = await getData({ uri: url }); return indexerList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getIndexerValue() {\n const indexers = this._indexers,\n result = [];\n\n for (let i = 0; i < indexers.length; i++) {\n result.push(indexers[i].val());\n }\n\n return result;\n }", "getIndices() {\n return this._registry.get('properties', 'schemaData', { in...
[ "0.6700296", "0.6373289", "0.5961235", "0.5952486", "0.58707345", "0.5865344", "0.58385175", "0.5815432", "0.57516646", "0.5702357", "0.5625296", "0.55507374", "0.55507374", "0.5531465", "0.54669195", "0.5431267", "0.5422411", "0.5420051", "0.54129714", "0.54033834", "0.53877...
0.8348808
0
save an indexer settings
async function setIndexer(indexer) { const url = getIndexerUrl(indexer.id); const indexerList = await putData({ uri: url, body: indexer }); return indexerList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettings() {\n var settings = {\n \"automaticLights\": 1,\n \"sunsetTime\": sunsetTime,\n \"sunriseTime\": sunriseTime,\n \"apiParams.lat\": apiParams.lat,\n \"apiParams.lng\": apiParams.lng,\n \"tzName\": tzName,\n \"tzOffsetHours\": tzOffsetHours\n };\n var settingsJson = JSO...
[ "0.65925324", "0.6586975", "0.6569288", "0.64223874", "0.634707", "0.6322958", "0.6321853", "0.6310257", "0.62929404", "0.62609243", "0.6194918", "0.6158918", "0.6142935", "0.61208117", "0.60691106", "0.6051129", "0.60306215", "0.6029779", "0.6028767", "0.60090625", "0.594012...
0.53912735
68
get list of torrents from radarr
async function getMovieResults({ movieId, title }) { await logger(`finding: ${title}`); const parameters = querystring.stringify({ movieId, apiKey: config.radarr.apiKey, }); const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`; return await getData({ uri: searchUrl }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function listTorrent() {\n try {\n const res = await axios({\n method: 'get',\n url: '/torrent/list',\n params: {\n uid: uid.value\n }\n });\n\n if (res.data && res.data.torrents) {\n ...
[ "0.67730206", "0.6555429", "0.6214942", "0.5507026", "0.5499082", "0.5399176", "0.5298732", "0.52483857", "0.5246274", "0.5200331", "0.50666714", "0.50635856", "0.50546646", "0.5044537", "0.5023046", "0.5013762", "0.50085807", "0.5006198", "0.50016767", "0.4984861", "0.496938...
0.0
-1
GET One Todo with the provided ID
function readOne(req, res, next) { todoRepository.findOne({ _id: req.params.id }, function (err, todos) { if (err) { res.send(err); } else { res.json(todos); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTodoById(id) {\n for (const i in todos) {\n const todo = todos[i];\n debugVar = todo;\n return todo;\n }\n\n if (todo.id === id) {\n return todo;\n }\n\n return null;\n }", "function selectATodo(todo_id) {\n return d...
[ "0.7446939", "0.720031", "0.69799197", "0.6963429", "0.68636817", "0.67221177", "0.67046577", "0.6697848", "0.66908777", "0.6569379", "0.6531879", "0.6494542", "0.6489736", "0.6485646", "0.6426763", "0.641737", "0.64111006", "0.64087814", "0.63859665", "0.63856345", "0.634991...
0.74806696
0
globally initializing the styleIds array
function initStyles() { // function for getting the ids from the local storage into the styleIds array var storedNames = JSON.parse(localStorage.getItem("styles") || '[]'); styleIds = storedNames.map(element => JSON.parse(element).id); console.log('styleIds'.styleIds) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get styles() { return []; }", "setupStyles_() {\n if (this.styles_.length) {\n return;\n }\n\n for (let i = 0, size; size = this.sizes[i]; i++) {\n this.styles_.push({\n url: `${this.imagePath_ + (i + 1)}.${this.imageExtension_}`,\n height: size,\n width: size\n ...
[ "0.67286617", "0.6711965", "0.62842315", "0.6019971", "0.59924304", "0.59844387", "0.59844387", "0.59195125", "0.5919479", "0.59068644", "0.5899297", "0.5859986", "0.5847478", "0.580809", "0.5790694", "0.5790694", "0.5790694", "0.5787608", "0.576951", "0.57650995", "0.5765099...
0.74856
0
Howard Livingston Gameworld Mobile AppProject 1 MiU10/2012 Robin Alarcon ////////////////////////////////////////////////////////////////////// Call function shortcut
function go(x) { var theElement = document.getElementById(x); return theElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArcadeTop50() {\n SideKickOnline_GetTopFifty();\n}", "function Main(){\n \n getLiveGames();\n \n}", "function HostGame() {\n\t// Your code goes here for hosting a game\n\tprint(\"Complete this method in Multiplayer.js\");\n}", "function Maybach(){\n \n}", "function tellFortune()...
[ "0.6077955", "0.5936539", "0.5840917", "0.5827062", "0.57908034", "0.5745781", "0.5731808", "0.5714056", "0.5706914", "0.5686966", "0.5667533", "0.5664043", "0.56595016", "0.5656272", "0.5637415", "0.5630485", "0.561523", "0.558794", "0.5584864", "0.5581453", "0.5557376", "...
0.0
-1
Get the radio button data
function getSelectedRadio(){ var radios =document.forms[0].deviceValue; for(var i=0; i<radios.length; i++){ if(radios[i].checked){ deviceValue = radios[i].value; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RadioButton_GetData()\n{\n\t//create an array for the result and return it with our value\n\treturn new Array(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_CHECKED]);\n}", "function getRadioInfo() {\n var decision = null;\n //for(var i = 0; i < $('input[type=radio]:checked'); i += 1...
[ "0.7653593", "0.76369643", "0.715704", "0.71437013", "0.7012642", "0.69910276", "0.6942195", "0.6902158", "0.68979347", "0.68725115", "0.68725115", "0.6848593", "0.68245333", "0.6777828", "0.6767706", "0.6761725", "0.67591804", "0.6733597", "0.6722869", "0.67205894", "0.66906...
0.6425453
43
Get the checkbox data
function getCheckboxValue(){ if(go('selectValue').checked){ selectValue= go('selectValue').value; }else{ selectValue="No" } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckBox_GetData()\n{\n\t//create an array for the result and return it with our value\n\treturn new Array(this.InterpreterObject.Properties[__NEMESIS_PROPERTY_CHECKED]);\n}", "get checkbox(){ return this.__checkbox; }", "function CheckBox_GetUserInputChanges()\n{\n\t//default result\n\tvar result = n...
[ "0.8010626", "0.67100656", "0.6519734", "0.6492971", "0.6474945", "0.6442223", "0.64209604", "0.64209604", "0.6402813", "0.639657", "0.6364421", "0.6364421", "0.6364421", "0.6364421", "0.6364421", "0.6364421", "0.6364421", "0.6364421", "0.63516057", "0.63484555", "0.6282981",...
0.6472339
5
Pick a theme for the groups
function pickATheme(){ var formTag = document.getElementsByTagName("form"); selectLi = go('select'); makeSelect = document.createElement('select'); makeSelect.setAttribute("id", "groups"); for(var i=0, j=contactGroups.length; i<j; i++){ var makeOption = document.createElement('option'); var optText= contactGroups[i]; makeOption.setAttribute("value", optText); makeOption.innerHTML =optText; makeSelect.appendChild(makeOption); } selectLi.appendChild(makeSelect); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function themePicker(selected) {\n switch (selected) {\n case 1:\n document.querySelector(\"#masthead\").style.backgroundColor = \"#FFB7A1\";\n break;\n case 2:\n document.querySelector(\"#masthead\").style.backgroundColor = \"#EFBC68\";\n break;\n ...
[ "0.6641326", "0.6321364", "0.63076615", "0.62818056", "0.6220797", "0.6192427", "0.6091712", "0.60732985", "0.6072098", "0.60162663", "0.60162663", "0.6012774", "0.60095465", "0.5983222", "0.59741145", "0.5950286", "0.5950269", "0.59466624", "0.59436655", "0.59301925", "0.592...
0.0
-1
Getting image for the right category
function getImage(pickATheme, makeSubList){ var imageLi = document.createElement('li'); makeSubList.appendChild(imageLi); var newImg = document.createElement('img'); var setSrc = newImg.setAttribute("src", "images/" + pickATheme + ".png"); imageLi.appendChild(newImg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postImage(category) {\n\n switch (category){\n case \"Home\":\n return imgArr[0];\n case \"Cars\":\n return imgArr[1];\n case \"Pets\":\n return imgArr[2];\n case \"Personal\":\n return imgArr[3]...
[ "0.7683832", "0.71003443", "0.6927804", "0.6910737", "0.68626535", "0.6815243", "0.6785635", "0.67454714", "0.66778606", "0.6634735", "0.6619897", "0.6587018", "0.6526304", "0.65252805", "0.6503675", "0.6441034", "0.6434616", "0.6421225", "0.6385539", "0.63811195", "0.6361985...
0.5719905
77
Auto populate Local Storage
function autoFillData(){ for (var n in json){ var id = Math.floor(Math.random() * 100000001); localStorage.setItem(id, JSON.stringify(json[n])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillStorage() {\n var local = {\n uid : uid,\n Time : timeLocal,\n Todos : todos\n }\n localStorage.clear();\n window.localStorage.setItem(`local`,JSON.stringify(local));\n mapping();\n}", "function initStorage() {\n $localStorage.authors = $localStorage.au...
[ "0.77881354", "0.73146164", "0.7314591", "0.72219455", "0.72162485", "0.7204014", "0.7186664", "0.7180088", "0.715921", "0.7143449", "0.7142774", "0.7114284", "0.70935833", "0.70916873", "0.7061917", "0.7050682", "0.70385754", "0.70028234", "0.6983559", "0.69835484", "0.69817...
0.664938
75
Links for the items
function makeItemLinks(key, linksLi){ var editLink=document.createElement('a'); editLink.href ="#"; editLink.key = key; var editText ="Edit Contact"; editLink.addEventListener("click", editItem); editLink.innerHTML = editText; linksLi.appendChild(editLink); var breakTag =document.createElement('br'); linksLi.appendChild(breakTag); var deleteLink=document.createElement('a'); deleteLink.href="#"; deleteLink.key =key; var deleteText ="Delete Contact"; deleteLink.addEventListener("click", deleteItem); deleteLink.innerHTML=deleteText; linksLi.appendChild(deleteLink); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeItemLinks(key, linksLi){\n\t\t//add edit singe item link\n\t\tvar editLink = document.createElement('a');\n\t\teditLink.href = \"#\";\n\t\teditLink.key = key;\n\t\tvar editText = \"Edit Information\";\n\t\teditLink.addEventListener(\"click\", editItem);\n\t\teditLink.innerHTML = editText;\n\t\tlinksLi...
[ "0.6695801", "0.6683276", "0.6648754", "0.66102666", "0.6595307", "0.65640926", "0.6549964", "0.65326923", "0.6499373", "0.6493053", "0.64907795", "0.6438922", "0.64371467", "0.6341043", "0.632901", "0.62931657", "0.6288615", "0.62824374", "0.6271318", "0.6236958", "0.6204170...
0.63649523
13
Validate groups, first and last name and email
function validate(e){ var getGroup = go('groups'); var getFname =go('fname'); var getLname =go('lname'); var getEmail =go('email'); errMsg.innerHTML = ""; getGroup.style.border ="1px solid black"; getFname.style.border ="1px solid black"; getLname.style.border ="1px solid black"; getEmail.style.border ="1px solid black"; var messageAry = []; if(getGroup.value === "--Who R U?--"){ var groupError = "Please choose a group."; getGroup.style.border ="3px solid orange"; messageAry.push(groupError); } //first name validation if(getFname.value === ""){ var fNameError = "You forgot your first name"; getFname.style.border ="3px solid orange"; messageAry.push(fNameError); } //last name validation if(getLname.value === ""){ var lNameError = "You forgot your last name"; getLname.style.border ="3px solid orange"; messageAry.push(lNameError); } //email validation var re = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; if(!(re.exec(getEmail.value))){ var emailError = "Please enter a valid email address."; getEmail.style.border ="3px solid orange"; messageAry.push(emailError); } //If there were errors, display them on the screen. if(messageAry.length >= 1){ for(var i =0, j=messageAry.length; i < j; i++){ var txt =document.createElement('li'); txt.innerHTML=messageAry[i]; errMsg.appendChild(txt); } e.preventDefault(); return false; }else{ //Send the key value from the edit function storeData(this.key); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validations() {\r\n var name = document.getElementById('formGroupExampleInput').value;\r\n var letters = /^[\\s A-Za-z]+$/;\r\n if (name != \"\") {\r\n if (name.match(letters)) {\r\n checkemail();\r\n } else {\r\n alert('Please input alphabet characters only');...
[ "0.65832984", "0.63882947", "0.6357756", "0.63363606", "0.6290604", "0.62265545", "0.6204815", "0.6198379", "0.6182521", "0.61776656", "0.61563206", "0.61250156", "0.6121102", "0.6113977", "0.6110392", "0.6103248", "0.60989785", "0.60793954", "0.6072309", "0.6059846", "0.6048...
0.6138898
11
Kompyuter yurishi taminlash uchun Randomdan foydalaniladi
function getCOMP_CHOICE() { const RANDOM_NUM = Math.floor(Math.random() * 3) return CHOICES[RANDOM_NUM] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomize (){\n\tvar random = Math.floor(Math.random()*4);\n\treturn ligth(random);\n}", "function randomID(){\n return 'moka-' + Math.random().toString(36).substr(2, 5)\n}", "function panjang (str) {\n let hasil = ''\n //let b = options.length;\n for(let i=0; i< b; i++) {\n hasil += ra...
[ "0.6818521", "0.6661141", "0.6649914", "0.6607463", "0.66011703", "0.65388197", "0.6521754", "0.6481385", "0.647475", "0.6429238", "0.6401693", "0.63845307", "0.6368639", "0.634212", "0.63344276", "0.6332327", "0.6322113", "0.6307049", "0.6299866", "0.62901324", "0.62897336",...
0.0
-1
So'z qaytarish uchun harfni tekshiradi
function convertToWord(char) { switch (char) { case "r": return "Tosh" case "s": return "Qaychi"; } return "Qog'oz"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n...
[ "0.6498934", "0.6402056", "0.63668275", "0.629768", "0.629768", "0.62388575", "0.62156624", "0.62109566", "0.6208665", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", "0.6194451", ...
0.0
-1
Natijani ko'rsatish uchun so'z va animatsiya qo'shadi
function win(usrChoice) { usr_score++; RESULT_DIV.innerText += " Siz yutdingiz! :)"; document.getElementById(usrChoice).classList.add("green-glow"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animatie(){\n var timeline = new TimelineMax ({repeat:-1});\n timeline.to(\"#klok\", 50, {ease: Elastic.easeOut.config(10), y:6});\n}", "function menjaj(smer = \"napred\")\n{\n if(smer == \"napred\")\n {\n id++;\n if(id == 3)\n id = 0;\n }\n else\n {\n ...
[ "0.66885763", "0.64937437", "0.6439931", "0.64211476", "0.63546854", "0.6290419", "0.62662023", "0.6218161", "0.6167926", "0.61637914", "0.6144197", "0.61409986", "0.6129472", "0.61025083", "0.6081565", "0.6066085", "0.60637033", "0.60263", "0.6020342", "0.601793", "0.5998834...
0.0
-1
Animatsiyani o'chirish uchun har bir elementni tekshirib chiqadi
function deleteAnimation() { CHOICES.forEach(el => { const CLASSES = document.getElementById(el).classList; if (CLASSES.length > 1) { CLASSES.remove(CLASSES[1]) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buttonAnimation () {\n\t\tlet fd_tmp = widthOfEltInDiap(); // recevoire la taille d'un élément\n\t\tif(innerWidth < 800){\n\t\t\tif(fd_position < fd_tmp * 10){\n\t\t\t\t// translate le diapo par une unité (fd_tmp la taille d'un seul élément de diapo) \n\t\t\t\tfd_ulDiapo.css('transition', '0.8s ease-in')....
[ "0.7210784", "0.6946136", "0.69201523", "0.67967707", "0.67505485", "0.64859825", "0.64402115", "0.6426381", "0.6417569", "0.6387671", "0.63532376", "0.6319641", "0.6313471", "0.630048", "0.62978816", "0.62505823", "0.62464553", "0.62419087", "0.62392753", "0.6234095", "0.623...
0.0
-1
Ishoralarni va natijani ko'rsatish uchun barcha yo'llarni tekshirib chiqadi va ballarni yozadi
function game(usrChoice) { deleteAnimation(); const COMP_CHOICE = getCOMP_CHOICE(); RESULT_DIV.innerText = `${convertToWord(usrChoice)} va ${convertToWord(COMP_CHOICE)}.`; switch (usrChoice + COMP_CHOICE) { case "pr": case "sp": case "rs": win(usrChoice); break case "rp": case "ps": case "sr": lose(usrChoice); break default: draw(usrChoice) } USR_SPAN.innerHTML = usr_score; COMP_SPAN.innerHTML = comp_score; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HyderabadTirupati() // extends PhoneticMapper\n{\n var map = [ \n new KeyMap(\"\\u0901\", \"?\", \"z\", true), // Candrabindu\n new KeyMap(\"\\u0902\", \"\\u1E41\", \"M\"), // Anusvara\n new KeyMap(\"\\u0903\", \"\\u1E25\", \"H\"), // Visarga\n new KeyMap(\"\\u1CF2\", \"\\u1E96\", \"Z\"), // jihvamuliya\n...
[ "0.68477225", "0.656495", "0.65097135", "0.6407308", "0.63106257", "0.61645097", "0.6148354", "0.61072993", "0.61067456", "0.60902953", "0.6084612", "0.6061757", "0.60578275", "0.60561407", "0.6054853", "0.60488534", "0.60458946", "0.60329", "0.600582", "0.6000124", "0.598724...
0.0
-1
Check for threads that are scheduled to be closed and close them
async function applyScheduledCloses() { const threadsToBeClosed = await threads.getThreadsThatShouldBeClosed(); for (const thread of threadsToBeClosed) { const closeMode = thread.scheduled_close_silent; if (config.closeMessage && ! closeMode & SCHEDULED_CLOSE_MODE.SILENT) { const closeMessage = utils.readMultilineConfigValue( config.closeMessage ); await thread.sendSystemMessageToUser(closeMessage).catch(() => {}); } await thread.close(false, closeMode & SCHEDULED_CLOSE_MODE.SILENT); if (closeMode & SCHEDULED_CLOSE_MODE.PING) { await sendCloseNotification( thread, `Почтовый тред #${thread.thread_number} с ${thread.user_name} (${thread.user_id}) был закрыт автоматически по истечению времени <@${thread.scheduled_close_id}>` ); } else { await sendCloseNotification( thread, `Почтовый тред #${thread.thread_number} с ${thread.user_name} (${thread.user_id}) был запланированно закрыт ${thread.scheduled_close_name}` ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function applyScheduledCloses() {\r\n const threadsToBeClosed = await threads.getThreadsThatShouldBeClosed();\r\n for (const thread of threadsToBeClosed) {\r\n if (config.closeMessage && ! thread.scheduled_close_silent) {\r\n const closeMessage = utils.readMultilineConfigValue(config.closeM...
[ "0.72873867", "0.59656674", "0.57460296", "0.5633413", "0.5598141", "0.54074544", "0.53801537", "0.535614", "0.5314782", "0.5295674", "0.52796066", "0.527865", "0.5245535", "0.5244968", "0.51843786", "0.51372606", "0.51300836", "0.5121815", "0.50970364", "0.5092351", "0.50802...
0.7417025
0
there is no local state on this because state is updated on it's parent component (Create Deal)
render() { return ( <div className="contactform"> <h2>{this.props.title} Contact info</h2> <input type="text" required name={`${this.props.title}Name`} placeholder={`${this.props.title} Name`} onChange={this.props.inputHandler}/> <input type="email" required name={`${this.props.title}Email`} placeholder={`${this.props.title} Email`} onChange={this.props.inputHandler}/> <input type="number" required name={`${this.props.title}Phone`} placeholder={`${this.props.title} Phone Number`} onChange={this.props.inputHandler}/> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.state = {\n description: \"\",\n debtorId: undefined,\n amount: 0\n };\n this.used = false;\n }", "constructor(props) {\n super(props);\n // local component state\n this.state = {\n ...
[ "0.6709819", "0.6288193", "0.62192905", "0.6181649", "0.6079883", "0.60046726", "0.59957755", "0.5936047", "0.59242916", "0.590624", "0.5874714", "0.58728576", "0.586989", "0.58618623", "0.5858884", "0.58137214", "0.5812924", "0.58099306", "0.57990324", "0.57936764", "0.57800...
0.0
-1
to send input content to server use ws.send('xxx');
function create_io_ws(userId, message_handler) { let ws = new WebSocket("ws://" + ip + ":" + port + "/io?userId=" + userId); ws.addEventListener("message", message_handler); // ws.onmessage = (message) => { // console.log(message) // } return ws; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send(){\n var text = document.getElementById(\"messageinput\").value;\n webSocket.send(text);\n}", "function send (data) {\n ws.send(data)\n}", "function sendMessage() {\r\n let content = document.getElementById(\"msg\").value;//recupere le message de l'input\r\n document.getElementById(\...
[ "0.7501975", "0.7470224", "0.7394298", "0.71458983", "0.71458983", "0.7102619", "0.7049072", "0.70241225", "0.6969679", "0.69621813", "0.69447523", "0.69147646", "0.6890113", "0.68891627", "0.68641484", "0.685054", "0.68350923", "0.6825764", "0.67574817", "0.6713223", "0.6669...
0.0
-1
Get a user by it ID
getUser(_, { id }) { return db.user.findById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "function getUserById(id) {\n return getUserByProperty('id', id);\n}", "function getUserFromId(id) {\n let users = getUsers();\n if(users === null) return null;\n return us...
[ "0.85218", "0.84464973", "0.82318753", "0.79787356", "0.7914046", "0.78848994", "0.78360695", "0.782005", "0.7800022", "0.779958", "0.7712408", "0.7674256", "0.7664401", "0.7633258", "0.7620494", "0.76008314", "0.759117", "0.75862586", "0.7583434", "0.75781053", "0.7566605", ...
0.7662995
13
Get a post by it ID
getPost(_, { id }, { authUser }) { const query = { where: { id } }; if (!authUser) { query.where.published = true; } return db.post.findOne(query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(id) {\n const reqId = shortid.generate();\n this.logger.info(`Request ID: ${reqId} - Getting post by id: ${id}`);\n\n return this.post.find(id)\n .then(post => {\n this.logger.info(`Request ID: ${reqId} - Gotten posts id: ${id}`);\n return post;\n })\n ...
[ "0.8145277", "0.80137324", "0.7830286", "0.7776114", "0.7748766", "0.772402", "0.7718272", "0.75758517", "0.7498849", "0.7489656", "0.73505855", "0.7318548", "0.7308838", "0.72728", "0.72415423", "0.7223204", "0.7167382", "0.7166684", "0.7166684", "0.7151069", "0.710502", "...
0.67416275
32
Update a particular user
async updateUser(_, { id, name, email, password }, { authUser }) { // Make sure user is logged in if (!authUser) { throw new Error('You must log in to continue!'); } // fetch the user by it ID const user = await db.user.findById(id); // Update the user await user.update({ name, email, password: await bcrypt.hash(password, 10) }); return user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "function updateUser(req, res, next) {\n const sql = sqlString.format(`UPDATE users SET ? WHERE id = ?`, [\n req.body,\n req.params.id\n ])\n\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n if (!result.a...
[ "0.80618936", "0.7857228", "0.77861416", "0.77838707", "0.7747367", "0.7713613", "0.769509", "0.7693302", "0.7684423", "0.76785946", "0.76580435", "0.7608627", "0.7595565", "0.7572619", "0.7562236", "0.7539366", "0.7531245", "0.75262356", "0.7510658", "0.7509899", "0.75096834...
0.7025029
89
Add a new post
async addPost(_, { title, content, published }, { authUser }) { // Make sure user is logged in if (!authUser) { throw new Error('You must log in to continue!'); } const user = await db.user.findOne({ where: { id: authUser.id } }); return db.post.create({ userId: user.id, title, content, published }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPost(post) {\n return PostsModel.create(post);\n}", "function addPost() {\n vm.newPost.userId = vm.userId;\n Post\n .create(vm.newPost)\n .$promise\n .then(function(post) {\n vm.postForm.$setPristine();\n $state.go('blog');\n });\n }", "...
[ "0.80426776", "0.7920027", "0.7774292", "0.76564944", "0.7559863", "0.75051075", "0.7414349", "0.7389964", "0.7386032", "0.72773343", "0.7261013", "0.7136289", "0.70472425", "0.704388", "0.7042664", "0.70101947", "0.70089567", "0.69860685", "0.6962039", "0.69416714", "0.69160...
0.76698726
3
Update a particular post
async updatePost(_, { id, title, content, published }, { authUser }) { // Make sure user is logged in if (!authUser) { throw new Error('You must log in to continue!'); } // fetch the post by it ID const post = await db.post.findById(id); // Update the post return post.update({ title, content, published }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function updatePost(id) {}", "function updatePost(post) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/posts/\"+postId,\n data: post\n })\n .then(function() {\n window.location.href = \"/view-post?post_id=\"+postId;\n });\n }", "function updatePost(...
[ "0.80458426", "0.79105175", "0.7784334", "0.75419253", "0.7536619", "0.7453488", "0.7410492", "0.73661435", "0.7337607", "0.73005986", "0.7227706", "0.710069", "0.70298266", "0.69433635", "0.6916832", "0.6885459", "0.6849954", "0.6835548", "0.67860204", "0.67848575", "0.67793...
0.7909641
2
Delete a specified post
async deletePost(_, { id }, { authUser }) { // Make sure user is logged in if (!authUser) { throw new Error('You must log in to continue!'); } // fetch the post by it ID const post = await db.post.findById(id); return post.destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePost(postId) {\n // TODO : Implement this\n}", "delete(post) {\n if (confirm('Are you sure?')) {\n this.sendAction('destroyPost', post);\n }\n }", "function deletePost() {\n\tvar snippet = {\n\t\tquery : {\n\t\t\t// published: false,\n\t\t\tid: \"-K_WonIe_j7iSm-WeyC8\"\n\t...
[ "0.86163586", "0.8466538", "0.8167986", "0.8123654", "0.78065586", "0.77046335", "0.7665497", "0.7650257", "0.7624633", "0.76071054", "0.76071054", "0.7604614", "0.75956285", "0.75494236", "0.7546867", "0.7538497", "0.75374407", "0.75277895", "0.750426", "0.74735117", "0.7441...
0.7717988
5
Fetch all posts created by a user
posts(user) { return user.getPosts(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPosts(){\n var posts = [];\n var currentUserId = Meteor.userId();\n \n // display only user's posts if currently logged in\n if (currentUserId){\n posts = Posts.find({owner: currentUserId}, {sort: {creationDate: -1}});\n } else {\n posts = Posts.find({}, {sort: {creationDate: -1}});\n }\n ...
[ "0.74919844", "0.74148387", "0.7263313", "0.72552896", "0.7079012", "0.7008244", "0.70023364", "0.69027275", "0.686663", "0.6862673", "0.6860463", "0.6856039", "0.6796464", "0.67176944", "0.66719204", "0.6638497", "0.6590459", "0.6585281", "0.65516216", "0.65416783", "0.65274...
0.7831254
0
Fetch the author of a particular post
user(post) { return post.getUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPostsByAuthor() {\n\tvar snippet = {\n\t\tquery: {authorId: \"-K_W_cxqkjGVo8zEfLUc\"}\n\t}\n\trimer.post.findByAuthor(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "get author () {\n return users.get(this...
[ "0.7346597", "0.716853", "0.7089207", "0.69538116", "0.6722026", "0.6634263", "0.6611067", "0.6584985", "0.6584985", "0.6584985", "0.657873", "0.65523714", "0.6520311", "0.65093315", "0.647792", "0.6445202", "0.6415506", "0.63541996", "0.63493", "0.6340558", "0.62690645", "...
0.6886912
4
Provide thenBy and thenByDescending functionality.
function OrderedLINQ(source, operations) { this._source = source; this._operations = operations; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "order(by) {\n if (typeof by === 'string') {\n by = {[by]: 'desc'};\n }\n return this.spawn().applyOrder(by);\n }", "function descendingComparator(a, b, orderBy) {\n if (b[orderBy] < a[orderBy]) {\n return -1;\n }\n if (b[orderBy] > a[orderBy]) {\n return 1;\n...
[ "0.5472745", "0.52984184", "0.5267378", "0.52155155", "0.5211266", "0.520471", "0.5150867", "0.51265883", "0.5111587", "0.5094722", "0.5088666", "0.5077725", "0.502652", "0.5000443", "0.49830535", "0.4929498", "0.49249166", "0.49087906", "0.4849712", "0.48452803", "0.48319116...
0.0
-1
defined here for using in two places
function toLookup(source, keySelector, elementSelector) { elementSelector = toFunction(elementSelector, defaultSelector); var result = {}; for (var i = 0, length = source.length; i < length; ++i) { var key = keySelector(source[i]); if (!result[key]) { result[key] = []; } result[key].push(elementSelector(source[i])); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "function _____SHARED_functions_____(){}", "static private internal function ...
[ "0.68320173", "0.6774367", "0.6726879", "0.660258", "0.64941347", "0.64790547", "0.6436148", "0.63701594", "0.6273941", "0.6250682", "0.61133015", "0.60598475", "0.5973559", "0.5875955", "0.587396", "0.5872695", "0.58664", "0.5766351", "0.5750184", "0.5747161", "0.57462996", ...
0.0
-1
for easy creating functions of deferred execution
function deferred(linq, add) { var cloned = linq._operations.slice(); cloned.push(add); return new LINQ(linq._source, cloned); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDeferredFn(fn) {\n\tvar resolve;\n\tvar onResolve;\n\n\tvar p = new Promise((res, rej) => resolve = res)\n\t\t.then(()=>{ return onResolve(); });\n\n\tp.resolve = function() { \n\t\tvar args = arguments;\n\t\tonResolve = () => { return fn ? fn.apply(null, args) : args[0] }\n\t\tresolve();\n\t\tretur...
[ "0.65569556", "0.6268467", "0.61596197", "0.61165404", "0.611544", "0.60894924", "0.60626906", "0.60526156", "0.60272276", "0.6018235", "0.601017", "0.59927434", "0.5947549", "0.59383297", "0.5921801", "0.59196013", "0.5904194", "0.5890487", "0.5874392", "0.5866436", "0.58631...
0.55264896
64
Label with required field display, htmlFor, and block styling
function Label(_ref) { var htmlFor = _ref.htmlFor, label = _ref.label, required = _ref.required; return _react.default.createElement("label", { style: { display: "block" }, htmlFor: htmlFor }, label, " ", required && _react.default.createElement("span", { style: { color: "red" } }, " *")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FieldLabel({ model }) {\n const { label, isMandatory } = model;\n\n if (!label || label.length === 0) {\n return null;\n }\n return (\n <div className=\"ff-field-label\" >\n {label}\n {(isMandatory) && (\n <span className=\"ff-field-mandatory\...
[ "0.670288", "0.60990804", "0.5998615", "0.5868826", "0.5847852", "0.5778551", "0.5767557", "0.5738318", "0.568455", "0.5545074", "0.5482438", "0.54752636", "0.5445866", "0.5419466", "0.5392262", "0.5384172", "0.5381788", "0.5366222", "0.53472376", "0.5327174", "0.53151035", ...
0.63564664
1
click the suggested items
function getAllSuggestedItems() { let allSuggestedItems = document.querySelectorAll(".suggest-btn"); allSuggestedItems.forEach((btn) => { btn.addEventListener("click", function () { let inputCategoryId = document.getElementById("category-id"); inputCategoryId.value = btn.getAttribute("category-id"); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickElem(item) {\n removeAllHints();\n buffer = \"\";\n searching = false;\n if(item) {\n var name = item.tagName;\n if(name == 'INPUT') {\n var type = item.getAttribute('type').toUpperCase();\n if (type == 'TEXT' || type == 'FILE' || type == 'PASSWORD') {\...
[ "0.6677567", "0.6650638", "0.64908373", "0.6486363", "0.63923764", "0.63382536", "0.6336302", "0.63037986", "0.6279304", "0.6261681", "0.6252996", "0.62223977", "0.61955976", "0.61039037", "0.60689414", "0.60379773", "0.602855", "0.59838545", "0.5982392", "0.5958365", "0.5948...
0.57971036
38
order and save to SESSION (CustomerOrderController)
function fetchToSession(data) { fetch("/customers/order", { headers: { "Content-Type": "application/json", "X-CSRF-TOKEN": token, }, method: "POST", body: JSON.stringify(data), }).then((res) => { res.text().then((res) => { console.log(res); if (res == "Order has removed from Session") { window.location.reload(); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertOrder(req, res, next) {\n var saveOrder = function(orderNumber) {\n var sessionOrder = req.session.order;\n var order = {\n orderNumber: orderNumber,\n status: 'active',\n shippingInfo: {\n firstName: sessionOrder.firstName,\n lastName: sessionOrde...
[ "0.67780584", "0.66642445", "0.65159535", "0.63972646", "0.6297388", "0.6211536", "0.6208688", "0.61641526", "0.6091335", "0.60471505", "0.5961393", "0.59454054", "0.5894086", "0.5889425", "0.58519256", "0.58516073", "0.58320886", "0.58278704", "0.58146375", "0.5731818", "0.5...
0.5304901
70
Create a function that takes a number (step) as an argument and returns the number of matchsticks in that step. See step 1, 2 and 3 in the image above.
function matchHouses(step) { if (step === 0){ return 0; } else { return (5 * step) + 1 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numWays(steps){\n var stairs = new Array(steps+1);\n stairs[0] = 1;\n stairs[1] = 1;\n for(var i=2;i<stairs.length;i++){\n stairs[i] = stairs[i-1]+stairs[i-2];\n }\n return stairs[steps]\n}", "function stepsCount(num, steps) {\n if (num <= 0) return;\n if (num === 1) {\n ...
[ "0.6326018", "0.62703425", "0.61365795", "0.6103491", "0.60844654", "0.60844654", "0.60844654", "0.59861463", "0.5896685", "0.58959943", "0.5886099", "0.5827093", "0.57891214", "0.57764864", "0.57749146", "0.5746566", "0.57333976", "0.56991816", "0.56991816", "0.56991816", "0...
0.7258101
0
What follows is code for rendering and manipulating the grid in an svg canvas. This code is only used on the clientside.
function loadClientCode(){ // d3 extensions d3.selection.prototype.moveToFront = function() { return this.each(function(){ this.parentNode.appendChild(this); }); }; // Private helpers and utilities var calcAssetX = function(hex, asset){ return hex.center().x() - (asset.width / 2.0); }; var calcAssetY = function(hex, asset){ return hex.center().y() - (asset.height / 2.0); }; //Begin client-side code injection H$.HexGrid.prototype.initNewBackgroundImage = HexGrid_initNewBackgroundImage_client; function HexGrid_initNewBackgroundImage_client(path){ // Generate unique id for new pattern var id = this.getDOMClass() + "-bg-" + (H$.Util.sizeof(this.patterns) + 1); var s = this.getHexagonSize(); d3.select("." + this.getDOMClass() + " defs") .append("svg:pattern") .attr("id", id) .attr("width", 1) .attr("height", 1) .append("svg:image") .attr("xlink:href", path) // Centers a square background in the hexagon .attr("x", (H$.Util.calcR(s) - s)) .attr("y", 0) .attr("width", s * 2) .attr("height", s * 2); this.patterns[path] = id; return this; } /** * @param {H$.Asset} asset * @param {String} selectString optional param: selector to override asset.klass, ex "#id" * @type {Function} */ H$.HexGrid.prototype.destroyDetachedAsset = HexGrid_destroyDetachedAsset; function HexGrid_destroyDetachedAsset(asset, selectString){ selectString = selectString || "." + asset.klass; delete asset.animating; d3.selectAll(selectString).remove(); var assets = this.detachedAssets; var keep = []; for(var i = 0; i < assets.length; i++){ if(assets[i].klass !== asset.klass) keep.push(assets[i]); } this.detachedAssets = keep; return this; } /** * The move animations are designed to be as interruptable as possible; the payload * and asset are loaded into the destination at the beginning of the animation, * and a dummy asset is created and moved from the source to the destination. * If animations are interrupted, internal state is clean but these dummy assets * do not get cleaned up (they are left to sit forever, invisible, under the grid). * This function cleans these up. */ H$.HexGrid.prototype.interruptAnimations = HexGrid_interruptAnimations; function HexGrid_interruptAnimations(){ // slice to copy array to avoid concurrent modification issues var rogue = this.detachedAssets.slice(0); for(var i = 0; i < rogue.length; i++){ if(rogue[i].animating){ this.destroyDetachedAsset(rogue[i]); } } return this; } /** * Note: this is not compatible with the array-of-payloads * generated by pushPayload */ H$.Hexagon.prototype.detachDrawnAsset = Hexagon_detachDrawnAsset; function Hexagon_detachDrawnAsset(){ var assetClass = this.getHexClass() + H$.Asset.CSS_SUFFIX; var newClass = assetClass + "-detached-" + Date.now(); d3.select("." + assetClass) .attr("class", newClass); var asset = this.payload.getAsset(); this.payload.setAsset(null); asset.klass = newClass; this.grid.detachedAssets.push(asset); return asset; } H$.Hexagon.prototype.reattachAsset = Hexagon_reattachAsset; function Hexagon_reattachAsset(asset){ var assetClass = this.getHexClass() + H$.Asset.CSS_SUFFIX; d3.select("." + asset.klass) .attr("class", assetClass); var i = this.grid.detachedAssets.indexOf(asset); this.grid.detachedAssets.splice(i, 1); delete asset.klass; delete asset.animating; this.payload.setAsset(asset); return this; } // Private helper function drawAsset(hex, asset, i){ var assetClass = hex.getHexClass() + H$.Asset.CSS_SUFFIX; if(i) assetClass += "-" + i; d3.select("." + assetClass).remove(); if(asset != null){ d3.select("." + hex.getGridClass()).append("svg:image") .attr("class", assetClass) .attr("xlink:href", asset.path) .attr("width", asset.width) .attr("height", asset.height) .attr("x", calcAssetX(hex, asset)) .attr("y", calcAssetY(hex, asset)); } } /** * Render the background, the highlight, and the asset. * The highlightOver attribute determines whether the highlight * or the asset is rendered first. */ H$.Hexagon.prototype.draw = Hexagon_draw; function Hexagon_draw(){ var highlightClass = this.getHexClass() + "-highlight"; d3.select("." + this.getHexClass()).remove(); d3.select("." + highlightClass).remove(); // Render background var bg = this.fill || "none"; renderHex(this, this.getHexClass(), "black", bg); // Render under-asset highlight, if any if(this.highlight && !this.highlightOver){ renderHex(this, highlightClass, this.highlight, this.highlight) .style("fill-opacity", this.highlightOpacity); } // Render asset if(Array.isArray(this.payload)){ // TODO: render array of payloads intelligently throw "array of payloads not yet implemented" } else { drawAsset(this, this.payload.asset); } // Re-render all detached assets, in case any have been overwritten by this hex this.grid.drawDetachedAssets(); // Render over-asset highlight, if any if(this.highlight && this.highlightOver){ renderHex(this, highlightClass, this.highlight, this.highlight) .style("fill-opacity", this.highlightOpacity); } function renderHex(context, klass, stroke, fill){ return d3.select("." + context.getGridClass()).append("svg:polygon") .attr("class", klass) .attr("points", context.vertices().join(" ")) .style("stroke", stroke) .style("fill", fill); } return this; } H$.Hexagon.prototype.undraw = Hexagon_undraw; function Hexagon_undraw(){ d3.select("." + this.getHexClass()).remove(); d3.select("." + this.getHexClass() + H$.Asset.CSS_SUFFIX).remove(); } /** * This is also not yet compatible with arrays of payloads. */ H$.Hexagon.prototype.movePayload = Hexagon_movePayload; function Hexagon_movePayload(targetHex, options){ return this.movePayloadAlongPath([targetHex], options); } /** * Available options (all have defaults): * duration: {Number} total duration of the animation. Default: DEFAULT_ANIMATION_DURATION * easing: {String} animation easing function. DEFAULT: "cubic-in-out" (slow in, slow out) * callback: {Function} function to call when animation finishes. Default: none * @type {Function} */ var global_start = 1; var global_end = 1; H$.Hexagon.prototype.movePayloadAlongPath = Hexagon_movePayloadAlongPath; function Hexagon_movePayloadAlongPath(path, options){ options = options || {}; var duration = options["duration"] || H$.Asset.DEFAULT_ANIMATION_DURATION; duration /= path.length; var grid = this.grid; var targetHex = path[path.length - 1]; var highlight = { color: this.highlight, opacity: this.highlightOpacity, over: this.highlightOver }; this.clearHighlight().draw(); var asset = this.detachDrawnAsset(); asset.animating = true; var assetCopy = new H$.Asset(asset.path, asset.width, asset.height); targetHex.setPayload(this.popPayload()); targetHex.payload.setAsset(assetCopy); animate(0); return targetHex; function animate(i){ var nextHex = path[i]; d3.select("." + asset.klass) .moveToFront() .transition() .duration(duration) .attr("x", calcAssetX(nextHex, asset)) .attr("y", calcAssetY(nextHex, asset)) .each("end", function(){ if(i === path.length - 1){ grid.destroyDetachedAsset(asset); targetHex.setHighlight(highlight.color, highlight.opacity, highlight.over).draw(); if(options["callback"]) options["callback"](targetHex); } else { animate(i + 1); } }); } } /** * Available options (all have defaults): * color: {String} color of the line. Default: black * length: {Number|String} length of the line. Default: 100% * Number: pixels, * String: percentage of distance to target. * width: {Number} width of line. Default: 1px * * animate: {Boolean} whether to animate the line. Default: false. * Other options require animated=true: * iterations: {Number} number of lines to "fire" Default: 1 * translate: {Boolean} whether to stretch or translate the line. Default: false * easing: {String} d3 animation easing function. Default: "linear". * duration: {Number} total duration of the animation. Default: DEFAULT_ANIMATION_DURATION * callback: {Function} function to call when animation finishes. Default: none * destroy: {Boolean} remove the line after the animation. Default: false * miss: {Boolean} land near the target hex but missing the center slightly. Default: false * @type {Function} */ H$.Hexagon.prototype.drawLineTo = Hexagon_drawLineTo; function Hexagon_drawLineTo(targetHex, options){ var startHex = this; var grid = this.grid; var start = this.center(); var target = targetHex.center(); // Move the target one hex size in a random direction perpendicular to the approach if(options["miss"]){ var vector = target.subtract(start); vector = vector.scale(1 / vector.magnitude()); var whichSide = Math.round(Math.random()); if(whichSide){ vector = new H$.Point(- vector.y(), vector.x()); } else { vector = new H$.Point(vector.y(), - vector.x()); } vector = vector.scale(targetHex.size()); target = target.add(vector); } var startToTarget = target.subtract(start); var lineVector; var len = options["length"]; if(len){ if(typeof len === "string"){ var frac = parseInt(len) / 100; lineVector = startToTarget.scale(frac); } else { lineVector = startToTarget.scale(len / startToTarget.magnitude()); } } else { lineVector = startToTarget; } var end = start.add(lineVector); var klass = this.getHexClass() + "-line"; var asset = new H$.Asset(); asset.klass = klass; var uniqueId = "line" + Date.now(); var width = options["width"] || 1; var color = options["color"] || "black"; d3.select("." + this.getGridClass()).append("svg:line") .attr("class", klass) .attr("id", uniqueId) .attr("x1", start.x()).attr("y1", start.y()) .attr("x2", end.x()).attr("y2", end.y()) .style("stroke", color) .style("stroke-width", width); if(options["animate"]){ asset.animating = true; grid.detachedAssets.push(asset); var iterations = options["iterations"] || 1; var easing = options["easing"] || "linear"; var translate = options["translate"] || false; var duration = options["duration"] || H$.Asset.DEFAULT_ANIMATION_DURATION; var callback = options["callback"] || null; var destroy = options["destroy"] || false; var startWillTravel; if(translate){ startWillTravel = start.add(startToTarget.subtract(lineVector)); } else { startWillTravel = start; } d3.select("#" + uniqueId) .transition() .ease(easing) .duration(duration) .attr("x1", startWillTravel.x()).attr("y1", startWillTravel.y()) .attr("x2", target.x()).attr("y2", target.y()) .each("end", function(){ // is flag has been disabled, stop if(!asset.animating) return; if(destroy){ grid.destroyDetachedAsset(asset, "#" + uniqueId); } else { asset.animating = false; } if(iterations > 1){ options.iterations = iterations - 1; startHex.drawLineTo(targetHex, options); } else { if(callback) callback(targetHex); } }); } else { grid.detachedAssets.push(asset); } return targetHex; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generate_grid() {\n\t\tvar svg_grid = document.getElementById(\"grid\");\n\t\tvar viewbox = \"\" + (-this.cell_width) + \" \" + (-this.cell_width) + \" \" + (this.cell_width*(this.width+2)) + \" \" + (this.cell_width*(this.height+2));\n\t\tsvg_grid.setAttribute(\"viewBox\", viewbox);\n\t\tdocument.addEventListener...
[ "0.7641785", "0.721418", "0.7069215", "0.6970663", "0.6941832", "0.68866366", "0.68809086", "0.68422633", "0.6804819", "0.67896956", "0.67816603", "0.67465883", "0.6735081", "0.67263734", "0.67235285", "0.67057526", "0.67028797", "0.66966486", "0.6692086", "0.6685657", "0.667...
0.0
-1
Display a string of classified text with colorful statuses.
function StatusText(_ref) { let { children, danger, info, muted, notice, success, warning } = _ref, restProps = _objectWithoutPropertiesLoose(_ref, ["children", "danger", "info", "muted", "notice", "success", "warning"]); const [styles, cx] = (0, _useStyles.default)(_styles.styleSheet); return _react.default.createElement(_Text.default, restProps, _react.default.createElement("span", { className: cx(danger && styles.text_danger, info && styles.text_info, muted && styles.text_muted, notice && styles.text_notice, success && styles.text_success, warning && styles.text_warning) }, children)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coloredText(status) {\n if(status === \"booked\") {\n return <span className=\"text-primary font-weight-bold\">{status}</span>\n }\n if(status === \"seated\") {\n return <span className=\"text-secondary font-weight-bold\">{status}</span>\n }\n if(st...
[ "0.70725805", "0.6496188", "0.62906456", "0.61371464", "0.6113337", "0.6076516", "0.60220325", "0.5956265", "0.5880307", "0.5848004", "0.5816931", "0.5816295", "0.5796156", "0.5790704", "0.57896113", "0.5776549", "0.5769741", "0.574389", "0.57296157", "0.5720185", "0.57048047...
0.60720956
6
generates a deck of cards
generate_deck(Difficulty) { let shapes = ["oval", "squiggle", "diamond"] let colors = ["red", "green", "purple"] let numbers = ["one", "two", "three"] let shadings = ["solid", "striped", "outlined"] // creates card generator function let card = (shape, color, number, shading) => { let name = "Shape :" + shape + ";Color :" + color + ";Number :" + number + ";Shade :" + shading //returns key and values into each instance of the this.deck array return { name: name, shape: shape, color: color, number: number, shading: shading, } } if (Difficulty === "Advanced") { for (let s = 0; s < shapes.length; s++) { for (let c = 0; c < colors.length; c++) { for (let n = 0; n < numbers.length; n++) { for (let i = 0; i < shadings.length; i++) { this.deck.push( card(shapes[s], colors[c], numbers[n], shadings[i]), ) } } } } } else { for (let s = 0; s < shapes.length; s++) { for (let c = 0; c < colors.length; c++) { for (let n = 0; n < numbers.length; n++) { this.deck.push(card(shapes[s], colors[c], numbers[n], "solid")) } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateDeck() {\r\n var cards = [];\r\n for (var i=1; i<53; i+=1) {\r\n cards.push(i);\r\n }\r\n return cards;\r\n}", "generateCards() {\n var cards = [];\n var suits = ['spades', 'clubs', 'diamonds', 'hearts'];\n var values = ['2', '3', '4', '5', '6', '7', '8', '9', '10', '...
[ "0.8204734", "0.80478245", "0.804249", "0.7991813", "0.79618454", "0.7945748", "0.79098946", "0.7884174", "0.7820705", "0.78156483", "0.7748324", "0.773479", "0.7731363", "0.77221864", "0.77179873", "0.7695832", "0.76659274", "0.7665051", "0.762101", "0.7615865", "0.75963193"...
0.7428823
32
prints the deck of card objects
print_deck() { if (this.deck.length === 0) { console.log( "Deck has not been generated. Call generate_deck() on deck object before continuing.", ) } else { for (let c = 0; c < this.deck.length; c++) { console.log(this.deck[c]) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "printDeck(){\n console.log(\"Printing deck..\");\n for (const card of this.cards){\n card.displayCard();\n }\n // for (let i=0; i < this.cards.length; i++){\n // console.log(`${i+1}:${this.cards[i]}`);\n //}\n }", "function printDeck() {\n var resul...
[ "0.7851098", "0.75887036", "0.7290327", "0.723787", "0.7114862", "0.6987267", "0.6956463", "0.6883937", "0.6878408", "0.6862186", "0.6740982", "0.6673502", "0.6654526", "0.6578331", "0.65128076", "0.64945745", "0.6441548", "0.6438234", "0.64375144", "0.6435145", "0.64243954",...
0.8022254
0
deal a number cards
deal(num_cards) { let cards = [] for (let c = 0; c < num_cards; c++) { let dealt_card = this.deck.shift() cards.push(dealt_card) this.dealt_cards.push(dealt_card) } return cards }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function use_card(num_card)\n{\n\tthis.carte[num_card].use();\n}", "function deal_number(){\n\t\n}", "function deal() {\n\n // Generate a random number between 1 and 4 for the suit, \n // and a random number between 1 and 13 for the number\n var newSuit = Math.floor( Math.random() * 4 + 1 );\n var ...
[ "0.7296435", "0.6804579", "0.67113036", "0.6679809", "0.6675583", "0.66414094", "0.66387796", "0.6638583", "0.6623848", "0.6580621", "0.65670973", "0.6452587", "0.6444479", "0.6429873", "0.6403464", "0.6343044", "0.6329002", "0.6325381", "0.63228744", "0.6291277", "0.62588686...
0.6669665
5
FIND // FROM, SELECT, CALLBACK
static find(from, select, callback) { find(from, {}, select, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findOne(from, select, callback) {\n findOne(from, {}, select, {}, callback);\n }", "static findWhere(from, select, where, callback) {\n find(from, where, select, {}, callback);\n }", "static findOneWhere(from, select, where, callback) {\n findOne(from, wher...
[ "0.70508325", "0.69658035", "0.6775976", "0.67516553", "0.63515645", "0.6249541", "0.62335974", "0.6201742", "0.6182281", "0.61668193", "0.60927075", "0.6061717", "0.6053274", "0.6053274", "0.599711", "0.5993098", "0.5993098", "0.59373194", "0.59373194", "0.58883005", "0.5881...
0.7520128
0
FROM, SELECT, WHERE, CALLBACK
static findWhere(from, select, where, callback) { find(from, where, select, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onGetAllSuccess_GetResponseFromDatabaseWhereClause(records){\n isSuccess = true;\n ReturnRecords = (records);\n}", "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n ...
[ "0.64405465", "0.6207406", "0.609639", "0.6034986", "0.6000077", "0.5946777", "0.59410465", "0.5916813", "0.5913977", "0.59038824", "0.58787817", "0.58688694", "0.5800897", "0.5769035", "0.5764621", "0.5753384", "0.5753384", "0.5753384", "0.5753384", "0.5753384", "0.5735689",...
0.58724636
11
FROM, SELECT, ORDERBY, CALLBACK
static findOrder(from, select, orderby, callback) { find(from, {}, select, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.60762626", "0.60649365", "0.60335785", "0.5891911", "0.5873087", "0.58057046", "0.57926667", "0.57185197", "0.5714517", "0.56626683", "0.5658111", "0.5648053", "0.5623484", "0.5619447", "0.56138074", "0.5613273", "0.5560034", "0.5552683", "0.54603034", "0.54602253", "0.544...
0.60436887
2
FROM, SELECT, WHERE, ORDERBY, CALLBACK
static findWhereOrder(from, select, where, orderby, callback) { find(from, where, select, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.61639965", "0.6125367", "0.5998499", "0.5948966", "0.5885602", "0.58367777", "0.58326936", "0.57719743", "0.5720882", "0.5657524", "0.56434005", "0.5624733", "0.5588958", "0.55889195", "0.55826503", "0.558083", "0.55767155", "0.5570669", "0.5560254", "0.5554302", "0.551882...
0.6181167
0
FIND ONE // FROM, SELECT, CALLBACK
static findOne(from, select, callback) { findOne(from, {}, select, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static find(from, select, callback) {\n find(from, {}, select, {}, callback);\n }", "static findOneWhere(from, select, where, callback) {\n findOne(from, where, select, {}, callback);\n }", "function find() {}", "static findWhere(from, select, where, callback) {\n ...
[ "0.7305295", "0.718484", "0.6932672", "0.6691217", "0.64910847", "0.644256", "0.64323795", "0.630001", "0.6285284", "0.6285284", "0.6278437", "0.6244728", "0.6244728", "0.6239255", "0.6239255", "0.6237212", "0.6205782", "0.61498463", "0.6144593", "0.61239946", "0.60439783", ...
0.75772613
0
FROM, SELECT, WHERE, CALLBACK
static findOneWhere(from, select, where, callback) { findOne(from, where, select, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onGetAllSuccess_GetResponseFromDatabaseWhereClause(records){\n isSuccess = true;\n ReturnRecords = (records);\n}", "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n ...
[ "0.64405465", "0.6207406", "0.6034986", "0.6000077", "0.5946777", "0.59410465", "0.5916813", "0.5913977", "0.59038824", "0.58787817", "0.58724636", "0.58688694", "0.5800897", "0.5769035", "0.5764621", "0.5753384", "0.5753384", "0.5753384", "0.5753384", "0.5753384", "0.5735689...
0.609639
2
FROM, SELECT, ORDERBY, CALLBACK
static findOneOrder(from, select, orderBy, callback) { findOne(from, {}, select, orderBy, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.60762626", "0.60649365", "0.60436887", "0.60335785", "0.5891911", "0.5873087", "0.58057046", "0.57926667", "0.57185197", "0.5714517", "0.56626683", "0.5658111", "0.5623484", "0.5619447", "0.56138074", "0.5613273", "0.5560034", "0.5552683", "0.54603034", "0.54602253", "0.54...
0.5648053
12
FROM, SELECT, WHERE, ORDERBY, CALLBACK
static findOneWhereOrder(from, select, where, orderBy, callback) { findOne(from, where, select, orderBy, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findWhereOrder(from, select, where, orderby, callback) {\n find(from, where, select, orderby, callback);\n }", "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n ...
[ "0.6181167", "0.61639965", "0.6125367", "0.5998499", "0.5948966", "0.58367777", "0.58326936", "0.57719743", "0.5720882", "0.5657524", "0.56434005", "0.5624733", "0.5588958", "0.55889195", "0.55826503", "0.558083", "0.55767155", "0.5570669", "0.5560254", "0.5554302", "0.551882...
0.5885602
5
FIND INNER JOIN // FROM, SELECT, JOIN, CALLBACK
static findInnerJoin(from, select, join, callback) { findInnerJoin(from, {}, select, join, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findInnerJoinWhere(from, select, where, join, callback) {\n findInnerJoin(from, where, select, join, {}, callback);\n }", "static findInnerJoinWhereOrder(from, select, where, join, orderby, callback) {\n findInnerJoin(from, where, select, join, orderby, callback);\n }",...
[ "0.7549586", "0.69616145", "0.6910877", "0.60859513", "0.57186496", "0.5668827", "0.56324303", "0.5555086", "0.5535045", "0.5451174", "0.5352476", "0.5272109", "0.51424843", "0.51024616", "0.5095254", "0.5060973", "0.50348043", "0.5022924", "0.49924514", "0.4932506", "0.49254...
0.78167605
0
FROM, SELECT, WHERE, JOIN, CALLBACK
static findInnerJoinWhere(from, select, where, join, callback) { findInnerJoin(from, where, select, join, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.6147903", "0.5992671", "0.589368", "0.5779637", "0.56121993", "0.5610767", "0.5591811", "0.5553784", "0.55252403", "0.55219066", "0.55199796", "0.55091566", "0.54178125", "0.54093045", "0.53890944", "0.53890944", "0.53890944", "0.53827435", "0.5373551", "0.53654605", "0.53...
0.5418067
12
FROM, SELECT, JOIN, ORDERBY, CALLBACK
static findInnerJoinOrder(from, select, join, orderby, callback) { findInnerJoin(from, {}, select, join, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.58848023", "0.57687473", "0.5705418", "0.5487354", "0.5480866", "0.54615325", "0.54339117", "0.5423955", "0.53772235", "0.5350298", "0.53425974", "0.5338893", "0.5319425", "0.5319411", "0.5313796", "0.5313753", "0.5251842", "0.5248762", "0.5232248", "0.5194783", "0.5174864...
0.5788549
1
FROM, SELECT, WHERE, JOIN, ORDERBY, CALLBACK
static findInnerJoinWhereOrder(from, select, where, join, orderby, callback) { findInnerJoin(from, where, select, join, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.60357344", "0.57442415", "0.5700293", "0.5689771", "0.5654416", "0.56365913", "0.55299103", "0.5524143", "0.54805267", "0.5469346", "0.5459586", "0.5427421", "0.5328001", "0.53189456", "0.5310093", "0.53100014", "0.52856827", "0.5280557", "0.52684355", "0.52655685", "0.525...
0.57911855
1
FIND LEFT JOIN // FROM, SELECT, JOIN, CALLBACK
static findLeftJoin(from, select, join, callback) { findLeftJoin(from, {}, select, join, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findLeftJoinWhere(from, select, where, join, callback) {\n findLeftJoin(from, where, select, join, {}, callback);\n }", "static findLeftJoinOrder(from, select, join, orderby, callback) {\n findLeftJoin(from, {}, select, join, orderby, callback);\n }", "static findLeft...
[ "0.7722422", "0.71773404", "0.7132845", "0.5753619", "0.57143575", "0.5251691", "0.5065213", "0.49813566", "0.49480498", "0.48615816", "0.47994074", "0.47624263", "0.47337973", "0.46875355", "0.4653055", "0.46352357", "0.46176502", "0.4595695", "0.45810297", "0.45780098", "0....
0.7944322
0
FROM, SELECT, WHERE, JOIN, CALLBACK
static findLeftJoinWhere(from, select, where, join, callback) { findLeftJoin(from, where, select, join, {}, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.6147903", "0.5992671", "0.589368", "0.5779637", "0.56121993", "0.5610767", "0.5591811", "0.5553784", "0.55252403", "0.55219066", "0.55199796", "0.55091566", "0.5418067", "0.54178125", "0.54093045", "0.53890944", "0.53890944", "0.53890944", "0.53827435", "0.5373551", "0.536...
0.5225493
31
FROM, SELECT, JOIN, ORDERBY, CALLBACK
static findLeftJoinOrder(from, select, join, orderby, callback) { findLeftJoin(from, {}, select, join, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.58848023", "0.5788549", "0.57687473", "0.5705418", "0.5487354", "0.5480866", "0.54615325", "0.54339117", "0.5423955", "0.53772235", "0.5350298", "0.53425974", "0.5319425", "0.5319411", "0.5313796", "0.5313753", "0.5251842", "0.5248762", "0.5232248", "0.5194783", "0.5174864...
0.5338893
12
FROM, SELECT, WHERE, JOIN, ORDERBY, CALLBACK
static findLeftJoinWhereOrder(from, select, where, join, orderby, callback) { findLeftJoin(from, where, select, join, orderby, callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ...
[ "0.60357344", "0.57911855", "0.57442415", "0.5700293", "0.5689771", "0.5654416", "0.56365913", "0.55299103", "0.5524143", "0.54805267", "0.5469346", "0.5427421", "0.5328001", "0.53189456", "0.5310093", "0.53100014", "0.52856827", "0.5280557", "0.52684355", "0.52655685", "0.52...
0.5459586
11
UPDATE // TABLE, UPDATES, WHERE, CALLBACK
static update(table, updates, query, callback) { if (table.length === 0 || updates.length === 0 || query.length === 0) { return; } let options = [table]; let sql = 'UPDATE ?? SET '; let sets = []; for (let key in updates) { if (updates.hasOwnProperty(key) && typeof updates[key] !== 'undefined') { sets.push(' ?? = ?'); options.push(key, updates[key]); } } sql += sets.join(','); if (Object.keys(query).length > 0) { sql += ' WHERE'; } let wheres = []; for (let key in query) { if (query.hasOwnProperty(key) && typeof query[key] !== 'undefined') { wheres.push('?? = ? '); options.push(key, query[key]); } } sql += wheres.join('AND '); return con.query(sql, options, (err,rows) => { if(err || rows.length > 0) { callback(err, null); } else { callback(null, rows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateData(sqlQuery, obj, callback){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(callback)callback();\r\n console.log('Changed ' ...
[ "0.692523", "0.6757804", "0.66608644", "0.66053283", "0.65152186", "0.6473978", "0.64712006", "0.64691204", "0.64691204", "0.64691204", "0.6465907", "0.643347", "0.6372709", "0.6261236", "0.62578446", "0.6214459", "0.6213561", "0.619379", "0.61779755", "0.61732286", "0.614786...
0.685313
1
CREATE // TABLE, DATA, CALLBACK
static create(table, data, callback) { if (table.length === 0 || data.length === 0) { return; } let options = [table]; let sql = 'INSERT INTO ?? ('; let sets = []; let setValues = []; if (!Array.isArray(data)) { data = [data]; } let allValueKeys = []; let allValues = []; for (let row of data) { let values = []; for (let key in row) { if (row.hasOwnProperty(key) && typeof row[key] !== 'undefined') { if (setValues.indexOf(key) === -1) { sets.push('??'); setValues.push(key); } values.push('?'); allValues.push(row[key]); } } allValueKeys.push(values); } sql += sets.join(', '); sql += ') VALUES '; let vals = []; for (let row of allValueKeys) { vals.push('(' + row.join(', ') + ')'); } sql += vals.join(', '); options = options.concat(setValues); options = options.concat(allValues); return con.query(sql, options, (err,rows) => { if(err || rows.length > 0) { callback(err, null); } else { callback(null, rows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tableCreationCallback(err) {\n if (err) {\n\tconsole.log(\"sotring error\",err);\n } else {\n\tconsole.log(\"data stored\");\n\tdb.close();\n }\n}", "function createTable() {\n\n db.transaction(function (tx) { tx.executeSql(createStatement, [], showRecords, onError); });\n\n}", "function ...
[ "0.7304874", "0.7243986", "0.6940083", "0.67983407", "0.6686058", "0.6669458", "0.66655284", "0.6657662", "0.66046566", "0.6589987", "0.6582277", "0.65199226", "0.651521", "0.643668", "0.63986546", "0.63930964", "0.6388023", "0.6347649", "0.63061947", "0.62753683", "0.6272511...
0.66011024
9
CREATE UPDATE // TABLE, DATA, CALLBACK
static createUpdate(table, data, callback) { if (table.length === 0 || data.length === 0) { return; } let options = [table]; let sql = 'INSERT INTO ?? ('; let sets = []; let setValues = []; if (!Array.isArray(data)) { data = [data]; } let allValueKeys = []; let allValues = []; let updatesVals = []; for (let row of data) { let values = []; for (let key in row) { if (row.hasOwnProperty(key) && typeof row[key] !== 'undefined') { if (setValues.indexOf(key) === -1) { sets.push('??'); setValues.push(key); } updatesVals.push(key); values.push('?'); allValues.push(row[key]); } } allValueKeys.push(values); } sql += sets.join(', '); sql += ') VALUES '; let vals = []; for (let row of allValueKeys) { vals.push('(' + row.join(', ') + ')'); } sql += vals.join(', '); options = options.concat(setValues); options = options.concat(allValues); if (updatesVals.length > 0) { sql += ' ON DUPLICATE KEY UPDATE '; let updates = []; for (let key of updatesVals) { updates.push('?? = VALUES(??)'); options.push(key, key); } sql += updates.join(', '); } return con.query(sql, options, (err,rows) => { if(err || rows.length > 0) { callback(err, null); } else { callback(null, rows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateData(id, data, userID, _callback) {\n db.transaction(\n tx => {\n tx.executeSql('update images set photo = ?, name = ?, description = ?, price = ?, address = ? where id = ?', [data[0], data[1], data[2], data[3], data[4], id], () => {\n this.insertIntoLog(userID, \"edit data : \" + dat...
[ "0.6365311", "0.63515353", "0.6273513", "0.62477237", "0.623554", "0.6218646", "0.6218646", "0.6218646", "0.6214957", "0.6201936", "0.6128711", "0.610704", "0.6089083", "0.60854906", "0.60675275", "0.60041606", "0.5985274", "0.5971839", "0.59590966", "0.59426886", "0.5935435"...
0.68953604
0
REMOVE // TABLE, WHERE, CALLBACK
static remove(table, query, callback) { if (table.length === 0 || query.length === 0) { return; } let options = [table]; var sql = 'DELETE FROM ?? '; if (Object.keys(query).length > 0) { sql += ' WHERE'; let wheres = []; for (let key in query) { if (query.hasOwnProperty(key) && typeof query[key] !== 'undefined') { const lastTwo = key.substr(key.length - 2, 2); const lastOne = key.substr(key.length - 1, 1); let finalKey = key; let cut = 0; let notCut = false; if (!Array.isArray(query[key])) { query[key] = [query[key]]; } for (let val of query[key]) { switch (lastTwo) { case '>=': wheres.push(' ?? >= ?'); cut = 2; break; case '<=': wheres.push(' ?? <= ?'); cut = 2; break; default: switch (lastOne) { case '>': wheres.push(' ?? > ?'); cut = 1; break; case '<': wheres.push(' ?? < ?'); cut = 1; break; case '=': wheres.push(' ?? = ?'); cut = 1; break; case '!': wheres.push(' ?? != ?'); cut = 1; break; default: wheres.push(' ?? = ?'); break; } } if (notCut) { finalKey = finalKey.substr(0, finalKey.length-cut); notCut = false; } options.push(finalKey, val); } } } sql += wheres.join(' AND'); } return con.query(sql, options, (err,rows) => { if(err || rows.length > 0) { callback(err, null); } else { callback(null, rows); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(table, id) {\n var queryString = `DELETE FROM ?? WHERE id = ?` \n\n return this.connection.query(queryString, [table, id]);\n }", "afterDelete() {\n let event = this.events[this.self.name];\n let index = event.indexOf(this.self.callback);\n event.splice(index, 1)\n }", "fu...
[ "0.66561526", "0.65086937", "0.6505503", "0.6493796", "0.64335805", "0.64335805", "0.6422086", "0.64019847", "0.6349288", "0.6342275", "0.63224596", "0.6285645", "0.62305546", "0.62284905", "0.6210389", "0.6207651", "0.62041676", "0.61899984", "0.61790437", "0.61527246", "0.6...
0.647382
4
o constructor cria as propriedades da classe quando for chamada usando o 'new'
constructor(nome, idade) { this.nome = nome this.idade = idade }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "consructor() {\n }", "function _construct()\n\t\t{;\n\t\t}", "function _ctor() {\n\t}", "constructor() {\r\n // ohne Inhalt\r\n ...
[ "0.7919343", "0.7380895", "0.7380895", "0.7380895", "0.7380895", "0.7380895", "0.7380895", "0.7380895", "0.7358387", "0.72570187", "0.7235949", "0.7193833", "0.71864176", "0.7162032", "0.71417624", "0.7084452", "0.7064094", "0.7060025", "0.700165", "0.700165", "0.700165", "...
0.6614083
95
new message: raise newMessage event
function SendMessage(e) { e.preventDefault(); var msg = document.getElementById("msg").value.trim(); if (msg && window.CustomEvent) { var event = new CustomEvent("newMessage", { detail: { message: msg, time: new Date(), }, bubbles: true, cancelable: true }); e.currentTarget.dispatchEvent(event); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_newMessage(message) {\n this.messages.push(message);\n this.emitChange();\n }", "function onNewMessage(myId, msg, msgtype)\n{\n\tm.startComputation();\n\tthis.textHistory().push([myId, msg, msgtype]);\n\tm.endComputation();\n}", "function onNewMessage(data) {\n //TODO: update dialogs\n\n...
[ "0.7991728", "0.74649405", "0.72114277", "0.71366924", "0.7135344", "0.7065524", "0.70335174", "0.6912358", "0.6857013", "0.6779055", "0.67637426", "0.6723245", "0.67085767", "0.665865", "0.664129", "0.6621189", "0.66198397", "0.6616027", "0.6588864", "0.6585592", "0.6567801"...
0.682013
9
log event in console
function LogEvent(msg) { log.textContent += msg + "\n"; var ot = log.scrollHeight - log.clientHeight; if (ot > 0) log.scrollTop = ot; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logEvent(eventType) {}", "function onEvent(name, event) {\n //console.log(event);\n console.log(name, JSON.stringify(event, null, 2));\n}", "function pushConsole(e, sender) {\n console.log(e, sender);\n}", "function consoleListener(event, level, message, line, sourceId) {\n\n console.log...
[ "0.7684453", "0.7492241", "0.7357996", "0.7300168", "0.72579813", "0.72156215", "0.71634036", "0.714248", "0.71235996", "0.70893526", "0.7081104", "0.6976334", "0.6942628", "0.69355565", "0.6924171", "0.6899149", "0.6895444", "0.6885877", "0.6868283", "0.68651664", "0.6844569...
0.0
-1
Nice abstractions over this.db
one(query, values, errorHandler = this.errorHandler) { return this.db .many(query, values) .then(rows => Right(this.Bo.createOneFromDatabase(rows))) .catch(errorHandler); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "get db() {\n return this._db;\n }", "function DB (options) {}", "static getDb (): any {\n return getDbInstance()\n }", "constructor(db) {\n this.db = db\n }", "constructor(db) {\n ...
[ "0.6858555", "0.6858555", "0.68481284", "0.671249", "0.66674954", "0.6619826", "0.65640706", "0.6513991", "0.64610314", "0.6402785", "0.6399935", "0.63908243", "0.63900465", "0.63622123", "0.63121766", "0.6293543", "0.62862176", "0.6190402", "0.6181677", "0.615275", "0.614923...
0.0
-1
Piecemeal endings if using this.db directly
errorHandler(err) { if (!err.name === 'QueryResultError') { this.logError(err); } return Left(err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get db() {\n return this._db;\n }", "function DB (options) {}", "function notesDB() { }", "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "constructor(db) {\n this.db = db\n }", "function Database(){}", "static getDb (): any {\n retur...
[ "0.654291", "0.6539298", "0.64124244", "0.6388274", "0.6388274", "0.62680376", "0.6242521", "0.6227932", "0.6221454", "0.62152547", "0.61731386", "0.6140533", "0.60987556", "0.60920644", "0.6080931", "0.60796994", "0.6053411", "0.6037246", "0.599416", "0.5959038", "0.593765",...
0.0
-1
Builtin basic DAO methods / Standard create
create(bo) { const { columns, values, valuesVar } = bo.getSqlInsertParts(); const query = ` INSERT INTO "${bo.Bo.tableName}" ( ${columns} ) VALUES ( ${valuesVar} ) RETURNING ${bo.Bo.getSQLSelectClause()}; `; return this.one(query, values); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(name, cb) {\n orm.create(name, cb);\n }", "function DatabaseFactory() {}", "function DatabaseFactory() {}", "function CreateDatabaseQuery() {}", "create() {}", "create() {}", "create(p1,p2,p3) {\n var name, structure, contentType, properties\n if (Array.isArray(p1)) {\n ...
[ "0.6542748", "0.6310506", "0.6310506", "0.6259123", "0.60709876", "0.60709876", "0.600118", "0.59900683", "0.59900683", "0.5858227", "0.5820346", "0.5803177", "0.5757477", "0.57417226", "0.5735306", "0.5716726", "0.5712752", "0.57000965", "0.56899524", "0.5656452", "0.5622938...
0.5381474
58
fyi: ALL fields must be present in the bo (for it to be created correctly if necessary) but that makes the matching unrealistic/undesired. Thus this method is likely practically unusable.
getMatchOrCreate(bo) { return this.getMatching(bo).then(obj => { let matchingBo; try { matchingBo = obj.val(); } catch (_err) {} if (matchingBo) { return Right(matchingBo); } return this.create(bo); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static assertFieldsExist(fields = []) {\n if (fields === RETURNS_ALL_FIELDS) {\n return;\n }\n\n const modelFields = this.fields();\n\n // Ensure that all fields are defined within our model\n const missing = fields.reduce((missing, field) => {\n if (modelFields.indexOf(field...
[ "0.5737411", "0.5457191", "0.5374542", "0.5360257", "0.53312933", "0.5265744", "0.51736456", "0.51610607", "0.50864327", "0.50282425", "0.49672687", "0.49584824", "0.49451214", "0.4941018", "0.49217084", "0.4913216", "0.4911907", "0.48920283", "0.48672137", "0.48573485", "0.4...
0.5877177
0