Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
true if object has own PolymerBase api
function isBase(object) { return object.hasOwnProperty('PolymerBase') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PolymerBase() {}", "function PolymerBase() {}", "function PolymerBase() {}", "isBaseComponent() {\n return !this._baseComponent;\n }", "get base(){\n\t\treturn this.hasAttribute('base');\n\t}", "function inPolymerFlavorContext(context) {\n var _a, _b;\n var declaration = context....
[ "0.68248886", "0.68248886", "0.68248886", "0.62755746", "0.6126963", "0.6083681", "0.595386", "0.5939951", "0.5897424", "0.58925766", "0.5891044", "0.58737415", "0.5870849", "0.5863242", "0.5843909", "0.5840509", "0.578689", "0.56771845", "0.5630979", "0.5630979", "0.5630979"...
0.84906304
1
name a base constructor for dev tools
function PolymerBase() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function Ctor() {}", "constructor( ) {}", "function Ctor() {\r\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", ...
[ "0.78428966", "0.7622284", "0.7622284", "0.7622284", "0.75954324", "0.75144726", "0.7442723", "0.73433644", "0.73433644", "0.73433644", "0.73433644", "0.73433644", "0.73433644", "0.73433644", "0.727632", "0.72345513", "0.72345513", "0.72345513", "0.72345513", "0.72345513", "0...
0.0
-1
NOTE: use raw prototype traversal so that we ensure correct traversal on platforms where the protoype chain is simulated via __proto__ (IE10)
function getPrototypeOf(prototype) { return prototype.__proto__; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ensurePrototypeTraversal(prototype) {\n if (!Object.__proto__) {\n var ancestor = Object.getPrototypeOf(prototype);\n prototype.__proto__ = ancestor;\n if (isBase(ancestor)) {\n ancestor.__proto__ = Object.getPrototypeOf(ancestor);\n }\n }\n }", "function ensurePrototyp...
[ "0.7497807", "0.7497807", "0.7497807", "0.6515354", "0.63857305", "0.6384318", "0.6376947", "0.6253904", "0.6229594", "0.6229594", "0.61653346", "0.61627245", "0.61513114", "0.61513114", "0.6085766", "0.6075135", "0.6075135", "0.6052306", "0.60387784", "0.60268545", "0.600564...
0.62632114
9
imperative implementation: Polymer() specify an 'own' prototype for tag `name`
function element(name, prototype) { if (arguments.length === 1 && typeof arguments[0] !== 'string') { prototype = name; var script = document._currentScript; name = script && script.parentNode && script.parentNode.getAttribute ? script.parentNode.getAttribute('name') : ''; if (!nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function element(name, prototype) {\n if (typeof name !== 'string') {\n var script = prototype || document._currentScript;\n prototype = name;\n name = script && script.parentNode && script.parentNode.getAttribute ?\n script.parentNode.getAttribute('name') : '';\n if (!name) {\n ...
[ "0.6790729", "0.67214805", "0.67214805", "0.67214805", "0.6534806", "0.5799567", "0.5509422", "0.54805255", "0.5437301", "0.54368174", "0.54002213", "0.5362226", "0.5349723", "0.53031236", "0.528295", "0.5263962", "0.52575004", "0.5256865", "0.5240024", "0.5229395", "0.522501...
0.6886998
0
On platforms that do not support __proto__ (versions of IE), the prototype chain of a custom element is simulated via installation of __proto__. Although custom elements manages this, we install it here so it's available during desugaring.
function ensurePrototypeTraversal(prototype) { if (!Object.__proto__) { var ancestor = Object.getPrototypeOf(prototype); prototype.__proto__ = ancestor; if (isBase(ancestor)) { ancestor.__proto__ = Object.getPrototypeOf(ancestor); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setElementProto$1(elm, def) {\n setPrototypeOf$2(elm, def.bridge.prototype);\n } // Typescript is inferring the wrong function type for this particular", "function setElementProto(elm, def) {\n setPrototypeOf(elm, def.bridge.prototype);\n }", "function protoAugment(target,src){/* eslint-disabl...
[ "0.6879114", "0.6863687", "0.6657838", "0.6378098", "0.62869835", "0.62869835", "0.6282692", "0.62447405", "0.62442344", "0.6233373", "0.6233373", "0.6233373", "0.6233373", "0.6233373", "0.6233373", "0.6233373", "0.62326556", "0.62241566", "0.61874604", "0.6162304", "0.614839...
0.0
-1
Will be overrideen by classes extending this class
getType() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor () { super() }", "constructor() { super() }", "initCustomFunctions() {/*To be overridden in sub class as needed*/}", "__previnit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "constructor() {\n\n\t\tsuper();\n\n\t}", "function inherited() { }", "constructor() {\n...
[ "0.6778292", "0.66822493", "0.66625625", "0.661536", "0.6593333", "0.6593333", "0.655252", "0.6550961", "0.6534584", "0.6461006", "0.64490914", "0.6444408", "0.6417521", "0.64131826", "0.6384607", "0.6384607", "0.6384607", "0.6384607", "0.6384607", "0.6384607", "0.6384607", ...
0.0
-1
What is the sum of the digits of the number 2^1000?
function powerDigitSum(exponent) { return String(BigInt(2 ** exponent)).split('').reduce((acc, val) => acc + Number(val), 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function process ( n )\n{\n \n var number = new BigInteger ( 2 ).pow ( n );\n var numberString = number.toString ();\n var digitSum = 0;\n for ( var i = 0; i < numberString.length; ++i )\n digitSum += parseInt ( numberString [i] );\n \n return digitSum;\n}", "function powerDigitSum(n)...
[ "0.7051284", "0.6978379", "0.6726224", "0.6484493", "0.6481843", "0.64277023", "0.6395869", "0.63925964", "0.6381515", "0.634449", "0.6337282", "0.629681", "0.6283542", "0.62446433", "0.6236177", "0.62264264", "0.6207746", "0.61810833", "0.6154792", "0.61539394", "0.6087868",...
0.6960951
2
Authenticate: is this username/password valid
static async authenticate(username, password) { try{ const result = await db.query( `SELECT username, password FROM users WHERE username = $1`, [username]); const user = result.rows[0]; if(user){ if(await bcrypt.compare(password, user.password)){ await Use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAuthValid() {\n var userProperties = PropertiesService.getUserProperties();\n var userName = userProperties.getProperty('dscc.username');\n var password = userProperties.getProperty('dscc.password');\n // This assumes you have a validateCredentials function that\n // can validate if the userName an...
[ "0.7567127", "0.7397525", "0.73348534", "0.7197748", "0.71484804", "0.714531", "0.69685686", "0.6964931", "0.69071966", "0.6845844", "0.6833367", "0.68317765", "0.68252206", "0.6816976", "0.67983186", "0.67960197", "0.6783584", "0.6768979", "0.6723791", "0.6711715", "0.670836...
0.0
-1
Update last_login_at for user
static async updateLoginTimestamp(username) { try{ await db.query( `UPDATE users SET last_login_at = current_timestamp WHERE username = $1`, [username] ); }catch(e){ throw new ExpressError(e, 404); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async updateLoginTimestamp(username) {\n await db.query(\n `UPDATE users SET last_login_at=current_timestamp\n WHERE username = $1`,\n [username]\n );\n }", "static async updateLoginTimestamp(username) { \n await db.query(`\n UPDATE users\n SET last_login_at = NOW()\n ...
[ "0.78547585", "0.768854", "0.73446", "0.7136553", "0.6890709", "0.6872784", "0.6852855", "0.68277115", "0.6822889", "0.67939734", "0.67606217", "0.65694284", "0.6458802", "0.5981065", "0.59229696", "0.58396906", "0.5788627", "0.5783305", "0.5747186", "0.5724289", "0.57103574"...
0.70614785
4
This action creates the tiny url for the Url the user submits
@action makeTinyUrl() { this.store.findRecord('create', this.get('urlGiven')) .then((url) => { this.set('latestUrlId', url.get('urlid')); this.set('latestTargetUrl', url.get('url')); this.set('latestTinyUrl', 'http://localhost:3000/' + url.get(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTinyUrl(req, res) {\n\n var longUrl = req.body.longUrl;\n addTinyUrl(req, res, trimUrl(longUrl))\n }", "function generateURL(url) {\n var value = input.value.replace(/ /g, \"%20\");\n var link = url + value + callback;\n console.log(link);\n search(lin...
[ "0.67561", "0.6645979", "0.6418355", "0.6342945", "0.62881076", "0.62454647", "0.62031156", "0.61581784", "0.6114475", "0.61099124", "0.60763395", "0.60707104", "0.60143995", "0.60097474", "0.5989358", "0.59556335", "0.5911231", "0.59095794", "0.58962065", "0.58795494", "0.58...
0.7178921
0
This action is for the user to redirect to the tiny url from the front end.
@action getTinyUrl() { let urlArray = this.get('findUrl').split('/'); let urlSearch; if (urlArray.length > 1) { urlSearch = urlArray[(urlArray.length - 1)] } else { urlSearch =urlArray[0] } this.store.findRecor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectByUrl() {\n location.href = u;\n }", "redirect(url) {\n window.location.href = url + Utils.getQueryString();\n }", "function redirectTo(theurl) { window.location = theurl.app_url+\"&option[loader]=\"+encodeURI(window.location.href); }", "function redirect_to(url...
[ "0.6982845", "0.6528096", "0.65082026", "0.6508068", "0.6454335", "0.63923156", "0.6337736", "0.62966895", "0.6263469", "0.625968", "0.6239131", "0.61987275", "0.6179443", "0.6171638", "0.6171391", "0.6159738", "0.6155081", "0.6151537", "0.6139898", "0.6139003", "0.6126754", ...
0.700054
0
Create a function called firstOfArray that take an array as a parameter and return the first element in an array Ex: firstOfArray([1,4,5]) => 1 Ex: firstOfArray(["t","u","g","x"]) => "t"
function firstOfArray(array){ return array[0] ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstOfArray(arr){\nreturn (arr[0]);\n}", "function first(array) {\n return array[0];\n}", "function firstElement(array) {\r\n return array[0];\r\n}", "function first(arr) {\n return arr[0];\n}", "function firstElement(array) {\r\n return array[0];\r\n}", "function getFirst(arr){\r\n ...
[ "0.87844986", "0.83732647", "0.8298605", "0.82897377", "0.8253065", "0.8163552", "0.8156738", "0.8035901", "0.7933094", "0.7928651", "0.7803309", "0.7695241", "0.7695241", "0.7695241", "0.7695241", "0.7687578", "0.7643893", "0.7606018", "0.75569504", "0.75564486", "0.75485325...
0.89292264
0
Create a function called lastOfArray that take an array as a parameter and return the first element in an array Ex: lastOfArray([1,4,5]) => 5 Ex: lastOfArray(["t","u","g","x"]) => "x"
function lastOfArray(array){ return array[array.length-1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lastOfArray(arr){\nreturn arr[arr.length-1];\n\n}", "function lastOfArray(arr){\r\n\tlet length=arr.length\r\n\treturn (arr[length-1])\r\n\t}", "function last_of(arr)\n{\n if (arr.length)\n return arr[arr.length - 1];\n \n return undefined;\n}", "function getLast(arr){\r\n return ...
[ "0.84325415", "0.83930767", "0.8359468", "0.8321987", "0.82840496", "0.82362974", "0.8232133", "0.8232133", "0.8232133", "0.81901675", "0.8187195", "0.81542796", "0.8144644", "0.8141221", "0.8115746", "0.80679125", "0.7999047", "0.79934734", "0.79821277", "0.79665047", "0.796...
0.8568519
0
7 Using the console try to figure out what the thing thats (push, unshift, shift, pop) return to you var array2 = [5,9,7,3.5] / 8 Create a function called middleOfArray that take an array as a parameter and return the middle element in an array if it is have an odd elemnets and return the two middle elemnt in an array ...
function middleOfArray(arry){ let num = arry.length; if(Array.isArray(arry)){ if(num%2==0){//even array num = num /2; return arry[num-1] +" and "+arry[num] ; }else{ num = num /2 - 0.5; return arry[num]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMiddlePosition(array) {\n const isEvenArray = array.length % 2 === 0;\n if (isEvenArray) {\n const positionEven = array.length / 2;\n const firstElement = array[positionEven];\n const secondElement = array[positionEven - 1];\n const middleArrayElement = (firstElement + secondElement) / 2...
[ "0.79912966", "0.7957686", "0.79260266", "0.7788625", "0.7744841", "0.75985384", "0.7596501", "0.73636943", "0.7351584", "0.7349369", "0.7301994", "0.7262355", "0.72581357", "0.7210668", "0.71410394", "0.6976933", "0.6721818", "0.6683371", "0.663446", "0.66060793", "0.6507266...
0.8331656
0
10 Create a function called indexOfArray that accept an array and index and return what this array have in this index var nums= [1,2,3,8,9] Ex: indexOfArray(nums,3) => 8 Ex: indexOfArray(nums,1) => 2 Ex: indexOfArray(nums,4) => 9 try more cases by your self
function indexOfArray(array , index){ return array.indexOf(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexOf(arr, num){\n for(var i=0; i<=arr.length; i++){\n if(num === arr[i]){\n return i;\n }\n }\n}", "function indexOf(arr, number) {\n let index =-1\n\n for(let i=0; i<arr.length; i++) {\n if(arr[i] === number)\n return i\n }\n\n return index\n\n}", "functi...
[ "0.7930773", "0.79071885", "0.7801894", "0.7721184", "0.7506609", "0.74454963", "0.7415268", "0.7370154", "0.73271954", "0.7315361", "0.73139215", "0.7311958", "0.72906023", "0.72691184", "0.725118", "0.72450113", "0.7216851", "0.72142076", "0.7200563", "0.7178576", "0.717032...
0.77673984
3
11 Create a function called arrayExceptLast that accept an array and return the entire array except the last elemnt hint: search abou the function that will cut the array on MDN var nums= [1,2,3,8,9] Ex: arrayExceptLast(nums) => [1,2,3,8] try more cases by your self
function arrayExceptLast(array){ array.pop() return array ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayExceptLast(arr){\n\t\n\treturn arr.slice();\n}", "function arrayExceptLast(arr){\r\n\tarr.splice(arr.length-1,1)\r\n\treturn arr\r\n}", "function withoutLastTwo(array){\n if (array.length<=2){\n return array\n } else {\n return array.slice(0,array.length-2)\n }\n}", "func...
[ "0.83305573", "0.81458855", "0.76523346", "0.7649416", "0.7615842", "0.75950503", "0.7559404", "0.7503634", "0.75036156", "0.75036156", "0.75036156", "0.74992543", "0.7484888", "0.7474624", "0.7456893", "0.74303716", "0.7422828", "0.74152267", "0.7384005", "0.7375388", "0.736...
0.8298614
1
12 Create a function called addToEnd that accept an array and value and return the entire array with add this value to the end of this array var nums= [1,2,3,8,9] Ex: addToEnd(nums,55) => [1,2,3,8,55] try more cases by your self
function addToEnd (array , value){ array.pop() array.push(value); return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToEnd(arr,x){\n\tarr.splice(nums.length-1, 1,x);\n\treturn arr;\n}", "function addToEnd(arr,value){\r\n\tarr.splice(arr.length,0,value)\r\n\treturn arr\r\n}", "function addElementToEndOfArray(array, element){\narray = [...array, element];\nreturn(array);\n}", "function addElementToEndOfArray(arra...
[ "0.78403753", "0.77907306", "0.7003182", "0.67890966", "0.6536248", "0.65133137", "0.64891493", "0.64854324", "0.6463941", "0.6418447", "0.6403239", "0.6393071", "0.63429123", "0.629066", "0.62740093", "0.6203574", "0.61519885", "0.61476207", "0.61077774", "0.6093234", "0.607...
0.77449495
2
all the exercises below should solved 2 times: 1 for loop 2 while loop / 13 Create a function called sumArray that accept an array and return the summation of all elemnt in this array var nums= [1,2,3,8,9] Ex: sumArray(nums) => 23 solve it one time using for loop and another using while loop try more cases by your self...
function sumArrayfor(array){ let sum =0; for(let i=0; i<array.length;i++){ sum += array[i]; } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumArr(nums) {\n // algorithm here\n}", "function sum(arr){\n let ourSum=0;\nfor(i=0;i<arr.length;i++){\n ourSum=ourSum+arr[i]\n}\nreturn ourSum;\n}", "function sumArray(numbers) {\n// numbers.reduce((accumulator, currentValue) => accumulator + currentValue)\n// }\nlet sum = 0;\nif (numbers.l...
[ "0.8464733", "0.81357336", "0.8125718", "0.8071257", "0.80063576", "0.80051816", "0.7954033", "0.7944612", "0.7938089", "0.792045", "0.7890167", "0.7886649", "0.7864247", "0.78398955", "0.78388447", "0.7828593", "0.7825915", "0.78245175", "0.7811837", "0.780272", "0.7792512",...
0.78486425
13
14 Create a function called minInArray that accept an array and return the minimum value inside this array var nums= [1,2,3,8,9] Ex: minInArray(nums) => 1 solve it one time using for loop and another using while loop try more cases by your self
function minInArray(array){ let minelemnt=array[0]; for (let i=1 ;i<array.length;i++){ if(array[i]<minelemnt){ minelemnt = array[i]; } } return minelemnt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minInArray(arr){\r\n\tvar min=arr[0];\r\n\tfor (i=1;i<arr.length;i++){\r\n\t\tif(arr[i]<min){\r\n\t\t\tmin=arr[i]\r\n\t\t}\r\n\t\treturn min\r\n\t}\r\n}", "function findMin(arr){\n var min = arr[0];\n for(var i = 0; i<arr.length; i++){\n if(arr[i]<min){\n min = arr[i];\n }\n }\n return m...
[ "0.8473247", "0.8371531", "0.829869", "0.8290394", "0.8269386", "0.8225829", "0.8207883", "0.81829965", "0.81735665", "0.81724167", "0.81271297", "0.8085898", "0.80850226", "0.8035461", "0.8035264", "0.80349135", "0.8014492", "0.79714525", "0.7967939", "0.79264957", "0.790801...
0.82092893
6
has many customers through deliveries
customers () { const allCustomers = this.deliveries().map( function (delivery) { return store.customers.find( function(customer) { return customer.id === delivery.customerId } ) } ) // return unique customers return Array.from(new Set(allC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "customers() {\n return this.deliveries().map(function(delivery) {\n return delivery.customer();\n });\n }", "customers() {\n return this.deliveries().map(delivery => {\n return delivery.customer();\n });\n }", "deliveries(){\n return store.deliveries.filter(delivery => {\n retur...
[ "0.6984776", "0.66732055", "0.6170143", "0.6142051", "0.60219324", "0.5718747", "0.5670315", "0.5551297", "0.55454063", "0.55167425", "0.549888", "0.54926825", "0.54762304", "0.5476216", "0.5435424", "0.54254675", "0.5351256", "0.5328993", "0.52382207", "0.52367693", "0.52301...
0.5809433
5
has many meals through deliveries
meals () { const allMeals = this.deliveries().map( function (delivery) { return store.meals.find( function(meal) { return meal.id === delivery.mealId } ) } ) return Array.from(new Set(allMeals)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "meals () {\n return this.deliveries().map(\n function (delivery) {\n return store.meals.find(\n function(meal) {\n return meal.id === delivery.mealId\n }\n )\n }\n )\n }", "meals() {\n return this.deliveries().map(function(delivery) {\n return d...
[ "0.7257738", "0.70647204", "0.6818757", "0.6417347", "0.64034814", "0.6306888", "0.6244357", "0.6055007", "0.60282826", "0.59052116", "0.58836246", "0.5785413", "0.56920445", "0.559663", "0.5477199", "0.5460662", "0.5374335", "0.5282371", "0.5238047", "0.51722187", "0.5172218...
0.60201836
9
has many meals through deliveries
meals () { return this.deliveries().map( function (delivery) { return store.meals.find( function(meal) { return meal.id === delivery.mealId } ) } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "meals() {\n return this.deliveries().map(function(delivery) {\n return delivery.meal();\n });\n }", "meals() {\n return this.deliveries().map(delivery => {\n return delivery.meal();\n });\n }", "deliveries() {\n return store.deliveries.filter(delivery => {\n return delivery.meal...
[ "0.7065534", "0.6819217", "0.6417724", "0.6403899", "0.63072187", "0.6244697", "0.60551846", "0.6028506", "0.6020951", "0.59056574", "0.5884981", "0.57868236", "0.56935614", "0.559813", "0.54776555", "0.54620564", "0.53749", "0.52820927", "0.523858", "0.5173416", "0.5173416",...
0.72584486
0
total spent on food
totalSpent() { let prices = this.meals().map( function(meal) { return meal.price; } ); return prices.reduce( function (total, price) { return total + price; } ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent() {\n return this.meals().reduce(function(sum, meal) {\n return sum + meal.price;\n }, 0);\n }", "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price)...
[ "0.7949309", "0.7949309", "0.7937208", "0.7773396", "0.76688266", "0.7628787", "0.7560685", "0.7417942", "0.72369975", "0.7162466", "0.71327645", "0.70155466", "0.697955", "0.69791764", "0.697466", "0.69523436", "0.69404423", "0.69320744", "0.6925324", "0.69227034", "0.691985...
0.7728312
4
order all meals by price in descending order
static byPrice () { console.log(store.meals) console.log(store.meals.sort(compare)) return store.meals.sort(compare) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static byPrice() {\n // how to sort in descending order\n // var points = [40, 100, 1, 5, 25, 10];\n // points.sort(function(a, b){return b-a});\n return store.meals.sort(function(a, b) {return b.price - a.price});\n }", "static byPrice(){\n return store.meals.sort((a, b) => b.price - a.p...
[ "0.8341706", "0.8093165", "0.8068297", "0.79003555", "0.70247924", "0.6954305", "0.6847577", "0.66223204", "0.6482893", "0.64625835", "0.6398347", "0.639471", "0.63798636", "0.63643837", "0.6346085", "0.62807083", "0.62268925", "0.61989546", "0.6126556", "0.6120239", "0.59988...
0.7350676
4
returns meal for a delivery
meal() { return store.meals.find( function(meal) { return meal.id === this.mealId }.bind(this) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "meals() {\n return this.deliveries().map(function(delivery) {\n return delivery.meal();\n });\n }", "meals() {\n return this.deliveries().map(delivery => {\n return delivery.meal();\n });\n }", "meals () {\n return this.deliveries().map(\n function (delivery) {\n return s...
[ "0.7130233", "0.6738922", "0.6586999", "0.62007165", "0.6150383", "0.6133858", "0.59424835", "0.58809763", "0.58745474", "0.5855932", "0.5851137", "0.5849818", "0.58295345", "0.57930624", "0.5781852", "0.577848", "0.5753981", "0.5708171", "0.5691573", "0.5681321", "0.5677758"...
0.54300845
54
returns customer for a delivery
customer() { return store.customers.find( function(customer) { return customer.id === this.customerId }.bind(this) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "customers() {\n return this.deliveries().map(function(delivery) {\n return delivery.customer();\n });\n }", "function getCustomer() {\n return customer;\n }", "customers() {\n return this.deliveries().map(delivery => {\n return delivery.customer();\n });\n }", "function getC...
[ "0.7291108", "0.6985703", "0.6906415", "0.6572798", "0.6526671", "0.64200795", "0.6337719", "0.6279224", "0.62770945", "0.617538", "0.6170713", "0.6141238", "0.6137117", "0.60696435", "0.6054062", "0.60530126", "0.59531593", "0.5926993", "0.5920604", "0.5918851", "0.58822614"...
0.62221074
9
returns neighborhood for a delivery
neighborhood() { return store.neighborhoods.find( function(neighborhood) { return neighborhood.id === this.neighborhoodId }.bind(this) ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchNeighborhoods() {\n return this._getIndexRange('neighborhood');\n }", "deliveries(){\n const deliveriesInNeighborhood = [];\n for(const delivery of store.deliveries){\n if(delivery.neighborhoodId === this.id){\n deliveriesInNeighborhood.push(delivery)\n }\n ...
[ "0.66149634", "0.6554927", "0.6417978", "0.63419604", "0.61767375", "0.6174465", "0.6161874", "0.6078533", "0.60558283", "0.60445595", "0.5943415", "0.5866969", "0.5866969", "0.5865234", "0.58633816", "0.5826944", "0.58156407", "0.5814635", "0.58117825", "0.5809136", "0.58091...
0.6255017
4
Algorithm to generate a crossword
generateBoard(){ // Makes a copy of inWordList. const wordList = [...this.wordList]; // 1. Sort all the words by length, descending. wordList.sort(function(a, b){ // ASC -> a.length - b.length // DESC -> b.length - a.length return b.length - a.length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeText(numWords = 100) {\n\n function getRandomElement(array) {\n // Pick a random element form the array\n return array[Math.floor(Math.random() * array.length)];\n }\n\n function getRandomKey(obj) {\n // Return randomly select key from the array of keys\n return getRandomElement(Ob...
[ "0.62857705", "0.6258918", "0.61851186", "0.6111271", "0.6060935", "0.59903264", "0.5943792", "0.5898607", "0.5881608", "0.58750165", "0.586126", "0.5837133", "0.5824617", "0.5790124", "0.57807636", "0.5738293", "0.57079303", "0.5697288", "0.5685587", "0.5684388", "0.56781757...
0.0
-1
Give all the CHOICES to experiment incrementally/sequentially. Validate choice against CONSTRAINS. Updates de next position to search. [valid, currX, currY, newX, newY, orientation, partialScore] = getNextValidPosition(newX, newY, state, stateHorizontal,stateVertical, currWord, lastOrientation);
getNextValidPosition(inX, inY, state, stateHoriz, stateVert, currWord, lastOrientation){ let valid = false; let currX = -1; let currY = -1; let newX = -1; let newY = -1; let partialScore = 0; let x = -1; let y = -1; let res = null; let fla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setNewQuestion() {\n this.currentQuestion = getRandomSyllables(1,\n this.props.allowedSyllables,\n false,\n this.previousQuestion);\n\n // Pick some syllables as options for answers\n this.answerOptions = getRandomSyllables(5,\n this.props.allowedSyllables,\n this.currentQuestion,...
[ "0.5922465", "0.58051735", "0.5774596", "0.57735306", "0.57573533", "0.56380993", "0.56299293", "0.55357355", "0.55290496", "0.5496812", "0.5475554", "0.54171425", "0.5413254", "0.53385323", "0.53334486", "0.53237444", "0.5317402", "0.5304851", "0.52774864", "0.52764285", "0....
0.66756326
0
[res, partialScore] = canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, currWord)
canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, word){ let result = false; let partialScore = 0; // Test if we can put the word at x, y, Horizontal. // Test if the star and end position are over invalid state value terminate early. let endX = x + wor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNextValidPosition(inX, inY, state, stateHoriz, stateVert, currWord, lastOrientation){\n let valid = false;\n let currX = -1;\n let currY = -1;\n let newX = -1;\n let newY = -1;\n let partialScore = 0;\n\n let x = -1;\n let y = -1;\n let res = null;\...
[ "0.78574896", "0.7635531", "0.66371155", "0.615441", "0.6122029", "0.61012083", "0.6081815", "0.6071906", "0.60090995", "0.5959586", "0.5937304", "0.5872129", "0.5864952", "0.58386517", "0.58359355", "0.58350074", "0.5812434", "0.57943326", "0.57725614", "0.57606316", "0.5733...
0.87721086
0
[res, partialScore] = canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, currWord)
canWordBePlacedVertical(x, y, state, stateHoriz, stateVert, word){ let result = false; let partialScore = 0; // Test if we can put the word at x, y, Vertical. // Test if the star and end position are over invalid state value terminate early. let endY = y + word.le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canWordBePlacedHorizontal(x, y, state, stateHoriz, stateVert, word){\n let result = false;\n let partialScore = 0;\n\n // Test if we can put the word at x, y, Horizontal.\n \n // Test if the star and end position are over invalid state value terminate early.\n let en...
[ "0.77801305", "0.7729702", "0.6526181", "0.6090291", "0.5822081", "0.5778684", "0.57716376", "0.57594687", "0.56874627", "0.5677386", "0.56713796", "0.5642991", "0.562144", "0.55623865", "0.55591255", "0.55578953", "0.5538963", "0.5500203", "0.5496398", "0.54935104", "0.54908...
0.87997663
0
function to create modal, all css styles are handled in here
function createPics(x){ for(i = 0; i < x.length; i++){ if((i % 3 === 0) && (i != x.length -1)){ var picture = document.createElement("img"); picture.setAttribute("src", x[i]); // picture.style.marginTop = '25%'; picture.style.position = 'relative'; newBox.style...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createModal() {\n return $(\"<div id=\\\"modal\\\" class=\\\"modal fade\\\" tabindex=\\\"-1\\\" aria-hidden=\\\"true\\\">\\\n <div class=\\\"modal-dialog\\\">\\\n <div class=\\\"modal-content\\\">\\\n <div class=\\\"modal-header\\\">\\\n <h5 class=\\\"modal-title\\\"></h5>\\\n ...
[ "0.72396785", "0.71066713", "0.7082859", "0.708085", "0.7054311", "0.698916", "0.6964184", "0.6944207", "0.69302154", "0.684649", "0.6844007", "0.6794452", "0.67898566", "0.67526877", "0.6751531", "0.67474544", "0.67427003", "0.67312354", "0.67177826", "0.6692518", "0.6685567...
0.0
-1
makeSmall = string.toLowerCase(); console.log(makeSmall);
function ceasarCipher3(alphabet) { for (var i = 0; i < alphabet.length; i++){ console.log(alphabet[i].charCodeAt()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lower(str){\n var smaller = str.toLowerCase()\n return smaller;\n}", "function whisper(string){ return string.toLowerCase() }", "function whisper(string) {\n return string.toLowerCase();\n}", "function whisper(string) {\n return string.toLowerCase()\n}", "function whisper(string) {\n return s...
[ "0.81820405", "0.8173265", "0.8127954", "0.8102936", "0.8102936", "0.8102936", "0.8026093", "0.8014278", "0.7950506", "0.7950506", "0.77565414", "0.77125156", "0.77125156", "0.7697154", "0.76867354", "0.761364", "0.7490729", "0.74797314", "0.74797314", "0.7439887", "0.7414374...
0.0
-1
DDGPSDistance expresses the distance betwwen to points loosly based on
function DDGPSDistance(pos1, pos2) { "use strict"; // // toRadian // // helper function to convert deg to rad // this.toRadian = function(v) { return v * (Math.PI / 180); }; // // diffDegrees // // helper function to get the delta between to degrees given in DEG...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dy(i, k){\n\tvar latlng = new google.maps.LatLng(pointarray[k].LatLng.lat(), pointarray[i].LatLng.lng());\n\tvar sign = (pointarray[k].LatLng.lat() > pointarray[i].LatLng.lat()) ? 1 : -1;\n\treturn sign * google.maps.geometry.spherical.computeDistanceBetween(latlng, pointarray[i].LatLng);\n}", "function...
[ "0.6728754", "0.6580154", "0.63693285", "0.635777", "0.6334744", "0.63190866", "0.630008", "0.62884635", "0.6285859", "0.6279469", "0.6278782", "0.62632", "0.61854905", "0.6141907", "0.6115319", "0.60991573", "0.6093052", "0.60790807", "0.60753334", "0.60683423", "0.6057333",...
0.70262086
0
do this for signup and login if you can.
componentDidUpdate(prevProps) { if (this.props.auth.isAuthenticated) { // if we changed the following prop, if ( prevProps.user && prevProps.user.following !== this.props.user.following ) { // refresh the page this.props.refreshUserProfile(this.props.match.params.us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sign_up(){\n try{\n if(Ti.Network.online){\n Ti.Platform.openURL('http://fieldteam.com.au/signup/');\n }else{\n self.show_message(L('message_o...
[ "0.7284577", "0.7162449", "0.7058603", "0.6872607", "0.6785819", "0.6782951", "0.6747031", "0.67247814", "0.6711408", "0.6698377", "0.66907704", "0.66859156", "0.6684917", "0.6645259", "0.6637659", "0.6631681", "0.6622034", "0.65420294", "0.6540746", "0.65363437", "0.6533254"...
0.0
-1
GIF ANCHO OCUPA DOS COLUMNAS
function aplicarAnchoOcupadoAGuifo() { if (imageHeight / imageWidth < 0.6) { imagenCont280.classList.add("imagenCont280x280OcupaDosColumnas"); imgBusqueda.style.paddingBottom = "50%"; } else { imagenCont280.classList.add("imagenCont280x280V2OcupaUnaColumna");...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verMasGifos(valorTextoBuscador) {\r\n contGeneralBusquedas = document.getElementById(\"contGeneralBusquedas\");\r\n while (contGeneralBusquedas.firstChild) {\r\n contGeneralBusquedas.removeChild(contGeneralBusquedas.firstChild);\r\n }\r\n\r\n const found = fetch(\r\n \"https://api.giphy.com/v1/g...
[ "0.5880145", "0.5784913", "0.5679738", "0.55934393", "0.55812246", "0.55696255", "0.5533217", "0.5489577", "0.54862547", "0.54764557", "0.54310805", "0.54258835", "0.54220295", "0.54122025", "0.54019475", "0.539128", "0.5378052", "0.53766495", "0.53716576", "0.5354802", "0.53...
0.52805626
25
TERMINA FUNCION BOTON BUSCAR FUNCION MOSTRAR TENDENCIAS
function mostrarTendencias() { const found = fetch( "https://api.giphy.com/v1/gifs/trending?" + "&api_key=D1S75ra9LrFB5yUfA4KZd0o47LpX3X4T" ) .then(response => { return response.json(); }) .then(data => { for (i = 0; i < 20; i++) { gif1 = data.data[i].images.previ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function etapaFinal() {\n \n msgTratamentoEtapa10.innerHTML = \"\";\n \n //PROCESSO DE CRIAÇÃO DO TEXTO DE CRIAÇÃO DA ULTIMA ETAPA\n //recebendo os valores os valores inseridos no input\n var descricaoEvento = document.getElementById('descricaoEvento').value;\n ...
[ "0.64337915", "0.61902803", "0.61390513", "0.606577", "0.6031369", "0.60222507", "0.59961957", "0.59891224", "0.5958323", "0.5933282", "0.59100324", "0.5907929", "0.589193", "0.58756924", "0.58743536", "0.5862667", "0.5862024", "0.5841386", "0.58310103", "0.58299184", "0.5827...
0.0
-1
QUE OCUPE DOS COLUMNAS SI LA RELACION DE ASPECTO ES HORIZONTAL
function aplicarAnchoOcupadoAGuifo() { if (imageHeight / imageWidth < 0.6) { imagenCont280.classList.add("imagenCont280x280OcupaDosColumnas"); imgBusqueda.style.paddingBottom = "50%"; } else { imagenCont280.classList.add("imagenCont280x280V2OcupaUna...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chequearHorizontal(ficha) {\n let cont = 1;\n if(ficha.getColUbicada() > 0) {\n cont += this.izqHoriz(ficha);\n }\n if(ficha.getColUbicada() < this.columna - 1) {\n cont += this.derHoriz(ficha);\n }\n return cont;\n }", "function posCalc(){\n ...
[ "0.6639687", "0.6292291", "0.61904603", "0.61602294", "0.6116126", "0.6101331", "0.6081628", "0.60055226", "0.599712", "0.59911174", "0.58876103", "0.58630615", "0.5849617", "0.58325", "0.58325", "0.58325", "0.58325", "0.58325", "0.58116716", "0.5811507", "0.5803368", "0.57...
0.0
-1
TERMINA FUNCION MOSTRAR TENDENCIAS FUNCION VER MAS GIFOS (HARDCODEADOS)
function verMasGifos(valorTextoBuscador) { contGeneralBusquedas = document.getElementById("contGeneralBusquedas"); while (contGeneralBusquedas.firstChild) { contGeneralBusquedas.removeChild(contGeneralBusquedas.firstChild); } const found = fetch( "https://api.giphy.com/v1/gifs/search?q=" + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifGg() {\r\n verifColonne();\r\n verifLigne();\r\n verifDiagonaleSlach();\r\n verifDiagonaleBackSlash();\r\n basculeJoueur();\r\n}", "function analizar(){\r\n \r\n bandera=false;//reinicar la varible cada ves que analizamos\r\n if(!textoEntrada.value==\"\"){\r\n \r\n ...
[ "0.6133268", "0.5963943", "0.58533466", "0.58438826", "0.5760844", "0.5757188", "0.57270044", "0.5725834", "0.57124954", "0.570269", "0.5624149", "0.5617929", "0.5617313", "0.55706954", "0.5558356", "0.55543184", "0.55327326", "0.55288804", "0.5527405", "0.5515659", "0.549918...
0.53499
39
QUE OCUPE DOS COLUMNAS SI LA RELACION DE ASPECTO ES HORIZONTAL
function aplicarAnchoOcupadoAGuifo() { if (imageHeight / imageWidth < 0.6) { imagenCont280.classList.add("imagenCont280x280OcupaDosColumnas"); imgBusqueda.style.paddingBottom = "50%"; } else { imagenCont280.classList.add("imagenCont280x280V2OcupaUnaColumna");...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chequearHorizontal(ficha) {\n let cont = 1;\n if(ficha.getColUbicada() > 0) {\n cont += this.izqHoriz(ficha);\n }\n if(ficha.getColUbicada() < this.columna - 1) {\n cont += this.derHoriz(ficha);\n }\n return cont;\n }", "function posCalc(){\n ...
[ "0.6640779", "0.6291029", "0.61918944", "0.615697", "0.61172885", "0.6098075", "0.6080758", "0.60047936", "0.5996679", "0.5992676", "0.5888541", "0.58616614", "0.5849544", "0.5833432", "0.5833432", "0.5833432", "0.5833432", "0.5833432", "0.58127743", "0.58117586", "0.58039397...
0.0
-1
TERMINA FUNCION VER MAS GIFOS (HARDCODEADOS) FUNCION ABRIR GIFO URL ORIGINAL
function abrirGifoUrl(gifoUrl2) { window.open(gifoUrl2, "_blank"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyLink(){\n const el = document.createElement('textarea');\n el.value = myGifURL;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.r...
[ "0.6653811", "0.6652704", "0.6557568", "0.65352964", "0.6434126", "0.6399392", "0.6328125", "0.62961864", "0.6145616", "0.60772014", "0.59617656", "0.59519905", "0.5944694", "0.5933584", "0.58944637", "0.58732325", "0.58227676", "0.58215296", "0.58000225", "0.5757338", "0.572...
0.64151686
5
library routine to "Safely get a dotnotated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined
function delve(obj, key, def, p) { p = 0; key = key.split ? key.split('.') : key; while (obj && p<key.length) obj = obj[key[p++]]; return obj===undefined ? def : obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPath(obj, ks) {\n if (typeof ks == \"string\") ks = ks.split(\".\");\n\n // If we have reached an undefined property\n // then stop executing and return undefined\n if (obj === undefined) return void 0;\n\n // If the path array has no more elements...
[ "0.69784325", "0.69172144", "0.68198967", "0.66340226", "0.65945303", "0.65895826", "0.65895826", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65510565", "0.65251285", "0.65164465", "0.64722514", "0.6445237",...
0.0
-1
You can extend webpack config here
extend(config, ctx) { // NuxtJS debugging support // eval-source-map: a SourceMap that matchers exactly to the line number and this help to debug the NuxtJS app in the client // inline-source-map: help to debug the NuxtJS app in the server config.devtool = ctx.isClient ? 'eval-source-map' : 'inl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend (config, { isDev, isClient }) {\n // if (isDev && isClient) {\n // config.module.rules.push({\n // enforce: 'pre',\n // test: /\\.(js|vue)$/,\n // loader: 'eslint-loader',\n // exclude: /(node_modules)/\n // })\n // }\n if (process.server && p...
[ "0.75780183", "0.7486256", "0.74535376", "0.7388344", "0.73616195", "0.72877634", "0.7282417", "0.7211369", "0.71547335", "0.7107632", "0.70970905", "0.7090317", "0.7045734", "0.7035934", "0.70036227", "0.699704", "0.69930667", "0.6985959", "0.69833404", "0.6973784", "0.69592...
0.67210746
50
/// Fonction pour ouvrir les snackbars
changeSnackbar(message, options) { this.props.closeSnackbar(); this.props.enqueueSnackbar(message, { variant: options }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nn(e,t){var a=e.display,n=a.scrollbars.update(t);a.sizer.style.paddingRight=(a.barWidth=n.right)+\"px\",a.sizer.style.paddingBottom=(a.barHeight=n.bottom)+\"px\",a.heightForcer.style.borderBottom=n.bottom+\"px solid transparent\",n.right&&n.bottom?(a.scrollbarFiller.style.display=\"block\",a.scrollbarFill...
[ "0.6217746", "0.59095204", "0.5889617", "0.5791345", "0.57629174", "0.57629174", "0.57629174", "0.57550716", "0.57249415", "0.56972605", "0.56530505", "0.5647044", "0.5640121", "0.5605316", "0.5541673", "0.5530385", "0.5530385", "0.5530385", "0.5530385", "0.5530385", "0.55303...
0.52679104
48
//// Fonction pour ouvrir le dialogue de suppression de compte
changeDialog() { this.setState({ openDialog: !this.state.openDialog }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmerSuppression() {\n let n = new Noty({\n text: 'Confirmer la suppression du frais ',\n layout: 'center',\n theme: 'sunset',\n modal: true,\n type: 'info',\n animation: {\n open: 'animated lightSpeedIn',\n close: 'animated lightSpeed...
[ "0.77172387", "0.69850814", "0.6619871", "0.66104627", "0.65871596", "0.65627605", "0.6555571", "0.6534313", "0.64463705", "0.6434666", "0.6403684", "0.6402108", "0.64011335", "0.6345391", "0.6328317", "0.6291136", "0.6288032", "0.6231813", "0.62201834", "0.62201834", "0.6203...
0.0
-1
//// Fonction pour ouvrir le modal de modification du password
changeModal() { this.setState({ openModal: !this.state.openModal }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "editPassword() {\n this.openChangePasswordModal();\n }", "function changePassword() {\n $rootScope.pwdModalTitle = '修改密码';\n $rootScope.pwdModal = $modal({\n scope: $rootScope,\n templateUrl: 'partials/modal.changePassword.html?' + new Date().getTime(),\n show: ...
[ "0.8072462", "0.77768934", "0.7775809", "0.77213126", "0.765381", "0.721205", "0.71587694", "0.7135265", "0.7063953", "0.7045441", "0.69749993", "0.6941379", "0.68708", "0.68125224", "0.6785911", "0.67566437", "0.6754021", "0.6753981", "0.6752273", "0.6713364", "0.67055655", ...
0.0
-1
text area for password
function writePassword() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\"...
[ "0.7510006", "0.746907", "0.74690545", "0.74439645", "0.7411469", "0.74101543", "0.74085397", "0.7390793", "0.73864794", "0.7381678", "0.7381035", "0.73720616", "0.73670405", "0.73420024", "0.7341333", "0.73367804", "0.7336413", "0.73349303", "0.7331306", "0.7328035", "0.7320...
0.0
-1
Returns the previous value of a reference after a component update.
function usePreviousValue(value) { const ref = React.useRef(); React.useEffect(() => { ref.current = value; }); return ref.current; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static usePrevious(value) {\n const ref = useRef();\n useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n }", "function usePrevious(value) {\n var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useRef\"])(); // Store current value in ref\n\n Objec...
[ "0.6968769", "0.6919886", "0.68952173", "0.6823359", "0.6805324", "0.6805324", "0.68033326", "0.67845196", "0.676848", "0.676848", "0.676848", "0.6727319", "0.6547264", "0.63774985", "0.6329312", "0.6262906", "0.6260976", "0.6164424", "0.6164424", "0.5897299", "0.58814037", ...
0.6749842
11
the key is lowerBound or upperBound. if opts.start is exists then lowBound key is opt.start
function encodeKey(key) { return encodePath(resolveKeyPath(vPath, key), opts, {}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lowerbound(arr, value, compare, start, to) {\r\n if (start === void 0) { start = 0; }\r\n if (to === void 0) { to = arr.length; }\r\n var count = to - start;\r\n while (0 < count) {\r\n var count2 = (count >> 1);\r\n var mid = start + count2;\r\n if (compare(arr[mid], valu...
[ "0.60179555", "0.57311285", "0.5563728", "0.55100125", "0.5428083", "0.5428083", "0.5423789", "0.54212034", "0.53937197", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625", "0.5392625"...
0.0
-1
`dataSet` is required in AD only. In AD, we call this function with `shouldValidateDataSet = true` In KD, we call this function with `shouldValidateDataSet = false`
function isValidFilterItemFormat(filterItem, shouldValidateDataSet) { if (shouldValidateDataSet === void 0) { shouldValidateDataSet = true; } if (typings_1.EmbeddedGdc.isDateFilter(filterItem)) { return isValidDateFilterFormat(filterItem, shouldValidateDataSet); } else { return isValidAt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateDataSetInputs($parentElem, setNo, cb){\n\n var collectionIn = $('input#dataSetCollection'+setNo).val();\n var filterFieldsIn = $('textarea#dataSetFilterFields'+setNo).val();\n var visibleFieldsIn = $('textarea#dataSetVisibleFields'+setNo).val();\n var sortFieldsIn = $('textarea#dataSetSortFiel...
[ "0.64525187", "0.63576126", "0.6223569", "0.5856935", "0.566922", "0.5654668", "0.5633762", "0.5630296", "0.56152713", "0.5592456", "0.55733246", "0.54581624", "0.5452156", "0.54521084", "0.5425719", "0.5423011", "0.5364372", "0.5351169", "0.5345526", "0.53274685", "0.5303188...
0.0
-1
Updates the current item
setItem(item) { this.setState({ currentItem: item }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateItems() {\n\t\tthis.callItemR('update');\n\t}", "update(item) {\n\t\tthis._cache[item._id] = item;\n\t\tthis.emit(events.CHANGE, item, this);\n\t}", "updateItem() {\n this.setState(this.state);\n }", "updateItem(el, value, index) {}", "_editItem() {\n // Edit Item from Order's Items array:...
[ "0.73549104", "0.7182145", "0.7042113", "0.70279205", "0.6845992", "0.68250275", "0.67719835", "0.66260827", "0.6619087", "0.6581458", "0.65396124", "0.6531059", "0.65190715", "0.6488068", "0.64700603", "0.64623135", "0.645273", "0.6387395", "0.63328433", "0.63280636", "0.631...
0.6304276
21
Updates the current item to the next item, or if the first item if at end of array.
nextItem() { const { itemCount, currentItem } = this.state; if (currentItem + 1 === itemCount) { return this.setItem(0); } return this.setItem(currentItem + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextInline (arr, item) {\n arr.push(item);\n //shift() removes the first item in the array.\n return arr.shift();\n}", "next(){\n let targetItem = this._currentItem + 1;\n let nextItem = targetItem >= this._itemCount ? 0 : targetItem;\n this._changeActive_keepPlayState(nextItem);\n }...
[ "0.6881295", "0.6446626", "0.63863486", "0.63625044", "0.6316742", "0.62030756", "0.6197833", "0.6197324", "0.61630523", "0.6158105", "0.6153818", "0.6101864", "0.60992175", "0.60796326", "0.60779005", "0.6073798", "0.6073798", "0.6073798", "0.6066566", "0.6058541", "0.601564...
0.6677017
1
Updates the current item to the previous item, or if the last item if at beginning of array.
prevItem() { const { itemCount, currentItem } = this.state; if (currentItem - 1 < 0) { return this.setItem(itemCount - 1); } return this.setItem(currentItem - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prev () {\n if (this._items.length < 2 || this._isMoving) {\n return\n }\n\n var currentIndex = this._items.indexOf(this._current);\n var prevIndex = this._items[currentIndex - 1] !== undefined \n ? currentIndex - 1 : this._items.length;\n this._to(prevIndex);\n }", "setPreviousItemActi...
[ "0.7119443", "0.6930721", "0.69208", "0.69050205", "0.68666184", "0.68666184", "0.68666184", "0.65523434", "0.6542491", "0.6527057", "0.649371", "0.6451188", "0.6364299", "0.63640904", "0.63526326", "0.6326494", "0.6319336", "0.6250204", "0.6224828", "0.61887646", "0.6183268"...
0.70862603
1
Starts playing of content, sets interval
play() { const delay = this.props.delay || 6000; const interval = setInterval(() => { this.nextItem(); }, delay); this.interval = interval; this.setState({ playing: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startPlayback() {\n setInterval(this.moveForward, this.slideInterval);\n }", "play() {\n console.log('play')\n\n this.timer = setInterval(this.next, this.options.autoplaySpeed);\n }", "play() {\n\t\tif (this._isActive && this._isPause) {\n\t\t\tthis.pause(false)\n\t\t} else {\n\t\t\t...
[ "0.70664746", "0.67528313", "0.66460854", "0.662362", "0.6584105", "0.64555216", "0.64378536", "0.6424639", "0.63814074", "0.6375833", "0.63728386", "0.6349882", "0.6326881", "0.6267367", "0.6260632", "0.6260189", "0.6231807", "0.62289184", "0.62266034", "0.6206737", "0.62027...
0.6769444
1
Stops playing of content, clears interval
pause() { clearInterval(this.interval); this.setState({ playing: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopPlay () {\n\t\tremoveWeenie();\n \tclearInterval(interval1);\n \tclearInterval(interval2);\n \tclearInterval(countdown);\n\t}", "stop() {\n this.pause();\n this._playingState = 'idle';\n this.index = 0;\n }", "stop() {\n player.src(player.src());\n }", ...
[ "0.74033123", "0.7299398", "0.72231483", "0.72073615", "0.7199217", "0.7194887", "0.71412444", "0.7137825", "0.7129847", "0.7128529", "0.7095325", "0.7094506", "0.70584553", "0.703985", "0.703437", "0.70324165", "0.70324165", "0.70275974", "0.70198184", "0.70057595", "0.69930...
0.0
-1
'sig' parameter is only used on LLVM wasm backend
function addFunction(func, sig) { if (typeof sig === 'undefined') { err('warning: addFunction(): You should provide a wasm function signature string as a second argument. This is not necessary for asm.js and asm2wasm, but is required for the LLVM wasm backend, so it is recommended for full portability.'); } v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "EI(op){ throw \"Unimplemented Instruction\"; }", "function gen_op_iwmmxt_movl_wCx_T0(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_iwmmxt_movl_wCx_T0, param:param1});\n}", "function gen_op_iwmmxt_movl_T0_T1_wRn(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.pu...
[ "0.51345295", "0.5086701", "0.50783587", "0.50659424", "0.5010076", "0.5001382", "0.4968674", "0.4954169", "0.49476784", "0.49438235", "0.49218324", "0.49212924", "0.49027812", "0.48821583", "0.48794067", "0.48761094", "0.48666885", "0.4846224", "0.4844152", "0.4831979", "0.4...
0.45642456
86
Returns the C function with a specified identifier (for C++, you need to do manual name mangling)
function getCFunc(ident) { var func = Module['_' + ident]; // closure exported function assert(func, 'Cannot call unknown function ' + ident + ', make sure it is exported'); return func; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCFunc(ident) {\n try {\n var func = Module['_' + ident]; // closure exported function\n if (!func) func = eval('_' + ident); // explicit lookup\n } catch (e) {}\n assert(func, 'Cannot call unknown function ' + ident + ' (perhaps LLVM optimizations or closure removed it?)');\n ...
[ "0.75233024", "0.75233024", "0.75203484", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", "0.7504646", ...
0.72423786
61
Allocate memory during any stage of startup static memory early on, dynamic memory later, malloc when ready
function getMemory(size) { if (!staticSealed) return staticAlloc(size); if (!runtimeInitialized) return dynamicAlloc(size); return _malloc(size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "allocateStatic(allowDirty = true) {\n if (allowDirty && this.dirtyMemory.length > 0) {\n let addr = this.dirtyMemory.shift();\n return addr.split(\" \");\n }\n //Create placeholder address\n let addr = \"S\" + this.staticLength.toString().padStart(3, \"0\");\n ...
[ "0.61939925", "0.6098248", "0.5965023", "0.58661103", "0.5771303", "0.5748167", "0.5683909", "0.55740565", "0.556984", "0.5547237", "0.5547237", "0.5547237", "0.55238634", "0.54585016", "0.5457148", "0.5436542", "0.542547", "0.54253507", "0.5408998", "0.5408998", "0.5408998",...
0.5408418
29
Given a pointer 'ptr' to a nullterminated ASCIIencoded string in the emscripten HEAP, returns a copy of that string as a Javascript String object.
function AsciiToString(ptr) { var str = ''; while (1) { var ch = HEAP8[((ptr++)>>0)]; if (!ch) return str; str += String.fromCharCode(ch); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AsciiToString(ptr) {\n var str = '';\n while (1) {\n var ch = ((SAFE_HEAP_LOAD(((ptr++)|0), 1, 0))|0);\n if (!ch) return str;\n str += String.fromCharCode(ch);\n }\n}", "function __getString(ptr) {\n if (!ptr) return null;\n const buffer = memory.buffer;\n const id = new Uint32Array...
[ "0.6905835", "0.6686162", "0.65401655", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65390843", "0.65343046", "0.65343046", ...
0.64706045
42
Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', nullterminated and encoded in ASCII form. The copy will require at most str.length+1 bytes of space in the HEAP.
function stringToAscii(str, outPtr) { return writeAsciiToMemory(str, outPtr, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToAscii(str, outPtr) {\r\n return writeAsciiToMemory(str, outPtr, false);\r\n}", "function stringToAscii(str, outPtr) {\nreturn writeAsciiToMemory(str, outPtr, false);\n}", "function stringToAscii(str, outPtr) {\n return writeAsciiToMemory(str, outPtr, false);\n }", "function string...
[ "0.73057526", "0.72830665", "0.72588694", "0.71218604", "0.7090151", "0.70606494", "0.70606494", "0.6991646", "0.6991646", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807", "0.6974807...
0.72290915
21
Given a pointer 'ptr' to a nullterminated UTF8encoded string in the emscripten HEAP, returns a copy of that string as a Javascript String object.
function UTF8ToString(ptr) { return UTF8ArrayToString(HEAPU8,ptr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UTF8ToString(ptr) {\n return UTF8ArrayToString(HEAPU8, ptr);\n}", "function UTF8ToString(ptr) {\n return UTF8ArrayToString(HEAPU8, ptr);\n}", "function UTF8ToString(ptr) {\n return UTF8ArrayToString(HEAPU8, ptr);\n }", "function UTF8ToString(ptr) {\nreturn UTF8ArrayToString(HEAPU8,ptr);\...
[ "0.692872", "0.692872", "0.69246566", "0.69131196", "0.6806165", "0.6590117", "0.64835745", "0.64835745", "0.6403124", "0.6360599", "0.6308334", "0.6301423", "0.6301423", "0.6301423", "0.6301423", "0.62988174", "0.6286197", "0.6229328", "0.6229328", "0.6229328", "0.6229328", ...
0.6947548
13
Copies the given Javascript String object 'str' to the given byte array at address 'outIdx', encoded in UTF8 form and nullterminated. The copy will require at most str.length4+1 bytes of space in the HEAP. Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this functi...
function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) { if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes. return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; // -1 for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8Array(str, outU8Array, outIdx, maxBytesToWrite) {\n\t if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.\n\t return 0;\n\n\t var startIdx = outIdx;\n\t var endIdx = outIdx + maxBytesToWri...
[ "0.7815157", "0.7803416", "0.77327996", "0.7732152", "0.7732152", "0.7732152", "0.7732152", "0.77259654", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0.76696134", "0...
0.76969755
12
Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', nullterminated and encoded in UTF8 form. The copy will require at most str.length4+1 bytes of space in the HEAP. Use the function lengthBytesUTF8 to compute the exact number of bytes (excluding null terminator) that this functio...
function stringToUTF8(str, outPtr, maxBytesToWrite) { assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8(str, outPtr, maxBytesToWrite) {\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n }", "function stringToUTF8(str, outPtr, maxBytesToWrite) {\n return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n}", "function stringToUTF8(str, outPtr, maxBytesToWr...
[ "0.74050784", "0.7389647", "0.73348516", "0.73348516", "0.73348516", "0.73348516", "0.73348516", "0.73348516", "0.73041177", "0.73015404", "0.73015404", "0.73015404", "0.7280944", "0.7279203", "0.7277983", "0.726424", "0.726424", "0.726424", "0.726424", "0.726424", "0.726424"...
0.7229892
46
Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.
function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! So decode UTF16->UTF32->UTF8. // See http://unicode.org/faq/utf_bom.html#utf16-3 var u = str.char...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);}// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.", "function lengthBytesUTF8(str) {\n var len = 0;\n fo...
[ "0.871143", "0.7463354", "0.7423347", "0.73541486", "0.73341924", "0.73341924", "0.73341924", "0.73341924", "0.73341924", "0.73341924", "0.73287153", "0.7315998", "0.72712785", "0.7171464", "0.7171464", "0.71336293", "0.70777076", "0.69523704", "0.69424164", "0.69211113", "0....
0.7385386
19
Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', nullterminated and encoded in UTF16 form. The copy will require at most str.length4+2 bytes of space in the HEAP. Use the function lengthBytesUTF16() to compute the exact number of bytes (excluding null terminator) that this fun...
function stringToUTF16(str, outPtr, maxBytesToWrite) { assert(outPtr % 2 == 0, 'Pointer passed to stringToUTF16 must be aligned to two bytes!'); assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF16(str, outPtr, maxBytesToWrite) {\n assert(typeof maxBytesToWrite == 'number', 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');\n // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded w...
[ "0.83270043", "0.83270043", "0.83270043", "0.8309919", "0.8282468", "0.82709014", "0.82709014", "0.82709014", "0.82709014", "0.82709014", "0.82709014", "0.82709014", "0.8233835", "0.8194967", "0.81605613", "0.7658179", "0.76382595", "0.76382595", "0.76382595", "0.75092375", "...
0.8248039
20
Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
function lengthBytesUTF16(str) { return str.length*2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);}// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.", "function lengthBytesUTF16(str) {\nreturn str.length*2;\n}", "fu...
[ "0.8159074", "0.7342527", "0.7341748", "0.7341748", "0.7341748", "0.7341748", "0.7341748", "0.7341748", "0.7341748", "0.73244786", "0.72331005", "0.72321904", "0.71784353", "0.7151909", "0.71390057", "0.71390057", "0.71390057", "0.71390057", "0.71390057", "0.71390057", "0.713...
0.73078996
27
Copies the given Javascript String object 'str' to the emscripten HEAP at address 'outPtr', nullterminated and encoded in UTF32 form. The copy will require at most str.length4+4 bytes of space in the HEAP. Use the function lengthBytesUTF32() to compute the exact number of bytes (excluding null terminator) that this fun...
function stringToUTF32(str, outPtr, maxBytesToWrite) { assert(outPtr % 4 == 0, 'Pointer passed to stringToUTF32 must be aligned to four bytes!'); assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF32(str, outPtr, maxBytesToWrite) {\n assert(typeof maxBytesToWrite == 'number', 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');\n // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded w...
[ "0.82103443", "0.82103443", "0.82103443", "0.81083363", "0.80677664", "0.8058171", "0.8058171", "0.8058171", "0.8058171", "0.8058171", "0.8058171", "0.8058171", "0.80273294", "0.7977888", "0.7931259", "0.7460105", "0.7460105", "0.7460105", "0.74547124", "0.74162847", "0.74162...
0.81008095
12
Returns the number of bytes the given Javascript string takes if encoded as a UTF16 byte array, EXCLUDING the null terminator byte.
function lengthBytesUTF32(str) { var len = 0; for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. // See http://unicode.org/faq/utf_bom.html#utf16-3 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite);}// Returns the number of bytes the given Javascript string takes if encoded as a UTF8 byte array, EXCLUDING the null terminator byte.", "function lengthBytesUTF16(str) {\nreturn str.length*2;\n}", "fu...
[ "0.8158064", "0.7342811", "0.73413706", "0.73413706", "0.73413706", "0.73413706", "0.73413706", "0.73413706", "0.73413706", "0.73247576", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", "0.73081255", ...
0.6969559
81
Allocate heap space for a JS string, and write it there. It is the responsibility of the caller to free() that memory.
function allocateUTF8(str) { var size = lengthBytesUTF8(str) + 1; var ret = _malloc(size); if (ret) stringToUTF8Array(str, HEAP8, ret, size); return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mallocAndWriteString(str) {\n const ptr = onigasmH_1.onigasmH._malloc(str.utf8Bytes.length);\n onigasmH_1.onigasmH.HEAPU8.set(str.utf8Bytes, ptr);\n return ptr;\n}", "function mallocAndWriteString(str) {\n const ptr = onigasmH_1.onigasmH._malloc(str.utf8Bytes.length);\n onigasmH_1.onigasm...
[ "0.7335188", "0.7335188", "0.7334625", "0.6472578", "0.64592624", "0.64134383", "0.64025587", "0.64025587", "0.64025587", "0.64020663", "0.64020663", "0.6331062", "0.6312919", "0.6312919", "0.6312919", "0.6312919", "0.6312919", "0.6312919", "0.6312919", "0.6312919", "0.631291...
0.591804
72
Allocate stack space for a JS string, and write it there.
function allocateUTF8OnStack(str) { var size = lengthBytesUTF8(str) + 1; var ret = stackAlloc(size); stringToUTF8Array(str, HEAP8, ret, size); return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mallocAndWriteString(str) {\n const ptr = onigasmH_1$1.onigasmH._malloc(str.utf8Bytes.length);\n onigasmH_1$1.onigasmH.HEAPU8.set(str.utf8Bytes, ptr);\n return ptr;\n}", "function allocateUTF8OnStack(str) {\nvar size = lengthBytesUTF8(str) + 1;\nvar ret = stackAlloc(size);\nstringToUTF8Array(st...
[ "0.64793503", "0.64146256", "0.6412377", "0.6412377", "0.63392955", "0.5900958", "0.585578", "0.585578", "0.585578", "0.58464277", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57998335", "0.57...
0.63302505
15
Initializes the stack cookie. Called at the startup of main and at the startup of each thread in pthreads mode.
function writeStackCookie() { assert((STACK_MAX & 3) == 0); HEAPU32[(STACK_MAX >> 2)-1] = 0x02135467; HEAPU32[(STACK_MAX >> 2)-2] = 0x89BACDFE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n /* Allow the browser to process other tasks */\n TASK_BREAK_TIME_MS = 128;\n /* Time to process the tasks for */\n TASK_PROCESS_TIME_MS = 256;\n /* Record progress completion */\n tasksScanned = 0;\n tasksCompleted = 0;\n /* The overall task stack */\n taskStack = [];\n /* The variable...
[ "0.5901585", "0.5730759", "0.5730759", "0.57203317", "0.5703816", "0.5697667", "0.5694294", "0.5694294", "0.5694294", "0.5694294", "0.5677654", "0.563127", "0.563127", "0.5625961", "0.55764705", "0.5539435", "0.5539435", "0.5539435", "0.55338556", "0.5527547", "0.55023634", ...
0.50923413
72
Deprecated: This function should not be called because it is unsafe and does not provide a maximum length limit of how many bytes it is allowed to write. Prefer calling the function stringToUTF8Array() instead, which takes in a maximum length that can be used to be secure from out of bounds writes.
function writeStringToMemory(string, buffer, dontAddNull) { warnOnce('writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!'); var /** @type {number} */ lastChar, /** @type {number} */ end; if (dontAddNull) { // stringToUTF8Array always appends null. If we don't want to do t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToUTF8(str, outPtr, maxBytesToWrite) {\n\t assert(typeof maxBytesToWrite == 'number', 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!');\n\t return stringToUTF8Array(str, HEAPU8,outPtr, maxBytesToWrite);\n\t}", "function ...
[ "0.74778044", "0.74363595", "0.7416579", "0.7346445", "0.73059785", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", "0.72995335", ...
0.59234416
86
Indicates whether filename is a base64 data URI.
function isDataURI(filename) { return String.prototype.startsWith ? filename.startsWith(dataURIPrefix) : filename.indexOf(dataURIPrefix) === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDataURI(filename){return hasPrefix(filename,dataURIPrefix);}", "function isDataURI(filename) {\n return hasPrefix(filename, dataURIPrefix);\n}", "function isDataURI(filename) {\n return hasPrefix(filename, dataURIPrefix);\n}", "function isDataURI(filename) {\n\t return String.prototype.startsWi...
[ "0.7676268", "0.7416155", "0.7416155", "0.72600096", "0.72294366", "0.72275877", "0.7206295", "0.7173091", "0.67666405", "0.67359805", "0.6659148", "0.6537542", "0.6343388", "0.6296736", "0.6278173", "0.6278173", "0.6266253", "0.61276126", "0.6084759", "0.6083254", "0.6012707...
0.7177315
17
handle a generated wasm instance, receiving its exports and performing other necessary setup
function receiveInstance(instance, module) { exports = instance.exports; if (exports.memory) mergeMemory(exports.memory); Module['asm'] = exports; Module["usingWasm"] = true; removeRunDependency('wasm-instantiate'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function receiveInstance(instance, module) {\n\t var exports = instance.exports;\n\t Module['asm'] = exports;\n\t removeRunDependency('wasm-instantiate');\n\t }", "function receiveInstance(instance, module) {\n var exports = instance.exports;\n Module['asm'] = exports;\n removeRunDepende...
[ "0.6808065", "0.67490506", "0.67317694", "0.67317694", "0.67152405", "0.6102554", "0.58304995", "0.58256936", "0.57448417", "0.5716801", "0.5701208", "0.5698744", "0.5643474", "0.56330514", "0.5580887", "0.5575151", "0.5558708", "0.555801", "0.55130184", "0.5451254", "0.54300...
0.6760272
6
Lazy chunked Uint8Array (implements get and length from Uint8Array). Actual getting is abstracted away for eventual reuse.
function LazyUint8Array() { this.lengthKnown = false; this.chunks = []; // Loaded chunks. Index is the chunk number }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LazyUint8Array() {\n this.lengthKnown = false;\n this.chunks = []; // Loaded chunks. Index is the chunk number\n }", "function LazyUint8Array() {\nthis.lengthKnown = false;\nthis.chunks = []; // Loaded chunks. Index is the chunk number\n}", "function LazyUint8Array() {\r\n this.l...
[ "0.8164789", "0.81487465", "0.81483644", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.8143208", "0.81031984", "0.81031984", "0.81031984", "0.81031984...
0.81534827
22
might have several active requests for the same fullname
function processData(byteArray) { function finish(byteArray) { if (preFinish) preFinish(); if (!dontCreateFile) { FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn); } if (onload) onload(); removeRunDependency(dep); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllPendingRequests(){\r\n\t\tFriendService.getAllPendingRequests().then(\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\t$scope.pendingRequests=response.data\r\n\t\t\t\t},\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\tif(response.status==401)\r\n\t\t\t\t\t\t$location.path('/login')\r\n\t\t\t\t})\r\n\t}", "...
[ "0.55691814", "0.54734445", "0.5364244", "0.5355023", "0.52813303", "0.5256878", "0.51982707", "0.5187541", "0.5176093", "0.5166524", "0.51381826", "0.5102556", "0.5100947", "0.508753", "0.50866383", "0.50805783", "0.5077806", "0.5031001", "0.5021867", "0.5020623", "0.5019766...
0.0
-1
run may have just been called through dependencies being fulfilled just in this very frame
function doRun() { if (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening Module['calledRun'] = true; if (ABORT) return; ensureInitRuntime(); preMain(); if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); as...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRun(){// run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if(calledRun)return;calledRun=true;Module['calledRun']=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module['o...
[ "0.71390134", "0.70668715", "0.6954484", "0.6940572", "0.69085675", "0.6817765", "0.6730855", "0.6726736", "0.6554362", "0.64763445", "0.6436964", "0.64342535", "0.64154637", "0.64030594", "0.6303505", "0.6262103", "0.6262103", "0.62268996", "0.62268996", "0.62268996", "0.622...
0.6317826
16
ao carregar todos os elementos da pagina, depois de 5 segundos invoca a funcao que troca o nome do usuario
function onLoaded() { // registra no console console.log("loaded"); // apos 5 segundos (5000 ms) invoca a funcao trocar nome setTimeout(function () { trocarNome(); }, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserNames() {\n $.get(\"/api/userNames\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createUserNameRow(data[i]));\n }\n renderUserNameList(rowsToAdd);\n nameInput.val(\"\");\n });\n }", "function mostrarDato...
[ "0.634465", "0.62235487", "0.617156", "0.61038905", "0.60950375", "0.6090873", "0.60625327", "0.60571206", "0.6041895", "0.60382295", "0.60291994", "0.60099536", "0.59758073", "0.5946827", "0.59403473", "0.5931283", "0.58881986", "0.5885548", "0.58821785", "0.5862917", "0.586...
0.0
-1
probe the function check after 100ms
function check(){ // reading the signal at P8_19 pin and calling function checkButton b.digitalRead('P8_19', checkButton); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pingCheck() {\n if (timer) { clearTimeout(timer);}\n var pong = new Date() - start;\n if (typeof callback === \"function\") {\n callback(pong);\n }\n }", "function check() {}", "function checkTimers(){\n createTimerCallback(amatriadata.sleepTimes)\n cons...
[ "0.63403505", "0.63391423", "0.63155407", "0.61456585", "0.6075736", "0.607377", "0.60648423", "0.6022146", "0.5952486", "0.5947416", "0.59374565", "0.59374565", "0.5937073", "0.5869874", "0.58557826", "0.58545953", "0.5849127", "0.58360004", "0.5813773", "0.5794463", "0.5785...
0.0
-1
mysqlpassport authentication returning email
async function find_email(email) { return new Promise((res, rej) => { con.query( `select * from Admin where email = ?`, [email], async (err, row, field) => { if (err) rej(err); // console.log("+++++++++++"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserLogin(userMail: string, callback: Function) {\n super.query(\n \"select mail, password from user where mail=? \",\n [userMail],\n callback\n );\n }", "function authenticate_user(res, mysql, context, us, pw, complete){\n\tvar sql = 'SELECT user_id, email, member_since FROM users WHERE...
[ "0.6609303", "0.6547953", "0.65036976", "0.6470842", "0.6425865", "0.6384841", "0.63687044", "0.6319707", "0.6298566", "0.629392", "0.62365484", "0.61926997", "0.6176324", "0.617026", "0.61556715", "0.61534506", "0.61524755", "0.6148987", "0.6115323", "0.61012655", "0.6036834...
0.0
-1
for checking if the user is authenticated then stopping him from going to other routes
function checkAuthenticated(req, res, next) { if (req.isAuthenticated()) { return next(); } res.redirect("/blogOpdemy"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNotAuth(req, res, next) {\n // If authenticated, redirect to Home page\n if (req.isAuthenticated()) {\n return res.redirect('/');\n }\n // If not authenticated, proceed to requested route\n next();\n}", "function checknotau(req,res, next){\n if(req.isAuthenticated()){\n return re...
[ "0.7306958", "0.72912395", "0.7285411", "0.7238605", "0.7165948", "0.7157216", "0.7146816", "0.71311665", "0.7130573", "0.71286225", "0.71205306", "0.7115849", "0.71132636", "0.7113018", "0.7112691", "0.7088868", "0.7087912", "0.7074107", "0.70687556", "0.7060433", "0.7058566...
0.70656914
19
for checking if the user is not authenticated then stopping him from going to any route which should be accessed by authorised personal
function checkNotAuthenticated(req, res, next) { if (req.isAuthenticated()) { return res.redirect("/blogOpdemy"); } next(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNotAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return res.redirect('/ratings/admin')\n }\n next()\n}", "function checkNotAuth(req, res, next) {\n // If authenticated, redirect to Home page\n if (req.isAuthenticated()) {\n return res.redirect('/');\n }\n...
[ "0.7544316", "0.7515141", "0.7466411", "0.739001", "0.7386292", "0.7318372", "0.7305811", "0.7268719", "0.72142136", "0.71669924", "0.71613467", "0.7137715", "0.7134091", "0.7118743", "0.7116973", "0.7085825", "0.705767", "0.704363", "0.703473", "0.70283145", "0.7020174", "...
0.7457255
3
function to add checkbox/legend option for a given term
function add_option(term) { // get form object var form = document.getElementById("key_options"); // console.log("adding option") // add input tag var new_key_input = document.createElement("INPUT"); new_key_input.id = term + "Option" new_key_input.type = "checkbox"; new_key_input.name ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function aj_opt(ref,desc) {\r\n\tvar nvspan = aligne();\r\n\tvar choix = document.createElement(\"input\");\r\n\tchoix.id = ref;\r\n\tchoix.type = \"checkbox\";\r\n\tchoix.checked = opt[ref];\r\n\tchoix.title = desc;\r\n\tvar etik = document.createElement(\"label\");\r\n\tetik.appendChild(illustr(ref,desc,desc));\...
[ "0.67247677", "0.62259895", "0.6101749", "0.5932211", "0.58307934", "0.5744172", "0.5740999", "0.57151663", "0.5676415", "0.5650616", "0.56368417", "0.5627962", "0.561337", "0.5606613", "0.5559653", "0.5530732", "0.55292857", "0.55162275", "0.55116576", "0.5508801", "0.54993"...
0.74772125
0
function to get data only from selected terms and decades in a useful structure
function clean_key_data(term_key_list, min_decade, max_decade, lang) { var key_data = []; // iterate through given term keys term_key_list.forEach(function (key) { datapoints = []; // iterate through data and push rows matching the term and decade data.forEach...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStructuredData () {\n let data = [];\n data.push((getCareerName()) ? getCareerName() : \"\");\n document.querySelectorAll(\"table#tabla_expediente[data-role=table]\").forEach((item) => {\n data.push({\n title: getTitleFromTable(item),\n data: getDataFromTable(item),\n }...
[ "0.56039804", "0.5453795", "0.5411598", "0.5392008", "0.5351751", "0.534853", "0.5318618", "0.52755266", "0.5270177", "0.5265761", "0.52011627", "0.5186945", "0.5185951", "0.5162575", "0.5150262", "0.515003", "0.51436234", "0.51418364", "0.51233095", "0.5111462", "0.509633", ...
0.54194504
2
function to draw graph based on selected term keys and scales
function update(selected_term_keys) { console.log("updating..."); // get value for y scale var yMax = document.getElementById('count_value').value / 100 // update domain of y scale yScale.domain([0, yMax]); // remove old y axis svg.selectAll(".y.axis").remove(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barC...
[ "0.6292561", "0.62092125", "0.60136163", "0.5870548", "0.5840892", "0.58114547", "0.5798202", "0.5749724", "0.5706162", "0.5692194", "0.5658058", "0.56386834", "0.56262684", "0.5624014", "0.5607007", "0.56015486", "0.5587138", "0.558149", "0.5575799", "0.5575799", "0.5556838"...
0.64926535
0
update value in text box when range input is edited
function update_title_range(val) { document.getElementById('count_value').value = val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRangeText(event, ui){\n $(this).parent().parent().children().children('.allocText').val(ui.value);\n updateSum();\n }", "function updateRangeInputValue() {\n \"use strict\";\n var id = this.id;\n var val = this.value;\n\n // Update Number Input with it's respective Sli...
[ "0.79295444", "0.78367156", "0.71084553", "0.6981818", "0.6884556", "0.6880933", "0.6777981", "0.66920596", "0.6683402", "0.65992326", "0.6580595", "0.6569573", "0.6523483", "0.65027535", "0.64961386", "0.64369917", "0.63844794", "0.63689303", "0.6365316", "0.6327034", "0.631...
0.65216184
13
update value on range to match type input in text box
function update_count_text(val) { if (val <= 100) { document.getElementById('count').value = val } else { update_title_range(8) update_count_text(8) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRangeInputValue() {\n \"use strict\";\n var id = this.id;\n var val = this.value;\n\n // Update Number Input with it's respective Sliders Range Input value\n var inputNumber = document.getElementsByClassName(id);\n inputNumber[0].value = val;\n renderView();\n}", "function upd...
[ "0.75809205", "0.7295847", "0.6951233", "0.6856544", "0.6708572", "0.6616575", "0.66098684", "0.65462476", "0.65346545", "0.6516526", "0.6487376", "0.6482322", "0.64808655", "0.64055264", "0.63900197", "0.6341553", "0.6338667", "0.63323617", "0.6282393", "0.627873", "0.627666...
0.57856435
68
let hour, minute, day, month;
function getTimeDate(){ let start = readline.question("Start From?(Format: MM-DD-YYYY H:mm) "); let end = readline.question("End?(Format: MM-DD-YYYY H:mm) "); // console.log((new Date(start).getTime()),new Date(end).getTime()) // console.log(moment(new Date(start).getTime()).format('MM-DD-YYYY H:mm'),m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "function date(time, date= '12th', month = 'August') {\n console.log({\n time: time,\n date: date,\n month: month\n })\n}", "function showDateTime() {\n let dt = new Date();\n let month = dt.getMonth() + 1;\n let day...
[ "0.74158543", "0.6767569", "0.6536105", "0.6388276", "0.6341837", "0.6298881", "0.629421", "0.62630427", "0.62476027", "0.62476027", "0.62476027", "0.62476027", "0.6219046", "0.6209437", "0.6209437", "0.61995053", "0.6163728", "0.61402774", "0.6119558", "0.6119558", "0.611955...
0.0
-1
Signup Add to users table Login Query users table to confirm name & password, return user_id & household_id (if any) getList Query items table & return items associated w user (_id, names, priority, shared?, location)
getList (req, res, next) { //console.log("here is what getList is getting: ", req.body) // console.log("here is what getList is getting: ", req.body) const query = ` SELECT _id, name, priority, location, shared FROM items WHERE user_id = $1` db.query(query, [req...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _noma...
[ "0.6273965", "0.5874992", "0.58311886", "0.58007485", "0.5790895", "0.5756027", "0.57546365", "0.57019943", "0.5674354", "0.5649198", "0.5626619", "0.56172574", "0.56125385", "0.5605019", "0.558434", "0.5565272", "0.5555583", "0.5550798", "0.5542547", "0.5529643", "0.55268854...
0.0
-1
addItem Insert into items table based on userid, priority, shareable?, location... next getList
addItem (req, res, next) { // console.log('Request Body: ', req.body); const query = ` INSERT INTO items (name, priority, location, shared, user_id) VALUES ($1, $2, $3, $4, $5)` const entries = [req.body.name, req.body.priority, req.body.location, req.body.shared, req.cookies...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addItem(userItem) {\n for(var i=0; i<this._userItemList.length; i++){\n // if not check the list for a new userItem and add it to the userItemList\n if(this.userItemList[i]._item._itemCode === userItem._item._itemCode){\n console.log('ERROR: Duplicate Save');\n } else {\n var newUserIte...
[ "0.6585293", "0.612725", "0.60575974", "0.60575974", "0.604214", "0.5983268", "0.5973855", "0.5944136", "0.5938338", "0.59231114", "0.5916791", "0.5912146", "0.5909294", "0.59051937", "0.5891268", "0.58813936", "0.5871066", "0.5866562", "0.58607644", "0.584902", "0.58338535",...
0.5909401
12
removeitem Delete from items table based on item_id.... next getList
deleteItem (req, res, next) { const query = ` DELETE FROM items WHERE _id = $1` const id = [req.body.id]; db.query(query, id, (err, data) => { if(err) { return next({ log: `deleteItem ERROR: ${err}`, message: { 'err': 'An error occurred in dele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function deleteItem(){\r\n// todo\r\n var id = readNonEmptyString('please typ...
[ "0.77026784", "0.7471258", "0.73697954", "0.7342651", "0.7284427", "0.7263386", "0.7246927", "0.724247", "0.71562093", "0.709938", "0.704098", "0.7032548", "0.70266896", "0.70053035", "0.69704", "0.69569874", "0.69218224", "0.6901263", "0.6889411", "0.6869964", "0.68634987", ...
0.67322713
30
updateItem based on column to update & new value, item_id.... next getList
updateItem (req, res, next) { console.log('updateItem request: ', req.body); const query = 'UPDATE items SET ' + req.body.set + ' = ' + req.body.newVal + ' WHERE _id = ' + req.body.id + ';'; // alternative (less secure) approach: insert variable parameters into query using template literals ${_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async updateItem(item) {\n try {\n await shopdb.poitem.update(item, { where: { id: item.id } });\n } catch (error) {\n throw error;\n }\n }", "updateItem(id, updatedItem) {\n return new Promise((fulfill, reject) => {\n return this.getItemById(id).then((currentItem) =>...
[ "0.68185085", "0.6703256", "0.6623037", "0.65752304", "0.65704834", "0.65401363", "0.65268385", "0.6504224", "0.64896697", "0.64858407", "0.64646", "0.64423907", "0.6415858", "0.64130145", "0.6391909", "0.6382583", "0.6377248", "0.6338425", "0.63113254", "0.6302893", "0.62835...
0.7158537
0
Grab and concatenate javascript files
function saveJavascript() { console.info( 'Creating javascript...' ); jsdom.defaultDocumentFeatures = { FetchExternalResources : ['script'], ProcessExternalResources : ['script'], MutationEvents : '2.0', } var html = loadUrlSync( webUrl ); html = html.replace( '<head>', '<head><...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scripts() {\n return (\n gulp\n .src(javascript_sources)\n .pipe(sourcemaps.init())\n .pipe(concat('concat.js'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(rename('package.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp...
[ "0.71815836", "0.7142118", "0.7025786", "0.7015904", "0.7009545", "0.6990861", "0.697715", "0.69198126", "0.6904944", "0.6900112", "0.68903494", "0.6870767", "0.6870409", "0.68685997", "0.684212", "0.6827409", "0.6826057", "0.6812122", "0.68118554", "0.67839634", "0.6749936",...
0.0
-1
Grab and concatenate stylesheet files
function saveStylesheet() { console.info( 'Creating stylesheet...' ); var stylePath = rootPath + styleDirectory + '/style.css'; fs.unlink( stylePath, function() {} ); loadUrlSync( webUrl, function( html ) { var doc = domino.createDocument( html ); var links = doc.getElementsByTagName( 'link' ); var c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function css()\n{\n var streams = pathConfig.css.map( function( folder )\n {\n return gulp.src( getGlob( folder ) )\n .pipe( $.clipEmptyFiles() )\n .pipe( !$.util.env.production && !folder.thirdParty ? $.sass.sync().on( 'error', $.sass.logError ) : $.util.noop() )\n .p...
[ "0.66915804", "0.6639572", "0.6627458", "0.66071355", "0.65548044", "0.6508056", "0.646826", "0.6465704", "0.6422513", "0.6418233", "0.6413769", "0.6409086", "0.63924", "0.6379888", "0.6367437", "0.63585794", "0.6355223", "0.6349717", "0.6339663", "0.6328741", "0.6310513", ...
0.6594607
4
Get ids from file
function getArticleIdsFromFile( finished ) { var file = new lineByLineReader( 'articles' ); file.on( 'error', function ( error ) { console.log( 'Error by reading article file: ' + error ); process.exit( 1 ); }); file.on( 'line', function ( line ) { if ( line ) { articleIds[line.replace( / /g, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIdsFromPath(fname) {\n const ids = [];\n while(true) { // eslint-disable-line no-constant-condition\n let val = IDS_RE.exec(fname);\n if (val === null) {\n break;\n }\n\n ids.push(val[1]);\n }\n\n return ids;\n}", "function getKittenIds() {\n let ids = [];\n if (args.startI...
[ "0.7646994", "0.6790208", "0.60717523", "0.60144883", "0.5993522", "0.5982908", "0.58029765", "0.578351", "0.5777233", "0.5691984", "0.5657367", "0.55920863", "0.5577659", "0.5565188", "0.5515875", "0.549026", "0.546665", "0.54471076", "0.54427844", "0.54420644", "0.5432205",...
0.73562115
1
Create directories for static files
function createDirectories() { console.info( 'Creating directories at \'' + rootPath + '\'...' ); createDirectory( rootPath ); createDirectory( rootPath + styleDirectory ); createDirectory( rootPath + htmlDirectory ); createDirectory( rootPath + mediaDirectory ); createDirectory( rootPath + java...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStatic() {\n fs.copy(config.paths.assets_dir, config.paths.public_dir + \"/\" + config.paths.public_assets_dir)\n .then(() => {\n renderToPublic();\n })\n .catch(err => {\n console.error(err)\n })\n}", "copyStaticFiles() {\n\t\tif (!this.weaver.root\n\t\t\t|| !fs.existsSync(...
[ "0.7403049", "0.7341603", "0.68073976", "0.67333937", "0.6637575", "0.65816605", "0.6562927", "0.65541494", "0.6351017", "0.62747514", "0.625774", "0.6186364", "0.6177188", "0.6126218", "0.6073393", "0.6073221", "0.6066431", "0.60513794", "0.6030727", "0.6022887", "0.6019511"...
0.70010763
2
Multiple developer friendly functions
function getFullUrl( url ) { if ( ! urlParser.parse( url, false, true ).protocol ) { var protocol = urlParser.parse( url, false, true ).protocol || 'http:'; var host = urlParser.parse( url, false, true ).host || urlParser.parse( webUrl ).host; var path = urlParser.parse( url, false, true ).path; url = protocol ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Helper() {}", "function FunctionUtils() {}", "function doCoolStuff(){\n // do cool stuff\n }", "function _____SHARED_functions_____(){}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "funct...
[ "0.6347103", "0.63402516", "0.6336777", "0.63161224", "0.63127565", "0.63127565", "0.62555295", "0.6203738", "0.61747336", "0.6154719", "0.6105724", "0.6105724", "0.6057565", "0.600851", "0.600851", "0.600851", "0.6001178", "0.599201", "0.5925386", "0.58999336", "0.5883429", ...
0.0
-1
zingsnis: 1.5mm rankos pasukimas: 140deg kiek sriegiu? kiek reikia pasukimu pilnai susukti medvarsti?
function screw(ilgis, zingsnis, pasukimas) { const sriegiai = ilgis / zingsnis; const laipsniai = sriegiai * 360; const ats = laipsniai / pasukimas; return ats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jelYamb(niz)\n{\n\tvar skup = napraviSet(niz);\n\n\t/* ako je velicina skupa 1 imamo yamb */\n\tif(skup.size === 1)\n\t\treturn 5*niz[0] + 80;\n\telse\n\t\treturn 0;\n\t\n}", "function jelKenta(niz)\n{\n\t/* make a set from an array */\n\tvar skup = napraviSet(niz);\n\tvar tmpn = Array.from(skup);\n\ttm...
[ "0.6463786", "0.63317394", "0.63153726", "0.615749", "0.6154522", "0.61228514", "0.6104034", "0.6096261", "0.60839975", "0.60718524", "0.6036072", "0.60091525", "0.6006375", "0.59842086", "0.5981816", "0.59752595", "0.5974185", "0.5961242", "0.5957792", "0.59516484", "0.59462...
0.56716824
57
Render any loading content that you like here
render() { return ( <View> <ActivityIndicator /> <StatusBar barStyle="default" /> </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderLoader() {\n $('.schedule-page__content', scheduled.$el).empty().html(scheduled.template.loadingTemplate());\n }", "_render() {\n const loaderInner = htmlHelper.createDivWithClass('');\n this.loader.appendChild(loaderInner);\n }", "render(){\n return (this.data.dataLoaded) ? ...
[ "0.7975903", "0.73663944", "0.7241082", "0.72083676", "0.71457154", "0.7106039", "0.70048237", "0.6981044", "0.6978636", "0.6968844", "0.6960897", "0.69382685", "0.6931847", "0.68998164", "0.6886192", "0.68804353", "0.6869426", "0.68350995", "0.68350995", "0.68350995", "0.683...
0.0
-1
Should return progress object with fields: current total
getProgress(execution){ if (execution.stepExecutions.length <= 2) { return { total: 1, current: 0 }; } return this.steps[2].getProgress(execution.stepExecutions[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getProgress(){// Steps are 0 indexed\nvar currentStep=parseInt(this._currentStep+1,10);return currentStep/this._introItems.length*100;}", "get uploadProgress() {\n let percent;\n if (this[kBodySize]) {\n percent = this[kUploadedSize] / this[kBodySize];\n }\n else ...
[ "0.74891394", "0.7462027", "0.7383842", "0.7383842", "0.7383842", "0.7383842", "0.7331394", "0.7277945", "0.7252552", "0.7055428", "0.7023601", "0.70036167", "0.7003559", "0.692278", "0.692278", "0.6835675", "0.66691065", "0.6655292", "0.66201866", "0.6582287", "0.65718555", ...
0.7020589
11