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
add block to canvas, offset by player's position
function insertBlocks(block, offset){ block.forEach((row,y)=>{ row.forEach((value,x)=>{ if(value!=0){ context.fillStyle = colors[value]; context.fillRect(x + offset.x, y + offset.y, 1,1); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBlock(ctx,position){\n let xCoord = position[0] * blockSize;\n let yCoord = position[1] * blockSize;\n ctx.fillRect(xCoord, yCoord, blockSize, blockSize);\n }", "placeBlock () {\r\n this.mouseFocus.updateFocus(this.player.getCamera(), this.currentMeshes)\r\n const newBl...
[ "0.66584563", "0.6648424", "0.6568184", "0.64881474", "0.6363058", "0.62471527", "0.62427515", "0.6178743", "0.6081619", "0.60674465", "0.6017858", "0.5999993", "0.59916353", "0.5971698", "0.5945909", "0.59144515", "0.5902959", "0.5900371", "0.5892508", "0.58663404", "0.58399...
0.5976035
13
props can also be just (name, message, likes) broken down from props
function Tweet(props) { return ( // must be className because this is technically javascript, not "real" HTML <div className="tweet"> <h3>{props.name}</h3> <p>{props.message}</p> <h3>Number of likes</h3> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PropsDemo(props) {\n console.log(props)//{ user:\"abc\"}\n // props.user = \"qwer\" //not allowed\n return (\n <div>\n <i>PropsDemo</i>\n <h2>Username is {props.user} and he is {props.isActive}</h2>\n </div>\n )\n}", "function Tweet(props){\n return(\n ...
[ "0.6029799", "0.57696897", "0.57544595", "0.56215847", "0.55836636", "0.5581137", "0.55753577", "0.55593", "0.5512051", "0.5482438", "0.54664946", "0.5453587", "0.5448514", "0.5438268", "0.5371988", "0.53607523", "0.53166175", "0.53091747", "0.530288", "0.5302372", "0.5302372...
0.5180192
39
This is a class constructor!!!
function Triangle(a, b, c) { this.a = a; this.b = b; this.c = c; this.type = 'Triangle'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor (){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor( ) {}", "function _construct()\n\t\t{;\n\t\t}", "consructor() {\n }", "function Constructor() {}", "fun...
[ "0.8870777", "0.8766848", "0.8677266", "0.8677266", "0.8677266", "0.8677266", "0.8677266", "0.8677266", "0.8677266", "0.8597568", "0.8557653", "0.85474837", "0.85140765", "0.85140765", "0.85140765", "0.8315106", "0.8291602", "0.82329404", "0.82329404", "0.82329404", "0.823294...
0.0
-1
you need node v7 or above for async / await syntax
async function testDatabase () { let service = app.service('test') await service.create([ { 'title': 'asdf' }, { 'title': 'qwerty' }, { 'title': 'zxcvb' }, { 'title': 'hello world' }, { 'title': 'world around' }, { 'title': 'cats are awesome' }, ]) let res = await service.find({ query: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function test() {}", "async function ej3() {\n var res = await prom();\n console.log(res);\n}", "async function asyncAwait() {\n try {\n let result = await cekHariKerja(\"sabtu\");\n console.log(`${result} adalah hari kerja`);\n } catch (error) {\n console.log(error.message);\n }\n}", ...
[ "0.73200905", "0.6917548", "0.69115615", "0.68315226", "0.6818439", "0.67694443", "0.67081964", "0.6701001", "0.6685849", "0.666841", "0.6657451", "0.663373", "0.66319686", "0.66313446", "0.66062164", "0.65977156", "0.6588719", "0.6550858", "0.65502065", "0.6523921", "0.65184...
0.0
-1
Ask Ro about this
function multiplier(factor) { return number => number * factor; //this is a short-form function within a function without parenthesis wrapped param? }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function whatisthis() {\n return this;\n }", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "transient protected internal function m189() {}", "obtain(){}", "protected internal function m252() {}",...
[ "0.6619345", "0.63771015", "0.63337976", "0.6324179", "0.6298916", "0.6140574", "0.60369253", "0.5968888", "0.59359044", "0.58282983", "0.5794494", "0.57251227", "0.5673878", "0.56708086", "0.56708086", "0.5662164", "0.56309193", "0.56011343", "0.56011343", "0.55615175", "0.5...
0.0
-1
the number 13 could be reached by first multiplying by 3 and then adding 5 twice, whereas the number 15 cannot be reached at all.
function findSolution(target) { function find(current, history) { //does the actual recursing if (current == target) { //if it finds a solution return history; //it returns a string that shows how to get to the target } else if (current > target) { return null; //if no solution is found,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(number){\n let i = number - 1\n let multiples = []\n while (i > 0) {\n if (i % 3 == 0 || i % 5 == 0) {\n multiples.push(i)\n }\n i--\n }\n let result = 0\n multiples.forEach(element => result = element + result)\n return result\n }", "function problem...
[ "0.69182074", "0.6910995", "0.68798375", "0.68646896", "0.6783367", "0.6777776", "0.67623526", "0.6754997", "0.6753095", "0.67394954", "0.6719936", "0.67037547", "0.66854423", "0.66659063", "0.6662802", "0.663418", "0.661022", "0.6576347", "0.65747243", "0.65328234", "0.65108...
0.0
-1
Function Exercises write a function min that takes two arguments and returns their minimum
function min(num1, num2) { return Math.min(num1, num2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function min(arg1, arg2) {\nreturn Math.min(arg1,arg2);\n}", "function fmin(a, b) { return Math.min(a, b); }", "function min(number1, number2) {\n console.log(Math.min(number1,number2))\n}", "function min(one, two) {\n \n if (one > two) return two;\n else return one;\n \n}", "function min (a, b) {\n...
[ "0.86771864", "0.8476379", "0.84325755", "0.8431213", "0.8378327", "0.83779466", "0.83779466", "0.83779466", "0.83624506", "0.8357609", "0.8349645", "0.8349645", "0.8322538", "0.8303753", "0.8284916", "0.8284916", "0.827887", "0.82762146", "0.825044", "0.8235705", "0.8229203"...
0.80645704
38
write a function that checks if a number is even
function isEven(number) { if (number % 2 == 0) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function is_even(num) {\n return num % 2 == 0;\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function even(number)\r\n{\r\n\treturn (number % 2) == 0\r\n}", "function evenIs(num){\n\treturn num % 2 == 0;\n}", "function isEven(number) {\n\n}", "function checkEvenNumber(num) {\n...
[ "0.89285064", "0.8865704", "0.8865704", "0.88597363", "0.88505805", "0.8825062", "0.88158846", "0.88114494", "0.88103193", "0.8799221", "0.8797842", "0.8796766", "0.87880886", "0.87857515", "0.8775685", "0.8767737", "0.87460446", "0.8739525", "0.8739525", "0.873557", "0.87331...
0.8564544
53
write a function that behaves like a bean counter that takes 2 arguments that indicates the number of characters in the second argument. eg Count the number of B's
function countChar(str, letter) { var letterCount = 0; for (let i = 0; i < str.length; i++) { if (str.charAt(i) == letter) { letterCount += 1; } } return letterCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newCountBs(x){\n\treturn countChar(x, \"B\");\n}", "function countBs(input){\r\n return countChar(input, \"B\");\r\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCo...
[ "0.74478143", "0.7366383", "0.71566", "0.71566", "0.71566", "0.71566", "0.71566", "0.7143255", "0.7143255", "0.7143255", "0.7143255", "0.6926511", "0.6908429", "0.689968", "0.6781984", "0.6625394", "0.6614063", "0.6591445", "0.6590656", "0.6560722", "0.6560722", "0.6547118"...
0.0
-1
Scrape a parsed HTML document/tree for links.
function scrapeHtml(document, robots) { var link,links,preliminaries,rootNode; rootNode = findRootNode(document); if (rootNode != null) { preliminaries = findPreliminaries(rootNode, robots); links = []; findLinks(rootNode, function(node, attrName, url) { link = linkObj(url); link.html.attrs = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseHTML(html) {\n const $ = cheerio.load(html);\n // select each element from the DOM which class equals \"storylink\"\n // all the other elements of the DOM will be manipulated relative\n // to this selected class\n const allStorylinkClasses = $('a[class*=\"storylink\"]');\n const results = [];\n...
[ "0.625865", "0.62324625", "0.61010665", "0.6095141", "0.5926578", "0.5903635", "0.58101773", "0.5797812", "0.57172114", "0.5686168", "0.5653031", "0.5478291", "0.5458357", "0.54544514", "0.54236233", "0.5415975", "0.5413753", "0.5408042", "0.53909516", "0.53806597", "0.537226...
0.6392682
0
::: PRIVATE FUNCTIONS / Traverses the root node to locate links that match filters.
function findLinks(rootNode, callback) { var attrName,i,link,linkAttrs,numAttrs,url; walk(rootNode, function(node) { linkAttrs = maxFilterLevel[node.nodeName]; // If a supported element if (linkAttrs != null) { numAttrs = node.attrs.length; // Faster to loop through Arrays than Objects for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feed(root, args, context, info) {\n const { filter, first, skip } = args\n const { db } = context\n const where = filter\n ? { OR: [{ url_contains: filter }, { title_contains: filter }] }\n : {}\n return db.query.links({ first, skip, where, orderBy: 'createdAt_DESC' }, info)\n}", "function fil...
[ "0.6429097", "0.56195724", "0.5554851", "0.5447873", "0.5389595", "0.53777903", "0.5372646", "0.5372032", "0.5368858", "0.53578085", "0.53578085", "0.5338443", "0.5325578", "0.52904946", "0.5216815", "0.52093804", "0.5195558", "0.51768893", "0.51403105", "0.51261514", "0.5115...
0.64402026
0
Traverses the root node to locate preliminary elements/data. Looks for the first instance. If no `href` attribute exists, the element is ignored and possible successors are considered. Looks for all robot instances and cascades the values.
function findPreliminaries(rootNode, robots) { var name; var find = { base: true, robots: robots != null }; var found = { base: false }; var result = { base: null }; walk(rootNode, function(node) { switch (node.nodeName) { // `<base>` can be anywhere, not just within `<head>` case "base": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sanearEnlaces(){\r\n\t\tvar a = find(\"//a[@href='#']\", XPList);\r\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshotItem(i).href = 'javascript:void(0)';\r\n\t}", "function sanearEnlaces(){\n\t\tvar a = find(\"//a[@href='#']\", XPList);\n\t\tfor (var i = 0; i < a.snapshotLength; i++) a.snapshot...
[ "0.5298306", "0.52976507", "0.52742255", "0.48688087", "0.4643774", "0.46162966", "0.46162966", "0.4613066", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.46079275", "0.4597091", "0.45687816", "0.45511746", ...
0.57841814
0
Find the `` element.
function findRootNode(document) { var i; var rootNodes = document.childNodes; for (i=0; i<rootNodes.length; i++) { // Doctypes have no `childNodes` property if (rootNodes[i].childNodes != null) { return rootNodes[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find() {}", "find() {\n\t\t// https://api.jquery.com/find/\n\t\tthrow new Error(\"NOT IMPLEMENTED\");\n\t}", "function find(doc, element, id) {\n if (!element) {\n element = doc.getElementById(id);\n if (!element) {\n throw new Error('Missing element, id=' + id);\n }\n }\n return elem...
[ "0.6613367", "0.6422249", "0.62908745", "0.61938256", "0.60865223", "0.5996172", "0.59885484", "0.59508336", "0.5906181", "0.58743197", "0.58373064", "0.5833384", "0.5820545", "0.57184833", "0.5715636", "0.5715393", "0.5712882", "0.5712882", "0.56996155", "0.56996155", "0.569...
0.0
-1
Find a node's `:nthchild()` index among its siblings.
function getNthIndex(node) { var child,i; var count = 0; var parentsChildren = node.parentNode.childNodes; var numParentsChildren = parentsChildren.length; for (i=0; i<numParentsChildren; i++) { child = parentsChildren[i]; if (child !== node) { // Exclude text and comments nodes if (child.nodeNam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getChildNodeIndex(child, selector) {\n\n\t\t\tlet index = 0;\n\t\t\twhile(child.previousSibling) {\n\t\t\t\tif (child.previousSibling.matches(selector)) index++;\n\t\t\t\tchild = child.previousSibling;\n\t\t\t}\n\t\t\treturn index;\n\n\t\t}", "function getActiveChildIndex(node) {\n\t\tvar i = 0;\n\t\twhile (nod...
[ "0.7167585", "0.68274057", "0.67102146", "0.66986", "0.6676886", "0.6527904", "0.6475895", "0.63463056", "0.6334", "0.6238086", "0.6210623", "0.61905444", "0.615939", "0.6144376", "0.6112987", "0.6110828", "0.6016076", "0.5976437", "0.5923216", "0.59182656", "0.5917587", "0...
0.76497287
0
Builds a CSS selector that matches `node`.
function getSelector(node) { var name; var selector = []; while (node.nodeName !== "#document") { name = node.nodeName; // Only one of these are ever allowed -- so, index is unnecessary if (name!=="html" && name!=="body" & name!=="head") { name += ":nth-child("+ getNthIndex(node) +")"; } // B...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNodeSelector(node){\n if(node.tagName === \"BODY\") return \"\"; //Don't use body tag\n\n let selector = \"\";\n if (node.classList.length){\n forEach(node.classList,(currentClass) => {\n selector += \".\" + currentClass;\n })\n }\n else if (node.id){\n se...
[ "0.70613164", "0.6368339", "0.6307722", "0.5816339", "0.5776628", "0.5675007", "0.5644318", "0.5427827", "0.5427827", "0.5375364", "0.536482", "0.53086764", "0.5276374", "0.5237373", "0.5224202", "0.52027607", "0.52027607", "0.52027607", "0.52027607", "0.52027607", "0.5120445...
0.660106
1
Serialize an HTML node back to a string.
function stringifyNode(node) { var result = "<"+node.nodeName; var numAttrs = node.attrs.length; for (var i=0; i<numAttrs; i++) { result += " "+ node.attrs[i].name +'="'+ node.attrs[i].value +'"'; } result += ">"; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toHTML(node) {\n const rootNode = tree.createDocumentFragment();\n tree.appendChild(rootNode, node);\n return parser.serialize(rootNode);\n}", "function nodeToString(node) {\n\t switch(node.nodeType) {\n\t case Node.DOCUMENT_NODE: return node.documentElement.textContent;\n\t case Node.TEXT_NOD...
[ "0.6583064", "0.613618", "0.6125403", "0.59656423", "0.59570307", "0.5945874", "0.5933346", "0.59223825", "0.591362", "0.5903156", "0.58946186", "0.5854875", "0.584483", "0.5835453", "0.5826083", "0.5798724", "0.5778108", "0.5776821", "0.5730175", "0.57275486", "0.57209873", ...
0.6030405
3
TODO :: contribute these to npmjs.com/domwalk
function walk(node, callback) { var childNode,i; if (callback(node) === false) return false; if (node.childNodes != null) { i = 0; childNode = node.childNodes[i]; } while (childNode != null) { if (walk(childNode, callback) === false) return false; childNode = node.childNodes[++i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function walker() {\n\n}", "function xWalkTree2( oNode, fnVisit, skip, data )\r\n{\r\n var r=null;\r\n if(oNode){if(oNode.nodeType==1&&oNode!=skip){r=fnVisit(oNode,data);if(r)return r;}\r\n for(var c=oNode.firstChild;c;c=c.nextSibling){if(c!=skip)r =xWalkTree2(c,fnVisit,skip,data);if(r)return r;}}\r\n retur...
[ "0.6008617", "0.57568514", "0.5724696", "0.5724696", "0.5644819", "0.5624021", "0.5578963", "0.5554337", "0.55524325", "0.55456823", "0.5535634", "0.5506584", "0.5500385", "0.5437665", "0.54349566", "0.53965205", "0.5371763", "0.5318995", "0.5289835", "0.5263777", "0.5213964"...
0.0
-1
TODO: add locale support
function t() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getLocale() {\n return 'en_US';\n }", "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! ...
[ "0.6310039", "0.62383157", "0.6186159", "0.6186159", "0.6137751", "0.6137751", "0.6130818", "0.611375", "0.6111681", "0.6101617", "0.60990304", "0.60990304", "0.60990304", "0.6094106", "0.60934126", "0.60934126", "0.60856414", "0.60819495", "0.6081894", "0.6080222", "0.608022...
0.0
-1
my very favorite helper
function xpath(node, expr) { var resultSet = document.evaluate(expr, node, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); var found = []; var res; for (var i = 0; i < resultSet.snapshotLength; i++) { found.push(resultSet.snapshotItem(i)); } return found; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Helper() {}", "function Utils() {}", "function Utils() {}", "function Util() {}", "function Utils(){}", "function helper() {\n debug(\"helper in helper-slcsp.js\");\n}", "function AeUtil() {}", "private public function m246() {}", "function TMP(){return;}", "function TMP(){return;}", ...
[ "0.71103597", "0.61540234", "0.61540234", "0.6008241", "0.59631765", "0.58618474", "0.5847262", "0.58304", "0.5821923", "0.5821923", "0.57371974", "0.5682485", "0.5665164", "0.56599987", "0.56599987", "0.5653909", "0.5643863", "0.5626737", "0.5613906", "0.5588112", "0.5562649...
0.0
-1
search object for key containing the characters 'loc' and use the value at matching keys as argument to cb()
function withLocationProperty(o, cb) { for(let key in o) { let i = key.toUpperCase().indexOf("LOC"); if(i >= 0) { cb(undefined, o[key]); return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function geocode(loc) {\n fs.readFile('keys/mapsApi', 'utf8', function(error, apikey) {\n var locComp = loc.split().join('+');\n request.post('https://maps.googleapis.com/maps/api/geocode/json?address=' + locComp + '&key=' + apikey, \n function(error, response, body) {\n ...
[ "0.56240666", "0.5562161", "0.5433308", "0.53779", "0.5336474", "0.532165", "0.5258664", "0.5230717", "0.5212629", "0.5190616", "0.5180531", "0.51507753", "0.50854343", "0.50741327", "0.50627327", "0.50455326", "0.5042982", "0.5042982", "0.50227636", "0.50071824", "0.4997055"...
0.6895326
0
go from a document to a country location
function locateServerFromDoc(doc, cb) { const out = { countryName: COUNTRY_UNKNOWN.countryName, countryCode: COUNTRY_UNKNOWN.countryCode }; withLocationProperty(doc.rules, (err, value) => { if(err) { return cb(err); } // TODO: implement x-* field location identification ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapGotoCountry(iso) {\n\t\t\tif (!$state.params.countries) {\n\t\t\t\tDataService.getOne('countries/bbox', [iso]).then(function(data) {\n\t\t\t\t\tvm.bbox = data;\n\t\t\t\t});\n\t\t\t}\n\n\t\t}", "function connectUserToLocation (userId, name, country, city, postal) {\n const locationId = idGenerator.ne...
[ "0.58067846", "0.56051856", "0.53698164", "0.531003", "0.5292399", "0.5224955", "0.51552427", "0.5138338", "0.5055458", "0.5031125", "0.50158733", "0.49920356", "0.4990697", "0.49532896", "0.49528942", "0.48864773", "0.48758736", "0.486351", "0.48632303", "0.48626226", "0.484...
0.622733
0
make geolocation requests from given IP to ipstack
function geolocate(ip, cb) { if(api_no) { return cb(undefined, COUNTRY_UNKNOWN); } const target = `${api_base}/${ip}?access_key=${api_key}`; request(target, function(err, res, body) { if(err) cb(err); if(res && res.statusCode !== 200) { cb(new Error(`Bad status code o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchIpStack(){\n\n\t$.getJSON(\"https://api.ipstack.com/check?access_key=c6ee8187642a24e73533d2395851c34c\", function(data){\n\t\tlet country = data.country_name;\n\t\tlet ip = data.ip;\n\t\tlet lat = data.latitude;\n\t\tlet long = data.longitude;\n\t\tlet state = data.region_name;\n\t let city = dat...
[ "0.7042196", "0.70086795", "0.6975636", "0.6883913", "0.68201345", "0.6729521", "0.656669", "0.6543718", "0.6436082", "0.64061725", "0.63979083", "0.63973475", "0.635229", "0.6349567", "0.6297692", "0.6246726", "0.6207104", "0.6078313", "0.60326797", "0.59606516", "0.59323347...
0.690987
3
try to load a cache from file
function loadLocationCache() { const now = new Date() / 1000; fs.readFile(cache, function(err, data) { if(err) { // catch non existent file, this isn't a throw-worthy error if(err.code === "ENOENT") { return console.log("No location cache file exists"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function file_cache_load(name) {\n\t\tlet load_promise = promise();\n\t\treturn file_cache_open().then(load);\n\n\t\tfunction load(db) {\n\t\t\tif (wkof.file_cache.dir[name] === undefined) {\n\t\t\t\tload_promise.reject(name);\n\t\t\t\treturn load_promise;\n\t\t\t}\n\t\t\tlet transaction = db.transaction('files', ...
[ "0.6981923", "0.69165665", "0.6826913", "0.6507346", "0.6419617", "0.63956976", "0.6367383", "0.63672", "0.6288342", "0.62340266", "0.62219214", "0.6156622", "0.61187625", "0.61109436", "0.6094742", "0.6040039", "0.60319483", "0.6006856", "0.6003814", "0.59755385", "0.5972393...
0.6599522
3
write cache to file as JSON
function writeLocationCache() { console.log("Writing location cache"); const out = JSON.stringify(locationCache, null, 0); fs.writeFile(cache, out, function(err) { if(err) throw err; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeCache(json) {\n fs.writeFileSync('.cache/' + engine + '.json', JSON.stringify(json));\n}", "writeCacheFile() {\n return new Promise((resolve, reject) => {\n fs.outputFile(this.getOutputPath(), JSON.stringify(this.getCacheObject()), (err) => {\n if(err) {\n return reject(e...
[ "0.79071885", "0.75413555", "0.7310712", "0.698459", "0.69245785", "0.6745049", "0.66473114", "0.66379285", "0.6479672", "0.6442507", "0.64410156", "0.6401099", "0.63313806", "0.63307405", "0.62946373", "0.62687707", "0.6242015", "0.61964977", "0.6167098", "0.6159262", "0.611...
0.6956809
4
add custom methods here If you need to access other helpers use: this.helpers['helperName']
async uploadImage(file) { let client = this.helpers['WebDriverIO'].browser; let upload = await client.uploadFile(file); return upload; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getHelpers() {}", "function define_helpers_registrator(Klass) {\n Klass.registerHelper = function (name, helper, options) {\n // Scenario: registerHelper('foo', foo_helper[, foo_opts]);\n if (_.isString(name)) {\n Klass.prototype[name] = helper;\n Klass.prototype.__helpers__[n...
[ "0.6716377", "0.6548928", "0.6484715", "0.6310645", "0.6188247", "0.61620975", "0.6086933", "0.5956583", "0.58745545", "0.5872899", "0.5848299", "0.5746598", "0.56708294", "0.56660575", "0.56604254", "0.56069463", "0.55554223", "0.5545714", "0.55071235", "0.55071235", "0.5507...
0.0
-1
this is for the nav bar / Open when someone clicks on the span element
function openNav() { document.getElementById("myNav").style.width = "100%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navOpen() {\n\t\t\t$('.navbar-toggle').on('click', function() {\n\t\t\t\t$('body').toggleClass('nav-open');\n\t\t\t});\n\t\t}", "function openNav() {\n var x = document.getElementById(\"navDemo\");\n if (x.className.indexOf(\"w3-show\") == -1) {\n x.className...
[ "0.7095632", "0.69488627", "0.6899184", "0.68626815", "0.68509746", "0.68147546", "0.6792032", "0.6764455", "0.67617077", "0.6749106", "0.672623", "0.6707073", "0.67021465", "0.669758", "0.6696939", "0.6675636", "0.66673774", "0.6650009", "0.6647722", "0.6645847", "0.66420776...
0.0
-1
Close when someone clicks on the "x" symbol inside the overlay
function closeNav() { document.getElementById("myNav").style.width = "0%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onBackdropClick() {\n close();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function closeOv...
[ "0.73381025", "0.700274", "0.68053573", "0.67820466", "0.67521745", "0.67230016", "0.6630703", "0.6580472", "0.65753084", "0.65749174", "0.65380573", "0.64967674", "0.6468673", "0.6422859", "0.6419836", "0.6409173", "0.6408367", "0.63673264", "0.6357037", "0.63539785", "0.634...
0.0
-1
LEGACY LAYOUTS "More details can be found on the Mountain Weather Forecast" got removed on November Xth, 2019 "Confidence" has moved the "Danger Ratings" tab to the "Details" tab for the AvCan forecast, so all forecasets we are showing on the website. TODO Need a way to implement these rendering strategies nicely.
function ForecastLayout({ date }) { return ( <Fragment> <Components.Metadata /> <Shim top> <Warning>This is an archived avalanche bulletin.</Warning> </Shim> <Components.Headline /> <Components.TabSet /> <ForecastPager d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSe...
[ "0.5647039", "0.5438004", "0.5364551", "0.5316146", "0.5297202", "0.52401876", "0.5181287", "0.512141", "0.5098562", "0.5098287", "0.5084363", "0.5039313", "0.50310016", "0.49918684", "0.49798828", "0.49783668", "0.49772158", "0.4975026", "0.49609435", "0.4926894", "0.4920218...
0.5737618
0
loads questions and answers in appropriate space. Also gives the intended answer a correctanswer flag
function loadQuestion() { callTimer(numMinutes); getAnswer1.removeAttr("Correct-Answer"); getAnswer2.removeAttr("Correct-Answer"); getAnswer3.removeAttr("Correct-Answer"); getAnswer4.removeAttr("Correct-Answer"); getQuestion.text(questionsArr[QuestionNum].question); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadWholeQuestion(){\n\t\tloadQuestion();\n\t\tloadChoices();\n\t\tloadHint();\n\t\tshowQuestionNumber();\n\t}", "function loadQuestion() {\n let q = quiz[currentQuestion];\n question.textContent = q.question;\n choiceA.textContent = q.options[0];\n choiceB.textContent = q.op...
[ "0.77767926", "0.7093501", "0.7025973", "0.7013959", "0.7011206", "0.69907737", "0.69723094", "0.69362247", "0.6903321", "0.6786024", "0.67348385", "0.6725824", "0.6723896", "0.6714399", "0.6710162", "0.6665145", "0.66631573", "0.66456664", "0.66402215", "0.66187793", "0.6601...
0.7496196
1
function used to call the timer and grab timer text
function callTimer(numMinutes) { var time = 60 * numMinutes, display = $('.timerText'); startTimer(time, display); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tPrint(txt) {\n document.getElementById(\"base-timer-label\").innerHTML = txt;\n}", "function timer() {\n\t\t//get elapsed time, comes as milliseconds\n\t\tlet timeElapsed = Date.now() - timerStart;\n\n\t\tif (timeElapsed >= QUIZDURATION) {\n\t\t\tendQuiz();\n\t\t\treturn;\n\t\t}\n\t\t//convert to se...
[ "0.72073346", "0.7186092", "0.69475913", "0.6946017", "0.6838941", "0.68299544", "0.6803395", "0.6762748", "0.6752655", "0.67049235", "0.66997796", "0.6665044", "0.6658719", "0.66558933", "0.6618528", "0.6614867", "0.6604277", "0.65308714", "0.65030044", "0.64569426", "0.6426...
0.64210725
21
end constructor Public API
getRoles() { return this.loading .then((db) => db('role') .select() .map((role) => { // We store the permissions as a JSON string, because that's way easier than doing crazy joins. // And this doesn't add much overhe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor (){}", "function _construct()\n\t\t{;\n\t\t}", "consructor() {\n }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor( ) {}", "constructor() {\n\t\t// ...\n\t}",...
[ "0.85443026", "0.84659934", "0.82765865", "0.8274296", "0.82246983", "0.82246983", "0.82246983", "0.82246983", "0.82246983", "0.82246983", "0.82246983", "0.819627", "0.8070055", "0.8067303", "0.8067303", "0.8067303", "0.8046613", "0.7861436", "0.78528583", "0.78315544", "0.77...
0.0
-1
store live parameters (attached to form fields)
function colorPart(offset) { return sketch.map(offset, -maxOffset, maxOffset, 0, 255) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateParams() {\n let params = [];\n params.push(getPlayerParams());\n params.push(getPilesParams());\n document.getElementById('new_parameters').value = JSON.stringify(params);\n all_params = params;\n}", "function storeLoadedParams() {\n // store top parameters\n $(\"#simulator-parameters-...
[ "0.63626796", "0.60545397", "0.6017945", "0.6002058", "0.59248155", "0.59193444", "0.59006935", "0.58751214", "0.58543754", "0.5852452", "0.584557", "0.5826354", "0.58231753", "0.58146465", "0.5802739", "0.5790631", "0.5771918", "0.57607114", "0.57300174", "0.57186985", "0.56...
0.0
-1
How would you implement a queue in Javascript? In Computer Science, a queue has a very distinct meaning and behavior. See a description of a queue here: queues represent a FIFO (first in, first out) policy with a linear data structure what are some real world examples of a queue in Javascript? which methods would be sp...
function delegate (child) { return function anon(){ var mathObj = this[child]; for(var key in this){ if(this[key] === anon){ return mathObj[key].apply(mathObj, arguments); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Queue() {\n this.stack = new Array();\n this.dequeue = function(){\n \treturn this.stack.pop();\n }\n this.enqueue = function(item){\n \tthis.stack.unshift(item);\n \treturn;\n }\n this.empty = function(){\n \treturn ( this.stack.length == 0 );\n }\n this.clear = function(){\n \tthis.stack = new Array(...
[ "0.83952767", "0.8372942", "0.8092089", "0.80328935", "0.7994929", "0.79742277", "0.79638886", "0.7887381", "0.7860053", "0.7813152", "0.77766573", "0.76529795", "0.75955987", "0.75832176", "0.75707316", "0.75680923", "0.74998313", "0.74078876", "0.73784864", "0.73485327", "0...
0.0
-1
function for converting the date to standard notation
function parseDate(timestamp) { return new Date(timestamp * 1000).toLocaleDateString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function universal() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long',\n day: 'numeric',\n weekday: 'long',\n hour: 'numeric',\n minute: '2-digit',\n second: '2-digit'\n });\...
[ "0.7107235", "0.70566094", "0.70395964", "0.69722295", "0.690565", "0.68629354", "0.68479025", "0.68322074", "0.6741902", "0.6711964", "0.67053956", "0.67028266", "0.66969746", "0.66912913", "0.6688531", "0.66883373", "0.6682643", "0.6673325", "0.66556114", "0.6642929", "0.66...
0.0
-1
function rendering the data in html
function renderHtml(date, current, image, high, low) { var html = "<div class='card' style='width: 10rem'>" + "<div class='card-body'>" + "<div>" + date + "</div>" + "<h5>" + 'current: ' + Math.round(current) + '°' + '</h5>' + '<img src="' + image + '" class="card...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderHTML(data) {\n var htmlString = \"\";\n\n for (i = 0; i < data.length; i++) {\n htmlString += \"<p>\" +data[i].name + \" is \" + data[i].age + \" years old.\" + \"</p>\";\n\n }\n infoContainer.insertAdjacentHTML('beforeend', htmlString);\n}", "function render(data){\n //Map:...
[ "0.755237", "0.7529474", "0.7328862", "0.72153026", "0.72094387", "0.71630174", "0.7158626", "0.7118596", "0.7108046", "0.70621973", "0.70398283", "0.69361246", "0.6903821", "0.6878462", "0.68676925", "0.6862057", "0.68186045", "0.6810708", "0.6810708", "0.6810708", "0.680338...
0.6397856
92
geocode function to get coordinates of user input
function geocode(search, token) { var baseUrl = 'https://api.mapbox.com'; var endPoint = '/geocoding/v5/mapbox.places/'; return fetch(baseUrl + endPoint + encodeURIComponent(search) + '.json' + "?" + 'access_token=' + token) .then(function (res) { return res.json(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function geocodeUserDestinationAndReturn(){\r\n var destinationStreet = document.getElementById('street').value;\r\n var destinationCity = document.getElementById('city').value;\r\n var destinationState = document.getElementById('state').value;\r\n var inputtedAddress = destinationStree...
[ "0.7344992", "0.7271955", "0.7252016", "0.7179473", "0.71445847", "0.7006383", "0.6918492", "0.6891296", "0.68768114", "0.6846232", "0.6822939", "0.6815516", "0.68128115", "0.67868483", "0.6785175", "0.6770593", "0.6769155", "0.6760445", "0.6760357", "0.6743951", "0.6742952",...
0.63769084
71
process the templates and build the template bundle
function processTemplates(dir,collectionPrefix) { var files = fs.readdirSync(dir); files.forEach(function(file){ var st = fs.statSync(path.join(dir,file)), contents, collection_id ; // template file to read contents and compile? if (st.isFile() && /\.grips\.html$/.test(file)) { console.log("Processing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assembleAndBundle(templatesFolder, templates, callback) {\n const options = { bundle: true };\n\n getTemplatePaths(templatesFolder, templates, options, (err, templatePaths) => {\n if (err) {\n return callback(err);\n }\n\n getContent(templatesFolder, templatePaths, ca...
[ "0.6796007", "0.67201084", "0.6600845", "0.64417094", "0.6439272", "0.63859355", "0.63766176", "0.6336091", "0.62494826", "0.6245521", "0.6143489", "0.61051697", "0.60716796", "0.598732", "0.5974664", "0.5973162", "0.59439635", "0.5888891", "0.58708835", "0.58323526", "0.5827...
0.63863856
5
outer() has access to this var only
function inner() { let inside = 'inside'; // inner() has access to both inside var and outside var console.log( outside ); console.log( inside ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outer(){\n console.log(this)\n function inner(){\n console.log(this)\n }\n inner();\n}", "function inner(){\n\t\t\tconsole.log(this); //will again represent Window since inner is not a method but a function\n\t\t}", "function outer() {\n inner();\n}", "function outer() {\n innte...
[ "0.686032", "0.6752283", "0.6586125", "0.62036616", "0.6203037", "0.6202539", "0.61118746", "0.6106864", "0.6088692", "0.5978248", "0.593743", "0.5935328", "0.5888335", "0.5831641", "0.58301723", "0.58173084", "0.5810744", "0.58035606", "0.5800598", "0.5775694", "0.57652795",...
0.5202828
77
tag string passed as props
function Tag({tag}) { //import post details from useContext const { URL, setPostsState } = useContext(DataContext); //When a tag is clicked, run a search for posts matching the tag const searchTags = () => { axios.get(`${URL}/filter/?search=${tag}`) .then(res => { se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tagString(tag) {\n for (const [handle, prefix] of Object.entries(this.tags)) {\n if (tag.startsWith(prefix))\n return handle + escapeTagName(tag.substring(prefix.length));\n }\n return tag[0] === '!' ? tag : `!<${tag}>`;\n }", "tagString(tag) {\n ...
[ "0.7039593", "0.67588294", "0.6622022", "0.6508873", "0.6415342", "0.63423437", "0.63423437", "0.63423437", "0.63423437", "0.6309759", "0.6286718", "0.6286718", "0.6286718", "0.6286718", "0.6187267", "0.6158093", "0.6158093", "0.6158093", "0.6158093", "0.6155809", "0.6121803"...
0.5531622
58
region [ IMAGE ] Choose Image
chooseImage() { var finder = new CKFinder(); finder.selectActionFunction = (fileUrl) => { this.$scope.data.Image = fileUrl; this.$scope.data.SEO_Image = fileUrl; this.$scope.$apply(); }; finder.SelectFunction = "ShowFileInfo"; finder.popup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseExamplePhoto() {\n const $activeExampleFace = $acitveExampleFaces.find(buildCustomData(KEY_OF_THE_INDEX_OF_AN_EXAMPLE_PHOTO, exampleFaceIndex)).find(buildCustomData(KEY_OF_THE_FACE_ID));\n setImgSrc($chosenPartOfFace, $activeExampleFace.attr('src'));\n activeExamplePhotoId = $activeExampleF...
[ "0.73233384", "0.72348106", "0.71738106", "0.71515447", "0.70427644", "0.7035183", "0.6931652", "0.6924242", "0.69237787", "0.691645", "0.686042", "0.6853979", "0.67812246", "0.6764441", "0.6763257", "0.676324", "0.6762077", "0.66876405", "0.6683661", "0.6663447", "0.6637279"...
0.64042735
40
endregion region [ IMAGE BANNER ] Choose Image Banner
chooseImageBanner() { var finder = new CKFinder(); finder.selectActionFunction = (fileUrl) => { this.$scope.data.ImageBanner = fileUrl; this.$scope.$apply(); }; finder.SelectFunction = "ShowFileInfo"; finder.popup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNextBannerPhoto(){\n\t\t\tif(!bannerChanging){\n\t\t\t\tbannerChanging = true;\n\t\t\t\tcurrentAdmImage = futureAdmImage;\n\t\t\t\tif(futureAdmImage < allImages.length-1){\n\t\t\t\t\tfutureAdmImage++;\n\t\t\t\t} else {\n\t\t\t\t\tfutureAdmImage=0;\n\t\t\t\t}\n\t\t\t\tallThumbnails = $('div.banner div....
[ "0.65471065", "0.63776076", "0.59747165", "0.5957305", "0.5909331", "0.58778536", "0.58726984", "0.58642524", "0.5845072", "0.58404523", "0.58224976", "0.58203477", "0.5813461", "0.5812504", "0.5802448", "0.5795212", "0.5780094", "0.5775109", "0.57569224", "0.5745765", "0.572...
0.59092015
5
endregion region [ IMAGES ] Add Media
addMedia() { var finder = new CKFinder(); finder.selectActionFunction = (fileUrl) => { const tempArray = fileUrl.split("/"); // Get path let path = ""; tempArray.forEach((e, i) => { if (i < tempArray.length - 1) { path += e + "/"; } }); // Get Images...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMedia(type,media){\n //assumption ki tabhi chlega jb dbAccess hoga\n let tx = dbAccess.transaction(\"gallery\",\"readwrite\");\n let galleryObjectStore = tx.objectStore(\"gallery\");\n let data={\n mId : Date.now(),\n type,\n media,\n };\n galleryObjectStore.add(d...
[ "0.76510763", "0.708268", "0.6897251", "0.6614728", "0.653625", "0.6506349", "0.64797634", "0.6440566", "0.6425611", "0.635203", "0.635186", "0.6313156", "0.6288894", "0.62678957", "0.62239265", "0.62073505", "0.6177633", "0.6157658", "0.6092391", "0.607674", "0.6053519", "...
0.6265564
14
endregion region [ CREATE GROUP ]
onCreateGroup() { this.createGroup.visible = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createGroup() {\n this.errorMsg = null;\n\n this.SymbolGroupResource.create(this.project.id, this.group)\n .then(createdGroup => {\n this.ToastService.success('Symbol group <strong>' + createdGroup.name + '</strong> created');\n this.EventBus.emit(events.GROUP...
[ "0.76059973", "0.7393868", "0.73436385", "0.7255303", "0.7211073", "0.71535724", "0.7125431", "0.70965874", "0.7071251", "0.6960076", "0.6928164", "0.6925813", "0.68656665", "0.68476474", "0.6797845", "0.6729474", "0.6697185", "0.6689958", "0.6685884", "0.6630386", "0.6623353...
0.6945937
10
fetching the data of the Game Videos
renderGameVideos(){ GameImageOrVideo(this.props.navigation.state.params.game_id,"videos") .then((response) => { console.log("[success of GameVideo]") this.setState({gameVideo:response.data.videos, video:response.data.videos[0] }) }).catch((error)=> { console.log("[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getVideo() {\n return (await this._client.helix.videos.getVideoById(this._data.video_id));\n }", "function loadVideos(){\n fetch(\"https://api.myjson.com/bins/1d653q\")\n .then((res)=> res.json())\n .then((data)=>{\n console.log(\"data:\", data);\n setVi...
[ "0.7106157", "0.7040211", "0.7019134", "0.69613856", "0.68417454", "0.6839773", "0.68169606", "0.6748325", "0.6727954", "0.6697066", "0.6655373", "0.6642415", "0.6624862", "0.6608411", "0.65831673", "0.6576724", "0.6544071", "0.65130323", "0.65018284", "0.6496917", "0.6489174...
0.67307377
8
rotate without t value.
function turnCartoonPack(arSrc1, arTar2) { if (null == arSrc1) { arSrc1 = gArrString2; //2to2 arTar2 = gArrString2; //2to2 } for (let i = 0; i < arSrc1.length; i++) { let x1 = arSrc1[i][0]; let y1 = arSrc1[i][1]; let xy = getZYtRotate(x1, y1, 10); // has [0,1] saveArrayVal(0, arTar2, xy...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rotateAntiClockwise()\r\n {\r\n this.rotation -= Math.PI / 180;\r\n }", "rotate(rotateAmount) {\n }", "function rotate(v, t) {\n var ct = Math.cos(t);\n var st = Math.sin(t);\n return make(ct * v.x - st * v.y, st * v.x + ct * v.y);\n}", "rotateClockwise()\r\n {\r\n this.rot...
[ "0.7463406", "0.71705437", "0.70085984", "0.68349576", "0.6759303", "0.6756931", "0.67004025", "0.6568304", "0.6534395", "0.63434947", "0.62962204", "0.62441903", "0.6243807", "0.6149848", "0.61443365", "0.61085", "0.6107222", "0.61062926", "0.6102713", "0.60853386", "0.60848...
0.0
-1
turn Multiple Elems. Roll.
function turnAutoRoll() { expandTiltArmArray(2); // 2개여야 함 turnRollPack(gTiltArm[0], gTiltArm[1], 20); expandTiltArmArray(3); // 3개여야 함 turnRollPack(gTiltArm[0], gTiltArm[2], 40); expandTiltArmArray(4); // 4개여야 함 turnRollPack(gTiltArm[0], gTiltArm[3], 60); // turnRollPack(gArrString2, gArrString2,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ROLL(state) {\n var stack = state.stack;\n var a = stack.pop();\n var b = stack.pop();\n var c = stack.pop();\n\n if (exports.DEBUG) {\n console.log(state.step, 'ROLL[]');\n }\n\n stac...
[ "0.5659173", "0.5575441", "0.5542539", "0.5427349", "0.53889525", "0.53889525", "0.53889525", "0.53889525", "0.5377196", "0.535459", "0.535459", "0.535459", "0.535459", "0.535459", "0.5295757", "0.52433795", "0.5236283", "0.5234036", "0.52266127", "0.5215743", "0.51471174", ...
0.5113552
22
convert radian to degree
function makeDeg(radians) { var pi = Math.PI; return radians * (180/pi); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function radianToDegree(rad) {\n return rad * 180 / Math.PI;\n}", "function toRadian(degree) {\n return degree * Math.PI / 180;\n}", "toRadian(deg) \r\n\t{\r\n\t\treturn (22 * deg)/(7*180)\r\n\t}", "function radiansToDegree(r){\n return r * 180 / Math.PI;\n}", "function toRadian(deg) { return deg * ...
[ "0.83048993", "0.8212112", "0.80425197", "0.8007749", "0.80051786", "0.7920644", "0.7858437", "0.7848859", "0.7806826", "0.77190185", "0.7704839", "0.7671138", "0.7666202", "0.76079786", "0.75814664", "0.7565156", "0.7547898", "0.7540333", "0.7507755", "0.7495228", "0.7478850...
0.0
-1
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file. Flags: allownativessyntax opt noalwaysopt
function foo(a, i) { a[i] = 1; return a[i]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cLike(hljs) {\n function optional(s) {\n return '(?:' + s + ')?';\n }\n var DECLTYPE_AUTO_RE = 'decltype\\\\(auto\\\\)';\n var NAMESPACE_RE = '[a-zA-Z_]\\\\w*::';\n var TEMPLATE_ARGUMENT_RE = '<.*?>';\n var FUNCTION_TYPE_RE = '(' +\n DECLTYPE_AUTO_RE + '|' +\n optional(NAMESPACE_RE) +'[a-zA...
[ "0.5508744", "0.5480175", "0.5480175", "0.54749364", "0.54735464", "0.54432887", "0.53272426", "0.5324499", "0.5324499", "0.5318389", "0.5289848", "0.5289848", "0.5289848", "0.5289848", "0.5289848", "0.5289848", "0.5289848", "0.5289848", "0.51923406", "0.51554245", "0.512528"...
0.0
-1
Skip links are a technique to ease keyboard navigation. It consists in giving some links as the firsts focusable elements of the page to go directly to some meaningful content.
function SkipLinks({ mainId, navigationId, t }) { return ( <nav className={theme['tc-skip-links']} aria-label={t('SKIP_LINKS', { defaultValue: 'Skip links' })} > <ul> {navigationId && ( <li key="navigation"> <SkipTo href={navigationId} label={t('SKIP_TO_NAV', { defaultValue: '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixSkiplinks(){\n jQuery('[href^=\"#\"][href!=\"#\"]').click(function() {\n jQuery(jQuery(this).attr('href')).attr('tabIndex', -1).focus();\n });\n}", "function skipTo () {\n const dest = document.querySelector(this.getAttribute('href'));\n dest.classList.remove('-nofocus');\n ...
[ "0.74471635", "0.7115925", "0.64120054", "0.64049155", "0.64049155", "0.617342", "0.6126795", "0.60420954", "0.5935449", "0.5923344", "0.5913142", "0.59037966", "0.5882324", "0.5875165", "0.58570105", "0.58495265", "0.5806385", "0.57857126", "0.5730191", "0.56924284", "0.5692...
0.60780156
7
this is the base code for the animation loop it is running but at present is not having any impact the listeners in the object are independent of the animation loop.
function animate(){ ctx.clearRect(0, 0, width, height); window.requestAnimationFrame(animate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this...
[ "0.6869602", "0.67879355", "0.66758794", "0.66456664", "0.6617853", "0.65561205", "0.6534819", "0.6530188", "0.6527916", "0.6521622", "0.649165", "0.6490909", "0.64847195", "0.64754295", "0.6473908", "0.643341", "0.6391811", "0.6367635", "0.63646543", "0.63492274", "0.633958"...
0.0
-1
The stateful component class passes down handleClick to a stateless component class:
render() { return ( <ChildClass onClick={this.handleClick} /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n\n this.handleClick = this.handleClick.bind(this);\n }", "constructor(props) {\n super(props);\n this.handleClick = this.handleClick.bind(this);\n }", "handleClick() {}", "constructor() {\n super();\n this.handleClick = this.han...
[ "0.7560192", "0.7445596", "0.7390743", "0.7232981", "0.72200745", "0.71896464", "0.7119222", "0.7116607", "0.709206", "0.6995433", "0.6977933", "0.69472426", "0.6944361", "0.68701655", "0.6829557", "0.6810033", "0.67886645", "0.6776873", "0.67742044", "0.6761948", "0.6733586"...
0.6767049
20
CONTACTS API ROUTES BELOW Generic error handler used by all endpoints.
function handleError(res, reason, message, code) { console.log("ERROR: " + reason); res.status(code || 500).json({"error": message}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contact(req,res){\n userService.contact(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "setErrorRoutes() {\n this.app.use((err, req, res, next) => {\n // pa...
[ "0.6141931", "0.6003798", "0.5847667", "0.5832289", "0.5753707", "0.571976", "0.5712361", "0.5698966", "0.56858814", "0.5678521", "0.56285083", "0.5624834", "0.5614072", "0.55945617", "0.5565897", "0.5546304", "0.55310386", "0.55251515", "0.55199516", "0.55129564", "0.5509523...
0.0
-1
CONTACTS API ROUTES BELOW Generic error handler used by all endpoints.
function handleError(res, reason, message, code) { console.log("ERROR: " + reason); res.status(code || 500).json({"error": message}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contact(req,res){\n userService.contact(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "setErrorRoutes() {\n this.app.use((err, req, res, next) => {\n // pa...
[ "0.6142099", "0.6005831", "0.5847333", "0.5834959", "0.5753784", "0.5719572", "0.5712948", "0.5700339", "0.5686703", "0.56797814", "0.56273746", "0.5626746", "0.5614568", "0.559436", "0.55680513", "0.5548094", "0.5532553", "0.5527231", "0.5521063", "0.5514365", "0.5511073", ...
0.0
-1
get("/api/contacts/:id") endpoint not used by Angular app delete("/api/contacts/:id")
deleteContact(delContactId: String): Promise<void | String> { return this.http.delete(this.contactsUrl + '/' + delContactId) .toPromise() .then(response => response.json() as String) .catch(this.handleError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(id) {\n return this.rest.delete(`${this.baseUrl}/${id}`);\n }", "delete(id) {\n return this.rest.delete(`${this.baseUrl}/${id}`);\n }", "Delete() {\n return {\n method: 'DELETE',\n path: '/contact/{id}',\n config: {\n description...
[ "0.6859458", "0.6859458", "0.6574619", "0.65552896", "0.64801365", "0.6459054", "0.64210933", "0.64113444", "0.6408434", "0.6366267", "0.63543826", "0.63379085", "0.6336877", "0.6232084", "0.62068164", "0.61812174", "0.61773455", "0.61460626", "0.6145975", "0.6139104", "0.611...
0.66189337
2
determines base combat damage for melee between two entities returns damage
function combatDamage(attacker, defender) { return attacker.baseDmg + attacker.stats.str - defender.stats.def; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combat(health, damage) {\n health = health - damage;\n return health >= 0 ? health : 0;\n}", "function combat(health, damage){\n return health > damage\n ? health - damage\n : 0\n}", "function dealDamage(attackingCombatant, targetCombatant) {\n\n}", "get effective...
[ "0.71677923", "0.70731384", "0.68821007", "0.67608017", "0.6725807", "0.6716862", "0.6624787", "0.66234654", "0.66173506", "0.6541449", "0.6532801", "0.65233153", "0.6437136", "0.6436907", "0.64337623", "0.6379882", "0.63756436", "0.6352782", "0.634677", "0.63327664", "0.6296...
0.7482207
0
[DONE] Create new variable params with max and min values
function calculateTagsParams(tags) { const params = { max: 0, min: 999999 } for(let tag in tags){ //console.log(tag + ' is used ' + tags[tag] + ' times'); if (tags[tag] > params.max) { params.max = tags[tag]; //console.log('params.max:', params.max); } if (tags[tag] < params.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueField.value);\n}", "function setMinMaxValues(min, max) {\n numberGuessInput.min = min;\n numberGuessInput.max = max;\n}", "function refreshParams() {\n params = { X_max: X_max, X_min: X_min, max_: max_, min_: min_ ...
[ "0.71276605", "0.69729507", "0.69314104", "0.68367916", "0.6764321", "0.6743482", "0.6725914", "0.6711818", "0.6620039", "0.660888", "0.6573747", "0.65326136", "0.6479449", "0.6452003", "0.6415157", "0.6393934", "0.6374175", "0.6358021", "0.6350627", "0.6277834", "0.6245621",...
0.63935316
16
Options are the values that are going to be passed as environment variables to the script; Static envs should work as a filter.
function envOptions(path, queries, staticEnv, data) { //Evaluate json queries var env = evalQueries(queries, data) _.merge(env, staticEnv); //static from descriptor _.merge(env, _.omit(process.env, function(value, varName) { if (_.includes(varName, 'npm_')) return true; return false; })); //process environ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processEnv() {\n process.env.NODE_ENV = env.NODE_ENV || 'dev';\n console.log(`Running the application with '${env.NODE_ENV}' environment`);\n Object.entries(options).forEach(([key,val]) => process.env[`aat_${key}`] = val);\n modifyModulePaths();\n}", "constructor(options) {\n\t\tif (options && optio...
[ "0.59379804", "0.5921748", "0.5889078", "0.5865134", "0.5856666", "0.5848398", "0.5830532", "0.5662461", "0.5562393", "0.5549305", "0.5463355", "0.54381657", "0.54337424", "0.54072654", "0.5399362", "0.53923976", "0.5389567", "0.53781927", "0.53517663", "0.53464043", "0.53329...
0.67649955
0
Security notice: Script Path should never be a user input directly. Options should never be user input directly.
function promisifiedExec(scriptPath, options) { //TODO: Sanitiza script path for ../ return new Promise(function(resolve, reject) { logger.debug(options); child_process.exec('/usr/bin/env sh ' + scriptPath, options, function(err, stdout, stderr) { logger.debug(stdout); if (err) { reject(err) }; r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scriptOptions(){\n\tdocument.getElementById(\"selectScript\").style.display=\"none\";\n\tdocument.getElementById(\"recorder\").style.display=\"\";\n\tscriptName = document.querySelector('input[name=\"script\"]:checked').value;\n\tif(scriptName === \"scratch\") {\n\t\tscriptName = '../web-recorder/public/t...
[ "0.58443516", "0.5324948", "0.53124976", "0.5228343", "0.5217593", "0.5200652", "0.5159287", "0.515891", "0.5144164", "0.5144164", "0.5123785", "0.50964975", "0.50943166", "0.5080756", "0.5072428", "0.507061", "0.50067073", "0.50067073", "0.50023454", "0.4966795", "0.4964144"...
0.0
-1
Written by Dr Desmond Case 2016 /jslint browser:true /global Leaf /global Selector /global Sequence /global PercEnum ================================================ = Behaviours = = Each behaviour is an object that implements = = run method that sends an action back to the = environment. ==============================...
function Forward(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "step(obs) {\n super.step(obs)\n if (obs.observation.available_actions.includes(FUNCTIONS.Attack_screen.id)) {\n const player_relative = obs.observation.feature_screen.player_relative\n const roaches = xy_locs(player_relative, _PLAYER_ENEMY)\n if (!roaches.length) {\n return FUNCTIONS.no...
[ "0.63377035", "0.6264567", "0.6080483", "0.60723275", "0.6047716", "0.6010906", "0.5960886", "0.5952205", "0.5833635", "0.5827323", "0.5827209", "0.5825026", "0.5824791", "0.5809432", "0.57660997", "0.5765381", "0.5732805", "0.5705199", "0.56823117", "0.5671263", "0.56587696"...
0.0
-1
Turns the avatar to the right
function Right(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateAvatar() {\n avatar.x = mouseX;\n avatar.y = mouseY;\n // Shrink the avatar and use constrain() to keep it to reasonable bounds\n avatar.size = constrain(avatar.size - AVATAR_SIZE_LOSS,0,avatar.maxSize);\n if (avatar.size === 0) {\n avatar.active = false;\n }\n}", "moveAvatar(e) {\r\n ...
[ "0.6374293", "0.6199006", "0.6186018", "0.6152041", "0.6134346", "0.60583895", "0.60529476", "0.596309", "0.59604025", "0.59587455", "0.5850713", "0.57772577", "0.57766265", "0.57718843", "0.57210267", "0.5691098", "0.5691098", "0.5688236", "0.5683976", "0.5672828", "0.566370...
0.0
-1
Turns the avatar to the left
function Left(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toLeft(){\n imgIndex--;\n if(imgIndex == -1){\n imgIndex = imgItems.length-1;\n }\n changeImg(imgIndex);\n }", "function goLeft() {\n if(positionIndex <= 0) {\n positionIndex = images.length - 1;\n } else {\n positionIndex--;\...
[ "0.7131069", "0.6474576", "0.64421225", "0.6300817", "0.6247531", "0.6246769", "0.6211852", "0.6190361", "0.6175671", "0.6155673", "0.61133605", "0.60901314", "0.6072491", "0.6057116", "0.60531425", "0.60490876", "0.6036303", "0.60200506", "0.60183555", "0.6014336", "0.601420...
0.0
-1
Issue the Jedi sense command
function JediSense(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCommand(sentence) {\n if (sentence == 'show kb') {\n alert(storage.getKnowledgeBaseAsText());\n } else if (sentence == 'show transcript') {\n alert(storage.getTranscript());\n } else {\n return false; // was not a command\n }\n}", "function interpret_command(content) {\n UDGE...
[ "0.59132355", "0.5777643", "0.5697939", "0.5559446", "0.55196553", "0.54022944", "0.5389901", "0.533497", "0.53247404", "0.52986324", "0.52719945", "0.5269412", "0.52454466", "0.5243337", "0.5241312", "0.5237932", "0.52216506", "0.51845586", "0.5181046", "0.516607", "0.516510...
0.0
-1
Issue command to use a nearby object
function Use(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function click_near_object(x, y){\n let obj = null;\n if (system){\n for (let i = 0; i < system['stars'].length; i++){\n system['stars'][i]['highlighted'] = false;\n if (!obj && distance_to(x, y, system['stars'][i]['x'], system['stars'][i]['y']) < CLICK_DISTANCE * Math.sqrt(zoom)...
[ "0.586353", "0.5379837", "0.5273982", "0.5232512", "0.52011436", "0.5152112", "0.5148436", "0.51481074", "0.51326615", "0.51032305", "0.5056764", "0.50308746", "0.5003119", "0.496913", "0.4953583", "0.4951234", "0.49373466", "0.4935241", "0.49349937", "0.49007094", "0.4899289...
0.0
-1
Sense if the agent is near to any danger
function NearDanger(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkVirus() {\n var {x, y} = this.pos;\n agents.filter(a => a instanceof Virus).forEach(v => {\n if(getDistance(x,v.pos.x,y,v.pos.y) < options.infectionDistance && !this.isInfected) {\n if(Math.random() < options.infectionProbability) {\n ...
[ "0.6887685", "0.67428255", "0.67060864", "0.6646361", "0.6640004", "0.6469725", "0.6463917", "0.64242655", "0.63217956", "0.6218736", "0.6204841", "0.62042904", "0.6198961", "0.6178583", "0.6176993", "0.6172384", "0.6162444", "0.6162253", "0.614406", "0.6112991", "0.61092657"...
0.0
-1
Sense if we have hit a wall
function Bump(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "meets (paddle) {\r\n if (this.pos.y < paddle.y &&\r\n this.pos.y > paddle.y - this.r &&\r\n this.pos.x > paddle.x - this.r &&\r\n this.pos.x < paddle.x + paddle.w + this.r) {\r\n this.pos.y -= this.r;\r\n playSound(\"wallHit\");\r\n return true;\r\n } else {\r\n return fals...
[ "0.6838052", "0.6778316", "0.6693539", "0.66525126", "0.6647945", "0.664049", "0.6562016", "0.65423065", "0.65408903", "0.6529148", "0.642351", "0.64081717", "0.6390564", "0.6388565", "0.6361268", "0.63543606", "0.63275075", "0.632656", "0.62978786", "0.6278076", "0.62626606"...
0.0
-1
Tingle from the agent's Jedi sense
function Tingle(status) { "use strict"; Leaf.call(this); this.state = status; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "textIntent(assistant) {\n this.assistant = assistant;\n\n const website = `For more details, go to reactivex.io/rxjs.`;\n let rawInput = assistant.getRawInput();\n let state = assistant.data;\n\n // hot phrases\n rawInput = rawInput.toLowerCase();\n const hotWord = ...
[ "0.5701234", "0.56797016", "0.54907006", "0.5395682", "0.5362532", "0.5278744", "0.52679753", "0.52268255", "0.5183817", "0.51677275", "0.51436746", "0.5142984", "0.5136717", "0.51352745", "0.5134145", "0.5122988", "0.5122988", "0.5122988", "0.5122988", "0.5116502", "0.510026...
0.0
-1
================================================ = KnowledgeBase = ================================================
function Memory() { "use strict"; this.percepts = null; // sensors from NPC this.action = ""; // action to NPC }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pfKnowledgeEngeneering(){\n\tthis.inheritFrom = pfGenericKnowledge;\n this.inheritFrom();\n this.setName(\"knowledge_engineering\");\n}", "function pfKnowledgeLocal(){\n\tthis.inheritFrom = pfGenericKnowledge;\n this.inheritFrom();\n this.setName(\"knowledge_local\");\n}", "function pfKnow...
[ "0.6285664", "0.5890247", "0.5740787", "0.5735378", "0.57059664", "0.56945604", "0.5664528", "0.5664269", "0.56218404", "0.5600076", "0.5576116", "0.55663353", "0.5525602", "0.55153114", "0.5496093", "0.54759836", "0.5472756", "0.54548043", "0.54414105", "0.54368174", "0.5411...
0.0
-1
Method called by the game to initialise the agent
function Memory_clearAction() { "use strict"; this.action = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startup() {\n // The AC Script needs to have an avatar to access avatar information\n Agent.isAvatar = true; \n Avatar.skeletonModelURL = Script.resolvePath('../resources/models/invisible_avatar/invisible_avatar.fst');\n Avatar.displayName = \"Money Tree Agent\";\n Avatar.position = {\"x\...
[ "0.6828412", "0.682292", "0.661654", "0.64387316", "0.64224017", "0.6422195", "0.6361474", "0.63155377", "0.6306528", "0.6269553", "0.62330204", "0.62260956", "0.62002957", "0.6160264", "0.61589515", "0.6157407", "0.61523515", "0.6137845", "0.6131518", "0.6127952", "0.6117474...
0.0
-1
Method called by the game to initialise the agent
function Memory_NoAction() { "use strict"; return this.action === ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startup() {\n // The AC Script needs to have an avatar to access avatar information\n Agent.isAvatar = true; \n Avatar.skeletonModelURL = Script.resolvePath('../resources/models/invisible_avatar/invisible_avatar.fst');\n Avatar.displayName = \"Money Tree Agent\";\n Avatar.position = {\"x\...
[ "0.68286824", "0.68217355", "0.6617168", "0.6439745", "0.6422452", "0.64210725", "0.635978", "0.63129747", "0.6305714", "0.6268042", "0.6229966", "0.6227136", "0.61983526", "0.6159732", "0.6157157", "0.6156523", "0.6152267", "0.6135578", "0.6131585", "0.6129621", "0.61176354"...
0.0
-1
================================================ = BT agent for wumpus world = ================================================
function Agent(hero) { "use strict"; // the line below must NOT be changed // allows information from the game NPC this.hero = hero; // pointer to the NPC }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Agent_process() {\n \"use strict\";\n // drive BT reasoning here\n var action = \"\";\n var status = this.hero.percept; // get sensors from NPC\n this.memory.clearAction(); // clear previous action\n this.memory.percepts = status; // update the information in the AI\n while (thi...
[ "0.6292018", "0.5829702", "0.5816405", "0.58017427", "0.5754609", "0.56741756", "0.564289", "0.5570537", "0.5543032", "0.5537784", "0.55356884", "0.55119306", "0.54841787", "0.5478415", "0.5421444", "0.5412566", "0.54102427", "0.5405437", "0.5400373", "0.5396881", "0.53839886...
0.49526158
86
Method called by the game to initialise the agent Note: below is for example purposes, you are free to delete/edit/hack it to your hearts content to engineer the agent behaviour you need
function Agent_init() { "use strict"; // data for your AI can be initialised here var knowledgeBase = new Memory(); // our top level/root behaviour var root = new Selector(); // Create Actions var forward = new Forward(knowledgeBase); // go forward var right = new Right(knowledgeBase);...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Simulator_Initialise()\n{\n\t//Create History\n\tthis.History = new History_History();\n\t//Create Camera\n\tthis.Camera = new Camera_Camera();\n\t//Want ScreenShots?\n\tif (__SCREENSHOTS_ON)\n\t{\n\t\t//initialise screenshot manager\n\t\tthis.ScreenShots = new ScreenShots_ScreenShots();\n\t}\n\t//has con...
[ "0.6921371", "0.68085307", "0.65233314", "0.64862186", "0.6480952", "0.6445105", "0.64108896", "0.6405496", "0.63876194", "0.6301295", "0.6299934", "0.6287298", "0.62741137", "0.6264206", "0.62612635", "0.625791", "0.62414265", "0.62226295", "0.62123275", "0.6201826", "0.6198...
0.6470888
5
Method called by the game to run the agent, it returns an action to control the NPC
function Agent_process() { "use strict"; // drive BT reasoning here var action = ""; var status = this.hero.percept; // get sensors from NPC this.memory.clearAction(); // clear previous action this.memory.percepts = status; // update the information in the AI while (this.memory.noActio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fireAction(action: Action) {\n switch (action) {\n case \"WINGAME\":\n g_gamearea.listener.room.solved = true;\n break;\n }\n }", "function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocub...
[ "0.64983463", "0.6463878", "0.6456347", "0.6439643", "0.62258315", "0.6023169", "0.60125405", "0.60087025", "0.5922665", "0.59215933", "0.5895554", "0.5860054", "0.58436465", "0.5842792", "0.58054113", "0.58036536", "0.57929087", "0.57913786", "0.57735884", "0.57651216", "0.5...
0.68339616
0
test bundling of src files against expected bundles
async function fixture(t, entry, options) { const { mockFs, compiler } = setupEnv(entry, options) await new Promise((resolve, reject) => { compiler.run((err, stats) => { err ? reject(err) : resolve(stats) }) }) // uncomment to update expected files /* const bundle = mockFs.readFileSync('/bundle.js', 'utf8...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bundler(options) {\n var allFiles = {};\n var bundles = {};\n var dir = options.src;\n var dest = options.dest;\n var resourcesFile = options.resourceJson;\n var indexBundles = options.indexBundles;\n var titleIndexBnudles = {};\n var traversed_bundl...
[ "0.581615", "0.57350373", "0.56247646", "0.5624446", "0.56226766", "0.56011194", "0.554391", "0.5520856", "0.5373026", "0.5370845", "0.536618", "0.53456193", "0.5323021", "0.53139067", "0.5298526", "0.52974784", "0.52865165", "0.5283066", "0.52772945", "0.5276882", "0.5262803...
0.5535978
7
component being shown when the basket is empty (the guy with picture and button to go back)
function EmptyBasket() { return ( <div className="imgParent"> <h1 className="myText"> Su carrito está vacío, haga click{" "} <Button size="small" variant="contained" component={Link} to="/" color="primary" > Aquí </B...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyBasket() {\n document.getElementById(\"basket\").style.display = \"none\"\n document.getElementById(\"emptyBasket\").style.display = \"block\"\n}", "function isEmptyBag(){\n\tif(bag.length==0){\n\t\tlet p = document.createElement('p');\n\t\tp.className = 'textAfter';\n\t\tp.innerHTML = 'Your shop...
[ "0.64153516", "0.6402835", "0.63368386", "0.62212366", "0.6205759", "0.6179111", "0.59404355", "0.5892481", "0.5892098", "0.58641243", "0.5858489", "0.5838867", "0.5828284", "0.58195466", "0.58164006", "0.58090955", "0.5771751", "0.576104", "0.5752773", "0.5729397", "0.569128...
0.6416501
0
make it refresh itself whenever a new event is added to a user i'm thinking: turn each
function displayUserEvents() { for (user of website.users) { //would be hilarious, if this worked let userEvents = user.savedEvents.map(e => `<li>${e.title}<br>${e.location} - ${e.date}<br>${e.description}</li>`) $('#my-events').append(`${user.title}'s saved events:<br>${user...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addUserToEvent(event) {\n if (this.orgReference.child(`eventList/${event}`) !== undefined && event !== '') {\n this.orgReference.child(`eventList/${event}/people/${this.props.firebaseUser.uid}`).set(this.props.firebaseUser.displayName)\n this.orgReference.child(`userList/${this.props.f...
[ "0.6411098", "0.58971965", "0.5881261", "0.5875481", "0.5868689", "0.58652663", "0.5863442", "0.5860696", "0.58388555", "0.5834753", "0.58226025", "0.581791", "0.5814149", "0.5813974", "0.5813483", "0.5794761", "0.57933116", "0.5792717", "0.57796544", "0.57796544", "0.5769748...
0.5989576
1
Creates an array of tuples from a given object.
function makeTuples(prefix, args){ var result = []; traverseToTuple(result, prefix, args) return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toTuple(o) {\n const symbols = [];\n const name = o.reference(new (class {\n referenced(symbol) {\n symbols.push(symbol);\n }\n })());\n return [name, symbols];\n}", "function createArray(object) {\n let tmp = [];\n _.each(object, (obj) => {\n tmp.push(obj);\n ...
[ "0.6727319", "0.6397961", "0.6308261", "0.62441635", "0.6238684", "0.604826", "0.6035834", "0.60254455", "0.6001108", "0.5993954", "0.5993954", "0.59500724", "0.5921424", "0.59033906", "0.5867265", "0.5866772", "0.5866772", "0.5866772", "0.5866772", "0.5866772", "0.5866772", ...
0.596402
11
Creates an object from an array of tuples
function makeObject(tuples){ var result = {}; _.each(tuples, function(tuple){ fromTuple(result, tuple); }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuple (iterable) {\n\t\tvar instance = iterable ? [] .slice.apply (iterable) : [];\n\t\tinstance.__class__ = tuple;\t// Not all arrays are tuples\n\t\treturn instance;\n\t}", "function tuple(t) {\r\n var ntuple = \"Tuple\" + t.length;\r\n t.constructor = Tuple[ntuple];\r\n return t;\r\n}", "f...
[ "0.6577601", "0.6523656", "0.6372333", "0.6135914", "0.6128947", "0.61259276", "0.605052", "0.60345745", "0.5850212", "0.5823852", "0.5748564", "0.5734126", "0.56744844", "0.56512856", "0.56365234", "0.5601409", "0.5594239", "0.5568129", "0.5555841", "0.5530465", "0.5522089",...
0.69237643
1
Creamos algunos ejemplos del modelo 'Articles' return: array de articles
function makeExamples() { try { // Model Article const articles = []; const examples = require('../lib/articles.json'); // JSON de ejemplo let cont = 0; examples.forEach( (article) => { Articles.create( parseDocument(article), (err, docum ) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArticles() {\n return $http.get('/api/core/articles');\n }", "getArticles() {\n\n\t\treturn axios.get(\"/api/saved\");\n\n\t}", "async function getArticles() {\n\n try {\n const response = await HTTP.get('/services/articles');\n return response.data.articles;\n\n ...
[ "0.74345386", "0.7347299", "0.73394287", "0.7108954", "0.7080283", "0.7067512", "0.680236", "0.67675656", "0.6728796", "0.66718286", "0.6666683", "0.65926224", "0.6559251", "0.65454656", "0.65365916", "0.6522756", "0.6504166", "0.65032095", "0.6502448", "0.64628905", "0.64278...
0.61359864
34
manage input field and new note output
function createNote() { //object that wraps each note and its delete link var $note_div = $("<div/>") //object for wrapper html for note var $note = $("<p>"); //define input field var $note_text = $(".note-input input"); //conditional check for input field if ($note_text.val() !== "") {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n /...
[ "0.7267864", "0.64949185", "0.6468047", "0.64146584", "0.641346", "0.6397205", "0.63916314", "0.63584733", "0.63517493", "0.63210255", "0.63033944", "0.6240739", "0.6239536", "0.62174755", "0.61906457", "0.613882", "0.61321187", "0.6126135", "0.61216134", "0.61009365", "0.609...
0.5997008
28
Move this shape to a different position on the page.
move(position = Vector.zero) { this.x = position.x; this.y = position.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveShape() {\n \n var x = Math.floor(Math.random() * 300);\n \n var y = Math.floor(Math.random() * 500);\n \n document.getElementById(\"shape\").style.position = \"relative\";\n \n docu...
[ "0.6895286", "0.66982067", "0.65627146", "0.654652", "0.6533627", "0.64642", "0.64074147", "0.63732153", "0.63666636", "0.63076836", "0.6298702", "0.62926185", "0.62836915", "0.62770873", "0.6275185", "0.6242056", "0.6201346", "0.6201346", "0.6198094", "0.6189481", "0.6188046...
0.58859104
50
Reset the origin of this shape.
recenter(origin = Vector.zero) { this.originX = origin.x; this.originY = origin.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.x = this.originX;\n this.y = this.originY;\n }", "reset () {\n this.y = this.startingY;\n this.x = this.startingX;\n }", "reset() {\n this.x = 202;\n this.y = 395;\n }", "reset() {\n\t\tthis._orbitCenter = this._resetOrbitCenter;\n\t}", "r...
[ "0.8175053", "0.7379282", "0.73081434", "0.71656334", "0.71558285", "0.71524036", "0.6946476", "0.69325155", "0.69311106", "0.6911766", "0.68516725", "0.6843377", "0.6827935", "0.67982507", "0.6773922", "0.6738404", "0.66741765", "0.6651535", "0.6646943", "0.6643516", "0.6610...
0.7128042
6
Actual X coordinate of this shape on the page.
get adjustedX() { return this.x - this.originX }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getX() {\n return this.getLocation().x;\n }", "get xPosition() { return this._xPosition; }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "getCenterX() {\n return this.x;\n }", "get centerX() {\n\t\t\treturn ...
[ "0.75201964", "0.73773414", "0.70287335", "0.70287335", "0.70287335", "0.69915324", "0.6927613", "0.6871445", "0.68538284", "0.68500334", "0.6840555", "0.6778276", "0.6703128", "0.6702714", "0.6683843", "0.6671834", "0.6669302", "0.66611475", "0.66359186", "0.6631432", "0.658...
0.6291849
35
Actual Y coordinate of this shape on the page.
get adjustedY() { return this.y - this.originY }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getY() {\n return this.getLocation().y;\n }", "function getY() {\n\n\t\treturn this.y;\n\n\t}", "getY() {\r\n return this.y;\r\n }", "get yPosition() { return this._yPosition; }", "getY() {\n\t\treturn ( 800 - this.ty ) * 32 + terrain.getYOffset( game.tyoff );\n\t}", "get getBodyY(){\...
[ "0.77184945", "0.75082064", "0.74200547", "0.7416809", "0.7346014", "0.72983927", "0.7293664", "0.72311664", "0.71993995", "0.7057482", "0.70064086", "0.6987911", "0.6946909", "0.68687934", "0.68223727", "0.67890817", "0.67701805", "0.67539316", "0.67446494", "0.67400956", "0...
0.67666
17
Do the actual drawing of the shape. This should be implemented by child classes.
drawOffscreen() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n // Don't draw if shape has have moved off the canvas\n if (this.x > this.canvas.width || this.y > this.canvas.height ||\n this.x + this.width < 0 || this.y + this.height < 0) {\n return;\n }\n this.canvas.context.fillStyle = this.fill;\n this.canvas.context.fillRect(this.x, th...
[ "0.80655944", "0.80346817", "0.7853169", "0.78452516", "0.7676044", "0.76683116", "0.76657856", "0.764504", "0.76245946", "0.75602597", "0.75429153", "0.7526349", "0.74920547", "0.7423046", "0.7379399", "0.73726547", "0.7365628", "0.7364617", "0.73280793", "0.7289766", "0.728...
0.0
-1
Draw this shape on the specified Canvas context.
drawOnscreen(ctx) { this.drawOffscreen(); ctx.drawImage(this.offCanvas, this.adjustedX, this.adjustedY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw(context) {\n context.beginPath();\n context.fillStyle = this.color;\n context.arc(this.x, this.y, this.size, 0, 2 * Math.PI);\n context.fill();\n }", "draw(ctx) {\n\t\t\n\t\tctx.beginPath();\n\t\t\n\t\tctx.fillStyle = this.fillStyle;\n\t ctx.fillRect(this.x, this.y, this.w, this.h);\n\t\t\...
[ "0.7190266", "0.71687174", "0.7127719", "0.70584446", "0.7048168", "0.7006656", "0.69810945", "0.6860138", "0.6819989", "0.6807444", "0.6778506", "0.67714053", "0.66516525", "0.6622854", "0.66078085", "0.66029197", "0.65955925", "0.6588539", "0.6588135", "0.6577282", "0.65533...
0.0
-1
Returns true if the pagePosition Vector is within this shape.
hitTest(pagePosition) { var thisX = pagePosition.x - this.adjustedX; var thisY = pagePosition.y - this.adjustedY; var imgData = this.offCtx.getImageData(thisX, thisY, 1, 1); return imgData.data[3] > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "contains(mouseXPosition, mouseYPosition) {\n // All we have to do is make sure the Mouse X,Y fall in the area between\n // the shape's X and (X + Height) and its Y and (Y + Height)\n var xPosition = this.xPosition;\n var yPosition = this.yPosition;\n var width = this.lineHeight;\...
[ "0.6806733", "0.6802835", "0.6757743", "0.67417836", "0.65165544", "0.6510503", "0.6446531", "0.6359129", "0.63533264", "0.634074", "0.6308318", "0.6308318", "0.6295069", "0.6274164", "0.6250104", "0.62455946", "0.6205396", "0.620035", "0.61974967", "0.6180979", "0.61517674",...
0.5916571
37
Make sure that activities and milestones cannot be moved beyond the campaign duration. Furthermore, make sure that they move together with a campaign if a campaign is being moved.
function limitMoveLeft(task, limit){ var dur = task.end_date - task.start_date; task.end_date = new Date(limit.end_date); task.start_date = new Date(+task.end_date - dur); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertAdvancementLimit() {\n var phaseLimit, periodLimit, executionPeriods,\n advLimitDesc;\n try {\n advLimitDesc = Variable.find(gameModel, \"advancementLimit\");\n } catch (e) {\n }\n if (advLimitDesc === undefined || advLimitDesc.getValue(self))...
[ "0.51831484", "0.5162723", "0.5073684", "0.50528187", "0.49783677", "0.49696618", "0.48337317", "0.48331404", "0.48328197", "0.4829403", "0.48213422", "0.47624743", "0.47244045", "0.47244045", "0.47244045", "0.4723569", "0.47069225", "0.46937427", "0.46934426", "0.46541613", ...
0.44731686
42
TODO: Seems like the calculated time of the day is not correct.
function onGanttRender_todayLine(today) { return function f() { var $today = $("#campaignchain_gantt_today"); if (!$today.length) { var elem = document.createElement("div"); elem.id = "campaignchain_gantt_today"; gantt.$task_data.appendChild(elem); $to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Day(t) {\n typeof t === \"number\";\n return Math.floor(t / msPerDay);\n } // 20.3.1.2 Day Number and Time within Day", "function timeManagement() {\n var day = $(\"#currentDay\"); \n var date = moment().format('llll').toString();\n day.text(date);\n var ampm = date.sp...
[ "0.66306657", "0.6488959", "0.6419257", "0.6397414", "0.63742405", "0.6346537", "0.6330876", "0.6312117", "0.6302083", "0.6291495", "0.62603533", "0.619537", "0.6188375", "0.6165349", "0.61290723", "0.6106414", "0.6099919", "0.6094845", "0.60857165", "0.6073786", "0.6072863",...
0.0
-1
All this logic will automatically be available in application.js.
function getData() { var divGardens = document.getElementById('gardens'); $.get('https://data.cityofnewyork.us/resource/yes4-7zbb.json', function(response) { var htmlString = "<ul>"; for (var i = 0; i < response.length; i++) { htmlString += "<li onclick='changeColor(this)' class='gardens'>" + response...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static ready() { }", "onReady() {\n\n }", "function app(){\n \"use strict\";\n\n // load some scripts (uses promises :D)\n loader.load(\n\n // Styles\n {url: \"./bower_components/normalize.css/normalize.css\"},\n {url: \"./bower_components/typeplate-starter-kit/css/typeplate.css\...
[ "0.6193292", "0.6160619", "0.60794383", "0.6071279", "0.60433996", "0.6033884", "0.6010402", "0.59810776", "0.59599423", "0.5898562", "0.58963054", "0.57417595", "0.5719849", "0.57116956", "0.57101244", "0.57011044", "0.56992644", "0.56781787", "0.56636846", "0.56485856", "0....
0.0
-1
I THINK THIS WORKED call the get method
async function main(){ try{ let ourDB = await dbManager.get(); //after this line we are connected. Notice that the async connect function can be awaited //if we put the call in another async function }catch(err){ console.log(err.message) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get() {\n\n }", "get(id) {\n\n }", "get() {}", "getData(){}", "getall(){\nreturn this.get(Config.API_URL + Constant.AGENT_GETALL);\n}", "get(id, params) {}", "_get () {\n throw new Error('_get not implemented')\n }", "GET() {\n }", "async get() {\n\t\treturn await this._run('GET');\n\t...
[ "0.65997434", "0.6526257", "0.643718", "0.64086694", "0.6369612", "0.61675435", "0.613426", "0.611729", "0.60870004", "0.60417545", "0.6018505", "0.60122037", "0.59764636", "0.59764636", "0.59764636", "0.5954486", "0.5951749", "0.5901889", "0.5896059", "0.5866268", "0.5792509...
0.0
-1
Calls the service worker to start the timer Creates listener for receiving messages from the service worker
playSequence() { if (!this.state.playing) { const interval = calculateInterval(this.state.bpm); this.timerWorker.postMessage({ action: 'start', interval }); this.timerWorker.onmessage = this.handleStep; this.setState({playing: true, paused: false}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _startTimer() {\n service.timer.start(times.ONE_MINUTE);\n }", "function start(){\n window.addEventListener(\"message\", _listener);\n }", "start() {\n timer.start();\n }", "startTimer() {\n if (this.onStartCallback) {\n this.onStartCallback(this...
[ "0.63152224", "0.62463254", "0.62425566", "0.61547256", "0.60960495", "0.6052875", "0.6047339", "0.6026736", "0.5974351", "0.5967269", "0.59219444", "0.59003377", "0.5806544", "0.57981795", "0.57976896", "0.5787143", "0.57647943", "0.5720651", "0.5700629", "0.56982964", "0.56...
0.0
-1
You are given an array of numbers. Write a JS function that prints the elements at odd positions from the array, doubled and in reverse order. The input comes as array of number elements. The output is printed on the console on a single line, separated by space.
function solve(numbers){ let result = numbers .filter((x, i) => i % 2 != 0 ) .map(x => x*2) .reverse() .join(' '); console.log(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processOddNumbers(arr) {\n\tconsole.log(arr\n\t\t\t.filter((x, i) => i % 2 !== 0)\n\t\t\t.map(x => x * 2)\n\t\t\t.reverse()\n\t\t\t.join(' '));\n}", "function processOddNumbers (input) {\n let numbers = input\n .filter((number, index) => index % 2 !== 0)\n .map(number => number * 2)\n .reverse...
[ "0.76598567", "0.7429979", "0.72614866", "0.7205881", "0.71176624", "0.7058109", "0.69476354", "0.69412637", "0.6922705", "0.6902406", "0.68597543", "0.6858117", "0.68535763", "0.6839802", "0.6838005", "0.6810468", "0.6805599", "0.6799828", "0.67967886", "0.678875", "0.677632...
0.6724707
24
Bottom Sheet controller for Encounter search
function ResourceSheetController($mdBottomSheet) { this.items = [ {name: 'Start new encounter', icon: 'encounter', index: 0}, {name: 'Back to face sheet', icon: 'person', index: 1}, ]; this.title = 'Encounter search options'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search() {\n this.trigger('search', {\n element: this.searchBar,\n query: this.searchBar.value\n });\n }", "search() {\n this.send('searchWithParams', this.buildSearchQuery());\n }", "function getAllSearchedContacts() {\n var searchInput = document.getElementById(\"searchb...
[ "0.6216686", "0.61909664", "0.6081968", "0.60520726", "0.60520726", "0.6026236", "0.58889437", "0.5888791", "0.587977", "0.5874685", "0.5849548", "0.5830852", "0.5828239", "0.5812548", "0.5787311", "0.577545", "0.57590795", "0.57590795", "0.57482374", "0.57446414", "0.5741936...
0.6413576
0
route middleware to ensure user is logged in
function isLoggedIn(req, res, next) { if (req.isAuthenticated()) return next(); res.send('No Session'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLoggedIn(req, res, next) {\n\tconsole.log('isLoggedIn middleware');\n if (req.isAuthenticated()) {\n \treturn next();\n } else {\n \tres.redirect('/users');\n }\n}", "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n else res.redirect('/signin');\n }", "...
[ "0.7830781", "0.78219163", "0.7809984", "0.7780423", "0.77706826", "0.776651", "0.77620107", "0.7753045", "0.7751315", "0.7751259", "0.7750051", "0.77436227", "0.7740583", "0.7735315", "0.7733077", "0.7733077", "0.77306277", "0.7725432", "0.77243286", "0.7714864", "0.7714864"...
0.0
-1
end employee Add a department to the departments list
function addDepartmentItem(department) { var departmentItem = '<li id="department-' + department.id + '">Id: ' + department.id + '&nbspName: ' + '<input type="text" value="' + department.name + '">'+ '&nbsp<button class="del">delete</button>' + '<div type="button" class="btn btn-info accord...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDepartment() {\n inquirer.prompt(deptQuestions).then(function(answer) {\n addNewDept(answer.department, answer.overheadcosts);\n });\n}", "function addDepartment(){\n\tinquirer.prompt([{\n\t\tname: 'department',\n\t\tmessage: 'Enter a department name: '\n\t},{\n\t\tname: 'overhead',\n\t\tmessage...
[ "0.7688174", "0.7544773", "0.7543282", "0.75279444", "0.7511921", "0.7478175", "0.74581087", "0.7452505", "0.7420819", "0.737738", "0.73611224", "0.73393565", "0.73145896", "0.728141", "0.727901", "0.726803", "0.7238651", "0.7223694", "0.71926665", "0.7177153", "0.71269494", ...
0.67312855
42
A real apply function would need to handle conflicts, beyond lastonewins.
async _apply (batch) { const b = this.bee.batch({ update: false }) for (const node of batch) { const op = JSON.parse(node.value.toString()) // TODO: Handle deletions if (op.type === 'put') await b.put(op.key, op.value) } await b.flush() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "apply () {}", "apply() {\n this.onApply(this.operations);\n }", "apply() {\n this.onApply(this.operations);\n }", "function safeApply($scope, fn) {\n var phase = $scope.$root.$$phase;\n if (phase === '$apply' || phase === '$digest') {\n if (fn && (typeof(fn) === '...
[ "0.65639687", "0.6310992", "0.6310992", "0.6295497", "0.61155236", "0.61072373", "0.6083071", "0.6083071", "0.60644096", "0.6060641", "0.5928321", "0.59045136", "0.58976245", "0.58976245", "0.58976245", "0.58976245", "0.58976245", "0.58976245", "0.58976245", "0.58976245", "0....
0.0
-1
call everytime when state changes
componentWillUpdate(e, state) { if (state.x) { this.xElement.innerHTML = ' x: ' + state.x } if (state.y) { this.yElement.innerHTML = ' y: ' + state.y } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stateChanged(state) { }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "stateChanged(_state) { }", "updateState() {\n\t\tthis.trigger(this.state);\n\t}", "_onChangeState() {\n\n\n }", "stateChanged(state) {\n }", "onStateChange() {\n\t\t// brute ...
[ "0.76891303", "0.76825327", "0.7665546", "0.7603353", "0.75013787", "0.74122113", "0.72763413", "0.72560453", "0.7228315", "0.7222379", "0.71700835", "0.7143373", "0.714133", "0.70892686", "0.7065504", "0.7053449", "0.7053449", "0.7053449", "0.7045425", "0.7014314", "0.697802...
0.0
-1
Create Http server instances.
function first() { function onRequest(request, response) { var pathname = url.parse(request.url).pathname; console.log(pathname) route(handle, pathname, response, request) }; console.log("Server listening on port 3003") http.createServer(onRequest).listen(3003) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CrearServidorHttp() {\n this.server = http.createServer(this.app);\n }", "async registerHttpServer() {\n this.httpServer = new HttpServer(this.app, this.port);\n this.httpServer.on('error', (err) => {\n this.emit('error', err);\n });\n this.httpServer.on('info', (msg) => {\n this....
[ "0.7520644", "0.7102504", "0.6980821", "0.6947622", "0.68789464", "0.6863273", "0.6710695", "0.6679695", "0.6612933", "0.6464614", "0.6438415", "0.63595605", "0.6305879", "0.62765497", "0.62358123", "0.61854076", "0.61662203", "0.61651945", "0.6138672", "0.6053487", "0.600812...
0.0
-1
create start function for html page response
function start(response) { var html = '<html>'+ '<head>'+ '<meta http-equiv="Content-Type" content="text/html; '+ 'charset=UTF-8" />'+ '<title>Dev upload page</title>'+ '</head>'+ '<body>'+ '<form action="/upload" enctype="multipart/form-data" '+ 'method="post">'+ '<input type="fil...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start(response) {\n\tconsole.log(\"Request handler 'start' was called.\");\n\t\n\t/*just for now define some fake topics already in the system*/\n\t/*data.insertTopic(\"things are happening\", \"www.google.com\");\n\tdata.insertTopic(\"other things are happening\", \"www.google.com\");\n\tdata.insertTopic...
[ "0.6590299", "0.65223265", "0.6449062", "0.6430622", "0.63390166", "0.6299314", "0.6228911", "0.6192831", "0.61071384", "0.6064472", "0.6047796", "0.60314655", "0.60282475", "0.6003362", "0.5982442", "0.5971919", "0.5924652", "0.59019417", "0.5887699", "0.5879119", "0.5866797...
0.5736987
33
import Mygallery from "./pages/Carousel";
function App() { return ( <div className="App"> <Nav /> <Switch> <Route path="/" exact> <Home /> </Route> <Route path="/social" exact> <Image /> </Route> <Route path="/contact" exact> <Contact /> </Route> <Route path...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <Hiring />\n //<Carousel />\n );\n}", "render() {\n return (\n <>\n <CarouselSlides/>\n <PlayingNowSlides/>\n </>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <SlickDemo />\n {/*<SpringSlider />*/}\n ...
[ "0.6121661", "0.58702546", "0.5849615", "0.5824331", "0.58053434", "0.5783374", "0.5773211", "0.5731699", "0.5661602", "0.5629195", "0.5598075", "0.5561402", "0.55473703", "0.55411536", "0.54748183", "0.5443183", "0.5435077", "0.5426057", "0.54225045", "0.5399002", "0.5379787...
0.5539103
14