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
map/reduce posts to array of unique authors
function makePostAuthorsArr (posts) { const uniques = {} return posts .map(post => post.author_id) .sort((a, b) => a - b) .reduce((list, curr) => { if (!uniques[curr]) { uniques[curr] = 1 list.push(curr) } return list }, []) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPostAuthors () {\n return Post.find({})\n .exec()\n .then(makePostAuthorsArr)\n}", "distinctByUid() {\n var posts = Model.getInstance().posts;\n var flags = [],\n output = [],\n l = posts.length,\n i;\n for (let i = 0; i < l; i++) {\n ...
[ "0.6528502", "0.6477398", "0.6427947", "0.6269938", "0.61401916", "0.6109524", "0.6059149", "0.58877665", "0.57522494", "0.57256943", "0.5702468", "0.56552905", "0.55212605", "0.5485624", "0.5474436", "0.5467552", "0.5445788", "0.5412739", "0.54111457", "0.5340023", "0.532914...
0.8065581
0
============================ PRIVATE METHODS ============================ Check db logs for previous engagement run today
function checkAlreadyRun () { return Log.find() .sort({ 'createdAt': -1 }) .limit(1) .exec() .then(log => { if (log.length === 0) { return true } let lastLogDate = Math.floor(Date.parse(log[0].createdAt) / 1000) let today = Math.floor(Date.now() / 1000) let oneDay = 86400 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _deleteHistoricEntries() {\n\n\t\ttry {\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Get date 30 days back\n\t\t\tvar lvDate = new Date();\n\t\t\tlvDate.setDate(lvDate.getDate() - 30);\n\t\t\tvar lvDateString = lvDate.toISOString().split('T')[0];\n\n\t\t\t...
[ "0.6099323", "0.59107107", "0.57912403", "0.57759804", "0.56775373", "0.56687784", "0.5515842", "0.5468624", "0.5420618", "0.54054457", "0.54054457", "0.54054457", "0.5398233", "0.5387583", "0.537252", "0.5360263", "0.5309621", "0.5295156", "0.5271902", "0.5247438", "0.524047...
0.65382105
0
Get inactive users Finds all users, then filters for users who have NOT authored posts.
function getInactiveUsers (postAuthors) { const projection = { _id: 1, username: 1, name: 1, email: 1, contactMeta: 1, engagementMeta: 1 } return User.find({}, projection) .exec() // filter for basic elegibility .then(users => users.filter(basicEligibility)) // filter for on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getInactiveUsers(users = [], nextPageToken) {\n const result = await admin.auth().listUsers(1000, nextPageToken);\n // Find users that have not signed in in the last 90 days.\n const inactiveUsers = result.users.filter(user => Date.parse(user.metadata.lastSignInTime) < (Date.now() - 90 * 24...
[ "0.6804068", "0.63976365", "0.63436556", "0.6222973", "0.60801226", "0.58970153", "0.5828662", "0.56970096", "0.56683993", "0.56620353", "0.5656293", "0.5617409", "0.5596384", "0.55951285", "0.5556652", "0.55316347", "0.5530327", "0.5521602", "0.55109", "0.55014354", "0.54950...
0.7277983
0
Get list of all post authors
function getPostAuthors () { return Post.find({}) .exec() .then(makePostAuthorsArr) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPostsByAuthor() {\n\tvar snippet = {\n\t\tquery: {authorId: \"-K_W_cxqkjGVo8zEfLUc\"}\n\t}\n\trimer.post.findByAuthor(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function getAuthors() {\n\tvar snippet = {...
[ "0.75279593", "0.73791873", "0.7072618", "0.702958", "0.68787766", "0.6268965", "0.62496984", "0.61659837", "0.614425", "0.609683", "0.60707635", "0.59308904", "0.59187776", "0.59184766", "0.5906672", "0.58872664", "0.58619004", "0.5817105", "0.57860374", "0.57689345", "0.572...
0.8051331
0
Creates user defined number of random strings function. User input is taken as the arguement and is used to set the number of times the random string function is called. Defines an array and the random strings are passed to it. Returns Array with random strings.
function number_of_strings(chosen_number) { var array = []; for (var i = 0; i < chosen_number; i++) { var rando = (random_string()); array.push(rando); } console.log(array) return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function array_builder(int) {\n // create a global empty array\n var random_word_array = []\n // create an alphabet variable\n var alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n // create a for loop that will make a random word the # of times in the function parameter\n for( var x = 0; x < int; x++) {\n // ...
[ "0.73689616", "0.7093474", "0.69122136", "0.6890669", "0.68398076", "0.6806301", "0.68056214", "0.6782696", "0.6781654", "0.6772082", "0.6721228", "0.6678096", "0.6673594", "0.66469353", "0.662255", "0.6589424", "0.65803015", "0.657992", "0.65778756", "0.65734965", "0.6562788...
0.7514006
0
The `include` syntax is used like in Sequelize. It replaces an ArangoDB ID string with the actual document. It's like a `JOIN`. This accepts an object or array of objects.
handleInclude () { const { include, attributes } = this.props const { query, bindVars } = this if (Array.isArray(include)) { query('return MERGE(instance, {') include.map((inc, index) => { const includeAs = `includeAs${index}` bindVars({ [includeAs]: inc.as }) query(` @...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function include(object) {\n\t\n}", "function include(arg) {\r\n\tvar spec = null;\r\n\tswitch (typeof arg) {\r\n\t\tcase 'function': {\r\n\t\t\tspec = this.record(arg);\r\n\t\t\tif (!spec && arg.__SERMAT__) {\r\n\t\t\t\tspec = arg.__SERMAT__;\r\n\t\t\t\tif (!arg.hasOwnProperty('__SERMAT__') && !spec.inheritable...
[ "0.64316916", "0.5931786", "0.59128594", "0.5636603", "0.5304836", "0.5289465", "0.51571923", "0.51141936", "0.5084598", "0.5024385", "0.4960541", "0.49181494", "0.48808184", "0.48635778", "0.47475207", "0.47319764", "0.470483", "0.46870264", "0.46673915", "0.46339113", "0.45...
0.6546098
0
Removes all station markers from the map. Used by markerpopulation functions there is no piling up of multiple markers for the one station.
function removeAllMarkers(){ for (var i = 0; i < markers.length; i++) { markers[i].setMap(null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eraseAllLots() {\n markers.forEach(function (marker) {\n marker.setMap(null);\n });\n markers = [];\n}", "function removeAllMarkers() {\n for(var i = 0 ; i < allMarkers.length ; i++)\n map.removeLayer(allMarkers[i]);\n \n allMarkers = [];\n}", "function removeMarkers() {\n ...
[ "0.7780475", "0.7701504", "0.76353234", "0.76353234", "0.76079017", "0.76043993", "0.7594373", "0.7590093", "0.7590093", "0.7590093", "0.7590093", "0.7590093", "0.7581892", "0.7581892", "0.7581892", "0.7581892", "0.7581892", "0.7563936", "0.75619537", "0.75531274", "0.7542069...
0.7907019
0
Displays current_position and selected_time, in a suitable format, to a div in index.html. Uses reverse geocoding to generate an address to display from the LatLng object referenced by current_position.
function displayAddressTimeFromCurrentPos() { var latLng = current_position; geocoder.geocode({"location": latLng}, function(data, status) { if(status == "OK") { // this is the format that matches that in the address bar, but seemed to be different for the different positions, so went for si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPosition() {\n fetch(\"https://ipwhois.app/json/?objects=city,latitude,longitude\")\n .then((response) => response.json())\n .then((data) => {\n let currentLat = parseFloat(data.latitude).toFixed(2);\n let currentLong = parseFloat(data.longitude).toFixed(2);\n let currentCity = d...
[ "0.65266603", "0.6522848", "0.6395222", "0.6392322", "0.6387366", "0.6331718", "0.6298909", "0.62880695", "0.62721765", "0.6248733", "0.62008667", "0.6194838", "0.6124618", "0.6117862", "0.61156154", "0.6115197", "0.60894585", "0.60875654", "0.60763425", "0.6064515", "0.60461...
0.81737614
0
based on Toggle for display bikeLayer, which is a globallydeclared Google Layer, which shows bike lanes and bikefriendly roads on the map.
function toggleBikeLayer() { if(bikeLayer.getMap() == null) { bikeLayer.setMap(map); } else { bikeLayer.setMap(null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnOn(){\n ga('send', 'event', 'layer-on', layer.layerType,layer.name);\n if(!layer.viz.isTimeLapse){\n turnOffTimeLapseCheckboxes();\n }\n if(layer.layerType === 'dynamicMapService'){\n layer.layer.setMap(map);\n layer.visible = true;\n ...
[ "0.6788092", "0.6735705", "0.6641071", "0.6528433", "0.64995295", "0.6493666", "0.6460388", "0.6439729", "0.6416057", "0.63954514", "0.63435125", "0.6304959", "0.6304511", "0.6258524", "0.62518483", "0.6229942", "0.62091666", "0.62030727", "0.61976075", "0.61915886", "0.61670...
0.8050719
0
var CREATE_DEVICE_BUSY = 0;
function before_do_CREATE_DEVICE() { dom__Compon_progress1.attribute("value", 0); dom__Compon_Inp1.style('background-color', '#E0F7FF');//blue /////////////////////////////////////////////////////////// REATE_DEVICE_NAME = Number(dom__Compon_Inp1.value()); if (isNaN(REATE_DEVICE_NAME) === false){ if(REATE_DE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get NOT_READY () {return 0}", "function onDeviceReady() {}", "isRealDevice () {\n return false;\n }", "static get WAITING_INIT () { return 0; }", "function initDeviceListener() {\n\n}", "function NTSCEvent()\r\n{\r\n try\r\n {\r\n gb_use_ntsc_arduino = this.checked() ? true : false; \r\n }\...
[ "0.6167679", "0.6102628", "0.59959906", "0.5816362", "0.5782384", "0.5761338", "0.5749479", "0.573992", "0.57094765", "0.55887777", "0.5518906", "0.5500182", "0.5442451", "0.54150975", "0.53998923", "0.539281", "0.53901464", "0.5389165", "0.53875345", "0.5323742", "0.5304826"...
0.6546514
0
animation to fade in list items sequentially
function fadeInList() { var eT = 0; $('.list-item').each(function () { $(this).delay(eT).fadeIn(300); eT += 100; }); $('.list-item').click(function () { $('.list-item').stop(true, true).fadeIn(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fadeIn(listItem) {\n listItem.style.opacity = 0;\n // listItem.style.backgroundColor = '#99C262';\n\n\n var tick = function() {\n listItem.style.opacity = +listItem.style.opacity + 0.05;\n\n if (+listItem.style.opacity < 1) {\n ...
[ "0.7720636", "0.7052389", "0.6905249", "0.6834905", "0.6629125", "0.65503407", "0.65380013", "0.6417345", "0.6339233", "0.6333696", "0.6323719", "0.6289074", "0.62312686", "0.6178727", "0.6106554", "0.6099223", "0.60887563", "0.607873", "0.6073805", "0.6058033", "0.60490495",...
0.79577845
0
function for submit Exam and give result
function submitExam(req, res) { // testData , username if (!req.body.testData) { res.status(200).send('{"error" : "Required params not found" }'); return false; } examservice.submitExam(req.body.testData) .then(function (submitResult) { res.send(submitResult)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submit() {\n message = input.value();\n getSentences(message); //Splits the message into separate sentences / questions \n}", "function submitAnswer() {\r\n\tclearInput();\r\n\tclearOutput();\r\n\tretrieveSubmittedAnswer();\r\n\tuserSubmitedAnswer();\r\n}", "submitExtra() {\n }",...
[ "0.6335427", "0.62804514", "0.6112791", "0.601281", "0.60036767", "0.5988164", "0.59644663", "0.59532857", "0.5916141", "0.5871843", "0.57827014", "0.5781528", "0.57808053", "0.5754581", "0.57529485", "0.57368726", "0.5730707", "0.5730707", "0.57261175", "0.5718446", "0.57177...
0.64025724
0
url => string url of the websocket connection exectuables => Json with commands as keys and functions as values to be executed when the socket recieve a message
constructor(url, executables) { this.socket = new WebSocket(url); this.execute_functions = executables this.socket.onopen = function() { console.log("[open] Connection established"); }; // event => response from websocoket close event this.socket.onc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connect(url) {\n if ( ! url ) {\n url = window.location.href; // http://localhost:8080/console.html\n this.log(\"This href \"+url);\n let start = url.indexOf('/');\n let protocol = url.substring(0,start);\n let webSocketProtocol = 'ws';\n if ( protocol == 'https:' ) {\n webS...
[ "0.67291313", "0.63119006", "0.62316144", "0.61773545", "0.615942", "0.61535627", "0.61461514", "0.6143888", "0.61336035", "0.6104658", "0.60603994", "0.6057315", "0.60534286", "0.60526025", "0.60452735", "0.60133314", "0.60056746", "0.59910595", "0.597346", "0.5972925", "0.5...
0.73688936
0
execute_functions => Json with functions references to be execute on incoming message
attach_functions(executables) { var run_functions = this.execute_functions Object.keys(run_functions).forEach(function(function_name) { var to_execute = run_functions[function_name]; executables[function_name]= to_execute }); this.execute_functions = executables ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFunctions() {\r\n var commands = [\r\n { command: \"command1\", description: \"description1\" },\r\n { command: \"command2\", description: \"description2\" },\r\n ];\r\n messagePayload.commands = commands;\r\n\r\n console.log(\r\n JSON.stringify(\r\n sendPayload(\"setMyCommands\", mes...
[ "0.64825946", "0.64114493", "0.6220222", "0.6187932", "0.6061222", "0.56842804", "0.56789064", "0.56651354", "0.5617795", "0.56059194", "0.55503", "0.55088276", "0.54996014", "0.54717433", "0.54589087", "0.5423826", "0.5344652", "0.52422607", "0.52411175", "0.52395105", "0.52...
0.7239392
0
Make AJAX request to Sinatra route to prompt caching of images to ./public/swap
function cacheImage(imgUrl) { console.log("cacheImage imgUrl: ", imgUrl) var imageInfo = parseImageUrl(imgUrl); console.log("cacheImage imageInfo: ", imageInfo); $.ajax({ url: "/cache_image", type: 'POST', data: { image_info: imageInfo }, success: function(result) { c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serveCached(res, url) {\n\tres.writeHead(200, {'Content-Type': 'application/javascript'});\n\tres.end(cache[url].data);\n}", "function retrieveImage(imageInfo) {\n\n var imageName = imageInfo[1];\n var status = $(\"#ajax_result\").text();\n var image = \"swap/\" + imageName;\n\n if (status === \"AJA...
[ "0.60751396", "0.5836335", "0.5774666", "0.575244", "0.575244", "0.5730995", "0.5711508", "0.56769294", "0.5559579", "0.54652214", "0.54554564", "0.5443246", "0.5381267", "0.5372589", "0.5311824", "0.5293163", "0.52533615", "0.52463174", "0.5245577", "0.52406055", "0.5233221"...
0.5899951
1
Find the property that the discriminator is referencing.
function findDiscriminatorField(schema, options, property) { if (schema.properties?.[property]) { return schema.properties[property]; } // I need to return early, so I can't .forEach, wish I could use a for-of loop! // eslint-disable-next-line no-plusplus for (let i = 0; i < options.length; i++) { co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FindPropertyRelative() {}", "get discriminator () {\n\t\treturn this._discriminator;\n\t}", "get propertyType() {}", "findPropertyNamed(aName){\n for(let i = 0; i < this._properties.length; i++){\n let prop = this._properties[i];\n if(prop.matchesNameOrAlias(aName)){\n ...
[ "0.6243743", "0.6051163", "0.5893268", "0.5860801", "0.5846527", "0.5756387", "0.57189983", "0.5589484", "0.5581087", "0.55489796", "0.5510333", "0.5464311", "0.5453479", "0.5433217", "0.5430656", "0.54084074", "0.5386774", "0.5317323", "0.53006953", "0.5284667", "0.5280301",...
0.6449322
0
rjsf/oasform adds an empty format field to the schema if there isn't one. We don't want that, to ensure we can identify equality with the schema component
function cleanDiscriminatorSchema(schema) { const copy = { ...schema }; if (copy.format === '') { delete copy.format; } return copy; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get format() { return this._format; }", "function isFieldInRightFormat(field) {\n if (field.value == \"\") return (true);\n var valid = true;\n switch (field.COMETFormat) {\n case \"C\" :\n field.value = field.value.toUpperCase();\n break;\n case \"F1\" :\n var num = formatFloat(field.val...
[ "0.5652181", "0.5558434", "0.5504406", "0.5448312", "0.5447001", "0.5432009", "0.54293966", "0.54120183", "0.54120183", "0.53421843", "0.5341449", "0.53217375", "0.53083366", "0.529654", "0.527914", "0.52683717", "0.52549475", "0.5247497", "0.5211121", "0.5205346", "0.5193931...
0.58683425
0
This is a fun one. So here we go. If we want to generate a list of options for the discriminator drop down, we look at the schemas in the oneOf/anyOf. Unfortunately the "value" of the discriminator is the name of that schema as referenced in the components/schemas list. This is unfortunate because by the time we reciev...
function getSchemaOptions(discriminatorSchemas, componentSchemas) { const options = []; Object.keys(discriminatorSchemas).forEach(dsKey => { const discSchema = discriminatorSchemas[dsKey]; Object.keys(componentSchemas).forEach(componentKey => { if (deepEquals(cleanDiscriminatorSchema(discSchema), com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMappingOptions(mapping, discriminatorSchemas, componentSchemas) {\n const validSchemas = {};\n\n // Get a list of valid schemas listed in the mapping and format it to look like its own component schema object, but\n // with the mapping keys instead of real keys so we can reuse getSchemaOptions.\n O...
[ "0.60455924", "0.57967395", "0.56654847", "0.5627153", "0.5399878", "0.5397701", "0.53744924", "0.53123015", "0.5296271", "0.5178589", "0.51784885", "0.5173124", "0.5156068", "0.5137887", "0.50856304", "0.5080955", "0.5063856", "0.50591636", "0.5048996", "0.5024626", "0.49855...
0.6754376
0
Navigates a schema, trying to find the discriminator details
function findDiscriminatorDetails(schema) { if (schema.discriminator) { return schema.discriminator; } // Sometimes discriminators are within each of the oneOf schemas, and not top level. if (schema?.oneOf) { // If the oneOf schemas has a discriminator, return that if (schema.oneOf?.[0]?.discrimina...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDiscriminatorRequired(){\n $scope.discriminatorReq = false;\n if ($scope.input.mappingPath) {\n //there is a mapping\n var cnt = 0;\n treeData.forEach(function (node) {\n if (node.data) {\n ...
[ "0.5901949", "0.582811", "0.536364", "0.5296662", "0.5290816", "0.52313435", "0.5226419", "0.5151155", "0.5128983", "0.5094177", "0.50280523", "0.49637398", "0.49637398", "0.49475205", "0.4855587", "0.48524567", "0.48497123", "0.48412746", "0.48193833", "0.48087174", "0.48087...
0.7060355
0
wrap the given array of statements in an IIFE (ImmediatelyInvoked Function Expression)
function wrapInIIFE(body, yyloc, yy) { var thisExp = yy.Node('ThisExpression', yyloc); return yy.Node('CallExpression', yy.Node('MemberExpression', yy.Node('FunctionExpression', null, [], null, createReturnStatementIfPossible(yy.Node('BlockStatement', body, yy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildFunctions2() {\r\n \r\n var arr = [];\r\n \r\n for (var i = 0; i < 3; i++) {\r\n // Push the RESULT of the EXECUTING function, and executing the function returns us ANOTHER function\r\n arr.push(\r\n (function(j) { // This is an IIFE, peep the paranthesis, *invo...
[ "0.5716215", "0.56186974", "0.5555125", "0.54931456", "0.5492233", "0.5454893", "0.54422987", "0.54246354", "0.54009074", "0.5391427", "0.5391427", "0.5391427", "0.5391427", "0.5391427", "0.5391427", "0.5391427", "0.5391427", "0.53893983", "0.53893983", "0.5388899", "0.536615...
0.5688473
1
Differ is a class for comparing sequences of lines of text, and producing humanreadable differences or deltas. Differ uses SequenceMatcher both to compare sequences of lines, and to compare sequences of characters within similar (nearmatching) lines. Each line of a Differ delta begins with a twoletter code: ' ' line un...
function Differ(linejunk, charjunk) { this.linejunk = linejunk; this.charjunk = charjunk; /* Construct a text differencer, with optional filters. The two optional keyword parameters are for filter functions: - `linejunk`: A function that should accept a sing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_diff(){\t\t\n\t\tvar text1 = this.currentContribution > 0 ? this.contributions[this.currentContribution - 1].content :'';\n\t\tvar text2 = this.contributions[this.currentContribution].content;\n\t\t\n\t\tvar author = this.contributions[this.currentContribution].user;\n\t\tvar soundEffect = this._getSoundEffect(au...
[ "0.6255535", "0.62120986", "0.62120986", "0.62120986", "0.62120986", "0.62120986", "0.62120986", "0.599089", "0.5925689", "0.5925689", "0.5925689", "0.5925689", "0.5925689", "0.5925689", "0.59139425", "0.5744261", "0.5692147", "0.565722", "0.565722", "0.56564367", "0.5648483"...
0.6793506
0
can access static methods directly by using the class name Car.addNumbers(3, 4);
static addNumbers(num1, num2) { // 🔴 this returns undefined becuase there is no value in classe properties console.log(this.brand); return num1 + num2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addNumbers(a, b){\n return a + b;\n }", "function addNumbers(a, b) {\n return a + b;\n}", "function addNumbers(a, b) {\n return a + b;\n}", "static addStuff(a, b) {\n return a + b;\n }", "function addNumbers(number1, number2){\r\n return number1 + number2;\r\n}", "function addMachine(...
[ "0.6770028", "0.6037172", "0.6037172", "0.6035702", "0.5995549", "0.59798265", "0.5968285", "0.5967076", "0.5942352", "0.5922503", "0.59097856", "0.5894646", "0.5887294", "0.5885926", "0.5882565", "0.58802295", "0.58768976", "0.5864574", "0.5864574", "0.58618665", "0.58382636...
0.61269575
1
For a given node, tells if it has children
hasChildren (node) { return !!node[this.childrenProp]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasChildNodes(node) {\n return firstChild(node) != null;\n}", "get hasChildren() {}", "hasChildren() {\n if (this.children !== undefined && this.children.length > 0) {\n return true;\n }\n return false;\n }", "hasChildren() {\n const child = this.oneChi...
[ "0.7913633", "0.7823143", "0.76599246", "0.7645543", "0.7592258", "0.7592258", "0.7592258", "0.7592258", "0.7592258", "0.75311446", "0.7487591", "0.7446401", "0.72652674", "0.7218086", "0.6926342", "0.6905417", "0.68858576", "0.67604816", "0.67594606", "0.67594606", "0.674947...
0.8068825
0
For a given node index, selectedindex and selectedPath, tells if that index at the current path is the index of a selected node
isSelected (index, selectedIndex, selectedPath) { return index === selectedIndex && selectedPath === this.path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectedIndex(x) {\n return x==selectedID;\n }", "function index() {\n if ( Array.isArray( arr ) ) {\n return arr.indexOf( selected ); // set var for the current index value\n }\n }", "function getIndex( __selectedLayer )\n{\n\tvar index = 0;\n\twhile ( __selectedLayer....
[ "0.6662649", "0.58082145", "0.57718104", "0.57340294", "0.5717099", "0.5603381", "0.55855286", "0.55374527", "0.55374527", "0.55374527", "0.5514989", "0.5442396", "0.5428043", "0.5398709", "0.53693616", "0.5359112", "0.53440785", "0.5329823", "0.53279537", "0.53242546", "0.52...
0.7133171
0
Sets the current path to display the directory where the selected node is
goToSelected () { this.path = this.selectedPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCurrentPath(d) {\n if (d == tmRoot)\n $('#path_label').text(getPath(d));\n else\n $('#path_label').text($('#path_label').text() + \"/\" + getPath(d));\n}", "static setRoot()\n {\n Explorer.currentDir = \"\";\n Explorer.set();\n }", "_updateCurrentPath() {\n let c...
[ "0.708337", "0.659647", "0.6575403", "0.6378914", "0.6313984", "0.6026832", "0.5920555", "0.590044", "0.59003496", "0.5790566", "0.5686205", "0.56705856", "0.56406134", "0.55561453", "0.5542052", "0.5535085", "0.5529024", "0.5514074", "0.5493992", "0.5492937", "0.5487237", ...
0.6611748
1
Removes nonsignificant zeros. 5.1 return 5.1 0.300 return 0.3 12.000 return 12
function removeZeros(value) { if (value.indexOf('.') !== -1) { while (value[value.length - 1] === '0') { value = value.substring(0, value.length - 1); } if (value[value.length - 1] === '.') { value = value.substring(0, value.length - 1); } } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripZero(num){\n return parseFloat(a.toFixed(4));\n}", "function removeZeroValues() {\n\t\n\n\tvar removeItem = 0;\n\n\tinputDigits = jQuery.grep(inputDigits, function(value) {\n\t return value != removeItem;\n\t});\n}", "function noBoringZeros(x) {\n let a = x.toString().split('');\n f...
[ "0.7007544", "0.6948893", "0.6896306", "0.68355525", "0.6814883", "0.6602012", "0.6552533", "0.653496", "0.6527961", "0.6508929", "0.64739627", "0.6472549", "0.6419774", "0.641551", "0.63912785", "0.63769567", "0.63070667", "0.62936974", "0.62623453", "0.6255773", "0.623396",...
0.70930684
0
Convert a weight (input > canonical > output).
function convertWeight(value, inputUnit, outputUnit, decimals) { decimals = !decimals && decimals !== 0 ? 3 : decimals; BigNumber.config({ FORMAT: parseFormat, DECIMAL_PLACES: decimals, }); value = new BigNumber(value); value = value.times(unitsOfWeight[inputUnit]); // to canonical unit value = valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set weight(value) {}", "function standardizeClassWeights(classWeight, outputNames) {\n return standardizeSampleOrClassWeights(classWeight, outputNames, 'classWeight');\n}", "function standardizeClassWeights(classWeight, outputNames) {\n return standardizeSampleOrClassWeights(classWeight, outputNames, 'cl...
[ "0.6019353", "0.57658845", "0.57658845", "0.57658845", "0.5757936", "0.5678507", "0.5670192", "0.5525434", "0.54816806", "0.54733825", "0.5470559", "0.544462", "0.5440952", "0.54157627", "0.53997445", "0.539851", "0.5391717", "0.5323453", "0.53111583", "0.53034496", "0.527953...
0.65360063
0
With a canonical weight, return a sortable string. Does not handle negative weights! 12 return '00000012000000' 1.666666667 return '00000001666666'
function getSortable(weight) { if (weight < 0) { console.log(`Do not support negative weights '${weight}'`); } else if (weight > 99999999) { console.log(`Do not support overweight '${weight}'`); } let n = weight * 1000000; // to milligramme n = n + ''; // to string const i = n.indexOf('.'); if (i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderWeight(strng) {\n\n const sumOf = (str) => {\n let sum =0;\n for(n of str)\n sum=sum+parseInt(n)\n return sum\n }\n\n return strng\n .split(' ')\n .sort((a, b) => {return (\n sumOf(a) === sumOf(b) ?\n a - b : sumOf(a) - sumOf(b)\n )})\n .join(' ')\n}", "fu...
[ "0.6526157", "0.6246007", "0.6185456", "0.5926503", "0.5863507", "0.5535772", "0.55219495", "0.5405602", "0.54016393", "0.5371851", "0.5371851", "0.5371851", "0.5371851", "0.5371851", "0.5371851", "0.5371851", "0.5371851", "0.53690255", "0.5368046", "0.5366952", "0.5358456", ...
0.8205837
0
THREEcapFramePool object pool for memoryefficient reuse of frame objects
function THREEcapFramePool(width, height, depth) { this.width = width; this.height = height; this.depth = depth; this.size = width * height * depth; this.frames = []; this.pending = []; this.allocations = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectPool() {\n return;\n }", "function makePframes(){\n console.log(\"Making P frames\".green);\n\n deferredList = frameList.map(function(){\n return Q.defer();\n });\n\n var promiseList = deferredList.map(function(def){\n return def.promise;\n });\n\n ...
[ "0.5638354", "0.562057", "0.5451283", "0.5437598", "0.5394427", "0.5394427", "0.5385946", "0.5346758", "0.5329906", "0.5302973", "0.5295735", "0.5287721", "0.5282261", "0.52762693", "0.527124", "0.52688134", "0.52503043", "0.52503043", "0.52502763", "0.52364874", "0.522003", ...
0.8328132
0
Reads in all '.ms' files in list of directories templateDirs giving each an ID which matches the ''. The returned object provides a `render(ID, view)` function which will render object view using the template specified by ID. Note that each template may refer to any other template by its ID using a mustache partial.
function Mustache(templateDirs = ['./templates']) { this.templates = {}; for (const templateDir of templateDirs) { for (const fname of fs.readdirSync(templateDir)) { const m = fname.match(/^([\w\-]+)\.ms$/); if (!m) continue; try { this.templates[m[1]] = String(fs.readFileSyn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTemplates() {\n\t var templates = {};\n\n\t var templatesLoc = _path2[\"default\"].join(__dirname, \"transformation/templates\");\n\t if (!_pathExists2[\"default\"].sync(templatesLoc)) {\n\t throw new ReferenceError(messages.get(\"missingTemplatesDirectory\"));\n\t }\n\n\t var _arr3 = _fs2[\"d...
[ "0.6162363", "0.6162363", "0.61528534", "0.6114716", "0.5965706", "0.5846081", "0.55924326", "0.5505657", "0.54250073", "0.5424878", "0.53247404", "0.5260394", "0.5255518", "0.5245327", "0.5187587", "0.51664597", "0.51353526", "0.5109314", "0.5102563", "0.50969595", "0.508103...
0.6705905
0
loads all the posts of a particular user
function loadPosts() { API.userPosts(pathParams.user_id) .then(res => setPosts(res.data) ) .catch(err => console.log(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "posts(user) {\n return user.getPosts();\n }", "loadPosts() {\n // 5) call getPosts with the user's id */\n // 6) use the response.data object to set \"posts\" field on the state\n }", "function loadPosts() {\n\t\tvm.posts = []\n\t\tapiService.getPosts().$promise.then(function(result) {\n\t\t\tre...
[ "0.76525307", "0.7397496", "0.7258199", "0.7234016", "0.71741486", "0.70369506", "0.70285517", "0.6968398", "0.6963604", "0.694993", "0.6935685", "0.69233996", "0.68983585", "0.6886818", "0.6865212", "0.68527424", "0.6834235", "0.6825139", "0.6800333", "0.67527014", "0.669904...
0.8195485
0
Adds the items on pressing enter
function addbyEnter(event) { if (inputValueLength() && event.keyCode === 13) { inputItemsName() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemsEnterPress() {\n var key = (event.keyCode ? event.keyCode : event.which); // Enter button code = 13\n if (key == 13) {\n addItemsClick();\n }\n }", "function addListAfterKeypress(event) {\n if (inputLength() > 0 && event.keyCode === 13) {\n createListItem()...
[ "0.8570376", "0.79090005", "0.77640146", "0.775961", "0.7755936", "0.7751309", "0.7751309", "0.7751309", "0.77431047", "0.77420115", "0.77248037", "0.7721685", "0.7686473", "0.7686441", "0.7666274", "0.7658267", "0.76161057", "0.7598579", "0.75345224", "0.75274354", "0.752295...
0.8017312
1
Get Variables This method is used to retrieve all the available variables through an API request and print the response.
static async getVariables(){ //Get instance of VariablesOperations Class let variablesOperations = new VariablesOperations(); //Get instance of ParameterMap Class let paramInstance = new ParameterMap(); /* Possible parameters of Get Variables operation */ await paramIn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVars() {\r\n return new Promise((resolve, reject) => {\r\n let xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"/vars\");\r\n xhr.addEventListener(\"load\", () => {\r\n resolve(JSON.parse(xhr.responseText));\r\n });\r\n xhr.addEventListener(\"error\",...
[ "0.6520443", "0.6225378", "0.6198148", "0.61921793", "0.609969", "0.5971702", "0.5955682", "0.5914655", "0.59011734", "0.5820287", "0.5727427", "0.57152516", "0.5681705", "0.56507844", "0.56009305", "0.5575785", "0.55591506", "0.5517595", "0.5486795", "0.54585403", "0.5430043...
0.7477043
0
Create Variables This method is used to create variables and print the response.
static async createVariables(){ //Get instance of VariablesOperations Class let variablesOperations = new VariablesOperations(); //Get instance of BodyWrapper Class that will contain the request body let request = new BodyWrapper(); //Array to hold Variable instances l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getVariables(){\n\n //Get instance of VariablesOperations Class\n let variablesOperations = new VariablesOperations();\n\n //Get instance of ParameterMap Class\n let paramInstance = new ParameterMap();\n\n /* Possible parameters of Get Variables operation */\n ...
[ "0.63257766", "0.6316801", "0.5603773", "0.55552393", "0.54795355", "0.5403458", "0.5357214", "0.5246855", "0.523902", "0.52342707", "0.52216446", "0.51913625", "0.51688915", "0.51330215", "0.5120953", "0.510228", "0.5093484", "0.5077033", "0.50674784", "0.50552577", "0.50460...
0.7434439
0
Update Variables This method is used to update details of variables in CRM and print the response.
static async updateVariables(){ //Get instance of VariablesOperations Class let variablesOperations = new VariablesOperations(); //Get instance of BodyWrapper Class that will contain the request body let request = new BodyWrapper(); //Array to hold Variable instances l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateVariables(name, age) {\n name = \"Noman\";\n age = 100;\n}", "static async createVariables(){\n\n //Get instance of VariablesOperations Class\n let variablesOperations = new VariablesOperations();\n\n //Get instance of BodyWrapper Class that will contain the request body\n ...
[ "0.6394424", "0.6020492", "0.5884947", "0.579378", "0.56854975", "0.55866647", "0.54551995", "0.5422611", "0.5413244", "0.539887", "0.5357973", "0.53579", "0.53579", "0.53579", "0.53579", "0.53579", "0.53579", "0.53579", "0.53519255", "0.53507423", "0.52975553", "0.52908003...
0.73563075
0
Agrega una coma al nombre del estado
function nombreMunicipio(estado) { if (estado == '') { return '' } else { return estado + ', ' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function namestatus(){}", "nombreCompleeto(){\n //return this._nombre+ ' '+this._apellido+ ', '+this._departamento;\n //super es par aceder metodo padre\n return super.nombreCompleeto()+ ', '+this._departamento;\n }", "getStateTicket() {\n return `...
[ "0.55315113", "0.5501023", "0.5473941", "0.5359455", "0.53118795", "0.53078043", "0.5230139", "0.5190768", "0.51593125", "0.51309156", "0.5109693", "0.5061344", "0.50150114", "0.500986", "0.5004524", "0.49826607", "0.49439743", "0.4931377", "0.49179873", "0.4908977", "0.49080...
0.57027686
0
Controller class for Worksheet's add blank/control views
function WorksheetAddQCAnalysesView() { var that = this; that.load = function() { $("#worksheet_services input[id*='_cb_']").live('click', function(){ get_updated_controls(); }); // get references for selected services on first load get_updated_controls(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ViewController(){}//Extends Controller (at bottom of page).", "function WorksheetAddDuplicateAnalysesView() {\n\n var that = this;\n\n that.load = function() {\n\n // click an AR in add_duplicate\n $(\"#worksheet_add_duplicate_ars .bika-listing-table tbody.item-listing-tbody tr\").li...
[ "0.6333779", "0.6085902", "0.59976625", "0.59599733", "0.59394395", "0.5886881", "0.57810396", "0.5769347", "0.5753275", "0.5679791", "0.56438565", "0.55786633", "0.5539009", "0.5465777", "0.54379296", "0.5418169", "0.5336253", "0.53238696", "0.53238696", "0.53238696", "0.531...
0.6267138
1
Controller class for Worksheet's manage results view
function WorksheetManageResultsView() { var that = this; that.load = function() { // Remove empty options initializeInstrumentsAndMethods(); loadHeaderEventsHandlers(); loadMethodEventHandlers(); // Manage the upper selection form for spread wide interim results val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ResourceSheetController($mdBottomSheet) {\n this.items = [\n {name: 'Add new related person', icon: 'groupAdd', index: 0},\n {name: 'Detailed search', icon: 'search', index: 1},\n {name: 'Quick find', icon: 'quickFind', index: 2}\n ...
[ "0.6226355", "0.6134003", "0.57797503", "0.562425", "0.55520487", "0.5422322", "0.54074895", "0.53623563", "0.527413", "0.513941", "0.51327413", "0.510164", "0.5092008", "0.50888973", "0.50810397", "0.5055379", "0.50330883", "0.49871007", "0.49725226", "0.49657634", "0.493783...
0.66657525
0
set node by position
setNode(pos, val){ let curr = this.head; for(let i = 0; i < this.length; i++){ if(i === pos){ curr.val = val; }else{ curr = curr.next; } } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNodePosition(Pos, node) {\n let currrentNode = this.nodes.find(n => n === node);\n currrentNode.x = Pos.x;\n currrentNode.y = Pos.y;\n }", "function setNode(pos, dist){\n\tif(nodeArray[pos] != start){\n\t\tnodeArray[pos].addDis('&#8734');\n\t}\n\n\tif(pos < nodeArray.length - 1){\n\t\t...
[ "0.7814428", "0.69615823", "0.6901578", "0.6725743", "0.66896814", "0.6635262", "0.66060925", "0.6603104", "0.6595944", "0.658282", "0.6519226", "0.6516562", "0.6457998", "0.64053893", "0.6319402", "0.6313296", "0.62933034", "0.6249902", "0.62485576", "0.62485576", "0.6248557...
0.7065831
1
Instantiate a new ArcRotateCameraVRDeviceOrientationInput.
function ArcRotateCameraVRDeviceOrientationInput() { /** * Defines a correction factor applied on the alpha value retrieved from the orientation events. */ this.alphaCorrection = 1; /** * Defines a correction factor applied on the gamma value retrieved from the orienta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOrientation(orientation){\n if(orientation)\n camera.rotation.z=Math.PI/2; ///=+\n else\n camera.rotation.z=0;\n}", "function Camera(position, rotation) {\n this.position = new Vector(position);\n this.rotation = new Angle(rotation);\n }", "function MouseKeyboar...
[ "0.58531", "0.58117807", "0.5730809", "0.57230157", "0.5689825", "0.56532645", "0.55303276", "0.5524355", "0.5478974", "0.5463871", "0.5463871", "0.5463871", "0.5463871", "0.5463871", "0.5450834", "0.5394657", "0.5394645", "0.53891516", "0.5369292", "0.53136545", "0.531067", ...
0.8141295
0
The x limit of the zoomed plane
limitx() { return (this.scale - 1) * this.sizex / 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xScreen(x) {\n return (x - xMin) / (xMax - xMin) * canvasGraph.width + 5;\n }", "function plot_get_x_max(plot_id) {\n\tif (! plot_is_showed(plot_id)) {\n\t\tconsole.log('Broken plot_get_x_max');\n\t\treturn;\n\t}\n\treturn plots[plot_id]['chart'].scales['x-axis-0'].max;\n}", "function panX(x...
[ "0.667424", "0.66566235", "0.6479898", "0.64628184", "0.6419926", "0.636661", "0.6361231", "0.6350731", "0.628075", "0.6252454", "0.62457293", "0.62448", "0.6192092", "0.61755496", "0.6171822", "0.61257285", "0.6121692", "0.60432696", "0.6033892", "0.6026142", "0.59978145", ...
0.76158494
0
linkify() For our specific purposes, we require the following inputs: input_textA string holding the table cell's contents (basically, a phone number) user_nameThe user's name that is currently logged in. Within our app, this was set on login and added to $.cookie('CookieWithUserID')
function linkify(input_text,user_name) { var replaced_text, replace_pattern; replace_pattern = /\(?([0-9]{3})\)?[- ]([0-9]{3})[- ]([0-9]{4})/; // regex for (999) 999-9999 /** * * replaced_text uses the replace() function to add the phone number to the output '($1) $2-$3', * create an <A> link tag. ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLogin() {\n if (loggedIn.length != 0) { //checking if any data in the cookie\n var startpos = loggedIn.indexOf('name') + 5; //will name my cookie name so have to chop first 5 digits out of cookie when displaying the content\n var endpos = loggedIn.indexOf(';', startpos); //gathering ...
[ "0.59496903", "0.53903747", "0.5389571", "0.5263074", "0.51986444", "0.5171703", "0.5102553", "0.50593734", "0.5055275", "0.50368494", "0.5033889", "0.50308996", "0.5007479", "0.49949852", "0.49717647", "0.49652958", "0.49633414", "0.4941591", "0.49346745", "0.4928168", "0.49...
0.60112774
0
makeCall() Pops up a new window that shows the user what is happening when they click on the phone icon. Ours just has a loading icon and says "Placing call to (999) 9999999"
function makeCall(url) { var random_number = Math.random(); //adding random_number to the window name as not to interfere with other phonecall popups that are already there newwindow=window.open(url,'makeNewCall_'+random_number,'height=250,width=450,top=300,left=250'); if (window.focus) {newwindow.focus()} return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeCall() {\n if (phone.busy) {\n throw new Error(\"Cannot place call. Phone busy\");\n }\n var params = {\n To: \"+\" + document.getElementById('dialerPhoneNumber').value\n };\n phone.state = PhoneState.Idle;\n log('Placing a call to ' + params.To + '...');\n phone.na...
[ "0.7443869", "0.74095786", "0.68959534", "0.6802078", "0.6800175", "0.6741294", "0.66856253", "0.66426045", "0.6630698", "0.6628084", "0.6623645", "0.65382653", "0.64952713", "0.6494951", "0.64909047", "0.6487892", "0.64727914", "0.644258", "0.641484", "0.64081156", "0.640414...
0.77259976
0
Delete item from a collection
async deleteItem(collection, id) { const db = await this.connect(); const col = await db.collection(collection); const res = await col.deleteOne({ _id: mongoId(id)}); await this.close(db); return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(collection, obj) {\n this.db.get(collection).remove(obj).value();\n }", "function deleteRelatedItem (currentUser, collection) {\n m.Item.findOne({type: itemTypes.COLLECTION.id, _content: collection._id}, function (err, item) {\n if (err) return logger.error(err)\n itemController.deleteOne(curre...
[ "0.74214125", "0.70990074", "0.70949346", "0.7044634", "0.69503427", "0.68494755", "0.68467665", "0.6797613", "0.6794574", "0.6793371", "0.6775509", "0.6774484", "0.6755843", "0.67332137", "0.66717005", "0.66466695", "0.66436094", "0.66436094", "0.66436094", "0.663918", "0.65...
0.7136949
1
CollidableObject.js__________ An object that can detect and respond to collision
function CollidableObject () { //CollidableObject will have a special child called Trigger //It would be slicker if Collision (this class basically) were a component for //other visible objects (or invisible triggers!), so Trigger wouldn't inherit //all the moving and drawing junk, but time shortage in the end pre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collision () {\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "onCollision(response, other) {\n // Make all other objects solid\n return true;\n }", "collides(obj) {\n const isColliding = super.collides(obj);\n if (isCol...
[ "0.7637805", "0.7606089", "0.7606089", "0.7547352", "0.7547352", "0.7404033", "0.7340297", "0.71667516", "0.7128738", "0.7128215", "0.70738053", "0.7064089", "0.7021435", "0.69841117", "0.6962646", "0.6950588", "0.6920248", "0.69144094", "0.6876559", "0.68330085", "0.68235743...
0.7617742
1
InvalidAccesConstructorException: heradado de MyBaseExceptions y su constructor
function InvalidAccesConstructorException(){ this.name = "InvalidAccesConstructor"; this.message = "El constructor no puede ser llamado como una función"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MyBaseExceptions(){\n}", "constructor() {\n throw Exception.staticClassConstructorInvocation;\n }", "constructor() {\n throw Exception.staticClassConstructorInvocation;\n }", "constructor() {\n\t\tthrow new Error('Sorry, this class can`t be instanciated, it is only for static met...
[ "0.70859224", "0.6836437", "0.6836437", "0.6749759", "0.6643529", "0.6523371", "0.6444918", "0.64441025", "0.63945675", "0.63800734", "0.636611", "0.6286572", "0.6178586", "0.61197925", "0.6119169", "0.6089573", "0.6089573", "0.6089573", "0.6089573", "0.6089573", "0.6089573",...
0.7040275
1
InvalidDateException: comprobar si la fecha introducida es correcta.
function InvalidDateException(param){ this.name = "InvalidDateException"; this.message = "La fecha introducida " + param + " no es correcta"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validarFechas(fecha) {\n let date = moment(fecha, \"DD/MM/YYYY HH:mm:ss\");\n\n return date.format(\"YYYY-MM-DD\");\n }", "function isInvalidDate(input) {\n\treturn isDate(input) && isNaN(input);\n}", "getInvalidDate(){\n return \"13/45/5555 50:49:99 CM\"\n }", "function validarFecha(){\n\tv...
[ "0.66470844", "0.6535305", "0.652699", "0.63783693", "0.6377858", "0.63377136", "0.6324454", "0.6312855", "0.62966406", "0.62949234", "0.62774897", "0.62576467", "0.6248056", "0.62311035", "0.6209545", "0.62060964", "0.6204566", "0.620377", "0.62028337", "0.62017727", "0.6199...
0.665289
0
AbstractClassException: es una clase abstracta.
function AbstractClassException(){ this.name = "AbstractClassException"; this.message = "es una clase abstracta, no puede instanciarse"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UIAbstract() {\n throw \"abstract class 'UIAbstract' can not be used directly!\";\n}", "function abstractmethod() {\r\n\tthrow new Error(\"abstract method\");\r\n}", "function abstractFunction() { throw new Error('abstract'); }", "function abstractFunction() { throw new Error('abstract'); }", "f...
[ "0.6710764", "0.6636191", "0.6531799", "0.6531799", "0.6465147", "0.640613", "0.6400292", "0.605147", "0.57003623", "0.5682162", "0.5670112", "0.56441885", "0.5558221", "0.55559856", "0.5545302", "0.5545302", "0.5539779", "0.5531091", "0.5530467", "0.5486837", "0.5454329", ...
0.77597755
0
excepciones sobre VS NoExistCategoryException: el valor NO existe en el array.
function NoExistCategoryException(param){ this.name = "NoExistCategoryException"; this.message = "el valor " + param + " NO existe en el array"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExistCategoryException(param){\n this.name = \"Error!\";\n this.message = \"Ese elemento ya está asignado\";\n}", "function categoryExists(category) {\n return originals[category] != null\n}", "function NoExistProductionException(param){\n this.name = \"NoExistProductionException\";\n t...
[ "0.60236245", "0.6008293", "0.5999101", "0.5669602", "0.5534597", "0.54323494", "0.5410763", "0.540227", "0.53668857", "0.5359263", "0.52548796", "0.52093357", "0.52093357", "0.519678", "0.5196634", "0.5171248", "0.51558435", "0.5104487", "0.5102729", "0.5098587", "0.5071099"...
0.7527624
0
NoExistProductionException: el valor NO existe en el array.
function NoExistProductionException(param){ this.name = "NoExistProductionException"; this.message = "el valor " + param + " NO existe en el array"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NoExistPersonnException(param){\n this.name = \"NoExistPersonnException\";\n this.message = \"el valor \" + param + \" NO existe en el array\";\n}", "function NoExistCategoryException(param){\n this.name = \"NoExistCategoryException\";\n this.message = \"el valor \" + param + \" NO existe en...
[ "0.5613019", "0.55778635", "0.5507985", "0.54425246", "0.5234419", "0.52068746", "0.5149036", "0.5063686", "0.50350666", "0.49173644", "0.4907574", "0.48618475", "0.47471932", "0.47387978", "0.469022", "0.4680313", "0.46772256", "0.46607217", "0.4659187", "0.4648016", "0.4639...
0.72870344
0
NoExistPersonnException: el valor NO existe en el array.
function NoExistPersonnException(param){ this.name = "NoExistPersonnException"; this.message = "el valor " + param + " NO existe en el array"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NoExistProductionException(param){\n this.name = \"NoExistProductionException\";\n this.message = \"el valor \" + param + \" NO existe en el array\";\n}", "function NoExistCategoryException(param){\n this.name = \"NoExistCategoryException\";\n this.message = \"el valor \" + param + \" NO exi...
[ "0.6580287", "0.5884059", "0.5423262", "0.54163903", "0.53671724", "0.5269888", "0.5268829", "0.5236642", "0.5218358", "0.5207749", "0.5145027", "0.5126828", "0.51176727", "0.50938433", "0.5067187", "0.50659376", "0.5044011", "0.501456", "0.49585873", "0.49126273", "0.4893081...
0.7561418
0
cancel reservation by id
function cancelReservation(junkId) { return axios.post(BASE_URL + '/itemReserveCancel', { junkId }) .then(response => response.data) .catch(function (error) { return error; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelInterview(id) {\n \n return axios.delete(`api/appointments/${id}`)\n .then(() => \n dispatch({ type : SET_INTERVIEW, value : {id, inverview : null }}))\n }", "function cancelInterview(id) {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n...
[ "0.7057859", "0.6851293", "0.6812993", "0.6720691", "0.66510713", "0.65523434", "0.6535941", "0.6517001", "0.651612", "0.64884853", "0.64578503", "0.64521134", "0.6396877", "0.638332", "0.6344686", "0.6313071", "0.6309037", "0.62597865", "0.6239375", "0.6239375", "0.6239375",...
0.7666215
0
changes reserved item status
function changeReservationStatus(status, fetcher, junkId) { return axios.post(BASE_URL + '/itemStatus', { status, fetcher, junkId }) .then(response => response.data) .catch(function (error) { return error; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeStatus(params) {\n var index = this.list.map(i => i.id).indexOf(params.id);\n this.list[index].open = params.status;\n ls.updateItem({id : params.id}, {open : params.status});\n this.filterByStatus(this.stats);\n }", "setAvailable() {\n this.currentState = assetState.AVAILABLE;\n }"...
[ "0.6100943", "0.6054176", "0.60130066", "0.60034466", "0.5954866", "0.59505177", "0.5871384", "0.58287275", "0.5775105", "0.5736545", "0.5706209", "0.56952065", "0.5611544", "0.5604569", "0.55715925", "0.55369216", "0.55019", "0.5499071", "0.54816645", "0.54792213", "0.545502...
0.6219006
0
Define the side effects that will occur in the application. E.G code that handles dispatches to redux, API requests, or timers.
function sideEffects() { // The dispatch function takes actions as arguments to make changes to the store/redux. dispatch(fetchAllUsers()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sideEffects() {\n\t\t// The dispatch function takes actions as arguments to make changes to the store/redux.\n\t\tdispatch(getAllUserPhotos())\n\t}", "function exampleSideEffects(param1, param2) {\n return {\n type: 'ACTION_WITH_SIDE_EFFECTS',\n payload: { param1, param2 },\n timestamp: Date.n...
[ "0.6790382", "0.61086494", "0.5840934", "0.5840934", "0.5840934", "0.5637937", "0.5584905", "0.5561914", "0.55577296", "0.55522776", "0.55368626", "0.55321664", "0.55321664", "0.54897565", "0.5463237", "0.54584223", "0.54584223", "0.54584223", "0.54584223", "0.54584223", "0.5...
0.65344304
1
mixin for fnOptions > userDefaultOptions > defaultOptions
function mixOptions(options, userDefaultOptions, key) { if (!obj(userDefaultOptions)) userDefaultOptions = {}; if (!key) { var key; for (key in options) { mixOptions(options, key); } } if (!options || Object.keys(options).length<1) { return defaultOptions[key]; } if (!key in defaultOptions) { defaultOptions[key] = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "option(flags, description, fn, defaultValue) {\n const option = new _option.default(flags, description);\n const optionName = option.name();\n const name = option.attributeName(); // default as 3rd arg\n\n if (typeof fn !== 'function') {\n if (fn instanceof RegExp) {\n const regex = fn;\n\n...
[ "0.6474481", "0.64641124", "0.6389796", "0.6389796", "0.6327632", "0.6250313", "0.6250313", "0.6235168", "0.61981374", "0.6108806", "0.6101446", "0.6086317", "0.6060487", "0.60217226", "0.60171", "0.5954101", "0.59286743", "0.58931327", "0.58931327", "0.58828485", "0.587371",...
0.652825
0
Convert the gregorian date array produced by toGregorian into a date string. NOTE(stephen): toGregorian is oneindexed for month, so we subtract one from the month to make it consistent with everything else in javascript.
function gregorianDateArrToStr([year, month, day]): string { return moment.utc([year, month - 1, day]).format('YYYY-MM-DD'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertDateToString(tday,format)\n{\ng_date= tday.getDate();\ng_month= tday.getMonth()+1;\ng_year= tday.getFullYear();\ng_date= (g_date >9)?g_date:\"0\"+g_date;\ng_month= (g_month >9)?g_month:\"0\"+g_month;\nreturn g_year+\"-\"+g_month+\"-\"+g_date;\n}", "formatDateForArray(date, month, year) {\n //c...
[ "0.6512063", "0.63108695", "0.62980396", "0.6264855", "0.61350936", "0.61163074", "0.61027485", "0.609457", "0.60539615", "0.6053127", "0.6015605", "0.5971661", "0.5947576", "0.5934217", "0.592161", "0.5920687", "0.59157515", "0.5900204", "0.58819926", "0.5873462", "0.5822532...
0.8038649
0
on submit, sends local state to db as new student (through express route)
handleSubmit(evt) { const studentObj = this.state; const nameAddOn = studentObj.name.split(' ')[0].toLowerCase() // adds github based on inputed name and random kitten img to student object studentObj.imgUrl = generateRandomKitty(); studentObj.github = 'github.com/' + nameAddOn; // sends...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSubmit(event) {\n event.preventDefault();\n\n const newStudent = {\n Name: this.state.name,\n Email: this.state.email,\n Password: this.state.password,\n dob: this.state.dob,\n preference: this.state.preference,\n student_starting_score: Math.floor(Math.random() * 100) \n }...
[ "0.7116824", "0.6409059", "0.6321907", "0.6317058", "0.6306816", "0.62574494", "0.6238375", "0.6219579", "0.6215312", "0.6201563", "0.6166424", "0.61287266", "0.60753286", "0.603805", "0.6008916", "0.5981759", "0.59734297", "0.5969333", "0.59617466", "0.5921761", "0.59005857"...
0.7027364
1
highlights events with CRN equal to the selected CRN returns list of events that were found
function highlightSelectedEvents() { var foundEvents = []; var selectedCrn = localStorage.getItem("mainContentCalendarSelectedCrn"); var events = $('#calendar').fullCalendar('clientEvents'); for (var i = 0; i < events.length; i++) { var eventCrn = events[i]._id.split("_")[0]; if (eventCr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assignColorIndication(data) {\n var finalArray = []; //stores formatted events data\n var overLappingArray = []; //stores set of overlapping arrays\n var oReferenceObject = data[0]; //Assuming Niki's data will be firts element\n data[0][\"label\"] = \"Me\"; //Assign lunch event as \"Me\" assum...
[ "0.5499881", "0.53830874", "0.5342186", "0.52496934", "0.5225264", "0.51261157", "0.51201695", "0.51061183", "0.5074155", "0.50440323", "0.5011427", "0.49949855", "0.4986823", "0.49582", "0.4935296", "0.49345142", "0.49329302", "0.49126828", "0.48915848", "0.48585814", "0.485...
0.6446505
0
gets the events that were reset in the last operation (if any) and sets them to the default color
function resetRevertColors() { var events = JSON.parse(localStorage.getItem("manageClasses_revertColorEvents")); var allEvents = $('#calendar').fullCalendar('clientEvents'); for (var i = 0; i < allEvents.length; i++) { if (allEvents[i]._id in events) { allEvents[i].color = '#5f5f5f'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_colors_dialog(){\r\n box = document.getElementById('TL_MENU');\r\n base = box.innerHTML;\r\n clr = '<i>Customize your event colours...</i>\\n';\r\n\r\n function add_color(display, event_name){\r\n clr +=...
[ "0.63807356", "0.6261158", "0.6195401", "0.6185454", "0.61729586", "0.6099009", "0.6060507", "0.6041962", "0.5981577", "0.59742385", "0.5973383", "0.597109", "0.59602976", "0.5949371", "0.5946961", "0.59405553", "0.59374636", "0.59144545", "0.59139943", "0.58786756", "0.58593...
0.6475992
0
returns every pair of overlapping events ex: [[e1,e2],[e3,e4]] doesn't get every pair, but each overlapped event will apear at least once if crn is specified, only checks events with that crn
function getOverlappingEvents(crn) { var overlappingEvents = []; if (crn === undefined || parseInt(crn) == NaN) { var allEvents = $('#calendar').fullCalendar('clientEvents'); } else { var allEvents = $('#calendar').fullCalendar('clientEvents', function (event) { return event._id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overlap (lines, event, maxParallelEvents, toRemove, doublecheck) {\n var range = event.pre > 0\n ? moment.range(moment(event.start).subtract(event.pre, 'minutes'), moment(event.end))\n : event.range\n for (var i = 0; i < lines.length; i++) {\n if (event.depth > maxParallelEv...
[ "0.661961", "0.6561839", "0.65313387", "0.6236351", "0.6219577", "0.6200367", "0.6082096", "0.5931608", "0.5864104", "0.56743044", "0.5561587", "0.5556626", "0.553477", "0.5516138", "0.54765624", "0.54234934", "0.54153806", "0.53805566", "0.5316086", "0.5259664", "0.52157503"...
0.7552767
0
pads num to width using the padChar padChar defaults to '0' from stackoverflow
function string_pad(num, width, padChar) { padChar = padChar || '0'; num = num + ''; return num.length >= width ? num : new Array(width - num.length + 1).join(padChar) + num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pad(num) {\r\n\tif (num > 9) {\r\n\t\treturn num;\r\n\t} else {\r\n\t\treturn '0' + num;\r\n\t}\t\r\n}", "function pad(num, width, zeroValue) {\r zeroValue = zeroValue || '0';\r num = num + '';\r return num.length >= width ? num : new Array(width - num.length + 1).join(zeroValue) + num;\r}", "funct...
[ "0.8279542", "0.8234422", "0.8194335", "0.8136641", "0.81058836", "0.8081274", "0.7982575", "0.7971607", "0.79663897", "0.7961255", "0.7910079", "0.7908198", "0.7907753", "0.785322", "0.7847278", "0.78356045", "0.7817234", "0.7817234", "0.7817234", "0.7817234", "0.7817234", ...
0.8357962
0
gets the first ancestor of startNode that is the given ancestorTag
function html_getFirstAncestorTag(startNode, ancestorTag) { ancestorTag = ancestorTag.toUpperCase(); var cur = startNode.parentNode; while (cur) { if (cur.tagName == ancestorTag) { return cur; } cur = cur.parentNode; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAncestorTag(tag, context) {\n var m = [], // nodelist container\n n = context.parent(), // starting point\n p;\n\n do {\n var node = n[0]; // break out of jqLite\n // limit DOM territory\n if (node.nodeType !== 1) {...
[ "0.66850257", "0.6492427", "0.64479995", "0.64479995", "0.63635904", "0.63417447", "0.6160682", "0.61593723", "0.6149042", "0.61457825", "0.6095674", "0.60503364", "0.600159", "0.600159", "0.6000293", "0.599451", "0.598761", "0.5963732", "0.5963732", "0.5963732", "0.5963732",...
0.86034346
0
Return the default page modal
function defaultModal(){var modal=modalFactory('#modal')[0];return modal}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultModal() {\n return modalFactory('#modal')[0];\n}", "openModal(){\n\n }", "function defaultPresentation() {\n home.css(\"margin-top\", \"20%\");\n home.find(\"span\").css(\"cursor\", \"default\");\n homebtn.show();\n roomList.hide();\n roomListLater.hide();\n roomListEdit.hid...
[ "0.7403983", "0.60988563", "0.59983903", "0.59771466", "0.59039706", "0.58733594", "0.5859187", "0.5857056", "0.58183575", "0.580388", "0.5779805", "0.5775498", "0.5775424", "0.576845", "0.57612544", "0.5755062", "0.5745705", "0.5723802", "0.57145506", "0.56989926", "0.569561...
0.74842525
0
Extend foundation.reveal with the ability to close a modal by clicking on any of its child element with datarevealclose attribute.
function revealCloseFactory(){var selector=arguments.length>0&&arguments[0]!==undefined?arguments[0]:revealCloseSelector;var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var $buttons=__WEBPACK_IMPORTED_MODULE_0_jquery___default()(selector,options.$context);return $buttons.map(function(index,elem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_extraHandlers() {\n var _this = this;\n if(!this.$element) { return; } // If we're in the middle of cleanup, don't freak out\n this.focusableElements = Foundation.Keyboard.findFocusable(this.$element);\n\n if (!this.options.overlay && this.options.closeOnClick && !this.options.fullScreen) {\n $('...
[ "0.62016964", "0.62005347", "0.6021866", "0.6000559", "0.6000559", "0.59430045", "0.5901137", "0.5824863", "0.58211917", "0.58158726", "0.57682633", "0.5745041", "0.565984", "0.56387544", "0.5621972", "0.56124437", "0.5602836", "0.5601074", "0.5559756", "0.55469525", "0.55423...
0.6470771
0
removes undo entry for "canceled" tools, that didn't affect state AT ALL op is the toolop requesting the cancelation, which allows us to validate the call.
toolop_cancel(op: ToolOp, executeUndo: boolean) { if (executeUndo === undefined) { console.warn("Warning, executeUndo in toolop_cancel() was undefined"); } if (executeUndo) { this.undo(); } else { if (this.undostack.indexOf(op) >= 0) { this.undostack.remove(op); this.u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelCallback()\n {\n deactivateInspectionToolButton();\n clearUndoBuffer();\n _layoutFunctions.enableToolbarMenu();\n }", "handleRejectUndo() {\n this.setState({\n undoContent: null,\n undoType: null\n });\n\n clearTimeout(this.stat...
[ "0.6718641", "0.63606995", "0.63549894", "0.625933", "0.625738", "0.62219054", "0.61556983", "0.6116803", "0.6084159", "0.60777056", "0.6076662", "0.6011858", "0.6011404", "0.5981685", "0.5977588", "0.5961895", "0.59591824", "0.59459704", "0.5944436", "0.5930281", "0.59217405...
0.691203
0
Starts a compiler server if none is available. Returns the available (or newly started server port) through callback
function start(callback) { searchForExisting(function(port) { if (port) { callback(port, false); } else { var fork = require('./fork'); var server = tcp.createServer({ allowHalfOpen:true }, function(client) { client.pip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startServer(callback) {\n if (!started) {\n started = true;\n\n server.listen(share.testPort, () => {\n callback();\n });\n } else {\n callback();\n }\n }", "async start() {\n const { events, server, host, port } = this;\n\n ...
[ "0.65892774", "0.6388846", "0.63605356", "0.6287483", "0.62031174", "0.62004304", "0.61476684", "0.60498923", "0.60493773", "0.6028313", "0.59530705", "0.59318143", "0.5922909", "0.59120923", "0.5911709", "0.5888276", "0.5877756", "0.58765346", "0.58520406", "0.57935256", "0....
0.70975655
0
Send compile job to a new or existing server
function compile(compilerPath, inOpt, callback) { start(function(port) { var client = tcp.connect({port:port,allowHalfOpen:true}, function() { client.end(new Buffer(JSON.stringify({ compilerPath: compilerPath, inOpt: inOpt }))); if (callbac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compile() {\n cloudCompile('Compile', 'compile', function (data, terminalNeeded) {});\n}", "function compile() {\n\tconst configItems = [\n\t\tEasyWebpack.getNodeWebpackConfig(merge(server, extend)),\n\t\tEasyWebpack.getWebWebpackConfig(merge(client, extend))\n\t];\n\treturn new Promise((resove, reje...
[ "0.6063128", "0.5594532", "0.55272216", "0.54125094", "0.53753126", "0.53380924", "0.5238724", "0.5152783", "0.51425076", "0.51405275", "0.5056868", "0.5048308", "0.5004647", "0.49832273", "0.4972968", "0.49676603", "0.49625525", "0.49591777", "0.49535087", "0.49533743", "0.4...
0.57341886
1
Returns True if the correct answer selected, else returns False btnVal: value of the button clicked, question: current question object
function checkAnswer(btnVal,question){ disableButtons(); if (btnVal === question.correctAns) { numCorrect++; return true; } else { numWrong++; return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guessAnswer (e) {\n console.log('Answer selected');\n // get the button from the event\n const selectedButton = e.target;\n console.log(e.target);\n // pull out the boolean represntinv if its true or not\n const correctAnswer = selectedButton.dataset.correct;\n console.log(correctAnsw...
[ "0.7179527", "0.71687853", "0.71294767", "0.70810133", "0.70266354", "0.70240575", "0.70230913", "0.6972883", "0.69720054", "0.69601065", "0.6953142", "0.6905553", "0.6903714", "0.68994117", "0.68934435", "0.68864095", "0.6884437", "0.6793881", "0.67810744", "0.67760944", "0....
0.7543486
0
add a booth to the cart
addBoothToCart(product, subitem){ this.cart.forEach(m => { if ( m.booths && m.id == product.id ){ this.total -= m.price; this.cart = this.cart.filter(n => n.id !== m.id); } if ( m.notify ){ this.cart ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItemToCart() {}", "function addItemToCart() {}", "add() {\n\t\torinoco.cart.add({ imageUrl: this.imageUrl, name: this.name, price: this.price, _id: this._id });\n\t}", "function addToBasket(detail) { }", "function addItemToCart(user, item) {}", "function addConeToCart(e) {\n var variation=...
[ "0.7579461", "0.7579461", "0.7171996", "0.6707231", "0.66796404", "0.6620558", "0.6605506", "0.6572338", "0.6547142", "0.6518147", "0.65180445", "0.6507502", "0.64902765", "0.648407", "0.64750767", "0.6471282", "0.64654934", "0.64533347", "0.64164233", "0.64111143", "0.640388...
0.7659925
0
remove a booth from the cart
removeBoothFromCart(booth, selector){ if ( selector == 'events' ){ this.cart.forEach(m => { if ( m.id == booth.id ){ this.total -= m.price; return; } }) } else this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItemFromCart(){\n\n}", "removeAdvert(advert){\n this.total -= advert.price;\n this.cart = this.cart.filter(m => m.name !== advert.name);\n }", "function removeItem() {\n const productId = this.name;\n if(confirm(\"Voulez-vous supprimer le produit du panier ?\")...
[ "0.7362706", "0.7092229", "0.70822144", "0.6965784", "0.6958989", "0.69540757", "0.6952191", "0.693511", "0.6930008", "0.6920335", "0.6902023", "0.6900565", "0.68861", "0.6885665", "0.68780607", "0.68670726", "0.6865352", "0.6861272", "0.68417215", "0.68416154", "0.6822964", ...
0.78548944
0
remove an advert from the cart
removeAdvert(advert){ this.total -= advert.price; this.cart = this.cart.filter(m => m.name !== advert.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItemFromCart(){\n\n}", "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function removeCart(){\n\n}", "function removeOneItemFromCart() {\n var ...
[ "0.7186218", "0.69834435", "0.6796209", "0.67953247", "0.6789865", "0.67864305", "0.67842346", "0.6667975", "0.666591", "0.6606586", "0.65796304", "0.65685546", "0.65538335", "0.65460706", "0.6522339", "0.64840144", "0.6469201", "0.644997", "0.6444465", "0.64258623", "0.64221...
0.8226165
0
we return to the calculator screen from checkout (if we want to add a new item etc.)
goBackFromCheckout() { this.selectedWorkshops = []; document.getElementById("main-wrapper").style.display = "block"; document.getElementById("checkout").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetProductView(){\n \n inquirer.prompt([\n {\n type: \"rawlist\",\n name: \"action\",\n message: \"What would you like to do next?\",\n choices:[\"I want to checkout\", \"I want to continue shopping\"]\n }\n\n ]).then(function(answers){\n if(answers.a...
[ "0.6229405", "0.6220836", "0.6134976", "0.6111532", "0.6067689", "0.5997576", "0.5956621", "0.591169", "0.59105605", "0.58636296", "0.58434606", "0.5837414", "0.5827951", "0.5821636", "0.5819902", "0.5819575", "0.58043396", "0.5793547", "0.5768011", "0.57678133", "0.57674396"...
0.63510144
0
Populate posts Array with post obj
populatePosts (postObj) { this.ghostObj['data']['posts'].push(postObj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendPosts(posts) {\n posts.forEach((post) => appendPost(post));\n}", "generatePosts(){\n const feedPosts = [];\n\n for(var i = 0; i < this.state.posts.length; i++) {\n feedPosts.push(\n <Post userName={this.state.posts[i].userName} postText={this.state.posts[...
[ "0.6883961", "0.6826927", "0.6803081", "0.66617537", "0.66567093", "0.66533864", "0.6615036", "0.65971863", "0.65886205", "0.6584849", "0.65563244", "0.6529883", "0.65218323", "0.65207726", "0.6520145", "0.65080684", "0.64397156", "0.64336723", "0.6361878", "0.63220096", "0.6...
0.8053132
0
Scroll chat window down
function scrollDownChatWindow() { const chatWindow = document.querySelector("#display-message-section"); chatWindow.scrollTop = chatWindow.scrollHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scroller() {\n chat[0].scrollTop = chat[0].scrollHeight;\n }", "function scrollChat() {\r\n var pixelScroll = $('.right-messages').height();\r\n $('.content-display-chat').scrollTop(pixelScroll); \r\n }", "function scroll() {\n div.scrollTop(div.innerHeight());\n cons...
[ "0.8300272", "0.82999444", "0.8195983", "0.81015813", "0.8044903", "0.79823273", "0.7969471", "0.794664", "0.793672", "0.792612", "0.7914739", "0.7910873", "0.78668773", "0.78203577", "0.78025013", "0.7652981", "0.76372105", "0.75937384", "0.75929993", "0.75929195", "0.758553...
0.8575856
0
ORDERS WILL BE FILTERED BY SELECTED VENDOR WHEN SELECTED VENDOR CHAGE OR ORDERS UPDATE
function filterOrders(){ let _orders = selectedVendor? orders.filter(order=> order.vendorName.trim().toLowerCase() === selectedVendor ) : orders setFilteredOrders(_orders) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(selectedGen, selectedType) {\n // Nueva data\n if (selectedGen == 0 && selectedType == 0 ){\n joinDeDatos(datos)}\n else if (selectedGen == 0 && selectedType != 0){\n var dataFilter = datos.filter(function(d){return (d.type_1==selectedType || d.type_2==selectedType )})\...
[ "0.56169754", "0.554323", "0.5501901", "0.547646", "0.5475095", "0.5475095", "0.54433256", "0.5423845", "0.54016834", "0.5380216", "0.53754807", "0.5364858", "0.5359942", "0.53465825", "0.53347814", "0.53310555", "0.5325146", "0.5313908", "0.5301896", "0.52633584", "0.5229275...
0.65443206
0
Grab the latest versions of all the libraries, download them, update our lockfile
async function upgrade() { console.log(`Obtaining latest Play Services libraries...`); const libraries = await gatherLibraries(repository); const destDir = path.join(__dirname, '../android/lib/'); await fs.emptyDir(destDir); const downloaded = await Promise.all(libraries.map(l => downloadLibrary(des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function ci() {\n console.log(`Obtaining Play Services libraries from lockfile...`);\n const json = await fs.readJSON(path.join(__dirname, 'libraries-lock.json'));\n const destDir = path.join(__dirname, '../android/lib/');\n await fs.emptyDir(destDir);\n return Promise.all(json.map(l => downlo...
[ "0.66241634", "0.6086251", "0.60420954", "0.6040492", "0.5820045", "0.5711987", "0.5631581", "0.56197816", "0.5610939", "0.54770356", "0.5422807", "0.54031813", "0.53966624", "0.5374752", "0.52828205", "0.5278909", "0.52750003", "0.52697456", "0.52406365", "0.5220837", "0.520...
0.7489039
0
Load company and append to req.
function load(req, res, next, id) { Company.get(id) .then((company) => { req.company = company; // eslint-disable-line no-param-reassign return next(); }) .catch(e => next(e)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadForm(company) {\n var targetUrl;\n var myOrg = new Organization();\n\n // myOrg.load(loadOrganizationList);\n loadOrganizationsByCompany(company.CompanyID, populateOrganizationList, pmmodaErrorHandler)\n// loadOrganizations(loadOrganizationList, loadOrgErrorHa...
[ "0.58563364", "0.5604971", "0.5535446", "0.5495807", "0.53796506", "0.5359211", "0.5356894", "0.531848", "0.5298784", "0.5298784", "0.52453536", "0.52274746", "0.52060324", "0.51853585", "0.51773953", "0.5176356", "0.51737607", "0.51244", "0.5121954", "0.5113392", "0.5094423"...
0.6847414
0
SocketController Handles Web Socket Connectivity _______________________________________________________________________________ _______________________________________________________________________________ Constructor
function SocketController(webSocketURL) { console.log("SocketController: construct"); this.url = webSocketURL; console.log("SocketController: URL="+this.url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSocket () {\n this.ws = new WebSocket(this.getEndpoint())\n }", "createSocket() {\n // Create the socket\n this.socket = new WebSocket('ws://localhost:7777');\n\n extendWebSocket(this.socket);\n\n // Listen for connect events and\n // print them to the terminal\n this.socket.onopen = ...
[ "0.7449641", "0.73595756", "0.73408306", "0.7312437", "0.72937995", "0.7277727", "0.7277727", "0.72560835", "0.72505146", "0.7182192", "0.7130973", "0.7126375", "0.7075218", "0.7054954", "0.69900733", "0.695825", "0.6942302", "0.6911369", "0.6850231", "0.68450385", "0.6835249...
0.8646348
0
create a method on the User class called `checkPassword` this method should take in a string and compare it to the object's password property return `true` if they match, otherwise return `false`
checkPassword(password) { return password === this.password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkPassword(loginPw) {\n // Using the keyword this, we can access this user's properties, \n // including the password, which was stored as a hashed string\n // compareSync confirms (true) or denies (false) that the supplied password\n // matches the hashed password stored on the obje...
[ "0.78689677", "0.7788803", "0.7663352", "0.7648508", "0.75532776", "0.75532776", "0.75532776", "0.75532776", "0.7540665", "0.75246733", "0.750402", "0.74928963", "0.74148124", "0.73565173", "0.7312607", "0.72874796", "0.7248212", "0.72455704", "0.72444224", "0.72419983", "0.7...
0.79972845
0
Build all the c3.js charts
function makeCharts() { issueChart(); countChart(); averageChart(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildCharts() {\n const charts = document.getElementsByClassName( 'simple-chart-target' );\n for ( let i = 0; i < charts.length; i++ ) {\n buildChart( charts[i] );\n }\n}", "function chartBuilder(data) {\r\n\r\n\r\n // -------------------- ??CROSSFILTER?? --------------------\r\n // ...
[ "0.6925157", "0.6781808", "0.66384554", "0.654592", "0.65225255", "0.64810836", "0.64736456", "0.6469864", "0.6437326", "0.6419178", "0.6407031", "0.63685894", "0.6317762", "0.6281911", "0.62788785", "0.6277378", "0.6252224", "0.62426335", "0.62398994", "0.61948144", "0.61748...
0.6792616
1
create a card in db using req.body input
create(req, res, next) { cardsDB.save(req.body) .then((card) => { res.locals.card = card; next(); }) .catch(err => next(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(req, res) {\n\t\tlet card = new cardM();\n\t\tif (!req.body.card_no) {\n\t\t\treturn this.common.findError(res);\n\t\t}\n\n\t\tcard.card_no = req.body.card_no;\n\n\t\treturn this.dao.create(card)\n\t\t\t.then(this.common.editSuccess(res))\n\t\t\t.catch(this.common.serverError(res));\n\t}", "function handl...
[ "0.75391895", "0.6872707", "0.6826811", "0.6660095", "0.6623724", "0.65985036", "0.6571531", "0.6492527", "0.64449716", "0.64103633", "0.6394405", "0.63881856", "0.6375443", "0.63679725", "0.6345313", "0.6324606", "0.63028264", "0.63020515", "0.6277574", "0.6271572", "0.62606...
0.76090443
0
console.log(angle) circular_position is used to calculate the postion of nodes which are evenly distributed on an arc
function circular_position(node, index, angle, radius ) { x = (center.x + radius * Math.cos(angle * index * Math.PI / 180)); y = (center.y + radius * Math.sin(angle * index * Math.PI / 180)); return x, y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OrthoganalCircle(theta,dTheta) {\n \n \tlet R = 1.0/cos(dTheta);\n this.r = abs(tan(dTheta));\n // this.x = R*cos(theta);\n // this.y = R*sin(theta);\n \t//endpoints\n \tthis.p1 = createVector(cos(theta-dTheta),sin(theta-dTheta));\n this.p2 = createVector(cos(theta+dTheta),sin(theta+dTheta))...
[ "0.6691818", "0.6655112", "0.6652717", "0.6442884", "0.64156455", "0.64156455", "0.6397851", "0.6381677", "0.6380599", "0.6380599", "0.6369801", "0.6368935", "0.63187546", "0.6302301", "0.62191993", "0.6197925", "0.6197925", "0.6197925", "0.6197925", "0.6197925", "0.6182991",...
0.73215157
0
INIT THE DISPLAY OF A PROJECT ( display the div + scroll to it )
function works_disp() { scrolltodisp(); displayProject(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupDisplayContent() {\n addClassToFeaturesThatEnableThisFeature();\n setContainerHeight();\n $('html, body').animate({\n scrollTop: 0\n }, 400);\n}", "function collapseProject() {\n document.getElementById(\"project__displayer\").style.height = \"0rem\";\n \n $('#project__dis...
[ "0.6907924", "0.63857585", "0.6345858", "0.62161434", "0.6209152", "0.6192852", "0.61766255", "0.61480063", "0.6139874", "0.61277455", "0.6105691", "0.6079524", "0.6069197", "0.6058731", "0.6052961", "0.5989826", "0.59797674", "0.5967217", "0.595974", "0.5956709", "0.58887434...
0.72125477
0
console.log(rolledDice) This is to shuffle the 25 dice on the board (not roll)
function shuffleDice(){ for (let i = 0; i < diceArray.length; i++){ var randNum = Math.floor(Math.random() * copyDice.length); randomDice.push(copyDice.splice(randNum,1)[0]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rollDice() {\n let dice = Math.floor(Math.random() * 6 + 1);\n console.log('dice roll: ', dice)\n changeDisplayedDice(dice);\n changeRoundScore(dice);\n}", "function rollTheDice(){\n\t\tfor (let i = 0; i < diceArray.length; i++){\n\t\t\tvar randNum = Math.floor(Math.random() * 6);\n\t\t\trol...
[ "0.7482507", "0.7467322", "0.7295041", "0.72410005", "0.7222144", "0.7090058", "0.7064546", "0.7062609", "0.7056518", "0.70264095", "0.7009862", "0.6978363", "0.69611615", "0.69611233", "0.68465483", "0.68304163", "0.6817885", "0.6803755", "0.6800506", "0.6797469", "0.6774182...
0.7476986
1
create a given number of random changesets, with options provided
getRandomChangesets (n, options = {}) { const changesets = []; for (let i = 0; i < n; i++) { const changesetInfo = this.getRandomChangesetData(options, i); changesets.push(changesetInfo); } return changesets; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandomChangesetData (options = {}, n) {\n\t\tconst repoId = options.changesetRepoIds ? options.changesetRepoIds[n] : options.changesetRepoId;\n\t\tconst numChangesets = options.numChangesets || 2;\n\t\tconst whichChangesets = options.whichChangesets || 0;\n\t\tconst commits = SAMPLE_COMMITS.slice(whichChangeset...
[ "0.73625565", "0.6306997", "0.6163856", "0.60938454", "0.5884378", "0.58605397", "0.5821458", "0.57813084", "0.57177156", "0.5713824", "0.5686332", "0.56066155", "0.55685157", "0.55293816", "0.5527666", "0.5527666", "0.5527666", "0.5527666", "0.55066377", "0.5498054", "0.5478...
0.8275994
0
Function: matchesDesignNote Description: There must be only one key exactly matching a DesignNote name.
function matchesDesignNote (fileURL, dnConditions) { var rtnBool = true; var filePtr; // Design note file to be opened for this file. var dnName, dnValue; var i, keys, tValue; var continueSearch = true; var regExCond; //??? Check for dnFile exisitence prior to open (Design notes optimization). //??? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkKeyWithNote(keyCode){\n\tif(pattern == null) {\n\t\treturn;\n\t}\n\n\tvar pressedKey = getPressedKey(keyCode);\n\tvar keyArr = eval(\"key\" + numOfKey);\n\tvar index = keyArr.indexOf(pressedKey);\n\tvar _score = getScoreByPosition(firstNote[index]);\n\tif(_score == 'bad'){\n\t\tprintScore('Miss');\n...
[ "0.5744337", "0.5618363", "0.5117649", "0.5103788", "0.4981949", "0.49234304", "0.49155283", "0.48849168", "0.48543167", "0.47951502", "0.47518906", "0.47244602", "0.4707123", "0.47062376", "0.46882397", "0.46390578", "0.46323168", "0.46145785", "0.4600654", "0.45895532", "0....
0.5970041
0
Function: applyParams Description: Applies or takes action. Uses the preferences object to set and save the current settings.
function applyParams() { // Get the current values from the UI and set the values. PREF_OBJ.set(); PREF_OBJ.save(); window.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_apply_settings(context, settings) {\n\t\t// 1. Try to migrate any old settings to the new layout.\n\t\tthis._migrate_settings(settings);\n\n\t\t// 2. Apply default settings to any missing entries.\n\t\tthis._default_settings(settings);\n\n\t\t// 3. Store the settings to Stream deck.\n\t\tthis.settings(context, se...
[ "0.6093607", "0.5378998", "0.5374148", "0.53729165", "0.5283282", "0.5277826", "0.5088289", "0.5001033", "0.4987889", "0.4970036", "0.49419144", "0.49175763", "0.48720887", "0.48639378", "0.48594585", "0.4828368", "0.48280305", "0.48157263", "0.4800022", "0.47239828", "0.4712...
0.69180876
0
Specifies whether to always send extra HTTP headers with the requests from this page.
async setExtraHTTPHeaders(params) { return await new Promise((resolve, reject) => { this.dbg.sendCommand('Network.setExtraHTTPHeaders', params, (error, result) => { this.assertError(error, 'Network.setExtraHTTPHeaders'); resolve(); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "header() {\n for (let head in this.config.header) {\n this.xhr.setRequestHeader(head, this.config.header[head]);\n }\n }", "flushHeaders() {\n if (this.headersSent) { return; }\n\n this.headersSent = true;\n this.emit('head');\n }", "function shouldGetHeader(options) {\n ...
[ "0.6166797", "0.576454", "0.5734352", "0.57171094", "0.57136613", "0.5710262", "0.57063496", "0.57063496", "0.5681193", "0.56711906", "0.5662484", "0.5574271", "0.55576265", "0.5553593", "0.55379504", "0.55217505", "0.5499786", "0.5490314", "0.546593", "0.545461", "0.5451352"...
0.58922
1
Tells whether clearing browser cache is supported.
async canClearBrowserCache() { return await new Promise((resolve, reject) => { this.dbg.sendCommand('Network.canClearBrowserCache', {}, (error, result) => { this.assertError(error, 'Network.canClearBrowserCache'); resolve(result); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkCache () {\n fetch('/cache/', {\n method: 'HEAD'\n }).then( function (response) {\n if (parseInt(response.headers.get('Last-modified'), 10) > CACHE_NAME) caches.delete(CACHE_NAME);\n });\n}", "function isCacheEnabled() {\n return process.env.XDN_CACHE === 'true';\n}", "f...
[ "0.66415715", "0.6335053", "0.6262408", "0.6256816", "0.61510605", "0.6100448", "0.6100448", "0.6100448", "0.6076188", "0.6067833", "0.60293037", "0.5940229", "0.5904085", "0.5893255", "0.58917594", "0.58786356", "0.58786356", "0.5878339", "0.586304", "0.58430237", "0.5829620...
0.69336826
0
Returns all browser cookies. Depending on the backend support, will return detailed cookie information in the cookies field.
async getAllCookies() { return await new Promise((resolve, reject) => { this.dbg.sendCommand('Network.getAllCookies', {}, (error, result) => { this.assertError(error, 'Network.getAllCookies'); resolve(result); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "list() {\n return this.cookies;\n }", "function getCookies() {\n var cookies = {}; // The object to be returned\n var all = document.cookie; // Get all cookies from document\n if (all === \"\") // If the property is the empty string\n return cookies; // return an empty object\n var l...
[ "0.74336016", "0.7053072", "0.68439716", "0.6843921", "0.6796928", "0.674224", "0.67039996", "0.65792066", "0.65792066", "0.6547783", "0.6501374", "0.64050484", "0.6288471", "0.6287301", "0.61250514", "0.61040294", "0.6038574", "0.6022942", "0.60156476", "0.6012785", "0.59911...
0.7203426
1
Tells whether emulation of network conditions is supported.
async canEmulateNetworkConditions() { return await new Promise((resolve, reject) => { this.dbg.sendCommand('Network.canEmulateNetworkConditions', {}, (error, result) => { this.assertError(error, 'Network.canEmulateNetworkConditions'); resolve(result); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNetConnection() {\n\tvar status = window.navigator.onLine;\n\tif (status) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function checkNetwork()\n{\n\tvar networkState = navigator.connection.type;\n var states = {};\n states[Connection.UNKNOWN] = 'Unknown connection';\...
[ "0.67898524", "0.6632445", "0.65735257", "0.65435886", "0.65052783", "0.6418583", "0.62457764", "0.61971146", "0.6175906", "0.61622477", "0.61581695", "0.61011416", "0.6026592", "0.5991292", "0.5945187", "0.5941623", "0.59400254", "0.59253114", "0.59253114", "0.59253114", "0....
0.7586997
0
Activates emulation of network conditions.
async emulateNetworkConditions(params) { return await new Promise((resolve, reject) => { this.dbg.sendCommand('Network.emulateNetworkConditions', params, (error, result) => { this.assertError(error, 'Network.emulateNetworkConditions'); resolve(); }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async canEmulateNetworkConditions() {\n return await new Promise((resolve, reject) => {\n this.dbg.sendCommand('Network.canEmulateNetworkConditions', {}, (error, result) => {\n this.assertError(error, 'Network.canEmulateNetworkConditions');\n resolve(result);\n ...
[ "0.6578758", "0.61230356", "0.59323245", "0.57928026", "0.572664", "0.5704108", "0.570194", "0.57002217", "0.56989837", "0.56156164", "0.55837685", "0.5546405", "0.55092084", "0.54560417", "0.5400314", "0.5353314", "0.5343154", "0.53366816", "0.53269416", "0.5318936", "0.5314...
0.6798531
0
disks = [[2, 1, 2], [3, 2, 3], [2, 2, 8], [2, 3, 4], [1, 3, 1], [4, 4, 5]] widthSorted = [1, 3, 1], [2, 1, 2], [2, 2, 8], [2, 3, 4], [3, 2, 3], [4, 4, 5] depthSorted = [2, 1, 2], [3, 2, 3], [2, 2, 8], [2, 3, 4], [1, 3, 1], [4, 4, 5] heightSorted= [1, 3, 1], [2, 1, 2], [3, 2, 3], [2, 3, 4], [4, 4, 5], [2, 2, 8] / The so...
function diskStacking(disks){ disks.sort((a, b) => a[2] - b[2]); const heights = new Array(disks.length); heights[0] = [disks[0][2], null]; const max = [disks[0][2], 0]; for(let i = 1; i < disks.length; i++){ const currHeight = [disks[i][2], null]; let localMax = currHeight[0]; for(let j = 0; j < ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function s(heights) {\n // o(n) time and space\n const n = heights.length;\n const stack = [];\n const lefts = Array(n);\n const rights = Array(n);\n\n // find left limits\n for (let i = 0; i < n; i++) {\n if (!stack.length) {\n // stack is empty, this is the leftmost bar\n lefts[i] = i;\n }...
[ "0.6710598", "0.64039546", "0.62300533", "0.62155974", "0.61942416", "0.58746696", "0.58193564", "0.58086395", "0.57772595", "0.5759552", "0.57296264", "0.56841075", "0.5619", "0.5608906", "0.5584354", "0.5558504", "0.55453616", "0.5540675", "0.55181754", "0.5517596", "0.5517...
0.8217402
0
Send a response back to the DApp using postMessage in the webview
handleBridgeResponse(msgData, result) { msgData.isSuccessful = Boolean(result) msgData.args = [result] this.dappWebView.postMessage(JSON.stringify(msgData)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _postResponse(data) {\n window.postMessage({ ...data, origin: \"content\" }, \"*\");\n}", "sendMessage(message) {\r\n this.currentPanel.webview.postMessage(message);\r\n }", "function postApp(message) {\n window.parent.postMessage(message, \"*\");\n}", "onMessageFromWebView(message) {\n ...
[ "0.6867955", "0.6824349", "0.6337156", "0.62525356", "0.6151658", "0.5943382", "0.59206134", "0.58900094", "0.5851711", "0.5843929", "0.58087236", "0.5792584", "0.57777166", "0.5768618", "0.5764264", "0.57522005", "0.57409555", "0.57342213", "0.56817675", "0.56720936", "0.564...
0.73767865
0
Handle a transaction hash event from the Origin Wallet
handleTransactionHash({ transaction, hash }) { // Close matching modal const modal = this.state.modals.find( m => m.msgData && m.msgData.data === transaction ) // Toggle the matching modal and return the hash this.toggleModal(modal, hash) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenForHash(txHash) {\n const _this = this;\n // Wait for tx to be mined\n var filter = web3.eth.filter('latest').watch((err, blockHash) => {\n // Get info about latest Ethereum block\n web3.eth.getBlock(blockHash, (err, block) => {\n // Found tx hash?\n if (block.transactions.in...
[ "0.66469973", "0.64203155", "0.6059804", "0.60434014", "0.60312074", "0.6023221", "0.6017267", "0.5998472", "0.5998374", "0.5989365", "0.59872127", "0.5981581", "0.5976537", "0.5967752", "0.5952416", "0.59520435", "0.5947948", "0.59258085", "0.5803096", "0.5795074", "0.576025...
0.6447281
1
Handle a signed message event from the Origin Wallet
handleSignedMessage({ data, signedMessage }) { // Close matching modal const modal = this.state.modals.find( m => m.msgData && m.msgData.data === data ) // Toggle the matching modal and return the hash this.toggleModal(modal, signedMessage.signature) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleMessageReceived(event) {\n const { data } = event;\n if (data === \"securesend_loaded\") {\n console.log(\"securesend loaded\")\n encryptIFrame.contentWindow.postMessage(bundle, \"*\");\n } else if (data === \"securesend_sent\") {\n loadEncrypt()...
[ "0.6375716", "0.61302805", "0.60480314", "0.6004007", "0.5957317", "0.5897702", "0.5847682", "0.5842634", "0.5782263", "0.57712805", "0.570345", "0.5700563", "0.56903696", "0.56822705", "0.5675027", "0.5673345", "0.56594104", "0.56070036", "0.56045336", "0.5552037", "0.555090...
0.62167317
1
store the output of the anonymous function in a variable var movieAnswerHorror = movieQuestions("horror"); you can now call this 'variable' and use it like a function and add an input movieAnswerHorror("jeremy"); the anonymous function withing the main function can be called and a parameter passed to it. movieQuestions...
function interviewQuestion(genre) { return function(name) { if (genre === "romance") { console.log(name + " do you like " + genre + " movies because you feel alone?"); } else if (genre === "horror") { console.log(name + " do you like " + genre + " movies because you want...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movieQuestions (genre) {\r\n\r\n\tif (genre == \"romance\") {\r\n\t\treturn function (name) {\r\n\t\t\tconsole.log(name + \" do you like \" + genre + \" movies because you feel alone?\");\r\n\t\t} \r\n\t} \r\n\r\n\telse if (genre == \"horror\") {\r\n\r\n\t\treturn function (name) {\r\n\t\t\tconsole.log(na...
[ "0.72342294", "0.61885", "0.6116772", "0.6055318", "0.6014742", "0.60034454", "0.595024", "0.5941236", "0.5938402", "0.5913503", "0.58862203", "0.5864727", "0.5801898", "0.5784862", "0.5784435", "0.5761696", "0.57494926", "0.5744348", "0.57301676", "0.571469", "0.5699195", ...
0.6557692
1
get collection from table name
async getCollection (tableName) { const db = await this.database; return db.collection(tableName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getCollection () {\n const name = this.collection\n return this.connection.collection(name)\n }", "function loadCollection(colName) {\n return client.db('api').collection(colName)\n}", "function getCollection(collection){\n var data = bd.collection(collection);\n return data;\n }"...
[ "0.718083", "0.6957665", "0.6844861", "0.6675882", "0.6518814", "0.64897543", "0.64833206", "0.6178145", "0.6158788", "0.61566293", "0.6125662", "0.61045355", "0.60920763", "0.59552187", "0.59501404", "0.5938488", "0.5938488", "0.5938488", "0.5880018", "0.5841381", "0.5787838...
0.75979275
0
find single record from table name
async findOne (tableName, query, options) { const table = await this.getCollection(tableName); return table.findOne(query, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function read(table_id) {\n return db(tableName).where({ table_id }).first();\n}", "findRecord(\n table,\n recordId,\n baseId = this.defaultBaseId,\n apiKey = this.defaultApiKey\n ) {}", "function findDeviceRecord(tbl, values) {\n log(\"findRecord\");\n var query = ClearBlade.Query({collect...
[ "0.65534514", "0.61993563", "0.6032463", "0.599348", "0.5954379", "0.59103054", "0.59064686", "0.58480364", "0.58073896", "0.5801989", "0.5725947", "0.5694454", "0.5659292", "0.5631617", "0.56247514", "0.5590433", "0.55879843", "0.55773836", "0.5573278", "0.5524807", "0.55190...
0.6211142
1
list the list to be sorted getKeyFunc a function that takes a list item and returns its key
treeSort (list, getKeyFunc) { var nextItems = service.corpusTree.slice(); // copies the array var sortedItems = []; while (nextItems.length > 0) { var currentItem = nextItems.shift(); if (Array.isArray(currentItem['children'])) next...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeyFromList(list, key) {\n for (const data of list) {\n if (data.name === key) {\n return data.value;\n }\n }\n throw Error(`'${key}' not found in ${JSON.stringify(list)}`);\n}", "key(item) {\n return item;\n }", "static sortList(list, key, orderBy = \"ASC\") {\n let sortedList...
[ "0.5824123", "0.5809927", "0.580003", "0.5640644", "0.56156605", "0.55704087", "0.5560173", "0.5558217", "0.5555246", "0.5554391", "0.55130124", "0.54813653", "0.54401153", "0.5418182", "0.5397635", "0.5380892", "0.5378984", "0.53695256", "0.5358343", "0.5358343", "0.5342239"...
0.6096204
0