query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Attach info windows to markers
function attachInfoWindows(brunnenMarkers, infoWindows, map){ for(let i = 0; i<brunnenMarkers.length; i++){ brunnenMarkers[i].addListener('click', ()=>{ closeInfoWindows(infoWindows); infoWindows[i].open(map, brunnenMarkers[i]); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attachInfoWindow(marker, contentString) {\n var infoWindow = new google.maps.InfoWindow({\n content: contentString,\n minWidth: 100 \n });\n\n google.maps.event.addListener(marker, \"click\", function () {\n infoWindow.open(map, marker);\n });...
[ "0.7782229", "0.771127", "0.75796425", "0.75594264", "0.74768466", "0.74380344", "0.7425368", "0.73971796", "0.7388206", "0.73761475", "0.73720086", "0.7361471", "0.73046327", "0.72790587", "0.72745436", "0.7262471", "0.7253457", "0.7236653", "0.71923023", "0.71921086", "0.71...
0.7920471
0
Do math to define PacMan's mouth based on the heading
defineMouth(angle, radius) { let mouthCoords = [0, 0, 0, 0, 0, 0]; let x = this.sprite.getChildAt(0).x; let y = this.sprite.getChildAt(0).y; switch (this.heading) { case "up": mouthCoords[0] = x + Math.cos(angle + (Math.PI * 3) / 2) * radius; mouthCoords[1] = y + Math.sin(angle + (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_mouth()\n{\n dictionary();\n\n var FLAG_VOWEL = 0x80;\n var FLAG_CONSONANT = 0x40;\n var FLAG_DIPTHONG_YX = 0x20;\n var FLAG_DIPTHONG = 0x10;\n var FLAG_FLAG08 = 0x08;\n var FLAG_VOICED= 0x04;\n var FLAG_STOPPED = 0x02;\n var FLAG_PLOSIVE = 0x01;\n\n var a = [];\n var...
[ "0.6695799", "0.64116645", "0.6131625", "0.61023146", "0.60915", "0.58292586", "0.5816859", "0.5707636", "0.56928384", "0.56774896", "0.567072", "0.5602619", "0.5592375", "0.5576796", "0.5526653", "0.5514679", "0.5490055", "0.5489923", "0.5485034", "0.5445835", "0.5405766", ...
0.69140875
0
Write a function titleize that takes an array of names and a function (callback). titleize should use Array.prototype.map to create a new array full of titleized versions of each name titleize meaning "Roger" should be made to read "Mx. Roger Jingleheimer Schmidt".Then pass this new array of names to the callback, whic...
function titleize (args, callback) { let arr = args.map(callback); arr.forEach(word => console.log(`Mx. ${word} Jingleheimer Schmidt`)); // for (let i = 0; i < arr.length; i++) { // console.log(`Mx. ${arr[i]} Jingleheimer Schmidt`); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalizeNames(arr) {\n return arr.map(function(str) {\n return str.split(\" \").map(function (item) {\n return item[0].toUpperCase() + item.slice(1).toLowerCase();\n }).join(\" \");\n })\n}", "function capitalizeNames(arr){\r\n return arr.map(function(word){\r\n ...
[ "0.6789376", "0.6667961", "0.66410995", "0.65670407", "0.6555085", "0.6481149", "0.6438161", "0.63771856", "0.6329821", "0.62960505", "0.62808263", "0.62538797", "0.6240044", "0.62021434", "0.61945504", "0.61688393", "0.61681277", "0.6150055", "0.6145028", "0.6140155", "0.613...
0.81888145
0
true iff prefix matches the first prefix characters in chars[0:len].
function PR_prefixMatch(chars, len, prefix) { if (len < prefix.length) { return false; } for (var i = 0, n = prefix.length; i < n; ++i) { if (prefix.charAt(i) != chars[i]) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function string_starts_with(st, prefix) {\n return st.slice(0, prefix.length) === prefix;\n}", "function doesStringStartWith(s, prefix) {\n return s.substr(0, prefix.length) === prefix;\n}", "function hasPrefix(source, prefix) {\n for (let i = 0, max = prefix.length; i < max; i++) {\n if ...
[ "0.78284913", "0.7551054", "0.75463116", "0.7545015", "0.75283545", "0.7451652", "0.7451652", "0.7020584", "0.7016692", "0.69391555", "0.6891079", "0.6891079", "0.6833059", "0.6826434", "0.6774138", "0.6771724", "0.6746674", "0.66903126", "0.665572", "0.653244", "0.64938605",...
0.89226496
0
walk the tokenEnds list and the chunk list in parallel to generate a list of split tokens.
function PR_splitChunks(chunks, tokenEnds) { var tokens = new Array(); // the output var ci = 0; // index into chunks // position of beginning of amount written so far in absolute space. var posAbs = 0; // position of amount written so far in chunk space var posChunk = 0; // current chunk var chunk ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PR_splitEntities(chunks) {\n var chunksOut = new Array();\n var state = 0;\n for (var ci = 0, nc = chunks.length; ci < nc; ++ci) {\n var chunk = chunks[ci];\n if (PR_PLAIN != chunk.style) {\n chunksOut.push(chunk);\n continue;\n }\n var s = chunk.token;\n var pos = 0;\n var ...
[ "0.57313895", "0.55918485", "0.55192703", "0.5402984", "0.5391128", "0.5381174", "0.53278303", "0.53009343", "0.5292804", "0.5218178", "0.5215263", "0.52030116", "0.52030116", "0.52030116", "0.5191862", "0.51719064", "0.5159108", "0.5159108", "0.5159108", "0.5159108", "0.5159...
0.6926532
0
splits markup tokens into declarations, tags, and source chunks.
function PR_splitMarkup(chunks) { // A state machine to split out declarations, tags, etc. // This state machine deals with absolute space in the text, indexed by k, // and position in the current chunk, indexed by pos and tokenStart to // generate a list of the ends of tokens. // Absolute space is calculated...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PR_tokenizeMarkup(chunks) {\n if (!(chunks && chunks.length)) { return chunks; }\n\n var tokenEnds = PR_splitMarkup(chunks);\n return PR_splitChunks(chunks, tokenEnds);\n}", "function PR_lexMarkup(chunks) {\n // This function works as follows:\n // 1) Start by splitting the markup into text and tag...
[ "0.7040341", "0.67994636", "0.6648816", "0.631886", "0.62877053", "0.606278", "0.60300845", "0.58656454", "0.56570154", "0.56067574", "0.55764353", "0.5564723", "0.5537442", "0.551154", "0.5507359", "0.5505148", "0.54991996", "0.5469954", "0.5466801", "0.54411674", "0.5391018...
0.72107404
0
splits the given string into comment, string, and "other" tokens.
function PR_splitStringAndCommentTokens(chunks) { // a state machine to split out comments, strings, and other stuff var tokenEnds = new Array(); // positions of ends of tokens in absolute space var state = 0; // FSM state variable var delim = -1; // string delimiter var k = 0; // absolute position of beg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PR_splitNonStringNonCommentToken(s, out_list) {\n var pos = 0;\n var state = 0;\n for (var i = 0; i <= s.length; i++) {\n var ch = s.charAt(i);\n // the next state.\n // if set to -1 then it will cause a reentry to state 0 without consuming\n // another character.\n var nstate = state;\n...
[ "0.7198582", "0.6894054", "0.68737584", "0.62788534", "0.6139895", "0.6091643", "0.60785115", "0.5990279", "0.5965606", "0.5964758", "0.58819836", "0.57985485", "0.5766247", "0.57565504", "0.5746716", "0.57064235", "0.5704827", "0.56961083", "0.5680323", "0.5674805", "0.56596...
0.7175333
1
used by lexSource to split a non string, non comment token.
function PR_splitNonStringNonCommentToken(s, out_list) { var pos = 0; var state = 0; for (var i = 0; i <= s.length; i++) { var ch = s.charAt(i); // the next state. // if set to -1 then it will cause a reentry to state 0 without consuming // another character. var nstate = state; if (i == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PR_splitStringAndCommentTokens(chunks) {\n // a state machine to split out comments, strings, and other stuff\n var tokenEnds = new Array(); // positions of ends of tokens in absolute space\n var state = 0; // FSM state variable\n var delim = -1; // string delimiter\n var k = 0; // absolute posit...
[ "0.6757323", "0.63352036", "0.6284822", "0.6259278", "0.623187", "0.61794287", "0.61794287", "0.61794287", "0.61794287", "0.6171351", "0.61392814", "0.61043495", "0.6041186", "0.5989051", "0.59552866", "0.5938856", "0.5901803", "0.5877887", "0.587023", "0.58507925", "0.583211...
0.74498534
0
splits the quotes from an attribute value. ['"foo"'] > ['"', 'foo', '"']
function PR_splitAttributeQuotes(tokens) { var firstPlain = null, lastPlain = null; for (var i = 0; i < tokens.length; ++i) { if (PR_PLAIN == tokens[i].style) { firstPlain = i; break; } } for (var i = tokens.length; --i >= 0;) { if (PR_PLAIN == tokens[i].style) { lastPlain = i; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stripQuotes( value ) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "function stripQuotes( value ) {\n return value.replace(/^[\"']|['\"]$/g, \"\");\n}", "removeQuotes(value) {\n const firstVal = value.charAt(0);\n const lastVal = value.charAt(value.length - 1);\n if (fi...
[ "0.6595991", "0.6595991", "0.65324074", "0.6523572", "0.6477665", "0.64021736", "0.64006585", "0.63944834", "0.6379494", "0.63791907", "0.6352995", "0.62904733", "0.62254405", "0.62099946", "0.6168974", "0.6105903", "0.61049396", "0.60138863", "0.59778357", "0.5959787", "0.59...
0.67043084
0
identify attribute values that really contain source code and recursively lex them.
function PR_splitSourceAttributes(tokens) { var tokensOut = new Array(); var sourceChunks = null; var inSource = false; var name = ''; for (var ci = 0, nc = tokens.length; ci < nc; ++ci) { var tok = tokens[ci]; var outList = tokensOut; if (PR_TAG == tok.style) { if (inSource) { inS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attributes(src, name) {\n const result = [];\n let start = 0;\n let end = src.length;\n if (name) {\n start = name.length + 1;\n end -= src.slice(-2) === '/>' ? 2 : 1;\n }\n const scanner = new Scanner(src, start, end);\n while (!scann...
[ "0.6112149", "0.57650405", "0.5585116", "0.53844786", "0.5284863", "0.51941055", "0.5158988", "0.5158988", "0.5134111", "0.5121732", "0.5114134", "0.5114134", "0.51068497", "0.51046574", "0.51046574", "0.51046574", "0.5030419", "0.5018116", "0.49839437", "0.4916708", "0.49092...
0.5816108
1
returns a list of PR_Token objects given a string of markup. This code assumes that comment declaration tag tag embedded source &[\w]...; entity It does not recognizes %foo; entities. It will recurse into any , , and on attributes using PR_lexSource.
function PR_lexMarkup(chunks) { // This function works as follows: // 1) Start by splitting the markup into text and tag chunks // Input: String s // Output: List<PR_Token> where style in (PR_PLAIN, null) // 2) Then split the text chunks further into comments, declarations, // tags, etc. // A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PR_splitNonStringNonCommentToken(s, out_list) {\n var pos = 0;\n var state = 0;\n for (var i = 0; i <= s.length; i++) {\n var ch = s.charAt(i);\n // the next state.\n // if set to -1 then it will cause a reentry to state 0 without consuming\n // another character.\n var nstate = state;\n...
[ "0.64373726", "0.6396938", "0.6174146", "0.6037519", "0.58961034", "0.58732545", "0.58548266", "0.5807783", "0.570604", "0.569034", "0.5665296", "0.5627967", "0.5626843", "0.55626315", "0.5544906", "0.5458798", "0.5430135", "0.53934497", "0.53873074", "0.5382622", "0.5334265"...
0.7023207
0
classify the string as either source or markup and lex appropriately.
function PR_lexOne(s) { var chunks = PR_chunkify(s); // treat it as markup if the first non whitespace character is a < and the // last non-whitespace character is a > var isMarkup = false; for (var i = 0; i < chunks.length; ++i) { if (PR_PLAIN == chunks[i].style) { if (PR_startsWith(PR_trim(chunks[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normal(source, state) {\n var plug;\n // Do we look like '\\command' ? If so, attempt to apply the plugin 'command'\n if (source.match(/^\\\\[a-zA-Z@]+/)) {\n var cmdName = source.current().slice(1);\n plug = plugins[cmdName] || plugins[\"DEFAULT\"];\n plug = new plug(...
[ "0.5862476", "0.5821489", "0.56753993", "0.56600773", "0.5511557", "0.55003", "0.5440437", "0.5437393", "0.54371244", "0.5323637", "0.5319748", "0.5257219", "0.52251446", "0.52061117", "0.51998043", "0.5184002", "0.5123796", "0.511371", "0.511371", "0.511371", "0.5103785", ...
0.7065637
0
find all the and tags in the DOM with class=prettyprint and prettify them.
function prettyPrint() { // fetch a list of nodes to rewrite var codeSegments = [ document.getElementsByTagName('pre'), document.getElementsByTagName('code'), document.getElementsByTagName('xmp') ]; var elements = []; for (var i = 0; i < codeSegments.length; ++i) { for (var j = 0; j < code...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prettyPrint(code){\n console.log(pretty.source(code));\n}", "function _loadPrettyPrint() {\n\n $(prettyPrint(data)).appendTo(this.$);\n this.adoptModalDialogPosition();\n }", "function prettify()\n {\n var body = document.body;\n\n // Render a...
[ "0.5635054", "0.5613509", "0.5596388", "0.55292565", "0.5460871", "0.5365181", "0.53426963", "0.5259398", "0.51750296", "0.51227957", "0.51189464", "0.50880414", "0.5085338", "0.48411325", "0.48196137", "0.480388", "0.4794113", "0.47766203", "0.47759134", "0.47517473", "0.471...
0.6968767
0
creates an instance of a view class in a given window by calling the class factory.
function createViewInstance(viewClass, window, windowId) { Log.log("Creating new instance of " + viewClass.id + " in window #" + windowId ); var view = viewClass.createInstance(window); if (!view) { Log.log("Skipped"); return false; } var id = uniqueId++; var viewInfo = { view: view, id: i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fromClass(cls, spec) {\n return ViewPlugin.define(view => new cls(view), spec);\n }", "static fromClass(cls, spec) {\n return ViewPlugin.define(view => new cls(view), spec);\n }", "function AnViewWindow(an) {\n\tWindow.call(this, an.annotext);\n\tthis.annotation = an;\n\tthis...
[ "0.6132532", "0.61228436", "0.61130023", "0.61033523", "0.61033523", "0.6102185", "0.61007375", "0.6060989", "0.6060989", "0.6060989", "0.6060989", "0.59647226", "0.59387165", "0.59278685", "0.59264004", "0.5895934", "0.58942646", "0.58500147", "0.5836525", "0.57589227", "0.5...
0.7529154
0
finds the appropriate weather status from description and calls changeBackground() to set appropriate bg image
function checkStatus(description){ if (description.search("cloudy") != -1){ changeBackground("http://www.cray.com/blog/wp-content/uploads/2015/09/Weather-Blog-Image.jpg"); } else if (description.search("fog") != -1){ changeBackground("https://a2ua.com/fog/fog-022.jpg"); } else if (description.search("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function backgroundImage(curWeather) {\n //convert to lower case\n curWeather = curWeather.toLowerCase();\n\n //empty varaible to hold the image url\n var url = \"\";\n\n //if weather description contains \"clouds\", set the background image\n if (curWeather.indexOf(\"clouds\") != -1) {\n //url = \"https:...
[ "0.6960229", "0.6797722", "0.6775195", "0.67635983", "0.66847837", "0.6654145", "0.6627466", "0.6622764", "0.65811926", "0.65699255", "0.6541667", "0.647971", "0.64244926", "0.6366389", "0.6309099", "0.62823105", "0.6250719", "0.6215336", "0.619541", "0.6188619", "0.6130311",...
0.7683817
0
the WebSocket used for communication with the server get HTML5 elements and register listeners
function init() { // get HTML5 elements screenName = document.getElementById( "screenName" ); connectButton = document.getElementById( "connectButton" ); disconnectButton = document.getElementById( "disconnectButton" ); messageListDiv = document.getElementById( "messageListDiv" ); messagesList = docu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addEventListeners() {\n const self = this;\n\n this.ws.onopen = function() {\n self.onOpen();\n };\n this.ws.onclose = function() {\n self.onClose();\n };\n this.ws.onmessage = function(ev) {\n self.onData(ev.data);\n };\n this.ws.onerror = function(e) {\n self.onError(\...
[ "0.665124", "0.665124", "0.6612031", "0.65952665", "0.6571214", "0.65434474", "0.6461862", "0.64459515", "0.6441149", "0.6421112", "0.6420763", "0.63632977", "0.6330749", "0.6293379", "0.6272299", "0.6245958", "0.6244239", "0.62075055", "0.6204362", "0.61673576", "0.6157656",...
0.6757259
0
This function is not used Fetch restaurants by a cuisine type with proper error handling.
static fetchRestaurantByCuisine(cuisine, callback) { // Fetch all restaurants with proper error handling //console.log('fetch restauranrt by cuisine'); IDBHelper.fetchRestaurants( (error, restaurants) => { if (error) { callback(error, null); } else { // Filter restaurants to hav...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurantByCuisine(cuisine) {\n // Fetch all restaurants with proper error handling\n return DBHelper.fetchRestaurants().then(restaurants => {\n if (!restaurants) {\n throw new Error('No Restaurants Found');\n } else {\n // Filter restaurants to have only given cuisine t...
[ "0.8050104", "0.76201874", "0.76127553", "0.7610791", "0.7598918", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.7594279", "0.75923955", "0.75856465", "0.75856465", "0.75856465", "0.7585646...
0.76933
1
Fetch restaurants by a cuisine and a neighborhood with proper error handling.
static fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood) { // Fetch all restaurants return IDBHelper.fetchRestaurants( (restaurants) => { let results = restaurants; if (cuisine != 'all') { // filter by cuisine results = results.filter(r => r.cuisine_type == cuisine); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fetchRestaurantByCuisineAndNeighborhood(cuisine, neighborhood) {\n // Fetch all restaurants\n return DBHelper.fetchRestaurants().then(restaurants => {\n if (!restaurants) {\n throw new Error('No Restaurants Found');\n } else {\n let results = restaurants;\n if (cuisine !...
[ "0.84830165", "0.8219936", "0.82010525", "0.8149893", "0.8131314", "0.812902", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.81235147", "0.8121277", "0.8121277", "0.8121277", "0.8121277", "0.81...
0.8524553
0
Retunr true if array contains an object with same property
function contains(array,object,property){ // console.log(JSON.stringify(array)) if (array.length==0){ return false } else{ for (index in array){ if (array[index]==null){ return false } else{ if (array[index][property]==object[property]){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasAll(arr) {\n for (let obj of arr) {\n if (!this.has(obj))\n return false;\n }\n return true;\n }", "function arrayContainsSomePropertyFromObject(o, array) {\r\n\tvar b = false;\r\n\tfor (var p in o) {\r\n\t\tb |= array.some(function(item) {\r\n\t\t\treturn o[p] === item;\r\n\t\t});\r\n\t...
[ "0.7128619", "0.71265054", "0.71013093", "0.6891579", "0.6886504", "0.6848154", "0.6816316", "0.6811681", "0.6741919", "0.67346025", "0.67014885", "0.67007685", "0.6601219", "0.655355", "0.65466523", "0.65447605", "0.6523226", "0.65189713", "0.6517682", "0.64851266", "0.64773...
0.7412304
0
Create weblas pipeline tensor in GPU memory 1D or 2D only see gl.MAX_TEXTURE_SIZE is a limiting factor. Where this is exceeded, weblas Tensor must be split.
createWeblasTensor () { if (this.weblasTensor) { this.weblasTensor.delete() } if (this.weblasTensorsSplit) { this.weblasTensorsSplit.forEach(t => t.delete()) } if (this.tensor.shape.length === 1) { const len = this.tensor.shape[0] if (len > MAX_TEXTURE_SIZE) { this.w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createShader(info, data) {\n const finfo = JSON.parse(info);\n const layoutEntries = [];\n for (let i = 0; i < finfo.arg_types.length; ++i) {\n const dtype = finfo.arg_types[i];\n if (dtype == \"handle\") {\n layoutEntries.push({\n bindin...
[ "0.6125648", "0.58009446", "0.5667431", "0.55905825", "0.5494392", "0.5460522", "0.54224116", "0.5403888", "0.5373809", "0.53528976", "0.5303911", "0.52652687", "0.52389115", "0.52389115", "0.52374494", "0.52326435", "0.52066326", "0.52046895", "0.519148", "0.5184507", "0.517...
0.7633595
0
Transfers weblas pipeline tensor from GPU memory
transferWeblasTensor () { if (this.weblasTensor) { const shape = this.weblasTensor.shape const arr = this.weblasTensor.transfer(true) this.tensor = squeeze(ndarray(arr, shape)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createWeblasTensor () {\n if (this.weblasTensor) {\n this.weblasTensor.delete()\n }\n if (this.weblasTensorsSplit) {\n this.weblasTensorsSplit.forEach(t => t.delete())\n }\n\n if (this.tensor.shape.length === 1) {\n const len = this.tensor.shape[0]\n if (len > MAX_TEXTURE_SIZE) {...
[ "0.6768021", "0.59752744", "0.572326", "0.55355984", "0.5405801", "0.5315666", "0.5308265", "0.5308265", "0.51924205", "0.5148434", "0.5131508", "0.5110645", "0.5082371", "0.5070501", "0.5053648", "0.5038195", "0.49995348", "0.49789527", "0.4958661", "0.4954325", "0.49290553"...
0.7353944
0
Delete weblas pipeline tensor
deleteWeblasTensor () { if (this.weblasTensor) { this.weblasTensor.delete() delete this.weblasTensor } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createWeblasTensor () {\n if (this.weblasTensor) {\n this.weblasTensor.delete()\n }\n if (this.weblasTensorsSplit) {\n this.weblasTensorsSplit.forEach(t => t.delete())\n }\n\n if (this.tensor.shape.length === 1) {\n const len = this.tensor.shape[0]\n if (len > MAX_TEXTURE_SIZE) {...
[ "0.67331296", "0.63754857", "0.6000764", "0.59191704", "0.5860717", "0.568067", "0.5671387", "0.5669318", "0.5598312", "0.55722857", "0.5563102", "0.5545216", "0.55130386", "0.54857254", "0.5455092", "0.545125", "0.5442911", "0.5394155", "0.5374757", "0.53605723", "0.5333115"...
0.8522237
0
Replaces data in the underlying ndarray.
replaceTensorData (data) { if (data && data.length && data instanceof this._type) { this.tensor.data = data } else if (data && data.length && data instanceof Array) { this.tensor.data = new this._type(data) } else { throw new Error('[Tensor] invalid input for replaceTensorData method.') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "replaceData(newData) {\n this.#data = newData;\n }", "replaceAt(_row, _col, _input)\r\n {\r\n this.array[_row][_col] = _input;\r\n return this;\r\n }", "reset () {\n this._data = this._originalData ? this._originalData.slice() : this._data.fill(0);\n }", "replacePixelD...
[ "0.7193655", "0.6236966", "0.60829383", "0.59051603", "0.58844304", "0.57595867", "0.56502634", "0.5604951", "0.54623806", "0.54550606", "0.5392468", "0.53870875", "0.5355839", "0.53499717", "0.5345579", "0.5343208", "0.5332028", "0.5321996", "0.5293949", "0.5281802", "0.5277...
0.67651284
1
I check if I can move right, and if so, I move, else I try doing down, left and up If all four positions have a wall, doesn't exist or are on the path, that position is a dead end
function move() { // TODO esto puede entrar en un loop infinito en el que no encuentra dead ends // siempre va a poder volver a donde vino if (canMoveRight()) { moveRight() console.log("derecha") } else if (canMoveDown()) { moveDown() console.log("abajo") } else if (c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move (up, down, left, right) {\n if (this.robotLocationX + (right - left) > -1 && this.robotLocationY + (up - down) > -1 && this.robotLocationX + (right - left) < 201 && this.robotLocationY + (up - down) < 201) {\n this.robotLocationY += (up - down)\n this.robotLocationX += (right - le...
[ "0.7373594", "0.7079006", "0.6989627", "0.68933094", "0.6867832", "0.6798949", "0.6759648", "0.6754825", "0.67464393", "0.67146343", "0.665341", "0.66345495", "0.66189605", "0.6618857", "0.661262", "0.6609752", "0.6592836", "0.6589419", "0.6582844", "0.658079", "0.65705806", ...
0.7872335
0
this function adds the current position to an array called Path, where I store the path to reach the exit Alto, it calls another function, addPathToMaze
function addPositionToPath() { newPosition = [actualRow, actualColumn] addPathToMaze() return path.push([actualRow, actualColumn]) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mazeSolveAll(maze, current, path){\n let mapCopy = maze.map(x => [...x])\n let x = current[0]\n let y = current[1]\n if (x < 0 || y < 0 || x >= mapCopy[0].length || y >= mapCopy.length || maze[y][x] === '*'){\n return false\n }\n if (maze[y][x] === 'e'){\n console.log(path)\n return true\n ...
[ "0.6796975", "0.6782296", "0.63065815", "0.62735677", "0.6268163", "0.6260227", "0.62522197", "0.6220588", "0.6209878", "0.6146783", "0.61444247", "0.61181235", "0.6113415", "0.6103571", "0.6053337", "0.6053281", "0.6035101", "0.6024401", "0.5961973", "0.5959196", "0.591372",...
0.7982881
0
Create some palettes and return a promise containing the new palette items
function setupPalettes() { let palettes = [ Palette({ title: 'Test Palette 1', colors: ['color 1', 'color 2'] }), Palette({ title: 'Test Palette 2', colors: ['color 3', 'color 4'] }), Palette({ title: 'Test Palette 3', colors: ['color 5', 'color 6', 'color 7'] }), ]; let promises = [];...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function fetchPalettes(){\n let res = await fetch(\"/palettes\");\n let data = await res.json()\n setPalettes(data)\n }", "getPalettes() {\n return palettes;\n }", "setupPalette(){\n this.palettes = new PaletteCollection();\n this.palettes.addPalette(\"RGB\",this...
[ "0.6845154", "0.65434843", "0.6508703", "0.6465661", "0.6415267", "0.64137864", "0.63283736", "0.6296733", "0.6281879", "0.6229398", "0.61602724", "0.6126829", "0.6109499", "0.6086143", "0.6043581", "0.6002166", "0.59692746", "0.5934294", "0.5933418", "0.5898692", "0.58756316...
0.83495665
0
================Day 3 Problem 4========================================================================================== unix timeStamp and covert to its UTC equivalent value
function UnixTimestampToUTC(timeStamp) { var dt = new Date(timeStamp); var d = dt.toUTCString(); return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static UnixToCalendarTimeStamp(obj) {\n //var unixTime = moment(obj).unix();\n var unixTime = moment(obj).format('LLLL');\n return unixTime;\n }", "function getUnixTime(x){\n return moment.tz(x, \"America/Los_Angeles\").valueOf()/1000;\n}", "function fetch_unix_timestamp() { return parseInt(new Da...
[ "0.7091856", "0.7036962", "0.68365526", "0.6808274", "0.6795685", "0.6790636", "0.6782859", "0.67738104", "0.6640471", "0.65664214", "0.65217257", "0.6437752", "0.6435591", "0.64331144", "0.64047194", "0.63947135", "0.6391754", "0.63699013", "0.6343619", "0.6339598", "0.63126...
0.7082288
1
Cached value of `sysinfo.alias` or `sysinfo.children[childId].alias` if childId set.
get alias() { if (__classPrivateFieldGet(this, _childId) && __classPrivateFieldGet(this, _child) !== undefined) { return __classPrivateFieldGet(this, _child).alias; } if (this.sysInfo === undefined) return ''; return this.sysInfo.alias; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAliasMap(node, parentAliasMap) {\n\t var applicationName = node.getApplicationName();\n\t var hash = node.getShallowHash();\n\t var children = parentAliasMap.children;\n\n\t if (!children.hasOwnProperty(applicationName)) {\n\t children[applicationName] = {\n\t childr...
[ "0.5924409", "0.5899796", "0.5213708", "0.51096755", "0.49768507", "0.48539707", "0.47299898", "0.46489564", "0.44961843", "0.44811648", "0.44719762", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0.445437", "0....
0.6924295
0
Cached value of `sysinfo.dev_name`.
get description() { return this.sysInfo.dev_name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get deviceName() {\n return this.getStringAttribute('device_name');\n }", "get deviceName() {\n return this.getStringAttribute('device_name');\n }", "get deviceName() {\n return this.getStringAttribute('device_name');\n }", "function shortGetDevice(db, devID) {\n\t\t\tdb.transac...
[ "0.64519", "0.64519", "0.64519", "0.6315265", "0.6256001", "0.61111164", "0.60956794", "0.5987167", "0.5897892", "0.576832", "0.5716943", "0.5652614", "0.55907357", "0.5564333", "0.5541277", "0.54655737", "0.54249966", "0.5365015", "0.5365015", "0.5340139", "0.5333904", "0....
0.6694402
0
Cached value of `sysinfo.deviceId` or `childId` if set.
get id() { if (__classPrivateFieldGet(this, _childId) && __classPrivateFieldGet(this, _child) !== undefined) { return __classPrivateFieldGet(this, _childId); } return this.sysInfo.deviceId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkDeviceId() {\n if (NSystemService.getInstance().checkDevice() === 'browser') {\n this._deviceUUID = this.getValue('uuid');\n if (!this._deviceUUID) {\n this._deviceUUID = new NUtility().generateUUID();\n this.setValue('uuid', this._deviceUUID);\n ...
[ "0.5921471", "0.590066", "0.5809403", "0.56917095", "0.54392254", "0.53871506", "0.5343702", "0.52233624", "0.52064186", "0.51898646", "0.5010452", "0.4941758", "0.49414313", "0.48948002", "0.4890706", "0.48766667", "0.48274684", "0.48226145", "0.48109668", "0.4761511", "0.47...
0.6989229
0
Determines if device is in use based on cached `emeter.get_realtime` results. If device supports energy monitoring (e.g. HS110): `power > inUseThreshold`. `inUseThreshold` is specified in Watts Otherwise fallback on relay state: `relay_state === 1` or `sysinfo.children[childId].state === 1`. Supports childId.
get inUse() { if (this.supportsEmeter && 'power' in this.emeter.realtime && this.emeter.realtime.power !== undefined) { return this.emeter.realtime.power > this.inUseThreshold; } return this.relayState; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIsLowEndDevice() {\n // If number of logical processors available to run threads <= 4\n if (getHC() && getHC() <= 4) {\n return true;\n }\n // If the approximate amount of RAM client device has <= 4\n if (getDM() && getDM() <= 4) {\n return true;\n }\n return false;\n}", "function getIsL...
[ "0.5103425", "0.49623868", "0.45913103", "0.44248345", "0.43777546", "0.43459153", "0.43397164", "0.43249762", "0.42821825", "0.42628464", "0.42394546", "0.42361724", "0.42284003", "0.4157007", "0.41422355", "0.41396317", "0.41246894", "0.4076503", "0.40519994", "0.4046917", ...
0.687075
0
Cached value of `sysinfo.relay_state === 1` or `sysinfo.children[childId].state === 1`. Supports childId. If device supports childId, but childId is not set, then it will return true if any child has `state === 1`.
get relayState() { if (__classPrivateFieldGet(this, _childId) && __classPrivateFieldGet(this, _child) !== undefined) { return __classPrivateFieldGet(this, _child).state === 1; } if (__classPrivateFieldGet(this, _children) && __classPrivateFieldGet(this, _children).size > 0) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isChild(child) {\n return !this.parent || child[this.parent.key] === this.parent.value.data.id;\n }", "isChild(nodeId) {\n const familyNodes = this.state.familyNodes;\n for(var i=0; i<familyNodes.length;i++) {\n if(nodeId === familyNodes[i]) {\n return true;\n }\n }\n return fals...
[ "0.5707035", "0.5669924", "0.5451924", "0.51877576", "0.51696163", "0.5151066", "0.5046598", "0.5025385", "0.50236803", "0.49271083", "0.49233055", "0.49139398", "0.49054304", "0.49019873", "0.48957747", "0.48666286", "0.48235634", "0.48198348", "0.4772764", "0.47641048", "0....
0.73361397
0
True if cached value of `sysinfo` has `brightness` property.
get supportsDimmer() { return 'brightness' in this.sysInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get bright() {\n\t\treturn (this.value & 0x08) ? true : false;\n\t}", "hasBuiltInLight() {\n return this.hasProperty(Properties.LIGHT_POWER);\n }", "hasColor() {\n return this.native.hasColor();\n }", "function checkBrightness(r, g, b) {\n return Math.sqrt(\n (r * r) * 0.299 +...
[ "0.5819736", "0.57492846", "0.5444093", "0.530184", "0.5295099", "0.52078956", "0.52055717", "0.5106433", "0.5079751", "0.5079746", "0.50765276", "0.50608754", "0.50608754", "0.50608754", "0.50608754", "0.50608754", "0.50091034", "0.49871683", "0.49752718", "0.49727657", "0.4...
0.6117536
0
True if cached value of `sysinfo` has `feature` property that contains 'ENE'.
get supportsEmeter() { return this.sysInfo.feature && typeof this.sysInfo.feature === 'string' ? this.sysInfo.feature.indexOf('ENE') >= 0 : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n$r(n){return \"performanceInfo\"in n}", "hasFeature(feature, version) {\n return true;\n }", "function hasFeature(feat) {\n return features && features.indexOf(feat) !== -1;\n }", "function exists(feature) {\n var normalizedFeature = feature.toLowerCase();\n return Boolean...
[ "0.61137956", "0.604957", "0.6009524", "0.59939873", "0.5885055", "0.58183444", "0.5813561", "0.5759483", "0.573962", "0.566524", "0.56533223", "0.5609406", "0.5605863", "0.55760914", "0.5391892", "0.5386162", "0.533814", "0.5319258", "0.5285389", "0.5272984", "0.52346027", ...
0.73935354
0
Gets plug's SysInfo. Requests `system.sysinfo` from device. Does not support childId.
async getSysInfo(sendOptions) { const response = await super.getSysInfo(sendOptions); if (!device_1.isPlugSysinfo(response)) { throw new Error(`Unexpected Response: ${response}`); } return this.sysInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getSystemInfo() {\n return this.tvRequest(WEBOS_URI_SYSTEM_INFO);\n }", "function getSystemInfo() {\n divElements[4].innerHTML = (os.platform() == 'win32' ? 'windows':'windows')\n}", "function getSystem(props) {\n return props.systems[getSystemId(props)]\n}", "async getSystemInformation() { \...
[ "0.66092694", "0.56184834", "0.55782497", "0.54578596", "0.5456944", "0.53947765", "0.5372193", "0.5363002", "0.5334936", "0.5297028", "0.5189364", "0.51724803", "0.5132564", "0.512065", "0.5089526", "0.5084201", "0.5082041", "0.5042204", "0.5024307", "0.49118388", "0.4886929...
0.652969
1
implementation of the 'ls' command / formats a directory child node
function formatLsChild(node, result) { result = result || []; if (node.Name) { if (node.Directory) { result.push(node.Name); result.push('/'); //$NON-NLS-0$ } else { result.push('<a href="/edit/edit.html#' + node.Location + '">'); //$NON-NLS-1$ //$NON-NLS-0$ result.push(node.Name); //TODO htm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function directoryTreeView() {}", "function formatLs(node, result, func) {\n\t\tresult = result || [];\n\t\tmCurrentDirectory.withChildren(node,\n\t\t\tfunction(children) {\n\t\t\t\tchildren.sort(function(a,b) {\n\t\t\t\t\tvar isDir1 = a.Directory;\n\t\t\t\t\tvar isDir2 = b.Directory;\n\t\t\t\t\tif (isDir1 !== i...
[ "0.6274809", "0.62679327", "0.62613976", "0.62535244", "0.6069042", "0.6026828", "0.60046643", "0.589303", "0.57240295", "0.57240295", "0.57240295", "0.56929857", "0.5675241", "0.5613409", "0.56068623", "0.5575203", "0.5567279", "0.552575", "0.54556835", "0.54547936", "0.5452...
0.67656714
0
Formats the children of a current file or workspace node. Optionally accepts an array 'result' to which the resulting Strings are pushed. To avoid massive String copying, the result is returned as an array of Strings rather than one massive String. Caller should join('') the returned result.
function formatLs(node, result, func) { result = result || []; mCurrentDirectory.withChildren(node, function(children) { children.sort(function(a,b) { var isDir1 = a.Directory; var isDir2 = b.Directory; if (isDir1 !== isDir2) { return isDir1 ? -1 : 1; } var n1 = a.Name && a.Nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatLsChild(node, result) {\n\t\tresult = result || [];\n\t\tif (node.Name) {\n\t\t\tif (node.Directory) {\n\t\t\t\tresult.push(node.Name);\n\t\t\t\tresult.push('/'); //$NON-NLS-0$\n\t\t\t} else { \n\t\t\t\tresult.push('<a href=\"/edit/edit.html#' + node.Location + '\">'); //$NON-NLS-1$ //$NON-NLS-0$\n\...
[ "0.7077811", "0.58788574", "0.5565822", "0.55118084", "0.54576796", "0.5448794", "0.5400175", "0.53983915", "0.521465", "0.51907563", "0.51907563", "0.51260084", "0.509805", "0.5082327", "0.50052625", "0.49550578", "0.4908642", "0.4901832", "0.48840514", "0.48729473", "0.4866...
0.6316507
1
implementaton of the 'cd' command
function cdExec(args, context) { var targetDirName = args.directory; if (typeof(targetDirName) !== "string") { //$NON-NLS-0$ targetDirName = targetDirName.Name; } var result = context.createPromise(); mCurrentDirectory.withCurrentTreeNode( function(node) { if (targetDirName === '..') { //$NON-NLS-0$...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cd(term, args) {\n if(args.length > 0) {\n directory_path = args[0];\n }\n else{\n directory_path = '~/';\n }\n try {\n filesystem.changeDirectory(directory_path);\n // update the prompt so that it 'looks right'\n root_dir = filesystem.cwd === '' ? '~' : '...
[ "0.7365416", "0.6511134", "0.62205863", "0.5472372", "0.5386305", "0.5223587", "0.5200919", "0.5196521", "0.5104084", "0.50929785", "0.50234145", "0.5014306", "0.4949843", "0.4931747", "0.49237156", "0.48845857", "0.48390982", "0.482797", "0.47841144", "0.47649965", "0.476299...
0.654483
1
factorial(3) > 6 factorial(4) > 24 factorial(5) > 120 Write a function called repeatString that takes two parameters, a string and a number and returns a new string with the given string repeated the given number of times.
function repeatString(string, number) { //Write your code here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "repeat(string, number) {\n return string.repeat(number);\n }", "function repeat(number, string) {\n let newString = '';\n\n for (let i = 0; i < number; i++) {\n newString += string;\n }\n\n return newString;\n\n}", "function repeatFunction(string, number) {\n console.log(string.repeat(numbe...
[ "0.88213277", "0.8704375", "0.865385", "0.8576029", "0.85700333", "0.85529846", "0.8551625", "0.85305625", "0.8527217", "0.85244334", "0.85150385", "0.85111666", "0.85082096", "0.84907556", "0.8480463", "0.84773225", "0.8462019", "0.84544194", "0.8445644", "0.8414939", "0.840...
0.87081367
1
fibonacci(5) > 8 fibonacci(6) > 13 fibonacci(7) > 21 Write a function called multiplyBy10 that takes two numbers as parameters and returns the first number multiplied by 10 the amount of times specified by the second number.
function multiplyBy10(firstNumber, secondNumber) { //Write your code here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fibonacci(n) {\r\n \r\n}", "function fibonacci(n) {\n\n}", "function fibonacci(n) {\n\n}", "function fibonacci(number) {\n if(number < 2) {\n return number;\n }\n console.log(fibonacci(number - 1) + fibonacci(number - 2));\n return fibonacci(number - 1) + fibonacci(number - 2)\n}", "func...
[ "0.74473524", "0.73561525", "0.73561525", "0.7249309", "0.70581585", "0.7005411", "0.6946925", "0.68529946", "0.6851031", "0.6837878", "0.683594", "0.6834206", "0.6833771", "0.6827785", "0.6799143", "0.6794245", "0.67828774", "0.6780231", "0.677718", "0.67730397", "0.6768873"...
0.74385816
1
multiplyBy10(4, 3) > 4000 multiplyBy10(5, 2) > 500 Intermediate: Write a function called sumBetween that takes two numbers (start and end) as parameters and returns the sum of the numbers from start to end. What happens if the start is larger than the end? Modify the function to check for this case and, when found, swa...
function sumBetween(start, end) { //Write your code here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sum (start, end) {\n if (start > end) {\n return sum(end, start);\n } else if (start === end) {\n return start;\n } else {\n return start + sum(start + 1, end);\n }\n}", "function sum (start, end) {\n return (end - start + 1) * (end + start)/2\n}", "function getSum(a, b) {\r\n\tlet start...
[ "0.74777895", "0.7200586", "0.69374526", "0.6719232", "0.6686441", "0.66447854", "0.65768963", "0.65372163", "0.6518543", "0.64018536", "0.63960874", "0.6353438", "0.6312094", "0.6304648", "0.628463", "0.6242755", "0.6240485", "0.62171555", "0.6216798", "0.6187959", "0.616731...
0.7498132
0
Hacky way to add active class to selected button
addActiveClass(target) { const head_btn = document.getElementsByClassName("head_btn"); // Before adding active to button style // removes all active classes from all head_btn elements. // In ideal situation first check if element has active class // then remove class from that element. for (va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSelectedClassBtn(target) {\n target.classList.add('selected-btn');\n}", "function buttonify(){\n\t$('button').click(function(){\n\t\t$(this).parent().children().each(function(){\n\t\t\t$(this).removeClass('active');\n\t\t});\n\t\t$(this).addClass('active');\n\t});\n}", "activate(el){\n el.addCl...
[ "0.72360563", "0.720912", "0.71805155", "0.7159257", "0.7134959", "0.7131121", "0.71307015", "0.71000725", "0.708024", "0.70703435", "0.70703435", "0.7048745", "0.70460874", "0.70176613", "0.70145506", "0.68871504", "0.687362", "0.68727964", "0.6866406", "0.68369436", "0.6804...
0.7270294
0
SCOReportSessionTime is called automatically by this script, but you may call it at any time also from the SCO
function SCOReportSessionTime() { var dtm = new Date(); var n = dtm.getTime() - g_dtmInitialized.getTime(); return SCOSetValue("cmi.core.session_time",MillisecondsToCMIDuration(n)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetSessionTime ()\n{\n\t\tvar d = new Date();\n\t\tCurrentTime = d.getTime();\n\t\t\n\t\tvar TimeElapsed = CurrentTime - StartSessionTime;\n\t\n\t\tvar StrTime = GetEllapsedTime(TimeElapsed/1000);\n\t\t\n\t\t// on set la value\n\t\tSetValue(\"cmi.core.session_time\",StrTime);\n\t\t\n\t\t//on commit\n\t\tc...
[ "0.6061847", "0.58281416", "0.56970316", "0.5672365", "0.56320417", "0.5580629", "0.5559797", "0.55471635", "0.54890645", "0.54686767", "0.5464839", "0.54293936", "0.5345149", "0.52717006", "0.5235166", "0.52236515", "0.5218874", "0.52059436", "0.5194426", "0.5147734", "0.513...
0.8244346
0
Since only the designer of a SCO knows what completed means, another script of the SCO may call this function to set completed status. The function checks that the SCO is not in browse mode, and avoids clobbering a "passed" or "failed" status since they imply "completed".
function SCOSetStatusCompleted(){ var stat = SCOGetValue("cmi.core.lesson_status"); if (SCOGetValue("cmi.core.lesson_mode") != "browse"){ if ((stat!="completed") && (stat != "passed") && (stat != "failed")){ return SCOSetValue("cmi.core.lesson_status","completed") } } else return "false" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCompletionStatus(sCompletion) {\n\t/* see if this SCORM 2004 */\n\tif (_sAPI == \"API_1484_11\") {\n\t\t/* it is SCORM 2004, set the completion status */\n\t\tscormSetValue(\"cmi.completion_status\", sCompletion+\"\");\n\t} else if (_sAPI == \"API\") {\n\t\t/* it is SCORM 1.2, see if this is a valid co...
[ "0.7154885", "0.68384767", "0.6579134", "0.6438089", "0.62755007", "0.62192756", "0.6177075", "0.61698234", "0.60777056", "0.6018129", "0.59799385", "0.5977269", "0.5961915", "0.59347194", "0.590971", "0.5909641", "0.5867837", "0.5841314", "0.58149695", "0.57690865", "0.57679...
0.7987068
0
name, listenPort, messageQueue, bindCallBack, messageReceiveCallBack,closeCallback,errorCallback
function Listener(name, port) { this.Name = name; this.Port = port; this.MessageQueue = new MessageQueue(name); this.Listener = new MessageServer(name, port, this.MessageQueue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connect(okCallback,errorCallback)\n {\n this.connectOKCallback=okCallback;\n this.connectErrorCallback=errorCallback;\n this.inConnectWait=true;\n \n this.queue=[];\n \n // now connect\n \n this.socket=new WebSocket('ws://'+this.core.setup.m...
[ "0.64779353", "0.6445823", "0.624896", "0.6246915", "0.61970603", "0.6036702", "0.60244244", "0.6003863", "0.598651", "0.5985685", "0.595042", "0.59305775", "0.5907047", "0.5894359", "0.5894359", "0.58852464", "0.58408844", "0.58387613", "0.58148694", "0.5801349", "0.5798769"...
0.654539
0
Insert a new task record into the table.
function insertTask(text) { return taskTable.insert({ taskname: text, created: new Date(), completed: false }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertTask() {\n const t = tasks.pop()\n\n if(t){\n heading('Creating Task ' + t._id)\n request(\n new Options('/tasks/' + t._id), \n JSON.stringify(t),\n insertTask,\n 200\n )\n } else finishHandler()\n}", "insertTask() {\n co...
[ "0.75503075", "0.69639397", "0.6777903", "0.6585963", "0.6579625", "0.6469229", "0.64235234", "0.63547283", "0.63313216", "0.63294184", "0.63041836", "0.62780935", "0.6205121", "0.61935794", "0.6170771", "0.61124754", "0.60744977", "0.6060063", "0.60121673", "0.5945447", "0.5...
0.74156594
1
Delete the record with a given ID.
function deleteRecord(id) { taskTable.get(id).deleteRecord(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRecord(id) {\n\t\ttaskTable.get(id).deleteRecord();\n\t}", "function deleteID(id){\n\t\n\tdb.transaction(function(tx) {\n\t\ttx.executeSql(\"DELETE FROM contactsTable WHERE ID = \"+id,\n\t\t\t[],\n\t\t\tfunction(trans, result) {\n\t\t\t\t//alert(\"contact: \"+id+\" has been deleted\");\n\t\t\t},\...
[ "0.7855261", "0.73186964", "0.72440773", "0.71014965", "0.70486176", "0.70328903", "0.7027043", "0.6904495", "0.6873295", "0.68667454", "0.68607175", "0.68557996", "0.6841792", "0.68417555", "0.6835212", "0.6835212", "0.6835212", "0.6804012", "0.680032", "0.6799869", "0.67873...
0.7853458
1
returns a random index for a response array given its length
static getRandomIndexOfArray(length){ var result=Math.floor(Math.random()*Number(length)); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomIndex(lengthOfGivenArray){\n return Math.round((Math.random() * (lengthOfGivenArray.length)));\n}", "function getRandomIndex(len) {\r\n return Math.floor(Math.random() * len);\r\n}", "function randomIndex (arrayLength) {\n let indexNum = Math.floor(Math.random() * arrayLength);\n retur...
[ "0.7612984", "0.74514014", "0.7420273", "0.7413447", "0.73282284", "0.73014444", "0.72293085", "0.7220415", "0.7188734", "0.7176243", "0.7176243", "0.7176243", "0.7176243", "0.70805764", "0.70751786", "0.70709604", "0.7028442", "0.6966865", "0.69233865", "0.68999326", "0.6776...
0.7500844
1
Check for if an element exists
function exists (elem) { return (elem != null && (elem.length >= 0 || elem.innerHTML.length >= 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get elementExists() {\n\t\treturn !(this.element === null)\n\t}", "function exists(elem) {\n return elem != null && (elem.length >= 0 || elem.innerHTML.length >= 0);\n }", "function exists(elem) {\n return elem != null && (elem.length >= 0 || elem.innerHTML.length >= 0);\n }", "function exists(elem) ...
[ "0.8007434", "0.75939244", "0.75939244", "0.75939244", "0.75838804", "0.74484074", "0.73705935", "0.733391", "0.71081984", "0.7043193", "0.6929121", "0.6894232", "0.6798516", "0.6791833", "0.6791833", "0.6791833", "0.6791833", "0.6791833", "0.6791833", "0.6791833", "0.6791833...
0.77786756
1
Funzione typeToUrl, converte il tipo di ricerca (stringa) nell'url corretto da utilizzare
function typeToUrl(type) { if (type == "movie") { return urlMovies; } else if (type == "tv") { return urlTV; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeUrl(type, channel) {\n return \"https://wind-bow.gomix.me/twitch-api/\" + type + \"/\" + channel + '?callback=?';\n }", "buildURL(type) {\n return this._super(type);\n }", "function buildURL(url, ip, port, type) {\n var returnURL = 'http://'\n if (type == 'OSB') {\n ...
[ "0.6659657", "0.6592236", "0.6248795", "0.62204343", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.61359453", "0.6133489", "0.6102777", "0.6091937", "0...
0.8056154
0
Funzione getCast, che ricerca la lista del cast in base all'id del film/serie
function getCast(id, type) { // Definisco l'url della chiamata, in base all'id var castUrl = "https://api.themoviedb.org/3/" + type + "/" + id + "/credits"; $.ajax( { // Ottengo l'url corretto in base al tipo di ricerca "url": castUrl, "method": "GET", "data": { /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnCast(id, $) {\n const cast = [];\n $ul = $(`#${id}`).parent().next();\n $ul.find(\"li\").each(function (i, ele) {\n $ele = $(ele);\n const actorData = $ele.text().trim();\n const nameStr = actorData.split(\" – \")[0];\n const desc = actorData.split(\" – \")[1].replace(/\\[.*\\]/g, \"\...
[ "0.6900713", "0.65126204", "0.61574876", "0.6122338", "0.60966265", "0.6031865", "0.60231006", "0.59601843", "0.592032", "0.587867", "0.57965", "0.571831", "0.5686672", "0.56056535", "0.56029344", "0.54892445", "0.5412982", "0.5350352", "0.53225404", "0.5300783", "0.52940273"...
0.7430408
0
function that handles the submission of a new store
function handleNewStoreSubmit (event) { console.log(event.target.storeName.value); //for debugging purposes event.preventDefault(); //prevents default browser behaviour //variables below grab the form values for later use var newStoreName = event.target.storeName.value; var minimumCustomerNumber = parseFloat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleStoreSubmit(event) {\n var tableBodyEl = document.getElementById('table-body');\n\n event.preventDefault(event);\n\n var storeName = event.target.storename.value;\n var maxCust = event.target.maxcust.value;\n var avgSale = event.target.avgcook.value;\n var minCust = event.target.mincust.value;...
[ "0.6956802", "0.69153476", "0.6900108", "0.67656374", "0.6730162", "0.65712917", "0.6547918", "0.65232664", "0.64903563", "0.64738435", "0.6461614", "0.64464647", "0.6443033", "0.641759", "0.64124286", "0.6375585", "0.6321812", "0.6321812", "0.62847084", "0.6280702", "0.62725...
0.7264335
0
find a single vendor with id
findOne (req, res) { res.json({ message: `find one vendor with id ${req.params.id}` }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findById(id, cb) {\r\n getProductsFromFile(products => {\r\n const product = products.find(p => p.id === id);\r\n cb(product);\r\n });\r\n }", "function pwxdevicefindVendor(vendor_name) {\n\tvar found_vendor = -1;\n\t//spin through the vendor array. The vendor name ...
[ "0.65079564", "0.64368564", "0.6401826", "0.6306381", "0.62044305", "0.6202411", "0.6177292", "0.6094446", "0.60639864", "0.60439867", "0.60253036", "0.6016919", "0.59910136", "0.59903884", "0.5981331", "0.59795475", "0.5858891", "0.58309364", "0.582076", "0.58153933", "0.581...
0.7269576
0
create and save a new vendor
create (req, res) { res.json({ message: 'create a new vendor' }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addTestVendor() {\n return new Promise((resolve, reject) => {\n let testVendor = new Vendor(TestHelper.getTestVendor());\n\n testVendor.save((err, vendor) => {\n if (err) {\n return reject(err);\n } else {\n res...
[ "0.68557394", "0.68257034", "0.6718269", "0.62785685", "0.61017996", "0.57574064", "0.57523775", "0.5673987", "0.56661206", "0.5645249", "0.5643558", "0.560163", "0.5503646", "0.5350453", "0.53503597", "0.5314151", "0.52856255", "0.52426517", "0.5209632", "0.5181545", "0.5158...
0.7043029
0
update a vendor identified by id in the request
update (req, res) { res.json({ message: `update vendor with id ${req.params.id}` }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async update({ request, params: { id } }) {\n const product = await Product.find(id)\n\n if (product) {\n const { name, description, qty } = request.post()\n product.name = name\n product.description = description\n product.qty = qty\n\n await product.save()\n\n return {\n ...
[ "0.65069884", "0.6123547", "0.6075126", "0.6074459", "0.59778535", "0.59737056", "0.594845", "0.5946593", "0.5926694", "0.58772665", "0.58625406", "0.5854943", "0.5852773", "0.5845453", "0.5845414", "0.5814495", "0.58142316", "0.5801486", "0.5801486", "0.5801486", "0.57992107...
0.8022802
0
delete a vendor with the specified id in the request
delete (req, res) { res.json({ message: `delete vendor with id ${req.params.id}` }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _delete(id) {\n return axios.delete('/driver/id/' + id).then(handleResponse);;\n}", "async destroy ({ request, response, params: { id } }) {\n\n const customer = request.post().customer\n\n await customer.delete()\n\n response.status(200).json({\n message: 'Succssfuly deleted this custo...
[ "0.6918662", "0.68474704", "0.66614485", "0.6543471", "0.6536951", "0.64907104", "0.6481616", "0.6413699", "0.6406948", "0.6403703", "0.6403464", "0.63919747", "0.63774204", "0.63709784", "0.6348696", "0.6344837", "0.6322004", "0.63089466", "0.62797636", "0.62607783", "0.6260...
0.8076285
0
This function is used for populating the gUserConfiguration object from elements inside the form passed to it.
function updateInMemoryConfigurationFromFormObject(form) { var formData = form.serializeArray(); $.each(formData, function() { var nameArray = this.name.split("-"); if (nameArray.length == 1) { gUserConfiguration.addConfigMetaInformation(this.name, this.value); } else if (nameArra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateFormDisplay(formConfiguration){\n\t\t// go through the configuration objects and create as required\n\t\tfor(let fieldRow in formConfiguration){\n\n\t\t\tlet currentFieldRowConfig = formConfiguration[fieldRow];\n\t\t\tlet documentField = fieldRow;\n\t\t\tlet currentValue = currentFieldRowConfig['value'];\n...
[ "0.6114276", "0.6088945", "0.59777915", "0.5954457", "0.59380394", "0.5917993", "0.59156364", "0.5797177", "0.57583183", "0.57105947", "0.5696275", "0.5635895", "0.5610258", "0.5603743", "0.5588788", "0.5582803", "0.5579367", "0.5514676", "0.5500205", "0.54609925", "0.5459935...
0.63456273
0
Get response HTTP status.
get httpStatus () { return this._rawResponse.status }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getStatus() {\n const res = await c(baseStatus + 'check').send()\n const json = await res.json();\n \n if (json) {\n\t\t\treturn json;\n\t\t} else throw new Error(res.statusCode);\n }", "get status () {\n if (this.isTimedOut()) {\n return 0\n }\n return this.req...
[ "0.71467876", "0.7091041", "0.6658925", "0.6584073", "0.6534698", "0.6469275", "0.6442194", "0.64334095", "0.6407693", "0.63536555", "0.62614053", "0.6238366", "0.6234537", "0.6226752", "0.6218531", "0.6204567", "0.6193165", "0.61539876", "0.61245817", "0.6122625", "0.6109798...
0.79857373
0
hangman 1 _______ 2 |/ | 3 | 4 | 5 | 6 | 7 | 8__|___ 0 _______ 1 |/ | 2 | (_)3 3 | \|/2 4 | | 1 5 | / \0 6 | 7___|___
function printHangman(count) { // var hangMan=[" _______\n"," |/ |\n"," | \n"," | \n"," | \n"," | \n", // " | \n","__|___\n"]; // USE FUNCTION AFTER. // var man = ""; // var head = " ( ) \n"; // var arms = " \\|/\n"; // var belly = " |\n"; // var legs = " / \\"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hangman(round) {\n var hangman = [\n `\n +---+\n |\n |\n |\n |\n |\n=========\n`, `\n +---+\n | |\n |\n |\n |\n |\n=========\n`, `\n +---+\n | |\n O |\n |\n |\n |\n=========\n`, `\n +---+\n | |\n O |\n | |\n |...
[ "0.68657774", "0.634366", "0.6237302", "0.61376053", "0.6109523", "0.58278483", "0.57549816", "0.57542515", "0.57463294", "0.5742197", "0.57365185", "0.5733226", "0.5726446", "0.5678219", "0.5668966", "0.56411767", "0.5563011", "0.5546916", "0.5543568", "0.55280083", "0.55149...
0.66817766
1
returns an empty array if there is no note in the database or no note matches the search query
async readAll(query = "") { if (query !== "") { const notes = await Note.find().or([{title: query}, {text: query}]); return notes; } const notes = await Note.find({}); return notes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchNotes() {\n showContent(\"allNotes\");\n\n var search = document.getElementById(\"searchInput\").value.toLowerCase();\n var storage = window.localStorage;\n var savedNote;\n clearBody();\n for (var note in storage) {\n if (note.slice(0, 10) == \"stickyNote\") {\n savedNote = JSON.parse...
[ "0.6384775", "0.62614524", "0.61278445", "0.6114132", "0.6112655", "0.6017675", "0.58953327", "0.5892241", "0.5872158", "0.58101684", "0.57697463", "0.56287193", "0.561935", "0.55887556", "0.5585598", "0.5570492", "0.55519396", "0.5544342", "0.5537161", "0.55247295", "0.55125...
0.6552824
0
2 UZDUOTIS parasyti fja "getVardasPavarde()", kuri turi "return" zodeli ir grazina varda ir pavarde i iskveitimo vieta. fjoje sukurti kintamaji "pavarde" Tomauskas, "vardas" Antanas patikrinti ar veikia fja
function getVardasPavarde(){ var pavarde = "Tomauskas"; var vardas = "Antanas"; return vardas }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVardasPavarde() {\nvar pavarde = 'Lekavicius' ;\nvar vardas = 'Egidijus' ;\n return (vardas + \" \" + pavarde);\n\n}", "function getVardas() {\nvar vardas= \"Tomas\";\nreturn vardas;\n}", "function printVardasPavardeAmzius() {\n console.log( \"=== Vardas: \", vardas, \" pavarde: \", pavarde,...
[ "0.77554286", "0.7026477", "0.6955124", "0.6933825", "0.67183155", "0.6677148", "0.66553295", "0.6588211", "0.65462554", "0.6537514", "0.6510302", "0.649213", "0.6428138", "0.6148697", "0.60952556", "0.60686827", "0.60516226", "0.60458755", "0.6044463", "0.6026211", "0.601846...
0.74936175
1
3.2 UZDUOTIS A) parasyti fja "getPelnas(pajamos, nuostoliai)", kuri turi "return" zodeli ir grazina apskaiciuota pelna B) fjoje apskaiciuoti pelna ( pvz: pelnas = pajamos nuostoliai) C) patikrinti ar veikia fja
function getPelnas(pajamos, nuostoliai){ var pelnas = pajamos - nuostoliai; return pelnas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPelnas22(pajamos, nuostoliai) {\n return pajamos - nuostoliai;\n}", "function pavadinimasAtspausdintiPirmininka() {\nconsole.log(pirmininkas);\n}", "function procesiraj_potezo(poteza) {\n if(glavna_igralna_plosca.na_potezi.clovek){ // Namig\n var...
[ "0.68613094", "0.6765746", "0.6706316", "0.6553657", "0.6387235", "0.6374829", "0.6360839", "0.632979", "0.6300391", "0.62904596", "0.6288901", "0.6228528", "0.6193464", "0.6183981", "0.6179794", "0.6177497", "0.6119289", "0.61189574", "0.61164445", "0.60953933", "0.6088696",...
0.7008789
0
clean all scans from DB
function _cleanAllScansFromDB() { SpecialBle.cleanScansDB(); _getContactsScans(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _cleanAllDevicesFromDB() {\n SpecialBle.cleanDevicesDB();\n _getAllDevicesFromDB();\n }", "function glomeCleanAds()\n{\n q = 'DELETE FROM ads';\n log.debug(q);\n var statement = db.createStatement(q);\n statement.execute();\n statement.reset();\n}", "clean() {\r\n this.val...
[ "0.7027587", "0.68617177", "0.65759367", "0.6445352", "0.62955254", "0.62786263", "0.6230411", "0.6188434", "0.6141923", "0.61357766", "0.61256033", "0.6124393", "0.61115587", "0.6085677", "0.60837", "0.60650843", "0.6051571", "0.60403913", "0.59971327", "0.59525365", "0.5868...
0.78766614
0
exports and shares all scans to csv
function _exportAllScansToCsv() { SpecialBle.exportAllScansCsv(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _exportScansByKeyAsCsv() {\n SpecialBle.exportScansByKeyAsCSV(pubKey);\t\n }", "exportCSV() {\n let csvContent = `data:text/csv;charset=utf-8,Page,Edits,Editors,Views${this.shouldShowMobile() ? ',Mobile %' : ''}\\n`;\n\n this.pageData.forEach(entry => {\n if (this.excludes.includes(...
[ "0.6608245", "0.64180505", "0.6326102", "0.6129065", "0.5989807", "0.59828144", "0.5959668", "0.5942209", "0.59282875", "0.59251153", "0.59248", "0.59077466", "0.5889839", "0.5864663", "0.5841514", "0.58413225", "0.5821035", "0.58178306", "0.5790636", "0.576141", "0.5706141",...
0.72823733
0
this custom method will trigger when the submit button is clicked. it will check the inputs for errors and then initiate the create guest method to actually create the guest.
processGuestForm(event) { // Prevent default action. in this case, action is the form submission event. event.preventDefault(); // do basic front-end checks to make sure form was filled out correctly const newGuest = this.state.newGuest; newGuest.eventId = this.props.activeEvent._id; //create t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_create() {\n if ($(\"#input-form\").valid() == true) {\n $(\"#input-form\").submit();\n }\n}", "function signUpInit()\n{\n checkEmailInputs();\n\n checkPassInputs();\n\n checkNameInput();\n\n GEBID(\"btnSubmit\").addEventListener(\"click\",() => \n {\n if(fullVal...
[ "0.62847096", "0.6147163", "0.5990705", "0.5957701", "0.59542286", "0.5891386", "0.58432734", "0.5837891", "0.5802863", "0.5797633", "0.57931083", "0.5765417", "0.57572156", "0.57056516", "0.5690842", "0.56861955", "0.5683809", "0.5659627", "0.5656041", "0.5648182", "0.564488...
0.6776222
0
Converts hexidecimal string representation to a RIPEMD160 state vector. Input a string of 40 characters, all hexadecimal digits, output is an array of 5 integers.
function rmd160_vec(s, h) { if (!h) h = [0,0,0,0,0]; var digits = "0123456789abcdef0123456789ABCDEF"; for(var n = 0; n < 20; ++n) { h[n >> 2] |= ((digits.indexOf(s.charAt(2*n + 0))) << (4 + ((n&7)<<3))); h[n >> 2] |= ((digits.indexOf(s.charAt(2*n + 1))) << ((n&7)<<3)); } return h...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex_rmd160(s) { return rstr2hex(rstr_rmd160(str2rstr_utf8(s))); }", "function parseHex(str, expected_size) {\n if (!/^([0-9a-f]{2})+$/.test(str)) throw new Error('Invalid blinders (invalid hex)')\n if (str.length != expected_size*2) throw new Error('Invalid blinders (invalid length)')\n return new...
[ "0.62729317", "0.5903354", "0.5851115", "0.5671562", "0.56087923", "0.5525105", "0.55229235", "0.5519437", "0.5519437", "0.55099404", "0.55099404", "0.5478549", "0.5437534", "0.5381792", "0.53625286", "0.5334155", "0.53341234", "0.5314733", "0.5296578", "0.52817935", "0.52698...
0.68866986
0
Creates the message digest for a string (of length less than 2^32), starting with the optional state vector 'h_in' or the default start state.
function rmd160_digest(str, h_in) { var h = [0,0,0,0,0]; if (!h_in) h_in = rmd160_start_vec; for(var n = 0; n < 5; ++n) h[n] = h_in[n] & 0xffffffff; var len = str.length, pos = 0, X = []; while(pos + 64 <= len) { for(var n = 0; n < 64; ++n) X[n] = 0; for(var n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_hash(str) {\n\t\tvar rotate_left = function (n, s) {\n\t\t\tvar t4 = (n << s) | (n >>> (32 - s));\n\t\t\treturn t4;\n\t\t};\n\n\t\tvar cvt_hex = function (val) {\n\t\t\tvar str = '';\n\t\t\tvar i;\n\t\t\tvar v;\n\n\t\t\tfor (i = 7; i >= 0; i--) {\n\t\t\t\tv = (val >>> (i * 4)) & 0x0f;\n\t\t\t\tstr ...
[ "0.66210455", "0.63534683", "0.61674666", "0.608786", "0.60843766", "0.5993506", "0.5975046", "0.59097296", "0.58772266", "0.5760835", "0.57328933", "0.5693451", "0.56667507", "0.56384474", "0.5631511", "0.5630744", "0.5629712", "0.5627222", "0.5627222", "0.5619019", "0.56148...
0.6490383
1
Appendix: Endpoint to center arc conversion From rx ry xaxisrotation largearcflag sweepflag x y To aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation
function parseArcCommand( path, rx, ry, x_axis_rotation, large_arc_flag, sweep_flag, start, end ) { if (rx == 0 || ry == 0) { // draw a line if either of the radii == 0 path.lineTo(end.x, end.y); return; } x_axis_rotation = (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arc_transform(a_rh, a_rv, a_offsetrot, large_arc_flag, sweep_flag, endpoint, matrix, svgDOM)\n {\n function NEARZERO(B)\n {\n if (Math.abs(B) < 0.0000000000000001) return true;\n else return false;\n }\n\n var rh, rv, rot;\n\n var m = []; // matrix representation of transformed e...
[ "0.674821", "0.66739815", "0.6670117", "0.66473", "0.6636955", "0.65698636", "0.6557993", "0.6529739", "0.6529739", "0.6529739", "0.65212685", "0.65005213", "0.6491343", "0.64658993", "0.64607584", "0.6437052", "0.64361054", "0.6397672", "0.6387356", "0.63744146", "0.63544893...
0.679791
0
Clear sessions and range cache.
clearCache() { this.sessions = [] this.rangeCache.clear() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearCache(){\n\n\t\t\tsessionStorage.setItem( identifierKey, '' );\n\t\t\tcallback = null;\n\t\t\tcustomdata = {};\n\t\t\tsectionID = null;\n\t\t\tslideID = null;\n\n\t\t}", "function clearSession(){\n\t\t_clearLocalStorage();\n\t\tbackToIndex();\n\t}", "function clearCache() {\n\tObject.keys( window...
[ "0.72615355", "0.70151454", "0.69463104", "0.6928527", "0.67653036", "0.670921", "0.6687335", "0.6627914", "0.6627914", "0.6627914", "0.6627914", "0.6627914", "0.6627914", "0.6627914", "0.6627914", "0.6550358", "0.6534327", "0.650327", "0.650327", "0.650327", "0.64882183", ...
0.89368486
0
Builder object for EventInfo docLink structures
function DocLinkBuilder() { this.docLinks = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thisEvent(doc){\n //Make elements\n let eventDiv = document.createElement('div');\n let name = document.createElement('span');\n let date = document.createElement('span');\n let address = document.createElement('span');\n let signup = document.createElement('button');\n signup.setAttr...
[ "0.55275935", "0.5485127", "0.54046065", "0.5327334", "0.52965826", "0.52965826", "0.51359844", "0.5020907", "0.50091517", "0.4954222", "0.49425945", "0.49243987", "0.48834482", "0.48781815", "0.4855428", "0.4840476", "0.48382178", "0.4834911", "0.4827399", "0.48249224", "0.4...
0.68685323
0
Auditor for Androidspecific traces.
function AndroidAuditor(model) { Auditor.call(this, model); var helper = model.getOrCreateHelper(AndroidModelHelper); if (helper.apps.length || helper.surfaceFlinger) this.helper = helper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logAudits() {\n var funcArray = [\n loadTime,\n componentRerenders\n ];\n\n // run functions in funcArray, with printLine prior to each\n funcArray.forEach((eventsMethod) => {\n printLine();\n eventsMethod(data);\n });\n}", "function TraceAPI() {\n }", "trace() {\n\n }", "func...
[ "0.5373686", "0.5368583", "0.5269433", "0.5231263", "0.5121517", "0.5063536", "0.5057234", "0.50049156", "0.50049156", "0.49928296", "0.49880552", "0.49738312", "0.49449617", "0.49286717", "0.49216497", "0.49214533", "0.48924905", "0.4870444", "0.4831754", "0.4822756", "0.481...
0.6803422
0
validate_charge.js // validate_charge javascript required to validate a new charge javascript required to validate a new charge This class is currently used by the "Add Charge" popup
function VixenValidateChargeClass() { //------------------------------------------------------------------------// // _objChargeTypeData //------------------------------------------------------------------------// /** * _objChargeTypeData * * Stores data relating to each unarchived Charge Type from the databa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateDonate() {\n\t\t// Add method to handle postal code and zip code validation\n\t\tjQuery.validator.addMethod('zipcode', function(value) {\n\t\t return /\\b[0-9]{5}(?:-[0-9]{4})?\\b/.test(value);\n\t\t}, 'Please enter a valid US zip code.');\n\n\t\tjQuery.validator.addMethod('postalcode', function(...
[ "0.6535235", "0.64168096", "0.6212038", "0.6184038", "0.61423016", "0.60977733", "0.6077157", "0.5992205", "0.5944989", "0.5934461", "0.58953357", "0.58920634", "0.5887605", "0.5881852", "0.5875673", "0.5805948", "0.57874125", "0.57670546", "0.57633996", "0.5762709", "0.57605...
0.69657445
0
display coordinates of the polygon on the web page
function showCoordinates(str) { var vertices = poly.getPath(); str=''; for (var i =0; i < vertices.getLength(); i++) { var xy = vertices.getAt(i); str += xy.lat() + ',' + xy.lng() + '\n'; } return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_polygon(poly, points) {\n\t var res = \"\";\n\t for (var i=0; i<points.length; i++) {\n\t\tif (i>0) res = res + \" \";\n\t\tres = res + (screenheight*points[i][0]+padding).toFixed(1) + \",\"\n\t\t + (screenheight*(1-points[i][1])+padding).toFixed(1);\n\t }\n\t poly.setAttribute(\"point...
[ "0.689958", "0.6672431", "0.64166653", "0.6258246", "0.6229277", "0.6184717", "0.6179031", "0.61299974", "0.60686606", "0.6067124", "0.6060372", "0.6045426", "0.6017442", "0.6006402", "0.599819", "0.59475845", "0.59369314", "0.592695", "0.59171593", "0.5905305", "0.5889886", ...
0.6925741
0
TestsRoot.js: accept data from ajax, and pass it on Project: STS Specialised Test Setter
function TestsRoot(parent, data) { this.launch = parent; this.$divBoard = $("#" + data.html.divBoard); this.whiteBoard = new WhiteBoard(this); this.$divMenu = $("#" + data.html.divMenu); this.$divMenu.empty(); this.$divForm = $("#" + data.html.divForm); this.$divForm.empty(); this.idLogged = data.logged.idLogg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AjaxTest(name)\n{\n TestCase.call( this, name );\n}", "populateTests() {\n this.tests = JSON.parse(localStorage.getItem(this.userSvc.getUserEmail()));\n }", "function testinit(name, assert) {\n $('#wait .msg').html(\"Obtaining document data (for test \" + name + \")\");\n $('#wait')...
[ "0.6174793", "0.61638784", "0.5835947", "0.5772779", "0.5649169", "0.558392", "0.5561269", "0.5531088", "0.5522658", "0.55077857", "0.5463232", "0.5438786", "0.54362094", "0.54148656", "0.54127586", "0.5403447", "0.5396769", "0.5390903", "0.53872806", "0.5365483", "0.5355124"...
0.61820006
0
Add dismiss button to watchlistmessage Description: Hide the watchlist message for one week. Maintainers: [[wikipedia:User:Ruud Koot|Ruud Koot]]
function addDismissButton() { var watchlistMessage = document.getElementById("watchlist-message"); if ( watchlistMessage == null ) return; var watchlistCookieID = watchlistMessage.className.replace(/cookie\-ID\_/ig,''); if ( document.cookie.indexOf( "hidewatchlistmessage-" + watchlistCookieID + "=yes"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hiddenNotify(close_btn_selector){\n $(close_btn_selector).on('click', function(){\n $(this).parent().css({'display':'none'});\n }) \n }", "function removeNotification(){\n\tdocument.getElementById(\"notification\").style.display =\"none\";\n}", "function removeNotificati...
[ "0.6107424", "0.5951316", "0.59442115", "0.5860362", "0.58055776", "0.57872504", "0.5760461", "0.5760461", "0.5760461", "0.57459545", "0.57416946", "0.57393146", "0.5734319", "0.5719177", "0.57027096", "0.56746703", "0.56508434", "0.5616933", "0.5604889", "0.55934286", "0.559...
0.7807237
0
Sysop Javascript Description: Allows for sysopspecific Javascript at [[MediaWiki:Sysop.js]]. Created by: [[wikipedia:User:^demon]]
function sysopFunctions() { if ( wgUserGroups && !window.disableSysopJS ) { for ( var g = 0; g < wgUserGroups.length; ++g ) { if ( wgUserGroups[g] == "sysop" ) { importScript( "MediaWiki:Sysop.js" ); break; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMsgFromSys(msg) {\n $.scojs_message(msg, $.scojs_message.TYPE_OK);\n}", "hasSysopAccess() {\n\t\tif (this.isSysop && Config.backdoor || Config.special.includes(this.userid)) {\n\t\t\t// This is the Pokemon Showdown system operator backdoor.\n\n\t\t\t// Its main purpose is for situations where some...
[ "0.6058858", "0.5899917", "0.5711481", "0.5168154", "0.5164463", "0.515343", "0.50696695", "0.50661516", "0.5025738", "0.50243586", "0.50105214", "0.5009148", "0.4992643", "0.49878895", "0.4981572", "0.49791723", "0.49788556", "0.49457166", "0.4939136", "0.49251193", "0.49133...
0.7486965
0
Correctly handle PNG transparency in Internet Explorer 6. Updated 18Jan2006. Adapted for Wikipedia by Remember_the_dot and Edokter. states "This page contains more information for the curious or those who wish to amend the script for special needs", which I take as permission to modify or adapt this script freely. I re...
function PngFix() { try { if (!document.body.filters) { window.PngFixDisabled = true } } catch (e) { window.PngFixDisabled = true } if (!window.PngFixDisabled) { var documentImages = document.images var documentCreateElement = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IEpngFix() {\n\t\tif ($.browser.msie) {\n\t\t\tvar transparentImage = \"i/transparent.gif\";\n\t\t\t\n\t\t\toImg = $(\"img[src$=.png]\");\n\t\t\tlImg = $(\"img[src$=.png]\").length;\n\t\t\t\n\t\t\tfor (i = 0; i < lImg; i++) {\n\t\t\t\tsrcImg = $(oImg[i]).attr(\"src\");\n\t\t\t\t$(oImg[i]).attr({src: trans...
[ "0.7930162", "0.7340205", "0.73035336", "0.6844822", "0.66648245", "0.6274972", "0.6196168", "0.6129063", "0.6105156", "0.59136444", "0.57670337", "0.575252", "0.5550718", "0.553761", "0.54687244", "0.5420064", "0.5418193", "0.5403383", "0.5385886", "0.5370747", "0.53188896",...
0.73562735
1
Note: only board can set problems right now
setProblem() { // change this to position !!!!! if (board[config.current].hasOwnProperty(this.props.owner)) { if (this.data.Session === undefined) { this.data.Session = []; } var sess = this.props.qrt + '/' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initInvalidBoard() {\n\t\t//fill out a square\n\t\tlet squaresTopLeftCorners = [[0, 0], [0, 6], [6, 0], [6, 6]];\n\n\t\tfor (let corner of squaresTopLeftCorners) {\n\t\t\tlet row = corner[0];\n\t\t\tlet col = corner[1];\n\n\t\t\tfor (let i = 0; i < 3; i++) {\n\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\tthis.m...
[ "0.6403782", "0.63299626", "0.6288251", "0.6269149", "0.6186196", "0.61761135", "0.61443174", "0.6122147", "0.6097739", "0.60894096", "0.5983455", "0.5961988", "0.5960941", "0.59323", "0.59116817", "0.5907454", "0.58965456", "0.58628327", "0.58544976", "0.58427364", "0.582289...
0.640476
0
============================================= Funcion para actualizar una fila en la tabla ascensor_valores_foso ==============================================
function updateItemsAscensorValoresFoso(cod_inspector,k_codinspeccion,cod_item, calificacion,seleccion,observacion) { var parametros = {"inspector" : cod_inspector, "inspeccion" : k_codinspeccion, "cod_item" : cod_item, "calificacion" : calificacion, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actualizarFila(table,i,rowCount){\n\tfor (var j=i; j<rowCount-1; j++){\n\t\tvar num_piezas = table.rows[j+1].cells[5].childNodes[0].value;\n\t\ttable.rows[j+1].deleteCell(5);\t\n\t\t\n\t\tvar td_precio = table.rows[j+1].insertCell(5);\n\t\ttd_precio.setAttribute(\"style\",\"text-align:center\");\n\t\ttd_p...
[ "0.60728574", "0.59635335", "0.5745888", "0.56796366", "0.56699044", "0.557667", "0.55651677", "0.55425596", "0.5496047", "0.5464461", "0.5435045", "0.5430646", "0.5285552", "0.52693874", "0.5252458", "0.52466965", "0.52444196", "0.52346003", "0.52189523", "0.52164763", "0.52...
0.6109843
0
============================================= Funcion para actualizar una fila en la tabla auditoria_inspecciones_ascensores ==============================================
function updateItemsAuditoriaInspeccionesAscensores(cod_inspector,cod_inspeccion,consecutivo_insp,cantidad_nocumple,cantidad_items_leve,cantidad_items_grave,cantidad_items_muygrave,o_actualizar_inspeccion) { var estado_revision; if (cantidad_nocumple > 0) { estado_revision = "Si"; }else{ estado_revision =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateItemsAuditoriaInspeccionesAscensores(estado,cod_cliente,cod_informe, cod_inspeccion,codigo_inspector,k_codusuario_modifica) {\n //alert(\"update->\"+cod_inspeccion);\n //alert(estado+\" \"+cod_cliente+\" \"+cod_informe+\" \"+cod_inspeccion);\n db.transaction(function (tx) {\n var query = \"UPD...
[ "0.62670326", "0.5937442", "0.57125175", "0.5682203", "0.56653434", "0.5605623", "0.55433077", "0.55174214", "0.54459435", "0.54214436", "0.52648395", "0.5179325", "0.514616", "0.51130277", "0.5103323", "0.50911963", "0.5087366", "0.5068268", "0.5056995", "0.50547403", "0.503...
0.61500484
1
Copies config example in to the working directory of a project
function init() { const example = path.resolve(__dirname, '../config-examples/main.config.js'); const newConfigFilename = path.join(process.cwd(), DEFAULT_CONFIG_FILENAME); fs.copyFileSync(example, newConfigFilename, fs.constants.COPYFILE_EXCL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "config() {\n this.fs.copyTpl(\n this.templatePath('_package.json'),\n this.destinationPath('package.json'), \n {\n props: this.props\n }\n );\n this.fs.copy(\n this.templatePath('_webpack....
[ "0.66614217", "0.6204918", "0.61904067", "0.6032746", "0.6022477", "0.6012887", "0.5975785", "0.5803773", "0.5772611", "0.56842196", "0.56750363", "0.5619195", "0.5556762", "0.5534517", "0.5532374", "0.5506192", "0.54974097", "0.5461325", "0.5459589", "0.5458148", "0.5440785"...
0.7409521
0
Sends data to a serial port.
function sendToSerial(data) { console.log("Sending to serial : " + data + "."); myPort.write(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendToSerial(data) {\n console.log(\"sending to serial: \" + data);\n port.write(data);\n}", "function sendData() {\n // convert the value to an ASCII string before sending it:\n console.log('Sending ' + input + ' out the serial port');\n myPort.write(input.toString());\n ...
[ "0.85924584", "0.8145121", "0.75173783", "0.7279193", "0.70987004", "0.70829904", "0.702989", "0.69146603", "0.6848244", "0.6403878", "0.6331858", "0.63314563", "0.6318448", "0.6280133", "0.62526125", "0.6197545", "0.619495", "0.6164763", "0.61482626", "0.60964257", "0.608680...
0.8354574
1
Using localStorage to access saved information Updates right table with newer prices, and left table with previous prices
async function load_storage_Portfolio() { if (localStorage.length !== 0) { var stocks = localStorage.getItem('myPortfolio'); stocks = JSON.parse(stocks); var total_value = 0; total_value_old = 0; for (var i=0; i<stocks.length; i++) { var url = urlForProfile(stocks[i].symbol); // Left t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveVotesToLS(){\n\n if(!localStorage.getItem('bag votes')){\n for(let i=0; i<chartVotes.length;i++){\n localStorage.setItem(`${chartLables[i]} votes`,chartVotes[i]);\n newVotesForDisplay.push(chartVotes[i]);\n } \n //console.log('first time')\n \n ...
[ "0.6622008", "0.6569738", "0.6416876", "0.6296487", "0.6254881", "0.6252749", "0.6242275", "0.6233957", "0.6216589", "0.61571276", "0.61446464", "0.61234224", "0.6122239", "0.60966647", "0.60966647", "0.6056995", "0.6053123", "0.60283625", "0.60229975", "0.6015678", "0.599452...
0.6814147
0
Returns newest price for a given stock
async function get_price(url, stock_name) { let response = await fetch(url); if (response.status == 200) { let json = await response.json(); let stock_data_price = await json.quote.latestPrice; return stock_data_price; } throw new Error(response.status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLatestStockPrice(symbol) {\r\n var request = require(\"sync-request\");\r\n var res = request(\"GET\", \"http://18.219.170.38/portfolio/stock/\" + symbol);\r\n var hold = JSON.parse(res.getBody(\"utf8\"));\r\n //console.log(hold.latestPrice);\r\n return hold.latestPrice;\r\n}", "function getPric...
[ "0.7310812", "0.6445052", "0.61709356", "0.60749596", "0.60189325", "0.59514767", "0.5950231", "0.5888596", "0.5782386", "0.57488376", "0.57269603", "0.5724928", "0.57153785", "0.5703341", "0.5698944", "0.5690422", "0.568831", "0.5687953", "0.5681299", "0.5652865", "0.5650862...
0.6526725
1
Clear Portfolio button function
function clearStorage_btn() { localStorage.removeItem('myPortfolio'); document.querySelector("#portfolio_last_visit").innerHTML = ` <p>Your portfolio has been cleared.</p> `; document.querySelector("#portfolio").innerHTML = ` <p>Your portfolio has been cleared.</p> `; document.querySelector("#changes"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetPortfolio() {\n $(\"#home\").on(\"click\", function(event) {\n landingAnimation();\n $(\".about-page, .portfolio-page, .current-skillset, .contact-info\").hide();\n });\n }", "function clearBet(){$(\"#btn-clear\").click();}", "function fundRecentClearData() {\n $('.formInpu...
[ "0.6747667", "0.6723447", "0.6662146", "0.6500743", "0.648723", "0.6480374", "0.6479475", "0.6475097", "0.6470609", "0.6459607", "0.64355356", "0.64304715", "0.6381356", "0.63162977", "0.63010705", "0.6231749", "0.6221966", "0.6215568", "0.6210629", "0.6204887", "0.6203842", ...
0.717024
0
checkNode() Check node slots
checkNode(){ this.noFreeSlots = true; this._NetworkRequests.getUnlockedInfo(this.harvestingNode).then((data) => { if (data["max-unlocked"] === data["num-unlocked"]) { this.noFreeSlots = true; } else { this.noFree...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testSlots(node, p) {\n if ((!isCompact(node)) && node.slots) {\n // x coordinate within range\n if (p.x < node.bounds.x + viewProperties.slotWidth*viewProperties.zoomFactor) {\n for (var slotIndex = 0; slotIndex < node.slotIndexes.length; slotIndex++) {\n if (get...
[ "0.6307627", "0.58164734", "0.57422704", "0.5645926", "0.5601221", "0.5566396", "0.5562691", "0.55154604", "0.5476608", "0.5470188", "0.5433823", "0.5428373", "0.5392087", "0.53811395", "0.5373877", "0.53603345", "0.5313621", "0.53135014", "0.52960116", "0.5272731", "0.525503...
0.7162841
0
updateFee() Update transaction fee
updateFee() { let entity = this._Transactions.prepareImportanceTransfer(this.common, this.formData); this.formData.fee = entity.fee; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetTotalFee() {\n \n var fee1 = ($('#mChanRuleObj_PAYMENT_FEE').val() != '') ? parseFloat($('#mChanRuleObj_PAYMENT_FEE').val()) : 0;// parseFloat($('#mChanRuleObj_PAYMENT_FEE').val());\n var fee2 = ($('#mChanRuleObj_REDEMPTION_FEE').val() != '') ? parseFloat($('#mChanRuleObj_REDEMPTION_F...
[ "0.61756146", "0.6075375", "0.59897614", "0.5969982", "0.59589255", "0.5926361", "0.5806665", "0.5798184", "0.5794238", "0.57471687", "0.57263404", "0.5700886", "0.56675684", "0.5665936", "0.56635225", "0.5600284", "0.55753386", "0.5552909", "0.5503107", "0.54938126", "0.5493...
0.80360186
0
updateRemoteAccount() Update the remote account public key
updateRemoteAccount() { if (this.customKey) { this.formData.remoteAccount = ''; } else { this.formData.remoteAccount = this._Wallet.currentAccount.child; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateEthAccount(){\r\n\tm_account = web3.eth.accounts[0];\r\n}", "function updateEthAccount(){\r\n\tm_account = web3.eth.accounts[0];\r\n}", "async updateAccount(){\n const accounts = await web3.eth.getAccounts();\n const account = accounts[0];\n this.currentAccount = account;\n }", ...
[ "0.53979784", "0.53979784", "0.535091", "0.52242225", "0.51461935", "0.5073447", "0.49918175", "0.49864566", "0.49507365", "0.49424046", "0.48912573", "0.4888079", "0.4865147", "0.4857041", "0.48422623", "0.47708136", "0.47700986", "0.47462055", "0.4729635", "0.47226095", "0....
0.72580177
0
revealDelegatedPrivateKey() Reveal the delegated private key
revealDelegatedPrivateKey() { // Decrypt/generate private key and check it. Returned private key is contained into this.commonDelegated if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonDelegated, this._Wallet.currentAccount, this._Wallet.algo, false)) { this._Alert.invalidPassword();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "marshalPrivKey () {\n if (this.privKey) {\n return cryptoKeys.marshalPrivateKey(this.privKey)\n }\n }", "marshalPrivKey () {\n if (this.privKey) {\n return crypto.keys.marshalPrivateKey(this.privKey)\n }\n }", "marshalPrivKey () {\n if (this.privKey) {\n return crypto.keys.marsh...
[ "0.56377405", "0.56070465", "0.56070465", "0.56070465", "0.56070465", "0.56010485", "0.56006277", "0.56006277", "0.56006277", "0.53884476", "0.5296489", "0.5219452", "0.51852316", "0.5146361", "0.5111746", "0.5078212", "0.50714415", "0.5065388", "0.5038018", "0.4967484", "0.4...
0.81848335
0
startDelegatedHarvesting() Start delegated harvesting, set chosen node in wallet service and local storage
startDelegatedHarvesting() { // Decrypt/generate private key and check it. Returned private key is contained into this.commonHarvesting if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonHarvesting, this._Wallet.currentAccount, this._Wallet.algo, false)) { this._Alert.invalidPassword();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stopDelegatedHarvesting() {\n // Decrypt/generate private key and check it. Returned private key is contained into this.commonHarvesting\n if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonHarvesting, this._Wallet.currentAccount, this._Wallet.algo, false)) {\n this._Alert.invalidPass...
[ "0.6405975", "0.5832314", "0.51486236", "0.5086524", "0.49049014", "0.4850479", "0.47549096", "0.4677317", "0.4669343", "0.46568257", "0.4650857", "0.4631172", "0.46095634", "0.45999545", "0.45559928", "0.45440212", "0.4525645", "0.45192942", "0.45069888", "0.44686538", "0.44...
0.75723755
0
stopDelegatedHarvesting() Stop delegated harvesting
stopDelegatedHarvesting() { // Decrypt/generate private key and check it. Returned private key is contained into this.commonHarvesting if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonHarvesting, this._Wallet.currentAccount, this._Wallet.algo, false)) { this._Alert.invalidPassword(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startDelegatedHarvesting() {\n // Decrypt/generate private key and check it. Returned private key is contained into this.commonHarvesting\n if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonHarvesting, this._Wallet.currentAccount, this._Wallet.algo, false)) {\n this._Alert.invalidPas...
[ "0.5931528", "0.5692479", "0.55888927", "0.548339", "0.54641885", "0.5437091", "0.54345834", "0.53708005", "0.5367569", "0.5363648", "0.5363648", "0.53356606", "0.53356606", "0.5322989", "0.52894354", "0.5273545", "0.52694905", "0.5252118", "0.5226996", "0.5209764", "0.520399...
0.69972944
0
updateDelegatedData() Update the delegated data and set chosen harvesting node if unlocked
updateDelegatedData() { this._NetworkRequests.getAccountData(this.harvestingNode, Address.toAddress(this._Wallet.currentAccount.child, this._Wallet.network)).then((data) => { this.delegatedData = data if (data.meta.status === "UNLOCKED") { // Set harvesting no...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startDelegatedHarvesting() {\n // Decrypt/generate private key and check it. Returned private key is contained into this.commonHarvesting\n if (!CryptoHelpers.passwordToPrivatekeyClear(this.commonHarvesting, this._Wallet.currentAccount, this._Wallet.algo, false)) {\n this._Alert.invalidPas...
[ "0.5922811", "0.5596118", "0.55143785", "0.54408455", "0.5432423", "0.50748026", "0.5071635", "0.49627638", "0.49101213", "0.49001545", "0.4896529", "0.48506323", "0.483982", "0.4813088", "0.4806272", "0.48051864", "0.48051864", "0.47898898", "0.47695723", "0.47680795", "0.47...
0.8291791
0
clearSensitiveData() Reset the common objects
clearSensitiveData() { this.common = { 'password': '', 'privateKey': '' }; this.commonDelegated = { 'password': '', 'privateKey': '', 'delegatedPrivateKey': '' }; this.commonHarvesting = { 'password': '', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanSharedData() {\n\t\tODataModel.mSharedData = {server: {}, service: {}, meta: {}};\n\t}", "function reset() {\n attachSource(null);attachView(null);protectionData = null;if (protectionController) {\n protectionController.reset();protectionController = null;\n }if (metricsReportingControll...
[ "0.713564", "0.6966989", "0.66192466", "0.65707666", "0.64770794", "0.64629996", "0.64292055", "0.6407552", "0.6403597", "0.63842326", "0.63735574", "0.63458115", "0.6337214", "0.627518", "0.62682754", "0.6221447", "0.62202024", "0.6192846", "0.6142878", "0.6095986", "0.60798...
0.8326771
0
getNodeInLocalStorage() Get node from local storage if it exists
getNodeInLocalStorage() { if (this._Wallet.network == Network.data.Mainnet.id) { if (this._storage.harvestingMainnetNode) { this.harvestingNode = this._storage.harvestingMainnetNode; } } else if (this._Wallet.network == Network.data.Testnet.id) { if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFromLocalStorage(key) {\n var item = localStorage.getItem(key);\n if(item) { \n return item;\n }\n else {\n console.log(\"could not store \" + key);\n return null;\n }\n }", "function getNode(){\n if(currentNode){\n return $('...
[ "0.652857", "0.64115506", "0.6053798", "0.6038564", "0.59555644", "0.5929863", "0.5913807", "0.59037787", "0.58906424", "0.5855913", "0.5838755", "0.5838755", "0.58197993", "0.5795406", "0.57941073", "0.57651275", "0.5747748", "0.57456917", "0.573304", "0.5732037", "0.5724758...
0.7679806
0
setNodeInLocalStorage() Set harvesting node in local storage according to network
setNodeInLocalStorage() { if (this._Wallet.network == Network.data.Mainnet.id) { this._storage.harvestingMainnetNode = this.harvestingNode; } else if (this._Wallet.network == Network.data.Testnet.id) { this._storage.harvestingTestnetNode = this.harvestingNode; } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNodeInLocalStorage() {\n if (this._Wallet.network == Network.data.Mainnet.id) {\n if (this._storage.harvestingMainnetNode) {\n this.harvestingNode = this._storage.harvestingMainnetNode;\n } \n } else if (this._Wallet.network == Network.data.Testnet.id) {\n ...
[ "0.71823335", "0.6074288", "0.59725136", "0.5858811", "0.58514214", "0.5793952", "0.5790414", "0.57805216", "0.5772914", "0.5755397", "0.5754129", "0.5648652", "0.5644027", "0.5621471", "0.56023884", "0.56009346", "0.55890214", "0.5547204", "0.5544676", "0.5542752", "0.551614...
0.8692361
0
Input: positive integer Output: an array of input numbers of array of input size Rules: create NxN multiplication table of a given size example: size = 3 => [[1, 2, 3], [2, 4, 6], [3, 6, 9]] Algorithm: set an empty table array set multiplicand to 1 start a loop that runs n number of times set an empty row array set inn...
function multiplicationTable(size) { const table = []; for (let multiplicand = 1; multiplicand <= size; multiplicand += 1) { const row = []; for (let multiplier = 1; multiplier <= size; multiplier += 1) { row.push(multiplicand * multiplier); } table.push(row); } return table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MultiplicationTable () {\n let table = [];\n let tableSize = 12;\n let includeLabels = true;\n if (includeLabels) {\n for (let i = 0; i <= tableSize; i++) {\n let array = [];\n for (let x = 0; x <= tableSize; x++) {\n if (i === 0 && x === 0) {\n ...
[ "0.7467181", "0.6887635", "0.6867344", "0.6819002", "0.6799164", "0.67461723", "0.66802883", "0.66717917", "0.6597054", "0.65628463", "0.6492631", "0.6474263", "0.6432144", "0.62948287", "0.62809396", "0.6272937", "0.6224391", "0.6188377", "0.61699945", "0.615292", "0.6145493...
0.7979945
0
save roles retrieved in session storage to avoid repeated calls to db for same date (roles are predefined and are not liable to change)
function callbackSaveRoles(roles) { sessionStorage.setItem("roles", JSON.stringify(roles)); buildRolesDDL(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "userRole() {\n let ur = getQueryParams('ur');\n if (ur) {\n switch (ur) {\n case '1':\n // Session.set('userRole', 'Developer');\n localStorage['userRole'] = 'Developer';\n break;\n case '2':\n ...
[ "0.64010954", "0.63430834", "0.594491", "0.590985", "0.587767", "0.58363813", "0.5812172", "0.57917327", "0.577739", "0.5756376", "0.57445604", "0.57153267", "0.5705055", "0.56593573", "0.564773", "0.56095695", "0.5589406", "0.5554408", "0.55098283", "0.550803", "0.5487518", ...
0.7679426
0
Load the CAPTCHA lib dynamically (either HCAPTCHA or RECAPTCHAV2). Once loaded, trigger an event to inform the parent form to actually render the CAPTCHA.
_addCaptcha() { // Callback invoked when CAPTCHA is solved. const onCaptchaSolved = (token) => { const captchaObject = this._getCaptchaOject(); // We reset the Captcha. We need to reset because every time the // Captcha resolves back with a token and say we have a server side error, /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRecaptchaLoad() {\r\n Dispatcher.sendAction('GRECAPTCHA_LOADED', grecaptcha);\r\n}", "function create_captcha(){var options={};if(Recaptcha.focus_on_load){options['callback']=Recaptcha.focus_response_field;}\nsetTimeout(function(){Recaptcha.create(\"6LezHAAAAAAAADqVjseQ3ctG3ocfQs2Elo1FTa_a\",\"captch...
[ "0.73189014", "0.6877761", "0.6742891", "0.66117454", "0.6536403", "0.6496497", "0.64438885", "0.6269922", "0.6139399", "0.6119968", "0.6101733", "0.5931638", "0.5891052", "0.5884028", "0.58170086", "0.57365835", "0.5705213", "0.57025284", "0.57025284", "0.5702164", "0.565986...
0.7119095
1
constructor gets an indexing client which is to where to store to extracted metadata
constructor(indexingClient) { this.indexingClient = indexingClient; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(config) {\n this.config = _.defaults({}, config.cluster, {\n // need to create new copy of config\n // riak decides to replace nodes with node objects\n nodes: Riak.Node.buildNodes(config.nodes, config.nodeOptions)\n });\n\n /**\n * The Riak client\n * @type {Riak.Client...
[ "0.63560784", "0.6196937", "0.6078859", "0.5988818", "0.5959192", "0.59010744", "0.5892742", "0.5844245", "0.5786405", "0.57757235", "0.57757235", "0.57757235", "0.57757235", "0.57755584", "0.57755584", "0.57755584", "0.57755584", "0.57755584", "0.57755584", "0.57755584", "0....
0.83611196
0
Filter pipelines with text
function filter_pipelines_text(ftext){ $('.pipelines-container .pipeline:contains("'+ftext+'")').show(); $('.pipelines-container .pipeline:not(:contains("'+ftext+'"))').hide(); if($('.pipelines-container .pipeline:visible').length == 0){ $('.no-pipelines').show(); } else { $('.no-pipelin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter() {}", "_onFilterChanged(filterText, items) {\n return filterText ? this.state.peopleList\n .filter(item => item.primaryText.toLowerCase().indexOf(filterText.toLowerCase()) === 0)\n .filter(item => !this._listContainsPersona(item, items)) : [];\n }", "function filterTasks(e){\n ...
[ "0.6103659", "0.5901989", "0.58330125", "0.5820344", "0.5780354", "0.5770043", "0.5706993", "0.56940776", "0.5693285", "0.5672316", "0.56644684", "0.56362927", "0.56305736", "0.5627812", "0.56208706", "0.56069714", "0.5582196", "0.5576829", "0.5546681", "0.5527403", "0.550122...
0.7805068
0