query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Strategy for determining operationId
function opId(operation, pathName) {var method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},v2OperationIdCompatibilityMode = _ref.v2OperationIdCompatibilityMode; if (!operation || typeof_default()(operation) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get defaultOperationId() {\n return this.name.replace('Operation', '').toLowerCase();\n }", "getOperationID() {\n return this._typeID;\n }", "getOperationID() {\n return this._typeID;\n }", "getOperationID() {\n return this._typeID;\n }", "function getOperatio...
[ "0.7091271", "0.6215225", "0.6215225", "0.6215225", "0.59940475", "0.5929654", "0.58005613", "0.58005613", "0.58005613", "0.58005613", "0.58005613", "0.58005613", "0.58005613", "0.57152", "0.5635911", "0.5623487", "0.55835193", "0.5571551", "0.55628467", "0.5560192", "0.55601...
0.73993
0
Create a generated operationId from pathName + method
function idFromPathMethod(pathName, method) {var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},v2OperationIdCompatibilityMode = _ref2.v2OperationIdCompatibilityMode; if (v2OperationIdCompatibilityMode) { var res = "".concat(method.toLowerCase(), "_").concat(pathName). replace(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function opId(operation, pathName) {var method = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},v2OperationIdCompatibilityMode = _ref.v2OperationIdCompatibilityMode;\n if (!operation || typeof_default()(opera...
[ "0.7306152", "0.6681627", "0.61569476", "0.6040444", "0.55094445", "0.54915434", "0.53420556", "0.53064716", "0.5280104", "0.52731574", "0.5272626", "0.5259322", "0.5259322", "0.5259322", "0.5259322", "0.5259322", "0.5259322", "0.52490246", "0.5228279", "0.5227308", "0.522730...
0.78627765
0
Will stop iterating over the operations and return the operationObj as soon as predicate returns true
function findOperation(spec, predicate) { return eachOperation(spec, predicate, true) || null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "some(predicate) {\n let result;\n do {\n result = this.source.next();\n if (!result.done && predicate(result.value)) {\n return true;\n }\n } while (!result.done);\n return false;\n }", "function eachOperation(spec, cb, find) {\n if ...
[ "0.53864735", "0.5274798", "0.5258404", "0.52491325", "0.52402467", "0.52361774", "0.5232825", "0.5203868", "0.5201742", "0.5195791", "0.51830196", "0.5136558", "0.51223856", "0.51127726", "0.50894344", "0.5076698", "0.50428325", "0.49954793", "0.4986511", "0.4986511", "0.496...
0.6230459
0
iterate over each operation, and fire a callback with details `find=true` will stop iterating, when the cb returns truthy
function eachOperation(spec, cb, find) { if (!spec || typeof_default()(spec) !== 'object' || !spec.paths || typeof_default()(spec.paths) !== 'object') { return null; }var paths = spec.paths; // Iterate over the spec, collecting operations for (var pathName in paths) { for (var method in paths[pathNa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "each(callback) {\n const count = this.objects.length;\n for (let i = 0; i < count; i++)\n if (this.objects[i] != null)\n if (callback(this.objects[i]) === false)\n break;\n }", "Find(findCallback) {\n throw new _.EXCEPTIONS.TODOException(\"bbuech...
[ "0.60666317", "0.59500617", "0.59205455", "0.5914662", "0.59030145", "0.5901974", "0.5832267", "0.58258736", "0.5824764", "0.5820946", "0.5781256", "0.575084", "0.57207215", "0.5711385", "0.57054806", "0.5637024", "0.55954516", "0.5586665", "0.55725396", "0.55512315", "0.5526...
0.6868053
0
Replace path paramters, with values ( ie: the URL )
function pathBuilder(_ref4) {var req = _ref4.req,value = _ref4.value,parameter = _ref4.parameter; req.url = req.url.split("{".concat(parameter.name, "}")).join(encodeURIComponent(value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generatePathWithParams(params: Object) {\n let path = this.path;\n _.forIn(params, (param, key) => {\n path = path.replace(`:${key}`, param)\n })\n\n return path\n }", "function updateUrl(paramName, paramValue) {\n var url = new URL(window.location),\n urlParams = new URLSearchParams(...
[ "0.6583716", "0.6309465", "0.60914403", "0.6091248", "0.6046835", "0.6035037", "0.60349333", "0.6025475", "0.5936203", "0.5876903", "0.58533233", "0.58410513", "0.581825", "0.5808927", "0.5801046", "0.5796964", "0.57871515", "0.57854104", "0.5780834", "0.5773098", "0.5771948"...
0.677822
0
Add security values, to operations that declare their need on them Adapted from the Swagger2 implementation
function applySecurities(_ref) {var request = _ref.request,_ref$securities = _ref.securities,securities = _ref$securities === void 0 ? {} : _ref$securities,_ref$operation = _ref.operation,operation = _ref$operation === void 0 ? {} : _ref$operation,spec = _ref.spec; var result = assign_default()({}, request);var _secu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSecurityPutPrivileges (opts) {\n // eslint-disable-next-line no-unused-vars\n const { makeRequest, ConfigurationError, handleError, snakeCaseKeys } = opts\n /**\n * Perform a [security.put_privileges](TODO) request\n *\n * @param {enum} refresh - If `true` (the default) then refresh the affe...
[ "0.671005", "0.64560115", "0.60826504", "0.6042461", "0.60248244", "0.58377045", "0.58023226", "0.5494489", "0.5380589", "0.5355556", "0.52457434", "0.5169382", "0.51590824", "0.5100053", "0.5082783", "0.5081872", "0.5018891", "0.5014358", "0.49500924", "0.49497852", "0.49253...
0.652265
1
Generate an array of patches from an observer
function generate(observer) { var mirror = beforeDict.get(observer.object); _generate(mirror.value, observer.object, observer.patches, ""); if (observer.patches.length) { core_1.applyPatch(mirror.value, observer.patches); } var temp = observer.patches; if (temp.length > 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generate(observer) {\r\n var mirror;\r\n for (var i = 0, length = beforeDict.length; i < length; i++) {\r\n if (beforeDict[i].obj === observer.object) {\r\n mirror = beforeDict[i];\r\n break;\r\n }\r\n }\r\n _generate(mirror.value, observer.object, observer....
[ "0.65395826", "0.62490106", "0.59985185", "0.59282666", "0.54294676", "0.54125595", "0.5392636", "0.5325508", "0.5182764", "0.5120102", "0.50758535", "0.50681615", "0.50560343", "0.49616653", "0.49554372", "0.49452227", "0.48946792", "0.48765498", "0.48511606", "0.47619402", ...
0.64489955
1
Dirty check if obj is different from mirror, generate patches and update mirror
function _generate(mirror, obj, patches, path) { if (obj === mirror) { return; } if (typeof obj.toJSON === "function") { obj = obj.toJSON(); } var newKeys = helpers_1._objectKeys(obj); var oldKeys = helpers_1._objectKeys(mirror); var changed = false; var deleted...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _generate(mirror, obj, patches, path) {\n var newKeys = _objectKeys(obj);\n var oldKeys = _objectKeys(mirror);\n var changed = false;\n var deleted = false;\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mir...
[ "0.7639574", "0.7553271", "0.7549692", "0.75245655", "0.7483253", "0.7483253", "0.7465192", "0.74328387", "0.71005106", "0.6013483", "0.58213955", "0.5821328", "0.5820412", "0.5751941", "0.572571", "0.5718326", "0.5692544", "0.56061184", "0.557463", "0.5564152", "0.54773015",...
0.76334393
1
Branching logic which calls the correct function to clone the given value base on its type.
function cloneValue(value) { // The value is an object so lets clone it. if (getTypeOf(value) === 'object') { return quickCloneObject(value); } // The value is an array so lets clone it. else if (getTypeOf(value) === 'array') { return quickCloneArray(value); } // Any other value can just be copied. ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cloneValue (value) {\n\n\t// The value is an object so lets clone it.\n\tif (getTypeOf(value) === `object`) {\n\t\treturn quickCloneObject(value);\n\t}\n\n\t// The value is an array so lets clone it.\n\telse if (getTypeOf(value) === `array`) {\n\t\treturn quickCloneArray(value);\n\t}\n\n\t// Any other val...
[ "0.757578", "0.6738044", "0.6540512", "0.6538504", "0.6418459", "0.63514435", "0.62977153", "0.623051", "0.61802554", "0.61802554", "0.6168444", "0.61547536", "0.6125784", "0.6124668", "0.6124668", "0.6124668", "0.60515636", "0.6045705", "0.59236544", "0.5858522", "0.5819451"...
0.7623701
0
Inline Parser class. Note that link validation is stricter in Remarkable than what is specified by CommonMark. If you want to change this you can use a custom validator.
function ParserInline() { this.ruler = new Ruler(); for (var i = 0; i < _rules.length; i++) { this.ruler.push(_rules[i][0], _rules[i][1]); } // Can be overridden with a custom validator this.validateLink = validateLink; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ParserInline() {\n\t this.ruler = new Ruler();\n\t for (var i = 0; i < _rules.length; i++) {\n\t this.ruler.push(_rules[i][0], _rules[i][1]);\n\t }\n\n\t // Can be overridden with a custom validator\n\t this.validateLink = validateLink;\n\t}", "function ParserInline() {\n\t this.ruler = new Rul...
[ "0.80791247", "0.80791247", "0.80791247", "0.7406927", "0.6889194", "0.6878703", "0.68767023", "0.68767023", "0.68767023", "0.68767023", "0.68767023", "0.68767023", "0.68767023", "0.68744755", "0.6870802", "0.6857642", "0.6857642", "0.68538344", "0.68538344", "0.68538344", "0...
0.8138188
1
Pass any properties provided to the QueryContainer to its child container, along with the query results, query parameters, and a setQueryParams function.
render() { const { queryParams, queryResults } = this.state; const queryIds = {}; Object.keys(this.queries).forEach((key) => { queryIds[key] = this.queries[key].id; }); const passedProps = { ...queryResults, query: { queryParams, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queryResults(results) {\n\t\tthis._queryResults = results;\n\t}", "_initNormalQuery() {\n const config = this.exposeConfig;\n if (config.method) {\n this._initMethod();\n }\n\n if (config.publication) {\n this._initPublication();\n }\n\n if (!config...
[ "0.5548827", "0.5430832", "0.5416729", "0.53028333", "0.5258347", "0.52287006", "0.5215411", "0.51924807", "0.50859576", "0.5078802", "0.5064386", "0.5060722", "0.50475645", "0.50470704", "0.5043123", "0.49888024", "0.49685475", "0.49636665", "0.4962243", "0.49606147", "0.495...
0.57037294
0
just like calling evalOuter directly. Similar to order used to parse in A2 where you look at the outertext before anything else because it is on the root node
function evalWML(ast, env) { return evalOuter(ast, env); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evalOuter (ast, env){\n if(ast) {\n var result;\n if(isDefined(ast.OUTERTEXT)) {\n result = ast.OUTERTEXT;\n } else if (ast.templateinvocation) {\n result = evalTemplateInvocation(ast.templateinvocation, env);\n } else if (ast.templatedef) {\n ...
[ "0.7047355", "0.57562363", "0.5699887", "0.54901904", "0.54557395", "0.5406038", "0.5321459", "0.53209335", "0.5311892", "0.5311892", "0.5311892", "0.5311892", "0.5311892", "0.52708834", "0.52541745", "0.5249418", "0.5249418", "0.5249418", "0.52331865", "0.5183493", "0.518349...
0.61313266
1
evaluates zero or more outer nodes. Each time a new node is evaluated, the function determines what it is (an OUTERTEXT, templateinvocation, or templatedef, and evaluates them as needed. Once done, everything evaulated is returned with an empty string at the end.
function evalOuter (ast, env){ if(ast) { var result; if(isDefined(ast.OUTERTEXT)) { result = ast.OUTERTEXT; } else if (ast.templateinvocation) { result = evalTemplateInvocation(ast.templateinvocation, env); } else if (ast.templatedef) { evalTemplat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "visitTemplateStringExpression(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "function evalInvocationText(ast, env) {\n if(ast) {\n var result;\n if(isDefined(ast.INNERTEXT)) {\n result = ast.INNERTEXT;\n } else if(ast.templateinvocation) {\n result = evalTemplat...
[ "0.6006359", "0.5856836", "0.56633836", "0.56022424", "0.5575447", "0.5521864", "0.54963386", "0.54415375", "0.5387879", "0.5379995", "0.531822", "0.5271601", "0.5270378", "0.52494544", "0.52195543", "0.52195543", "0.52089703", "0.52037156", "0.5200336", "0.51534265", "0.5144...
0.6875172
0
creates argument list by adding a spot in the list for each targ that exists and adding the itext of that targ to the lsit
function getArgumentList(targs) { if(targs) { var list = getArgumentList(targs.next); list.unshift(targs.itext); return list; } else { return []; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeListElementFromArgumentList(argList){ \n var result= \"<li class='apiTest'> \";\n var flag = false;\n for(argument in argList){\n if(!flag){\n flag = true; \n }else{\n result += \", \";\n } \n result += \"<span...
[ "0.5327791", "0.51197857", "0.5005536", "0.48664355", "0.48398805", "0.48102313", "0.47893825", "0.4755502", "0.47206727", "0.47131076", "0.47089672", "0.46726602", "0.46702158", "0.46567956", "0.4648992", "0.46380055", "0.45949122", "0.4593488", "0.45508027", "0.45508027", "...
0.55375236
0
evaluates built in if function by evaluating itext if condition is true. if condition is not true, and there was no elseBody return empty string, otherwise evaluate itext of elseBody
function HashtagIf(cond, thenBody, elseBody, env) { if(cond) { return evalInvocationText(thenBody, env); } else if(elseBody === null){ return ""; } else{ return evalInvocationText(elseBody, env); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doIf(template,env) {\n // We have 2 or 3 pieces to an if, so pull them out.\n var cond = template.targs;\n var thenpart = (cond!=null) ? cond.next : null;\n var elsepart = (thenpart!=null) ? thenpart.next : null;\n\n var condeval = (cond==null) ? \"\" : evalWML(cond.itext,env).trim();\n ...
[ "0.7512796", "0.71960276", "0.71960276", "0.703375", "0.6835425", "0.6805616", "0.6770868", "0.6699745", "0.663437", "0.64973444", "0.6461399", "0.64317274", "0.6414863", "0.6373943", "0.6339642", "0.63177747", "0.63106924", "0.62438166", "0.6230528", "0.6230528", "0.6215502"...
0.7367784
1
evaluates built in ifeq function by evaluating first itext (then body) if var1 and var2 are equal, or else body if they are not
function HashtagIfEq(var1, var2, thenBody, elseBody, env) { if (evalInvocationText(var1, env) === evalInvocationText(var2, env)) { return evalInvocationText(thenBody, env); } else { return evalInvocationText(elseBody, env); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EQ$operator(val1, val2) {\n if (val1 === $Dart$Null) {\n return val2 === $Dart$Null;\n } else if (typeof(val1) == typeof(val2) && typeof val1 != 'object') {\n // number, boolean, string\n return val1 === val2;\n } \n return val1.EQ$operator(val2);\n}", "function isEqual$2(a, b) {\n retur...
[ "0.6838106", "0.66436553", "0.6510786", "0.6471273", "0.6420725", "0.6322057", "0.631777", "0.631777", "0.631777", "0.631777", "0.6280737", "0.6280737", "0.6255817", "0.6231557", "0.6231557", "0.6231557", "0.6231557", "0.6225865", "0.6215168", "0.62064266", "0.61709076", "0...
0.73642004
0
evaluates zero or more targs. Each time a node is evaluated, checks if there is an itext. If there is, it evals that and adds it to what we are returning, then checks the next node in the ast to see if it is also a targ. If there are no targs, an empty string is returned.
function evalTemplateArgs(ast, env) { if (ast) { var result; if (ast.itext) { result = evalInvocationText(ast.itext, env); } var rest = evalTemplateArgs(ast.next, env); return result + rest; } else { return ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArgumentList(targs) {\n if(targs) {\n var list = getArgumentList(targs.next);\n list.unshift(targs.itext);\n return list;\n } else {\n return [];\n }\n }", "function getEffectiveCallArguments(node) {\n...
[ "0.5633068", "0.51225346", "0.5117204", "0.51055837", "0.507896", "0.50480026", "0.5019815", "0.4955332", "0.49422705", "0.49317417", "0.49133945", "0.4904017", "0.48978654", "0.4886744", "0.48844847", "0.48825705", "0.48661724", "0.48471522", "0.4840477", "0.4780363", "0.477...
0.59587055
0
evaluates one tparam. Looks for name of param (pname) using lookup from Q1. If param binding is found, checks if it is a string or a function (itext node) and returns the string or evaluates the node.
function evalTemplateParameters(ast, env) { var paramVal = lookup(ast.pname, env); if(isDefined(paramVal)) { if(typeof paramVal === "string") { return paramVal; } else if(paramVal.name === "itext") { return evalInvocationText(paramVal, env); } else { t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evalParameter(param,env) {\n var pname = param.pname.trim();\n var value;\n \n value = lookup(pname,env);\n if (value!==null)\n return value;\n // If we didn't find it, return the original syntax.\n return \"{{{\"+pname+\"}}}\";\n}", "function getParam(params, name)\n\t{\n\t\...
[ "0.66938716", "0.558795", "0.554566", "0.54189354", "0.5251379", "0.52489626", "0.5197521", "0.519349", "0.5087317", "0.5077756", "0.50564855", "0.5037048", "0.49619722", "0.4960691", "0.4960691", "0.49555433", "0.49319425", "0.49249956", "0.48963043", "0.48926553", "0.488743...
0.6570509
1
sliding function moves and resies orange line
function slidingline() { var paddingset = $('.slide-button-block[data-slide=3]').css('padding-left').replace(/[^-\d\.]/g, ''); if($('.slide-button-block.active').attr('data-slide') == 1) { var leftPosition = $('.slide-button-block.active')["0"].offsetLeft; } else { var leftPosition = $('.slide-button-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transition() {\n $carousel.css({ left: ( positions[currentPosition] * -1 ) });\n // Wraparound logic\n // Should refresh staging area\n var wraparound = false;\n console.log(currentPosition);\n if (currentPosition == 1) {\n currentPostion += numItems;\n...
[ "0.6281832", "0.6020056", "0.601388", "0.59518236", "0.59079975", "0.5879651", "0.5803167", "0.5763857", "0.57485056", "0.5738771", "0.5738771", "0.57188666", "0.5713384", "0.5692498", "0.5692399", "0.5690472", "0.56824845", "0.56518525", "0.5645334", "0.5608384", "0.56040657...
0.7059567
0
this method will compare and returns the most relevant ad + reason if exists
function getAd(urlAnalysis, adsAnalysisMap) { //map of (key = ad, value = {relevance, reason:{type, relevance, value}) const adsRelevanceMap = new Map(); let mostRelevantAd = null; adsAnalysisMap.forEach( function(adAnalysis, key) { let maxRelevantKeyword, maxRelevantEntity, maxRelevantConcept, maxRelevantTaxono...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getReasonInfo(abuseReportEl, reason) {\n return abuseReportEl.ownerGlobal.ABUSE_REPORT_REASONS[reason];\n }", "async deliverAdsWithPriority(adIds, allAdData) {\n // all ads with recorded impressions\n let impressions = await ClientAdInteractions_1.default.aggregate([\n {\n ...
[ "0.54276973", "0.53224975", "0.5237722", "0.5163715", "0.506794", "0.50542617", "0.5047273", "0.502425", "0.4983796", "0.49835846", "0.49648458", "0.49241558", "0.49183175", "0.49045905", "0.48972946", "0.48898646", "0.48696065", "0.48644793", "0.48644793", "0.48644793", "0.4...
0.6435546
0
"This is first method create in the application" defining a new function which checks current states of component then return a output if the value will be zero then it returns "zero" otherwise it returns value
formateCount() { const { value } = this.props.counter; return value === 0 ? "Zero" : value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCount() {\n return this.props.counter.value === 0 ? \"Zero\" : this.props.counter.value;\n }", "function calState(A, B, C, oA, oB) {\n if ( oA === 'empty' ) { return 1; }\n if ( oA !== 'empty' && B === 'empty' ) { return 2; }\n if ( oA !== 'empty...
[ "0.6087409", "0.59080213", "0.5877831", "0.58703125", "0.585068", "0.5824623", "0.58099", "0.57447445", "0.57359046", "0.5638975", "0.5588236", "0.55398905", "0.55364907", "0.54846007", "0.5482094", "0.546058", "0.5451663", "0.5444642", "0.5444642", "0.5442262", "0.5407877", ...
0.60180515
1
takes a URL and converts it to a form that can be submit, getting around the URL length limitation
function CreateFormFromUrl(url) { var tempForm = document.createElement("form"); tempForm.method = "POST"; tempForm.action = url.split('?')[0]; var qd = {}; if (url.includes('?')) { url.split('?')[1].split("&").forEach(function(item) { var s = item.split("="), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPostForm(url){\n let form = document.createElement('form');\n form.method = 'POST';\n form.action = url;\n form.target = 'iframe';\n document.body.appendChild(form);\n return form;\n}", "function submitAsPost(url) {\n var bodyTag = document.getElementsByTagName('body')[0];\n ...
[ "0.6362143", "0.63394517", "0.6301668", "0.6102396", "0.60696346", "0.6065687", "0.5990124", "0.593962", "0.5906043", "0.58732706", "0.5821303", "0.5802635", "0.5757086", "0.573967", "0.5734925", "0.5706414", "0.57060564", "0.5690876", "0.56806487", "0.56339747", "0.56133157"...
0.69561267
0
this sends some values to the parent windows FormValuesUpdated() function if there is one
function ParentWindowFormValuesUpdated(values, callbackItem) { if (window.parent != window && window.parent.FormValuesUpdated) window.parent.FormValuesUpdated(Json_FromString(values), callbackItem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_form(win) {\n\t\tvar f = win.form;\n\t\tvar diff = 'submitting ' + f.name + ':\\n';\n\t\tfor (var i = 0; i > f.elements.length; i++) {\n\t\t\tvar edit = document.getElementById('_ _pi_cell_value_text_' + i);\n\t\t\tif (edit && edit.value != f.elements[i].value) {\n\t\t\t\tdiff += f.elements[i].name...
[ "0.66663074", "0.66157746", "0.6547606", "0.6478915", "0.6464716", "0.6459208", "0.6361137", "0.6338721", "0.6337289", "0.63044953", "0.6281643", "0.623756", "0.6170686", "0.6158437", "0.6141122", "0.6131963", "0.61080056", "0.60890853", "0.60626394", "0.6053049", "0.60449183...
0.76847523
0
Fills the area array with tiles, and does basic mapmaking. Then, calls SetUpConnections() on each tile
function SetUpArea () { var i; var j; var k; for (i = 0; i < AREA_WIDTH; i++) { area.push(new Array()); for (j = 0; j < AREA_HEIGHT; j++) { area[i].push(new Tile(EMPTY, "", "#000000", i, j)); } } var wallStyle = "wall1"; var wallColor = "#B0B0B0" SetByRect(0, 0, AREA_WIDTH - 1, AREA_HEIGHT - 1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetUpArea () {\n\tvar i;\n\tvar j;\n\tvar k;\n\tfor (i = 0; i < AREA_WIDTH; i++)\n\t{\n\t\tarea.push(new Array());\n\t\t\n\t\tfor (j = 0; j < AREA_HEIGHT; j++)\n\t\t{\n\t\t\tarea[i].push(new Tile(EMPTY, \"\", \"#000000\", i, j));\n\t\t}\n\t}\n\tvar wallStyle = \"double\";\n\tvar wallColor = \"#B0B0B0\"\n\...
[ "0.6707925", "0.6668847", "0.6586276", "0.65233564", "0.64954466", "0.64695865", "0.6465475", "0.641059", "0.63892555", "0.6375469", "0.63537353", "0.6327203", "0.63260764", "0.63115495", "0.62528175", "0.62303257", "0.6215369", "0.61693275", "0.6159388", "0.61506903", "0.615...
0.6927674
0
Make a bunch of entities. Also, create promptMessage.
function SetUpEntities () { for (var i = 0; i < 100; i++) { if (entityList.length < 50) { var randX = Math.floor(Math.random() * AREA_WIDTH); var randY = Math.floor(Math.random() * AREA_HEIGHT); if (area[randX][randY].type == FLOOR && area[randX][randY].entities.length == 0) { NewRandomEntity(rand...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetUpEntities () {\n\t\n\tplayer = new Entity(\"Player\", \"player\", \"#00FFFF\", 17, 17);\n\tplayer.isClient = true;\n\tcameraX = player.x + 0.5;\n\tcameraY = player.y + 0.5;\n\t//cameraZ = player.z;\n\ttargetX = player.x + 0.5;\n\ttargetY = player.y + 0.5;\n\t//targetZ = player.z;\n\tpromptMessage = ne...
[ "0.6836224", "0.6137373", "0.5871245", "0.5820453", "0.57957923", "0.57234824", "0.5710038", "0.5701181", "0.56874037", "0.56832147", "0.56767786", "0.56645125", "0.56608224", "0.55643725", "0.5562691", "0.55248195", "0.55091643", "0.5507937", "0.54924214", "0.5484593", "0.54...
0.6274933
1
Set one specific tile with a solidity, symbol, and color
function SetTile (X, Y, type, tileset, color) { if (!CheckBounds(0, AREA_SIZE - 1, [X, Y])) { console.log("SetTile() Failed: limits"); return; } /*if (symbol.length != 1) { console.log("SetTile() Failed: symbol too long/short"); return; }*/ var curTile = area[X][Y]; curTile.type = type; curTile.tileset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetTile (X, Y, type, tileset, color) {\n\tif (!CheckBounds(0, AREA_SIZE - 1, [X, Y]))\n\t{\n\t\tDebug(\"SetTile() Failed: limits\");\n\t\treturn;\n\t}\n\t/*if (symbol.length != 1)\n\t{\n\t\tDebug(\"SetTile() Failed: symbol too long/short\");\n\t\treturn;\n\t}*/\n\tvar curTile = area[X][Y];\n\tcurTile.type...
[ "0.7238472", "0.62565666", "0.6185119", "0.6173946", "0.607827", "0.6067885", "0.60290897", "0.598668", "0.5982389", "0.5975484", "0.5963232", "0.5929837", "0.5925609", "0.5890183", "0.5851189", "0.58389354", "0.583521", "0.5807368", "0.58018464", "0.57738745", "0.5771237", ...
0.74751216
0
Test if all of an array of numbers are within a range Inclusive is okay (4 is within the bounds of 4 to 8) True if within the limits
function CheckBounds (botLimit, topLimit, testArray) { for (var i = 0; i < testArray.length; i ++) { if (testArray[i] < botLimit || testArray[i] > topLimit) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arr(min,target,max){\n if(target >= min && target <= max){\n return true; \n } else {\n return false;\n }\n}", "function checkArea(arr) {\n return arr.every(elem => elem >= 10);\n}", "function checkAllCorrectRanges (arr) {\n for (var i = 0; i < arr.length; i++) {\n ...
[ "0.7348378", "0.7333751", "0.7289404", "0.71560764", "0.68232864", "0.6735337", "0.6733527", "0.67037034", "0.6685451", "0.6663155", "0.66624093", "0.66570336", "0.6650951", "0.6638371", "0.6634184", "0.6614908", "0.66104776", "0.6579748", "0.6532548", "0.6526466", "0.6525417...
0.73952013
1
Test if a color is valid for use. ( "123456" format)
function ColorValid (color) { //I didn't make this //http://stackoverflow.com/questions/8027423/how-to-check-if-a-string-is-a-valid-hex-color-representation var test = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(color); if (test) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidColor(color) {\n return color.search(/^[0-9a-f]{6}$/i) > -1;\n }", "isValidColor(color) {\n return (/^#([0-9A-F]{3}){1,2}$/i.test(color));\n }", "function isValidColor(color) {\n return /^[0-9A-F]{6}$/i.test(color);\n}", "function validateColorField(value) {\n\tvar rege...
[ "0.8298377", "0.8175731", "0.81473774", "0.79969615", "0.79401946", "0.7910195", "0.7834898", "0.7834898", "0.78141624", "0.77906984", "0.769359", "0.7546569", "0.7474707", "0.7456049", "0.7416196", "0.73734003", "0.73660344", "0.73095816", "0.7302851", "0.72984004", "0.70950...
0.8354943
1
entity and next path tile > key to simulate press
function PathToKeyMove (entity, tile) { if (entity.x == tile.x) { if (entity.y - 1 == tile.y) { return "w"; } if (entity.y + 1 == tile.y) { return "s"; } } if (entity.y == tile.y) { if (entity.x - 1 == tile.x) { return "a"; } if (entity.x + 1 == tile.x) { return "d"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyPressed() {}", "press(e) {\n var key = this.fromCharCode(e.keyCode);\n var targetMap = this.keyMap[this.currentTamplate];\n if(targetMap!=undefined) {\n var call = targetMap[key.toUpperCase()];\n if(call!=undefined) {\n e.preventDefault();\n eventManager.dispatch(call...
[ "0.6505204", "0.64000505", "0.6396529", "0.6396529", "0.637987", "0.63710654", "0.6359341", "0.63410294", "0.6306716", "0.6300024", "0.6286915", "0.6261511", "0.623867", "0.62037575", "0.6164895", "0.61631995", "0.6154278", "0.61498165", "0.61350286", "0.61199", "0.61192566",...
0.6747771
1
Try moving an entity, with a normal step
function EntityMove (entity, x, y) { if (!(((x == 1 || x == -1) && y == 0) || ((y == 1 || y == -1) && x == 0))) { return false; // Entities can only move by one space, orthogonally } var ex = entity.x; var ey = entity.y; if (!CheckBounds(0, AREA_SIZE - 1, [ex + x, ey + y])) { return false; } if (area[ex ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "runExactMove()\n {\n const targetPos = new RoomPosition(this.memory.targetPos.x,\n this.memory.targetPos.y,\n this.memory.targetPos.roomName);\n\n if (this.instance.pos === targetPos)\n {\n this.c...
[ "0.6820768", "0.6701876", "0.6681438", "0.6537275", "0.65216124", "0.64677495", "0.64547753", "0.64535826", "0.64419705", "0.6399483", "0.6398652", "0.6366185", "0.6343966", "0.6325339", "0.6323244", "0.63146895", "0.6293857", "0.62883735", "0.6277559", "0.6270071", "0.626305...
0.7018606
1
Actually move an entity to a location. (Assumes new position is valid) (Updates tile content data correctly)
function ChangePosition (entity, newX, newY) { if (!CheckBounds(0, AREA_SIZE - 1, [newX, newY])) { console.log("ChangePosition failed: outside bounds"); return; } var prevTile = area[entity.x][entity.y]; var newTile = area[newX][newY]; var index = prevTile.entities.indexOf(entity); if (index == -1) { con...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ChangePosition (entity, newX, newY)\n{\n\tif (!CheckBounds(0, AREA_SIZE - 1, [newX, newY]))\n\t{\n\t\tDebug(\"ChangePosition failed: outside bounds\");\n\t\treturn;\n\t}\n\n\tvar prevTile = area[entity.x][entity.y];\n\tvar newTile = area[newX][newY];\n\tvar index = prevTile.entities.indexOf(entity);\n\tif...
[ "0.7389081", "0.6801351", "0.67396104", "0.6669001", "0.6665845", "0.65324545", "0.6480163", "0.6365544", "0.6363097", "0.63493", "0.6309102", "0.62890697", "0.6262904", "0.6211828", "0.6198314", "0.61878955", "0.6171045", "0.6142282", "0.6142105", "0.6112796", "0.6063202", ...
0.7544856
0
Pathfinding sets an entity's path array to a list of tiles to move to. Also sets the entity's foundPath value Based on pseudocode from
function FindPath (entity, destination) { //return; //Pathfinding var closedSet = []; var openSet = [new PathNode(area[entity.x][entity.y], destination, 0, null)]; var cameFrom = []; while (openSet.length > 0) { openSet.sort(SortNodes); var current = openSet[0]; if (current.tile == destination) { var p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FindPath (entity, destination) {\n\t//return; //Pathfinding\n\tvar closedSet = [];\n\tvar openSet = [new PathNode(area[entity.x][entity.y], destination, 0, null)];\n\tvar cameFrom = [];\n\twhile (openSet.length > 0)\n\t{\n\t\topenSet.sort(SortNodes);\n\t\tvar current = openSet[0];\n\t\tif (current.tile ==...
[ "0.6993894", "0.6643448", "0.63768655", "0.60372543", "0.6034966", "0.6034002", "0.6034002", "0.6030534", "0.59232575", "0.5915129", "0.589666", "0.5876836", "0.5832398", "0.57731587", "0.5753016", "0.57505006", "0.573222", "0.5725931", "0.5715359", "0.56807536", "0.5651285",...
0.7037011
0
Return an index if there the tile is already in the array, 1 otherwise
function CheckForDuplicate (array, newNode) { var newTile = newNode.tile; for (var i = 0; i < array.length; i++) { var oldTile = array[i].tile; if (oldTile == newTile) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForExistentTiles(x, y) {\n for (var i = 0; i < tiles.length; i++) {\n if (tiles[i].x == x && tiles[i].y == y) {\n return i;\n }\n }\n return -1;\n}", "function Locate(tile){for(i in M)if(M[i]==tile)return+i}", "function containsDuplicate(array) {\n let map = new Map();\n for (...
[ "0.7195411", "0.6729443", "0.6545734", "0.6353369", "0.6299171", "0.6273077", "0.62519956", "0.6236273", "0.6233476", "0.6221163", "0.6216641", "0.6159726", "0.61487997", "0.6134706", "0.6098576", "0.6098576", "0.60818976", "0.60778344", "0.60574377", "0.604775", "0.604775", ...
0.80320495
1
Add a node to an array but only if there is no lower cost node already present If there is one, replace it if the new one has a lower cost
function AddNodeWithoutDuplicate (array, newNode) { var newTile = newNode.tile; for (var i = 0; i < array.length; i++) { var oldTile = array[i].tile; if (oldTile == newTile) { if (array[i].cost > newNode.cost) { array.splice(i, 1); array.push(newNode); } return; } } array.push(newNod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(weight, data) {\n let node = new Node(weight, data);\n this.allNodes.push(node);\n let size = this.allNodes.length;\n let current = size - 1;\n let parentIndex = Math.floor((current - 1) / 2);\n this.nodePosition[node.data] = current;\n while (parentIndex >= 0) {\n let parentNode = th...
[ "0.65890676", "0.6254023", "0.6053542", "0.5676539", "0.5600886", "0.55920905", "0.5585716", "0.5540668", "0.5522115", "0.546402", "0.5441107", "0.54151344", "0.5400151", "0.53757286", "0.536915", "0.53482443", "0.5319832", "0.5302325", "0.53018916", "0.5291142", "0.5277562",...
0.70163596
1
Sorting function for nodes, sorting by cost + distance estimate
function SortNodes (a, b) { return (a.cost + a.distEst) - (b.cost + b.distEst); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortNodesByDistance(unvisitedNodes) {\n unvisitedNodes.sort((nodeA, nodeB) => nodeA.distance - nodeB.distance);\n }", "function sortNodesByDistance(unvisitedNodes) {\n unvisitedNodes.sort((nodeA, nodeB) => nodeA.distance - nodeB.distance);\n}", "function sortNodesByDistance(unvisitedNodes) {\n ...
[ "0.70376796", "0.69956356", "0.69925135", "0.69250226", "0.67457306", "0.6379436", "0.6218656", "0.62034756", "0.6186448", "0.6159805", "0.60935587", "0.60801136", "0.6075376", "0.6060132", "0.6022884", "0.600153", "0.59264976", "0.58187926", "0.5809202", "0.57940435", "0.576...
0.7864645
1
Go through all the effects
function ProcessEffects () { for (var i = 0; i < effectList.length; i++) { var effect = effectList[i]; effect.delay --; if (effect.delay <= 0) { effect.delay = effect.MAX_DELAY; effect.imageList.shift(); if (effect.imageList.length == 0) { //layerList[effect.z].eNeedsUpdate = true; //layer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawSetup()\n {\n let effect;\n \n for (effect of this.effects) {\n if (!effect.show) continue;\n effect.setupOK=effect.drawSetup();\n }\n }", "runEffects(state, block, context) {\n const { actions, blockInfo } = block;\n for (const action of ...
[ "0.67811567", "0.672633", "0.66915464", "0.6599384", "0.6593142", "0.64489627", "0.64206916", "0.6414066", "0.6399161", "0.639905", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.63607234", "0.6...
0.6802512
1
Blend two colors together. weight is 1 if completely color2, 0.5 if halfway between 1 and 2
function BlendColors (color1, color2, weight) { //console.log(color2); //console.log(player.color); var r1 = parseInt(color1.slice(1, 3), 16); var g1 = parseInt(color1.slice(3, 5), 16); var b1 = parseInt(color1.slice(5, 7), 16); var r2 = parseInt(color2.slice(1, 3), 16); var g2 = parseInt(color2.slice(3, 5), 16)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BlendColors (color1, color2, weight)\n{\n\t//Debug(color2);\n\t//Debug(player.color);\n\tvar r1 = parseInt(color1.slice(1, 3), 16);\n\tvar g1 = parseInt(color1.slice(3, 5), 16);\n\tvar b1 = parseInt(color1.slice(5, 7), 16);\n\tvar r2 = parseInt(color2.slice(1, 3), 16);\n\tvar g2 = parseInt(color2.slice(3,...
[ "0.83545303", "0.7722703", "0.7601824", "0.6822415", "0.6815221", "0.68091196", "0.6770105", "0.66654396", "0.6652055", "0.662487", "0.6595037", "0.6564188", "0.6514173", "0.64961565", "0.64559287", "0.6454367", "0.64454675", "0.638349", "0.632716", "0.62903005", "0.62893564"...
0.8169921
1
Draw a text box, given a message. Does fade out stuff
function DrawTextBox (message) { SetColor("#000000"); var mColor = (message.glow && message.glowColor) ? BlendColors(message.color, message.glowColor, Math.random()) : message.color; ctx.strokeStyle = mColor; var alpha; if (message.fade > 0) { alpha = 1; } else { alpha = Math.max(0, (1 + (message.fade) * 0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMessage(text) {\n stage.removeChild(text_message);\n stage.removeChild(ScreenText);\n stage.removeChild(t2);\n text_message = new createjs.Text(text, \"20px Trirong serif\", \"#346D80\");\n text_message.outline = 3;\n text_message.textBaseline = \"alphaba\";\n t2 = text_message...
[ "0.7043984", "0.6985202", "0.68685377", "0.68676263", "0.6831073", "0.68284285", "0.67935425", "0.6757779", "0.6752531", "0.6747544", "0.6711111", "0.67090076", "0.66319835", "0.6615447", "0.6605284", "0.6595726", "0.65888244", "0.6573622", "0.6526684", "0.6518788", "0.648877...
0.81972384
1
Determines the X position on the screen for an entity
function EntityScreenX (entity) { return 315 + (entity.x - cameraX) * 30;// * (50 - entity.z + cameraZ) * 0.6; // 0.6 is 30/50 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getX() {\n return this.position.x;\n }", "function GetPosX()\n\t{\n\t \treturn pos.X;\n\t}", "GetEntityPosition( entity ) { \n\t\treturn entity.pos;\n\t}", "function getPositionX(){\r\n return Math.random()*(screenWidth - 150);//trapezoid takes more place to be drawn\r\n }", "getXPositi...
[ "0.71585613", "0.7140567", "0.69712794", "0.6891771", "0.67999715", "0.672131", "0.6701604", "0.66409093", "0.6606468", "0.6592926", "0.654966", "0.654966", "0.651861", "0.6497718", "0.64747727", "0.64738303", "0.64738303", "0.6466078", "0.6452765", "0.64310235", "0.640434", ...
0.7605446
1
Determines the Y position on the screen for an entity
function EntityScreenY (entity) { return 315 + (entity.y - cameraY) * 30;// * (50 - entity.z + cameraZ) * 0.6; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getY() {\n return this.position.y;\n }", "get y() {\n return this.__Internal__Dont__Modify__.position.y - (this.__Internal__Dont__Modify__.height / 2);\n }", "worldPosY(y) {\n return (y / this.scaleY) - this.offY;\n }", "get y() { return this.position.y; }", "get y() { return ...
[ "0.7056884", "0.7050602", "0.6955149", "0.69288605", "0.69288605", "0.6791554", "0.6790582", "0.67768455", "0.67768455", "0.6768655", "0.67420787", "0.67345625", "0.67290676", "0.66926605", "0.66719824", "0.6540648", "0.6485744", "0.6483569", "0.64765406", "0.64715505", "0.64...
0.8187437
1
Determines the tile number (tileset position) to use, based on the surrounding tiles.
function GetTileNumber(tile) { var t = tile.type; if (t == EMPTY || t == OTHER) { tile.tNumber = 0; return; } var x = tile.x; var y = tile.y; if (t == FLOOR) { var tNumA = MtTyp(x, y-1, t, 1) + MtTyp(x+1, y-1, t, 2) + MtTyp(x+1, y, t, 4) + MtTyp(x+1, y+1, t, 8) + MtTyp(x, y+1, t, 16) + MtTyp(x-1, y+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNeerestTileNum(){\n\t\tvar innerPos = -getInnerPos();\n\t\tvar numTiles = getNumTilesInSpace(innerPos);\n\t\tvar tile1Pos = g_functions.getElementSize(getTile(numTiles)).left;\n\t\tvar tile2Pos = g_functions.getElementSize(getTile(numTiles+1)).left;\n\t\t\t\t\n\t\tif(Math.abs(tile1Pos - innerPos) < Mat...
[ "0.71138674", "0.69109964", "0.6542434", "0.6507268", "0.6429182", "0.6407734", "0.64062923", "0.62948275", "0.62033653", "0.6163628", "0.60806364", "0.6068618", "0.596974", "0.59365714", "0.5917266", "0.59122604", "0.58795226", "0.5848099", "0.58068573", "0.57907134", "0.576...
0.72832316
1
sends the tweet data to the server on success calls on the loadTweets function
function saveTweet(data) { $.ajax({ url: '/tweets', method: 'POST', data: data, success: function(data) { loadTweets(); $('textarea').val(""); $(".counter").text("140"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTweets() {\n $.ajax({\n url: '/tweets',\n method: 'GET',\n success: function (tweetsArray) {\n //console.log('Success POST : ', tweetsArray);\n renderTweets(tweetsArray);\n }\n });\n }", "function loadTweets() {\n $.ajax({\n url: '...
[ "0.74065363", "0.71564436", "0.7144295", "0.70873654", "0.7036661", "0.7003752", "0.6995388", "0.6960248", "0.6954372", "0.69228125", "0.6885513", "0.6853721", "0.68271244", "0.68220675", "0.67809194", "0.6776465", "0.6768375", "0.67521256", "0.6741376", "0.6739884", "0.67342...
0.7187876
1
MinIO Javascript Library for Amazon S3 Compatible Cloud Storage, (C) 2015 MinIO, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, softwa...
function promisify(fn) { return function () { var _this = this; // If the last argument is a function, assume its the callback. var callback = arguments[arguments.length - 1]; // If the callback is given, don't promisify, just pass straight in. if (typeof callback === 'function') return fn.apply(thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function promisify(func, self = func) {\n return function() {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line prefer-rest-params\n func.call(self, ...arguments, function(err, data) {\n err ? reject(err.message) : resolve(data);\n });\n });\n };\n}", "functi...
[ "0.55909866", "0.55280346", "0.5437884", "0.54315007", "0.5408051", "0.5361777", "0.5318169", "0.5267889", "0.5265995", "0.5258037", "0.5241946", "0.52266514", "0.5172645", "0.5157841", "0.51576096", "0.515746", "0.5149888", "0.51308995", "0.5126753", "0.51167905", "0.5113966...
0.5884968
1
For example: probeContentType('file.png') returns 'image/png'.
function probeContentType(path) { var contentType = _mimeTypes.default.lookup(path); if (!contentType) { contentType = 'application/octet-stream'; } return contentType; } // isValidPort - is input port valid.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetMemeType(filename) {\n\n var ext = filename.split('.').pop();\n\n switch (ext.toLowerCase()) {\n case \"txt\":\n return \"text/plain\";\n case \"pdf\":\n return \"application/pdf\";\n case \"doc\":\n return \"application/vnd.ms-word\";\n ...
[ "0.68023944", "0.6771748", "0.67294383", "0.67235076", "0.67235076", "0.6689475", "0.6685499", "0.6685499", "0.6685499", "0.66813177", "0.66512465", "0.66235805", "0.65593815", "0.6544109", "0.6521497", "0.6487007", "0.64478576", "0.6444885", "0.6443409", "0.64200354", "0.640...
0.7065579
1
pipesetup will also make sure that error emitted at any of the upstream Stream will be emitted at the last stream. This makes error handling simple
function pipesetup() { for (var _len = arguments.length, streams = new Array(_len), _key = 0; _key < _len; _key++) { streams[_key] = arguments[_key]; } return streams.reduce(function (src, dst) { src.on('error', function (err) { return dst.emit('error', err); }); return src.pipe(dst); });...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test(err) {\n console.log('########### Starting Pipe flow ' + ((err == 1) ? 'with' : 'without') + ' error ###########');\n let pkg = (new Package()).init({\n step: 0,\n msg: 'Initial state'\n });\n let PipelineFlow = new Pipeline(pkg);\n PipelineFlow\n .pipe(new Step(1, '--> First step msg')...
[ "0.64945745", "0.647197", "0.6468702", "0.6404671", "0.6404671", "0.6404671", "0.6340956", "0.6333522", "0.6324563", "0.62958676", "0.62958676", "0.62958676", "0.62958676", "0.62958676", "0.62958676", "0.62958676", "0.6294427", "0.6294427", "0.6294427", "0.6294427", "0.629442...
0.7496913
1
getS3Endpoint get relevant endpoint for the region.
function getS3Endpoint(region) { if (!(0, _helpers.isString)(region)) { throw new TypeError(`Invalid region: ${region}`); } var endpoint = awsS3Endpoint[region]; if (endpoint) { return endpoint; } return 's3.amazonaws.com'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "endpoint(callback) {\n let isOGS3 = region === 'us-east-1'\n let domain = isOGS3 ? `https://s3.amazonaws.com/` : `https://s3-${region}.amazonaws.com/`\n let bucket = getBucket(env, arc.static)\n callback(null, `${domain}${bucket}`)\n }", "getEndpoint(endpoint) {\r\n if (!endpoint.st...
[ "0.62013435", "0.57110906", "0.56519014", "0.56519014", "0.5646153", "0.5509459", "0.547831", "0.5401524", "0.5384744", "0.53619576", "0.5361452", "0.5276915", "0.5254307", "0.52409774", "0.51702964", "0.5105334", "0.5022904", "0.5016532", "0.5002589", "0.49759585", "0.496508...
0.80324566
1
and emits suitable Javascript objects. Parses CopyObject response.
function getCopyObjectTransformer() { return getConcater(xmlParsers.parseCopyObject); } // Parses listBuckets response.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processCopy(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_rqst_no\", value: v_global.logic.key },\n { name: \"arg_user_id\", value: gw_com_module.v_Session.USR_ID }\n ]\n },\n t...
[ "0.5644178", "0.5633926", "0.5630553", "0.562129", "0.55913216", "0.5536884", "0.5478227", "0.5478227", "0.5417152", "0.5376029", "0.5331645", "0.5309951", "0.5246408", "0.52082354", "0.5191322", "0.5169345", "0.5165943", "0.515054", "0.5121486", "0.5121486", "0.510664", "0...
0.6705477
1
this function adds up the five highest paying years the user enters
function highestAnnualSalaryAddedUp() { return highestAnnualSalary_1 + highestAnnualSalary_2 + highestAnnualSalary_3 + highestAnnualSalary_4 + highestAnnualSalary_5 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateYears(principal, interest, tax, desired) {\n // your code\n var years = 0;\n while(principal < desired){\n principal += (principal * interest) * (1 - tax);\n years++;\n }\n return years;\n}", "function calculateYears(principal, interest, tax, desired) {\n // your cod...
[ "0.66038543", "0.6601203", "0.65621895", "0.65324306", "0.65228796", "0.63927174", "0.6372623", "0.63617253", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.6233843", "0.62209153", "0.6169175", "0.6151076", "0.614398...
0.67018366
0
HINT. YOU'RE GOING TO USE parseInt() function OR isNaN() EX. "a3b2c1d3" => "aaabbcddd" // THUR / String: Rotate String Create a standalone function that accepts a string and an integer, and rotates the characters in the string to the right by that given integer amount.
function rotateString(string, n){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotate(string, num){\n function rotate(string, num){\n var temp = ''\n for(i = 0; i<string.length-num; i++){\n temp += string[i];\n }\n for(i =string.length-1; i >string.length-num-1; i--){\n temp = string[i] + temp;\n }\n return temp\n ...
[ "0.8125383", "0.8121199", "0.7858703", "0.7840229", "0.78315914", "0.781656", "0.75989294", "0.7246643", "0.7124623", "0.7038108", "0.69633037", "0.6910901", "0.69082874", "0.6818392", "0.68045944", "0.67967546", "0.67712474", "0.67387056", "0.6716063", "0.6696146", "0.666287...
0.81959635
1
FRI / Given a string, return the first nonrepeating character within string EX. "stress" => "t" EX. "moonmen" => "e"
function firstNonRepeatingChar(string){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstNotRepeatingCharacter(s) {\r\n let c='';\r\n for (let i = 0; i < s.length; i++) {\r\n c=s.charAt(i);\r\n if (s.indexOf(c)==i && s.indexOf(c,i+1) ==-1)return c;\r\n }\r\n return ;\r\n}", "function firstNonRepeatingLetter(str) {\n let temp = str.toLowerCase();\n for (let i...
[ "0.7835564", "0.78297216", "0.7660327", "0.7620118", "0.7618178", "0.75286096", "0.7343896", "0.73148733", "0.72752285", "0.72714704", "0.72548854", "0.72388196", "0.72158617", "0.72109777", "0.7113374", "0.70821464", "0.70450664", "0.704398", "0.7013111", "0.7002046", "0.698...
0.80904734
0
doReturn( ?value, ...extraValues ) >> thisTab if 'this' is not a Tab object then 'thisTab' is a newly constructed Tab
function doReturn(value) { // jshint validthis: true, unused: false var thisTab = this; // construct a new tab when none provided if (!(thisTab instanceof Tab)) { thisTab = Tab.construct(); } // throw when this tab is cancelled if (thisTab._cancelled) { throw thisTab._values[0].valueOf(); } /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tab() {\n\t\tif (this instanceof Tab) {\n\t\t\treturn Tab.construct.apply(this, arguments);\n\t\t}\n\t\telse {\n\t\t\treturn Tab.convert.apply(this, arguments);\n\t\t}\n\t}", "function Tab() {\n\t\tif (this instanceof Tab) {\n\t\t\treturn Tab.construct.apply(this, arguments);\n\t\t}\n\t\telse {\n\t\t\tr...
[ "0.5154501", "0.5154501", "0.51112723", "0.50714016", "0.50440806", "0.5014366", "0.4957672", "0.4910942", "0.49098048", "0.4890503", "0.4880758", "0.48353508", "0.48353437", "0.48353437", "0.4794264", "0.47222576", "0.47202688", "0.4712071", "0.4697016", "0.4692412", "0.4687...
0.77510893
0
doThrow( ?error, ...extraValues ) >> thisTab if 'this' is not a Tab object then 'thisTab' is a newly constructed Tab
function doThrow(error) { // jshint validthis: true, unused: false var thisTab = this; // construct a new tab when none provided if (!(thisTab instanceof Tab)) { thisTab = Tab.construct(); } // throw when this tab is cancelled if (thisTab._cancelled) { throw thisTab._values[0].valueOf(); } //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thisThrows() {\n throw \"Error\";\n}", "function Foo(do_throw) {\n if (do_throw) throw new Error(\"get me outta here\");\n}", "addTab(tab, onClick) {\n // noop\n }", "function tabErrorNotifier()\n{\n try\n {\n var errMsg = \"\";\n var tabColumnIDs = retrieveTabColumnIDs();\...
[ "0.56413937", "0.558681", "0.55397683", "0.53246695", "0.5259197", "0.5200155", "0.51759195", "0.5160516", "0.51527214", "0.5114842", "0.51009214", "0.5032113", "0.50319934", "0.5030621", "0.50218093", "0.50218093", "0.50218093", "0.50218093", "0.50218093", "0.4997361", "0.48...
0.72061
0
threePost Template view for three random posts
function threePost(data, target) { // Wrapper for the component let postContainer = document.createElement("div"); postContainer.className = "threePost"; // Body of the component data.forEach((el, i) => { let anchor = document.createElement("a"); anchor.className = `flowtow flowtow-${i + 1}`; anc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function threeRandomPics() {\n noPatterns();\n for (var i=0; i< threeImages.length;i++){\n threeImages[i].src = allItems[currentItemlist[i]].filepath;\n threeImages[i].alt = allItems[currentItemlist[i]].name;\n threeImages[i].title = allItems[currentItemlist[i]].name;\n ...
[ "0.61796826", "0.57844573", "0.56604713", "0.5647658", "0.55689883", "0.55689883", "0.5537053", "0.55147177", "0.55116093", "0.55055344", "0.53930753", "0.53748286", "0.5361798", "0.5357438", "0.53447723", "0.53447026", "0.53437096", "0.5337525", "0.5335388", "0.5334079", "0....
0.66449517
0
tenRecentPost Template view for the most ten recent posts
function tenRecentPost(data, target) { // Wrapper for the component let container = document.createElement("div"); container.className = "rePost"; // Title of the component let title = document.createElement("h2"); title.className = "rePost-title"; title.innerHTML = "Recent Posts"; container.appendChil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOlderPosts() {\n var currentPosts = ShowListModel.postsWrapper.posts;\n Posts.getPosts({\n category: 'SHOW-POST',\n sort: 'id DESC',\n limit: 10,\n olderThan: currentPosts[currentPosts.length - 1] && currentPosts[currentPosts.length - 1].id,\n populates: 'ph...
[ "0.65930486", "0.59694433", "0.59163964", "0.5877999", "0.58347255", "0.5666047", "0.56191015", "0.55273634", "0.5526161", "0.54973114", "0.5492583", "0.5433379", "0.54096043", "0.539041", "0.5357678", "0.53005993", "0.5283282", "0.5272448", "0.5271145", "0.525905", "0.525864...
0.6653818
0
tenPopularPost Template for the most ten popular post
function tenPopularPost(data, target) { // A wrapper for the whole component let container = document.createElement("div"); container.className = "poPost"; // Title of the component let title = document.createElement("h2"); title.className = "poPost-title"; title.innerHTML = "Popular Posts"; container....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tenRecentPost(data, target) {\n // Wrapper for the component\n let container = document.createElement(\"div\");\n container.className = \"rePost\";\n\n // Title of the component\n let title = document.createElement(\"h2\");\n title.className = \"rePost-title\";\n title.innerHTML = \"Recent Posts\";...
[ "0.60775787", "0.59006846", "0.57401127", "0.5653804", "0.55324125", "0.55284315", "0.5512291", "0.54801327", "0.54558796", "0.54555", "0.541297", "0.5412694", "0.5402474", "0.53908926", "0.5379079", "0.53747386", "0.53688604", "0.5361515", "0.53600585", "0.5354086", "0.53470...
0.6553808
0
Link: NOTES written before solving problem: FRONT: Page 1, no flip Page 2 & 3, flip 1 page Page 4 & 5, flip 2 pages Page 6 & 7, flip 3 pages BACK: Page 6 & 7, no flip Page 4 & 5, flip 1 pageMath.floor(p / 2) = |2 3| = 1 Page 2 & 3, flip 2 pageMath.floor(p / 2) = |1 3| = 2 Page 1, flip 3 pages 7 / 2 = 3.5Greater than (o...
function pageCount(n, p) { if (p === 1 || p === n || (p === n - 1 && n % 2 !== 0) ) return 0; if ( p <= Math.floor(n / 2) ) { console.log("FRONT"); return Math.floor(p / 2); } else { console.log("BACK"); return Math.abs(Math.floor(p / 2) - Math.floor(n / 2)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solve(n, p){\n const book = generateBook(n),\n pageTurns = [-1, -1];\n\n // Front side\n for (let i = 0; i < book.length; i++) {\n if (~book[i].indexOf(p)) {\n pageTurns[0] = i;\n break\n }\n }\n\n // Back side\n for (let i = book.length - 1; ...
[ "0.65701884", "0.64717484", "0.6359625", "0.625374", "0.6225365", "0.6218546", "0.61273366", "0.607886", "0.59856", "0.58965975", "0.584755", "0.57932025", "0.56823766", "0.56355214", "0.5606991", "0.5560761", "0.5558167", "0.5545071", "0.55066544", "0.5505584", "0.5494128", ...
0.6563807
1
======= ======= ======= Sequencer ======= ======= =======
function Sequencer() { console.log('Sequencer'); this.name = "Sequencer"; this.currentGameState = "doTheMath"; this.gameStatesArray = ["splash", "login", "saveStart", "deal", "bet", "playGame", "turnOver", "hitDealer", "doTheMath"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Sequencer() {\n\tthis.grid = new Grid(this.defineGridSize())\n\tthis.audio = new AudioHandler(this.grid.sounds.getFileNames())\n\tthis.direction = 'col'\n\tthis.speed = 400\n\tthis.minSpeed = 100\n\tthis.maxSpeed = 800\n\tthis.speedStep = 50\n\tthis.loopId = null\n\tthis.iteration = 0\n\tthis.isPlaying = ...
[ "0.6691826", "0.64374894", "0.5609718", "0.5591002", "0.5548404", "0.54920936", "0.54829043", "0.54669666", "0.54229367", "0.54196465", "0.5393733", "0.5374572", "0.5312371", "0.5271009", "0.5257439", "0.523663", "0.52295566", "0.5224193", "0.52211976", "0.5199837", "0.516900...
0.67152107
0
This service provides the list of menus available per restaurant
async function GetRestMenus(id) { try { const response = await axios.get(`${process.env.REACT_APP_API_BASE_URL}/restaurant/${id}/menus/`); return response.data.menus; } catch (error) { console.error(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getMenus() {\r\n return menuController.getMenus();\r\n }", "function GetAllMenuItems(req, res, next) {\n const { knex } = req.app.locals;\n knex\n .select('*')\n .from('menu_items')\n .then(data => res.status(200).json(data))\n .catch(error => res.status(500).json(erro...
[ "0.6741649", "0.657999", "0.6567727", "0.64506775", "0.6404431", "0.61618537", "0.61362827", "0.60943544", "0.604665", "0.6032366", "0.60203546", "0.59936094", "0.5992742", "0.59866345", "0.5975761", "0.5969712", "0.59413725", "0.5934178", "0.59240806", "0.59240806", "0.59116...
0.6631271
1
Apply the final computation steps to the intermediate value `hash` to form the final result of the MurmurHash 3 hash function.
function finish(hash, numberOfWords) { hash = hash ^ numberOfWords * 4; hash = hash ^ hash >>> 16; hash = Math.imul(hash, 0x85EBCA6B); hash = hash ^ hash >>> 13; hash = Math.imul(hash, 0xC2B2AE35); hash = hash ^ hash >>> 16; return hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finish(hash, numberOfWords) {\r\n hash = hash ^ (numberOfWords * 4);\r\n hash = hash ^ (hash >>> 16);\r\n hash = Math.imul(hash, 0x85EBCA6B);\r\n hash = hash ^ (hash >>> 13);\r\n hash = Math.imul(hash, 0xC2B2AE35);\r\n hash = hash ^ (hash >>> 16);\r\n retur...
[ "0.695711", "0.6948662", "0.6484533", "0.6281322", "0.6260686", "0.62412804", "0.617105", "0.61659795", "0.5916765", "0.59133786", "0.59133786", "0.59108347", "0.59108347", "0.5861738", "0.58309", "0.58309", "0.5826142", "0.5816319", "0.5816319", "0.580896", "0.5805214", "0...
0.69756144
0
Function to hash a string. Based on the implementation found here:
function hashString(str) { var len = str.length; if (len === 0) { return 0; } var hash = 0; for (var i = 0; i < len; i++) { var c = str.charCodeAt(i); hash = (hash << 5 >>> 0) - hash + c; hash |= 0; } return hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringHash(str) {\n\t var value = 5381;\n\t var i = str.length;\n\t while (i) {\n\t value = (value * 33) ^ str.charCodeAt(--i);\n\t }\n\t return (value >>> 0).toString(36);\n\t}", "function StringToHash (s){\n return s.split(\"\").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);...
[ "0.8140541", "0.80165756", "0.80078775", "0.8002399", "0.7985797", "0.79777664", "0.7949034", "0.79313684", "0.7887815", "0.7884785", "0.7884785", "0.78647935", "0.7861589", "0.7855065", "0.7806612", "0.77987325", "0.77697045", "0.7761368", "0.774852", "0.77276194", "0.769360...
0.81939006
0
Returns node before but one the value
getOneNodeBefore (value, comparator) { let pointer = this.head, prev = this.head, found = false; if (value) { for(;pointer.next; prev = pointer, pointer = pointer.next) { if(comparator(pointer.value, value)) { found = true; break; } } }else{ prev = getLastButOneNode(); } if(co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function node_before( sib )\r\n{\r\n while ((sib = sib.previousSibling)) {\r\n if (!is_ignorable(sib)) return sib;\r\n }\r\n return null;\r\n}", "previousSibling(editor, at) {\n const { selection } = editor;\n if (at === undefined) {\n at = selection;\n }\n if (at !== undefined && at !== n...
[ "0.6812069", "0.6645713", "0.6523808", "0.6470732", "0.6437428", "0.63550544", "0.62940353", "0.61592436", "0.60708255", "0.5960064", "0.59398794", "0.5935763", "0.59246546", "0.5906749", "0.59044915", "0.59044915", "0.58928454", "0.58777016", "0.5873704", "0.5853502", "0.585...
0.6788814
1
Say HI//Send unknown command Stop wr
function sayHI(){w.pM({'cmd': 'start', 'msg': 'Hi'});}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function say(str) {\n\n msgHandler.sendMessage(str);\n }", "function sendHaltCommand() {\n // clear command buffer, make halt next command\n _commandQueue = [];\n return enqueueCommand(\"halt()\", true);\n }", "say(text) {\n const event = { event_name: 'furhatos.event.a...
[ "0.61402714", "0.60782564", "0.60562557", "0.5757879", "0.5748865", "0.5641339", "0.56394875", "0.56330085", "0.5525597", "0.55000097", "0.54865724", "0.5427765", "0.5418105", "0.5415915", "0.54082674", "0.5407635", "0.54042625", "0.53878665", "0.53662133", "0.5362479", "0.53...
0.6299593
0
Update the size of the screen to small
function handleTransitionSmall() { resizeScreen(SMALL_WIDTH, SMALL_HEIGHT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function screenResized() {\n updateTileRatio();\n }", "function updateSizeOnScreen() {\r\n sizeElement.innerText = size;\r\n}", "setCurrentScreenSize(){\n //1. READ USER SCREEN SIZE AND SAVE TO STATE\n if(window.innerWidth > 600){\n this.screenSize = \"big\"\n };\n\n ...
[ "0.7323884", "0.7185847", "0.7085291", "0.70612174", "0.697323", "0.692179", "0.68836397", "0.6744478", "0.672859", "0.6690701", "0.66690177", "0.6666944", "0.6650778", "0.66487974", "0.663384", "0.6631679", "0.6615771", "0.66148674", "0.6600107", "0.6581761", "0.6570349", ...
0.74686134
1
create a unique ID, which is often necessary so that jsPlumb doesn't get confused due to multiple ExecutionVisualizer instances being displayed simultaneously
generateID(original_id) { // (it's safer to start names with a letter rather than a number) return 'v' + this.visualizerID + '__' + original_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n window.flareID = window.flareID + 1;\n return \"flare-component-\" + window.flareID.toString();\n }", "function getUniqueID() {\n if (window.flareID === undefined) {\n window.flareID = 0;\n }\n...
[ "0.68026394", "0.68026394", "0.68026394", "0.6761567", "0.6714714", "0.6709602", "0.6636183", "0.65302116", "0.6497251", "0.637615", "0.6351357", "0.63245875", "0.63183177", "0.6310893", "0.6283861", "0.627098", "0.62702835", "0.62534124", "0.62534124", "0.62499136", "0.62102...
0.7318971
0
find the previous/next breakpoint to c or return 1 if it doesn't exist
findPrevBreakpoint() { var c = this.curInstr; if (this.sortedBreakpointsList.length == 0) { return -1; } else { for (var i = 1; i < this.sortedBreakpointsList.length; i++) { var prev = this.sortedBreakpointsList[i-1]; var cur = this.sortedBreakpointsList[i]; if (c <=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stepBack() {\n var myViz = this;\n\n if (myViz.curInstr > 0) {\n // if there is a prev breakpoint, then jump to it ...\n if (myViz.sortedBreakpointsList.length > 0) {\n var prevBreakpoint = myViz.findPrevBreakpoint();\n if (prevBreakpoint != -1)\n myViz.curInstr = prevBreakpo...
[ "0.6108703", "0.5957885", "0.5929265", "0.58624375", "0.58080065", "0.56761956", "0.5672427", "0.5621248", "0.5553724", "0.55109406", "0.54925466", "0.5481452", "0.5466", "0.54598963", "0.54445374", "0.53736126", "0.5369097", "0.5332563", "0.53241736", "0.53241736", "0.532417...
0.76144236
0
update fields corresponding to the current and previously executed lines in the trace so that they can be properly highlighted; must call before rendering code output (NB: argh pesky ordering dependency)
updateLineAndExceptionInfo() { var myViz = this; var totalInstrs = myViz.curTrace.length; var isLastInstr = myViz.curInstr === (totalInstrs-1); myViz.curLineNumber = undefined; myViz.prevLineNumber = undefined; myViz.curLineIsReturn = undefined; myViz.prevLineIsReturn = undefined; myViz...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onFocusStackFrame() {\n this.modelDataMap.forEach((modelData, uri) => {\n modelData.currentStackDecorations = modelData.model.deltaDecorations(modelData.currentStackDecorations, this.createCallStackDecorations(uri));\n });\n }", "function updateLineForChanges(cm,lineVi...
[ "0.60252917", "0.5834833", "0.5793673", "0.5749415", "0.57363206", "0.57128453", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.57066596", "0.570444", "0.5702843", "0...
0.7150416
0
Function to set cookie from a string (useful on server)
setCookieFromString(cookieString) { document.cookie = cookieString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseSetCookieString(str) {\n str = cleanCookieString(str);\n str = getFirstPair(str);\n\n var res = COOKIE_PAIR.exec(str);\n\n return {\n name: decodeURIComponent(res[KEY_INDEX]),\n value: decodeURIComponent(res[VALUE_INDEX])\n };\n}", "function parseSetCookieString(str) {\n str = cleanCook...
[ "0.7280316", "0.7280316", "0.7004658", "0.6976361", "0.6902953", "0.6861029", "0.6840111", "0.6764707", "0.6740935", "0.671991", "0.67176753", "0.66921353", "0.66863793", "0.6683413", "0.6677821", "0.6658914", "0.66533417", "0.663007", "0.663007", "0.65828025", "0.655689", ...
0.81087834
0
Remove column card count constraints.
removeColumnConstraints() { $('.ghx-busted-max').removeClass('ghx-busted-max'); // Red background remove $('.ghx-constraint').remove(); // Column header remove }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearAllColumnWidths() {}", "function removeConstraint() {\n\t\tprops.value.edited = false;\n\t\tprops.changeValue(props.value.ID, props.value, false);\n\t}", "function removeColums() {\n MVCGrid.setColumnVisibility('PackAGrid', { \"Edit\": false });\n MVCGrid.setColumnVisibility('PackAGrid', { \"Delete\...
[ "0.58871317", "0.58015925", "0.5725183", "0.5611164", "0.5569877", "0.54604304", "0.5440978", "0.54345393", "0.54219174", "0.5417002", "0.54072803", "0.53364366", "0.52483636", "0.5087434", "0.507606", "0.5068599", "0.506604", "0.5054664", "0.5053061", "0.5048493", "0.5034099...
0.7430359
0
Process every issue card at kanban board.
processIssues() { $('.ghx-issue').each((i, element) => { (new JiraIssue(element)); // Every card is JiraIssue instance }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dealAllCards() {\n // Empty the current hands of all players\n listHands = [];\n // Re-initialize the general global variables\n initGeneralVars();\n // Empty the table cards of all the players\n emptyAllTableCards();\n //Empty all the current messages\n emptyMessages();\n // Deal cards from deck...
[ "0.56406593", "0.55844194", "0.55584437", "0.5470415", "0.5419384", "0.5395771", "0.53833646", "0.5343846", "0.5340892", "0.53205174", "0.5295917", "0.5245384", "0.52356184", "0.519268", "0.51832294", "0.517838", "0.5171733", "0.51604337", "0.5125473", "0.51206255", "0.509974...
0.6569155
0
Append Domain List to HTML DOM
function appendDomainList(data) { for (i = 0; i < data.length; i++) { var html = ""; html += "<li id='" + i + "' class='list-group-item p-0 border-top-0 border-right-0 border-left-0 checkDomain d-flex align-items-center' data-domain='" + data[i] + "'>"; html += "<h6 class='mr-auto ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDomains(l) {\n var pg = document.getElementById('active_domlist')\n pg.innerHTML = \"\"\n var ul = document.createElement('ul')\n ul.style.textAlign = \"left\"\n ul.style.listStyle = \"none\"\n ul.style.paddingTop = \"12px\"\n for (var i in domlist[l]) {\n var dom = domlist...
[ "0.63070226", "0.6029176", "0.58990765", "0.58497876", "0.57254404", "0.5703736", "0.5574323", "0.5529449", "0.54753053", "0.5470908", "0.54621804", "0.5458153", "0.5437868", "0.54210466", "0.5418011", "0.539966", "0.5358496", "0.53440785", "0.532233", "0.53117514", "0.530119...
0.60740054
1
Update Domain List with new data
function updateDomainList(status, tld, domain) { var elem = $("li[data-domain='" + domain + "']"); var id = '#' + elem.attr('id'); $(id).attr("data-tld", tld); $(id).attr("data-status", status); $(id).removeClass("checkDomain"); if (status.indexOf("unav") !== -1) { $(id).find('....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_sites_lists() {\n\t\tfunction doRequest() {\n\t\t\t$db.view('app/get-sites-list', {\n\t\t\t\ttype: 'json',\n\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t$content_sites_list.empty();\n\t\t\t\t\tvar $template = $('#sites_list_template');\n\t\t\t\t\t$.each(data.rows, function(i, site) {\n\t\t\t\t\t\ts...
[ "0.6181679", "0.61265045", "0.6046823", "0.5989692", "0.59636396", "0.5952263", "0.59053767", "0.5885825", "0.5814984", "0.5788878", "0.5778808", "0.57413304", "0.57317513", "0.5725948", "0.57220864", "0.570601", "0.56838894", "0.56425256", "0.55808437", "0.55736065", "0.5560...
0.6323007
0
count the selected checkboxes and display the number updates the global filters count
function esf_count_selected(element) { // element is the clicked checkbox var parent_tab = element.closest('.esf-as-filter-panel'), element_id = parent_tab.attr('id'), nb_of_items_sel = parent_tab.find('input:checkbox:checked').length, $filter_tag = $('.esf-' + element_id + '-filter'), panel_n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRecordCount(filter_key) {\n $('#filtered_record_count').html($('.filterable:not(.hidden)').size() + \" of\")\n // $('#total_record_count').html($('.filterable').size())\n $(\".filter_checkbox\").each(function(i) {\n $(this).siblings(\"small\").html( \n $(\".filterable:not(.hidden)[data-fi...
[ "0.7329028", "0.7181538", "0.7135429", "0.70250314", "0.69969743", "0.6946113", "0.6903626", "0.68045217", "0.6796337", "0.6641078", "0.6601672", "0.65954924", "0.6569522", "0.6555626", "0.65313816", "0.6519841", "0.64935595", "0.6484345", "0.64640224", "0.6454548", "0.644074...
0.74911416
0
use the next card to populate the "flashcard view", using view preferences that the user specified earlier
function nextCard() { $('#card-followup-container').hide(); if (wordList.length === 0) { practice_complete(); } else { var entry = wordList[0].entry; var word = getWord(entry.words[entry.languages[1]]); var pronun = entry.pronuncations[entry.languages[1]]; var trans = entry.words[entry.languages[0]]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thorFCloadCard(){\n if (N != 0){\n $('#ContentCardView').append('<div class=\"card\"></div>');\n $('.card').append('<div class=\"front face flashcard\"></div>');\n $('.card').append('<div class=\"back face flashcard\" style=\"display: none;\"></div>');\n \t$('.front').text(curre...
[ "0.6597418", "0.65605706", "0.62655884", "0.6263335", "0.6169247", "0.60985214", "0.60869247", "0.6061844", "0.6002972", "0.59907603", "0.5960506", "0.5956471", "0.5930746", "0.5928135", "0.5918572", "0.5909378", "0.5908978", "0.5888694", "0.58707356", "0.5860941", "0.585976"...
0.69717014
0
send student ratings to the backend
function send_rating(value) { shiftCards(); nextCard(); var currentURL = URL + 'user_practice_response.php'; $.post(currentURL, { 'practice_entry_id' : wordList[0].practiceEntryId, 'grade_id' : value }, function(data) { authorize(data); if (data.isError === true) { failureMessage(data.errorTitle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postRating(data) {\n var url = '/ratings/send';\n\n fetch(url,\n {\n method: 'post',\n credentials: 'include',\n headers: {\n 'Content-type': 'application/json',\n 'X-CSRFToken': csrftoken,\n 'X-Requested-With': 'XM...
[ "0.6814867", "0.65713376", "0.6458022", "0.64066523", "0.6379716", "0.63478494", "0.6117714", "0.610975", "0.6035452", "0.6032704", "0.60238284", "0.5990275", "0.59595764", "0.5958399", "0.5955666", "0.5930196", "0.5927642", "0.5923824", "0.5882458", "0.5857117", "0.58565015"...
0.6707744
1
Create a function that takes an array of numbers and return the first and last elements as a new array.
function firstLast(arr) { arr = [arr[0],arr[arr.length -1]]; return arr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstAndLast(list) {\n\t// create a new array for storing the output\n\tvar newArray = [];\t\n\t// get the first one\n\tvar first = list.shift();\n\tnewArray.push(first);\n\t// get the last one\n\tvar last = list.pop();\n\tnewArray.push(last);\n\t// return the array\n\treturn newArray;\n}", "function Ar...
[ "0.7103199", "0.69906706", "0.6987153", "0.66126376", "0.65440136", "0.6505056", "0.6498832", "0.64576185", "0.6391846", "0.63908637", "0.6389298", "0.6389298", "0.6389298", "0.63712186", "0.6327742", "0.6302062", "0.62591535", "0.6236793", "0.61261916", "0.61042166", "0.6097...
0.72364163
0
Given a number and an object with min and max properties, return true if the number lies within the given range (inclusive).
function isInRange(num, range) { if ( num >= Math.min(range.min) && num <= Math.max(range.max)) { return true }else{ return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inRange(x, min, max) {\n return x >= min && x <= max;\n}", "function isWithinLimits(value, min, max) {\n return value >= min && value < max;\n}", "function inRange(x, min, max) {\r\n\treturn x >= min && x <= max;\r\n}", "InRange(value, min,max){\n return ((value-min)*(value-max) <= 0)...
[ "0.7934336", "0.7887668", "0.78738815", "0.7835599", "0.77835554", "0.778259", "0.77806294", "0.7741976", "0.770686", "0.7677094", "0.7654599", "0.7609225", "0.7535489", "0.7488", "0.7468038", "0.74065435", "0.73830986", "0.73682135", "0.73671955", "0.73671955", "0.7351379", ...
0.7992261
0
function to get value of any HTML field by id
function getFieldValueById(id) { return document.getElementById(id).value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getValue(id) {\n return $(`#${id}`).val();\n}", "function getValue(id) {\n return $(\"#\"+id).val();\n }", "function getValue(id) {\n return document.getElementById(id).value;\n}", "function getInputVal(id) {\n return document.getElementById(id).value;\n }", "function getIn...
[ "0.8463181", "0.8395949", "0.82079834", "0.81751627", "0.8171657", "0.81711096", "0.8160209", "0.81524795", "0.81524795", "0.81524795", "0.8150973", "0.81506646", "0.8146235", "0.81417674", "0.81417674", "0.8130005", "0.8130005", "0.8130005", "0.8130005", "0.8130005", "0.8113...
0.86245847
0
function to get value of any HTML field by name
function getFieldValueByName(name) { return document.getElementsByName(name)[0].value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getInputFieldValue(fieldName) {\n var field = document.getElementById(fieldName);\n if (field) \n return field.value;\n else\n return '';\n}", "function getValueOfInput(name){\r\n\tvar object =document.getElementsByName(name)[0];\r\n\tif(object!=undefined){\r\n\t\tvar result = obj...
[ "0.7541209", "0.74010086", "0.7353036", "0.7278094", "0.72557604", "0.72204363", "0.71940345", "0.7155176", "0.7050671", "0.686433", "0.6861488", "0.6858443", "0.6804525", "0.68034387", "0.6788306", "0.6701577", "0.66605407", "0.6650196", "0.6650196", "0.6650196", "0.66438997...
0.83063394
0
function to show HTML element by id
function showHTMLById(id) { document.getElementById(id).style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show(id)\r\n{\r\n\t//get element by id\r\n\tvar elm=document.getElementById(id);\r\n\tif(elm!=null)\r\n\t\telm.style.display=\"block\";//show element\r\n}", "function showDisplay(ID)\r\n{\r\n showDisplayObj(getElemnt(ID));\r\n}", "function showById(id) {\n document.getElementById(id).style.display...
[ "0.8158297", "0.7720674", "0.76997626", "0.7648309", "0.75819856", "0.7517202", "0.7509446", "0.7504415", "0.7475659", "0.7473785", "0.7446765", "0.74388665", "0.7221694", "0.7184455", "0.71392685", "0.71362054", "0.711572", "0.70715773", "0.70610666", "0.7048899", "0.7033234...
0.79759586
1
function to check material sled
function checkMaterialSled() { if (null != getMaterialSled() && getFieldValueById("trxtransactiondetails-manufacturing_date").length > 0) { setFieldValueById("trxtransactiondetails-expiry_date", calculateDate(getFieldValueById("trxtransactiondetails-manufacturing_date"),getMaterialSled(),"add")); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMaterialSled() {\n\tvar material_sled_val = material_sled[getFieldValueById(\"trxtransactiondetails-material_code\")];\n\t\n\treturn material_sled_val;\n}", "function checkVisualSequence() {\n\treturn (visualSequence[currentLevel] == image);\n}", "info_check()\n {\n // check browser compa...
[ "0.65931517", "0.6048727", "0.6028118", "0.5900244", "0.58520633", "0.57669646", "0.5751067", "0.57438517", "0.57251054", "0.5696782", "0.5686151", "0.5683941", "0.5667235", "0.563298", "0.56170183", "0.56125987", "0.5592396", "0.55920863", "0.5590493", "0.5587881", "0.558451...
0.6190792
1
function to add/subtract days in a date string
function calculateDate(strDate, days, type) { var newDate = new Date(strDate); if (type == 'add') { newDate.setDate(newDate.getDate() + days); } else if (type == 'subtract') { newDate.setDate(newDate.getDate() - days); } else { // do nothing } var dd = newDate.getDate(); var mm = newDate.getMonth() + 1; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDays(date, plusDays){\n var outputDate = new Date(date);\n outputDate.setDate(endDate.getDate() + plusDays);\n return outputDate;\n}", "function addDays(date, days) {\r\n var result = new Date(date);\r\n result.setDate(result.getDate() + days);\r\n return result.toJSON().slice(0,...
[ "0.6908897", "0.6667037", "0.6641401", "0.65658945", "0.6559264", "0.65489364", "0.654418", "0.6502619", "0.6490579", "0.6485398", "0.64396685", "0.6436653", "0.64021105", "0.634799", "0.6328493", "0.63269335", "0.63242185", "0.629991", "0.62881845", "0.6205394", "0.6197607",...
0.712316
0
function to search material by barcode/description
function searchMaterial() { var material_val = material_list_barcode[getFieldValueById("material_barcode")]; if (null == material_val) { material_val = material_list_desc[getFieldValueById("material_barcode")]; } return material_val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchMaterials(material) {\n queryFetch(BASE_URL+'earth911.searchMaterials?api_key='+API_KEY+'&query='+material);\n}", "function fhWaste_barcodeSearch() {\n\t\n\t\n\tjQuery('#fhWaste_scan_loading').slideDown();\n\t\n\tvar barcode = jQuery('#fhWaste_scan_code').val();\n\t\n\tjQuery.post(\n\t\t'index....
[ "0.67329335", "0.6730497", "0.6306335", "0.60443693", "0.60004777", "0.59404683", "0.5904498", "0.5872986", "0.580014", "0.56953263", "0.56357896", "0.5617148", "0.55983824", "0.55788255", "0.55576456", "0.55518556", "0.5548576", "0.55334103", "0.55294603", "0.5527416", "0.55...
0.7506256
0
function to retrieve sled of material
function getMaterialSled() { var material_sled_val = material_sled[getFieldValueById("trxtransactiondetails-material_code")]; return material_sled_val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchMaterial() {\n\tvar material_val = material_list_barcode[getFieldValueById(\"material_barcode\")];\n\tif (null == material_val) {\n\t\tmaterial_val = material_list_desc[getFieldValueById(\"material_barcode\")];\n\t}\n\t\n\treturn material_val;\n}", "getTileMaterial(position) {\r\n const til...
[ "0.6420572", "0.6310853", "0.6309248", "0.6195626", "0.6132829", "0.61223286", "0.6047912", "0.59237856", "0.5916713", "0.58685106", "0.58576953", "0.5855666", "0.58496016", "0.57890934", "0.5776838", "0.5730965", "0.5709303", "0.5701397", "0.56899005", "0.5674414", "0.563992...
0.8047116
0
function to retrieve unit of material conversion
function getMaterialConversionUnit() { var material_conv_unit = "KG"; if (null != material_conversion[getFieldValueById("trxtransactiondetails-material_code")]) { material_conv_unit = material_conversion[getFieldValueById("trxtransactiondetails-material_code")]['unit_1']; if (material_conv_unit === "CBM" || mater...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUnit(unit) {\n if(unit === 'foot/inch') {\n return '';\n }\n if(unit === 'centimeter') {\n return 'cm';\n }\n if(unit === 'pound') {\n return 'lbs';\n }\n return unit;\n }", "function getUnits() {\n if (!documents.length) return '';\n var key = activeDocument.ru...
[ "0.690892", "0.68983054", "0.6827985", "0.6811211", "0.6692393", "0.64710873", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", "0.6453381", ...
0.8415134
0
function to get total weight of material
function getMaterialTotalWeight() { var material_total_weight = getFieldValueById("trxtransactiondetails-net_weight"); if (null != material_total_weight && material_total_weight.length > 0) { switch(getMaterialConversionUnit()) { case 'KG': // do nothing break; case 'CBM': case 'BXS': material...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getWeight() {\n let sum = 0;\n for (let i = 0; i < this._items.length; i++) {\n sum += this._items[i].getWeight() * this._items[i].count;\n }\n return sum;\n }", "get weights() {\n return this._fields.reduce((prev, curr) => prev + curr.weight, 0);\n }", "materialCo...
[ "0.77666354", "0.7345117", "0.72718143", "0.71446717", "0.7001668", "0.6951351", "0.6867953", "0.6795447", "0.6729107", "0.6702891", "0.66764647", "0.6672527", "0.6621109", "0.6560147", "0.649499", "0.648006", "0.64492404", "0.6443886", "0.6435789", "0.6406491", "0.6406491", ...
0.8174761
0
function to check existing pallet kitted unit of transaction detail
function checkTransactionKittedUnit() { if (checkTransactionStatus()) { if (null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]) { var trx_kitted_unit = transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['kitted_unit']; // set...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTransactionPalletType() {\n\tif (checkTransactionStatus() && null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n\t\tsetFieldValueById(\"material-pallet_type\", transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_type']);\n\t}\n}", ...
[ "0.6281981", "0.60178095", "0.5730874", "0.57251036", "0.56983584", "0.5662393", "0.5659159", "0.5658176", "0.5651058", "0.55611485", "0.55400306", "0.552302", "0.55068135", "0.54813457", "0.54751724", "0.54636437", "0.5443884", "0.5424527", "0.5422551", "0.54208875", "0.5393...
0.6906316
0
function to check pallet weight of transaction_detail
function checkTransactionPalletWeight() { if (checkTransactionStatus()) { var trx_pallet_weight = 0; // add current net weight if (null != getMaterialTotalWeight()) { trx_pallet_weight = trx_pallet_weight + parseInt(getMaterialTotalWeight()); } if (null != transac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTransactionPalletWeight() {\n\tvar trx_pallet_weight = 0;\n\tif (null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n\t\tvar trx_pallet_weight = transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_weight'];\n\t}\n\t\n\treturn trx_palle...
[ "0.75710505", "0.61499226", "0.57837534", "0.5709165", "0.56422126", "0.561545", "0.56001675", "0.5476176", "0.5469981", "0.54570115", "0.54323345", "0.54023814", "0.5393807", "0.53816396", "0.53658366", "0.5357072", "0.53552526", "0.5340221", "0.53007954", "0.52652436", "0.5...
0.82793367
0
function to check pallet type of transaction_detail
function checkTransactionPalletType() { if (checkTransactionStatus() && null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]) { setFieldValueById("material-pallet_type", transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['pallet_type']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateTransactionPalletType() {\n\tif (null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")] && getFieldValueById(\"trxtransactiondetails-pallet_type\").length > 0) {\n\t\tvar pallet_type = transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_...
[ "0.71435183", "0.6431107", "0.5936204", "0.59194785", "0.56882215", "0.56678736", "0.56316596", "0.55433095", "0.54000586", "0.5379948", "0.53426975", "0.533217", "0.5289828", "0.52657986", "0.52537286", "0.5238088", "0.5232931", "0.5230254", "0.5225449", "0.52161616", "0.521...
0.79033333
0
function to validate pallet type of material and transaction_detail
function validateTransactionPalletType() { if (null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")] && getFieldValueById("trxtransactiondetails-pallet_type").length > 0) { var pallet_type = transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['pallet_type']; if (pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTransactionPalletType() {\n\tif (checkTransactionStatus() && null != transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]) {\n\t\tsetFieldValueById(\"material-pallet_type\", transaction_details[getFieldValueById(\"trxtransactiondetails-pallet_no\")]['pallet_type']);\n\t}\n}", ...
[ "0.75448185", "0.577318", "0.57089955", "0.56882447", "0.5637881", "0.5599041", "0.5585064", "0.5551229", "0.54695404", "0.54533166", "0.54055965", "0.5376383", "0.53613037", "0.5311494", "0.5277261", "0.5276237", "0.52749103", "0.52551305", "0.5227888", "0.52227134", "0.5210...
0.7357039
1
function to retrieve pallet weight of transaction_detail
function getTransactionPalletWeight() { var trx_pallet_weight = 0; if (null != transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]) { var trx_pallet_weight = transaction_details[getFieldValueById("trxtransactiondetails-pallet_no")]['pallet_weight']; } return trx_pallet_weight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTransactionPalletWeight() {\n if (checkTransactionStatus()) {\n var trx_pallet_weight = 0;\n // add current net weight\n if (null != getMaterialTotalWeight()) {\n trx_pallet_weight = trx_pallet_weight + parseInt(getMaterialTotalWeight());\n }\n if (nul...
[ "0.7342174", "0.6351819", "0.60321647", "0.60169405", "0.5988039", "0.59866154", "0.597903", "0.5838386", "0.5803765", "0.57704675", "0.5764323", "0.57362926", "0.5731095", "0.57123005", "0.5679883", "0.556368", "0.5547435", "0.5547435", "0.5547435", "0.5547435", "0.5547435",...
0.861437
0
function to calculate net weight
function calculateNetWeight() { var grossWeight = parseFloat(getFieldValueById('gross_weight')); var palletTare = parseFloat(getFieldValueById('pallet_tare')); var productTare = parseFloat(getFieldValueById('product_tare_total')); var palletPackagingTare = parseFloat(getFieldValueById('pallet_packaging_tare')); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ComputeWeightFromWeight(_out, _in) {\n Equation.call(this, _out, _in);\n}", "getWeight() {\n let sum = 0;\n for (let i = 0; i < this._items.length; i++) {\n sum += this._items[i].getWeight() * this._items[i].count;\n }\n return sum;\n }", "function weightCalc...
[ "0.73142827", "0.69220674", "0.6824408", "0.68165725", "0.6812984", "0.6808902", "0.67868143", "0.67636293", "0.67252284", "0.6672151", "0.6662629", "0.66419655", "0.65730095", "0.65673596", "0.6542133", "0.6504576", "0.6495618", "0.64904654", "0.6486373", "0.64607716", "0.63...
0.7334527
0
function to calculate total product tare
function calculateTotalProductTare() { var productTare = getFieldValueById('product_tare'); var units = getFieldValueById('units'); if (!isNaN(productTare) && null != productTare && productTare.length > 0 && !isNaN(units) && null != units && units.length > 0) { setFieldValueById('product_tare_total', parseFlo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcTotal() {\n return this.products\n .map( price => price )\n .reduce( (ac, price) => ac + price, 0 );\n }", "calcularTotal() {\n let total = this.precio * this.cantidad;\n return total;\n }", "clacTotal() {\n return this.products\n ....
[ "0.7788733", "0.7467819", "0.7437123", "0.7405795", "0.73941857", "0.72997993", "0.72469985", "0.7244141", "0.7229977", "0.720659", "0.71759045", "0.7171982", "0.7164317", "0.7158529", "0.7120759", "0.70831376", "0.7073168", "0.70449156", "0.7040011", "0.70382243", "0.7032639...
0.79660225
0
function to view transaction summary
function viewTransactionSummary(transaction_id) { if (null != transaction_id && "" != transaction_id && "-- Select a transaction --" != transaction_id) { window.open("view-entries?id=" + transaction_id,'_blank'); } else { alert('Please select a transaction.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSummary(summary){\n console.log(summary);\n}", "function DisplayTransactionInfo(data) {\n\t\n\treturn \"\";\n}", "async function get_overview(request, response, next){\n\t\n\tresponse.locals.log = {label:'transaction', type:'overview'};\n\t\n\ttry{\n\t\t//language=MySQL\n\t\tconst query = 'SELE...
[ "0.65642446", "0.6537339", "0.6385639", "0.61888963", "0.6188707", "0.60624856", "0.6041463", "0.59445393", "0.5928347", "0.5886101", "0.5838252", "0.5837997", "0.5830489", "0.57841355", "0.57726735", "0.5760752", "0.57524574", "0.5745961", "0.574409", "0.57404715", "0.573590...
0.72426075
0
function to view pallet details
function viewPalletDetails(transaction_id, pallet_no) { if (null != transaction_id && "" != transaction_id && "-- Select a transaction --" != transaction_id) { if (null != pallet_no && "" != pallet_no) { window.location = "view-entries?TrxTransactionDetailsSearch[pallet_no]=" + pallet_no + "&id=" + transaction_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDetails(pokemon) {\n console.log(pokemon)\n}", "function OCG_display_point(pt_id,layer_name)\n{\n\t//on recupere la map\n\tvar map = OCG_config.map;\n\tvar layers = map.getLayersByName(layer_name);\n\tif(layers.length !== 0)\n\t{\n\t\tvar layer = layers[0];\n\t\tOCG_display_point_layer(pt_id,layer)...
[ "0.6157294", "0.57849044", "0.5614294", "0.5563346", "0.55550957", "0.55420405", "0.54637206", "0.5445946", "0.5443171", "0.5439387", "0.5433343", "0.5412697", "0.539322", "0.5389105", "0.5376774", "0.5363486", "0.53632486", "0.5333816", "0.53178835", "0.5313446", "0.5274416"...
0.6277283
0
validation middleware: checks that reservation_date has a valid date value
function dateIsValid(req, res, next) { const { reservation_date } = req.body.data; const date = Date.parse(reservation_date); if (date && date > 0) { return next(); } else { return next({ status: 400, message: `reservation_date field formatted incorrectly: ${reservation_date}.`, }); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function isValidDateTime(req, _, next) {\n const { reservation_date, reservation_time } = req.body.data;\n const date = new Date(reservation_date);\n let today = new Date();\n const resDate = new Date(reservation_date).toUTCString();\n\n if (resDate.includes(\"Tue\")) {\n return next({\n status:...
[ "0.6971311", "0.68972397", "0.6703616", "0.67017406", "0.6687783", "0.667776", "0.66289604", "0.6621074", "0.65987164", "0.64757484", "0.6472927", "0.64607126", "0.645868", "0.64317036", "0.63824844", "0.6377672", "0.63498443", "0.63498443", "0.62974554", "0.62839603", "0.625...
0.8564729
0
validation middleware: checks that reservation_time has a valid date value
function timeIsValid(req, res, next) { const { reservation_time } = req.body.data; const regex = new RegExp("([01]?[0-9]|2[0-3]):[0-5][0-9]"); if (regex.test(reservation_time)) { return next(); } else { return next({ status: 400, message: `reservation_time field formatted incorrectly: ${res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateIsValid(req, res, next) {\n const { reservation_date } = req.body.data;\n const date = Date.parse(reservation_date);\n if (date && date > 0) {\n return next();\n } else {\n return next({\n status: 400,\n message: `reservation_date field formatted incorrectly: ${reservation_date}.`,...
[ "0.81792265", "0.7354622", "0.7176569", "0.6580746", "0.65723944", "0.65439695", "0.65425825", "0.64657265", "0.6424209", "0.6378595", "0.63029546", "0.62091976", "0.6196714", "0.6186753", "0.61748797", "0.6136806", "0.6117049", "0.60540897", "0.6042324", "0.60146964", "0.601...
0.76913095
1
validation middleware: checks that the value of people is a number
function peopleIsNumber(req, res, next) { const { people } = req.body.data; const partySize = Number.isInteger(people); if (partySize) { return next(); } else { return next({ status: 400, message: `people field formatted incorrectly: ${people}. Needs to be a number.`, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateNums(req, res, next) {\n //optional chaining\n let values = req.query.nums?.split(\",\").map(e => Number(e));\n\n if (!values) {\n throw new BadRequestError(\"nums are required\");\n }\n\n if (values.some(e => isNaN(e))) {\n throw new BadRequestError(\"invalid number recieved\");\n }\n...
[ "0.65740716", "0.6125776", "0.6098932", "0.6049222", "0.60439664", "0.5990207", "0.5968311", "0.5937658", "0.588401", "0.5879911", "0.5820835", "0.5784866", "0.5770159", "0.5750103", "0.57484007", "0.5732752", "0.57213205", "0.57116616", "0.57104945", "0.5696752", "0.56703985...
0.8610202
0
validation middleware: checks that the reservation_date & reservation_time are not in the past
function notInPast(req, res, next) { const { reservation_date, reservation_time } = req.body.data; const reservation = new Date(`${reservation_date} PDT`).setHours(reservation_time.substring(0, 2), reservation_time.substring(3)); const now = Date.now(); if (reservation > now) { return next(); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateIsValid(req, res, next) {\n const { reservation_date } = req.body.data;\n const date = Date.parse(reservation_date);\n if (date && date > 0) {\n return next();\n } else {\n return next({\n status: 400,\n message: `reservation_date field formatted incorrectly: ${reservation_date}.`,...
[ "0.73963165", "0.70149654", "0.70133865", "0.6990828", "0.66445297", "0.65834916", "0.6434461", "0.64272267", "0.63932246", "0.6385481", "0.6335736", "0.62243944", "0.6127172", "0.60459894", "0.6015146", "0.5969026", "0.58896405", "0.5874922", "0.5838478", "0.58209324", "0.58...
0.7925732
0
validation middleware: checks that the reservation_date is not a Tuesday
function notTuesday(req, res, next) { const { reservation_date } = req.body.data; const date = new Date(reservation_date); const day = date.getUTCDay(); if (day === 2) { return next({ status: 400, message: "The restaurant is closed on Tuesday.", }); } else { return next(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateIsValid(req, res, next) {\n const { reservation_date } = req.body.data;\n const date = Date.parse(reservation_date);\n if (date && date > 0) {\n return next();\n } else {\n return next({\n status: 400,\n message: `reservation_date field formatted incorrectly: ${reservation_date}.`,...
[ "0.7475359", "0.7168282", "0.6782319", "0.6427107", "0.63916737", "0.62688977", "0.61477226", "0.6032597", "0.59961647", "0.590408", "0.58663917", "0.5748985", "0.5747954", "0.57397705", "0.5738244", "0.572222", "0.5718827", "0.5667783", "0.5663109", "0.5626342", "0.5606884",...
0.80839646
0
validation middleware: checks that the reservation_time is during operating hours
function duringOperatingHours(req, res, next) { const { reservation_time } = req.body.data; const open = 1030; const close = 2130; const reservation = reservation_time.substring(0, 2) + reservation_time.substring(3); if (reservation > open && reservation < close) { return next(); } else { return nex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeIsValid(req, res, next) {\n const { reservation_time } = req.body.data;\n const regex = new RegExp(\"([01]?[0-9]|2[0-3]):[0-5][0-9]\");\n if (regex.test(reservation_time)) {\n return next();\n } else {\n return next({\n status: 400, \n message: `reservation_time field formatted inc...
[ "0.7545674", "0.69965225", "0.69429564", "0.68783814", "0.66348153", "0.6500808", "0.6489923", "0.6414548", "0.6226648", "0.62156945", "0.59854263", "0.5928799", "0.58978724", "0.58930457", "0.5848081", "0.5818861", "0.57671344", "0.57286257", "0.57269293", "0.57041144", "0.5...
0.8318219
0