Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Flattens the API object structure into an array containing all versions of all APIs.
function flatten (apimap) { let apiArray = []; for (let [name, api] of Object.entries(apimap)) { let latestVersion = api.versions[api.preferred]; apiArray.push({ name, version: api.preferred, swaggerYamlUrl: latestVersion.swaggerYamlUrl, }); } return apiArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allResources(api) {\n var resources = [];\n var visitor = function (res) {\n resources.push(res);\n res.resources().forEach(function (x) { return visitor(x); });\n };\n api.resources().forEach(function (x) { return visitor(x); });\n return resources;\n}", "async function fet...
[ "0.59983337", "0.57756156", "0.5740566", "0.54524314", "0.53644454", "0.5291548", "0.52775735", "0.52082676", "0.5189902", "0.51794326", "0.5116799", "0.5091336", "0.50475836", "0.50402397", "0.5012935", "0.49749878", "0.49698266", "0.49588013", "0.49189168", "0.49148747", "0...
0.7147988
0
Hammer.JS version 0.6.1 author: Eight Media Licensed under the MIT license.
function Hammer(a,b,c){function x(a){return a.touches?a.touches.length:1}function y(a){a=a||window.event;if(!w){var b=document,c=b.body;return[{x:a.pageX||a.clientX+(b&&b.scrollLeft||c&&c.scrollLeft||0)-(b&&b.clientLeft||c&&b.clientLeft||0),y:a.pageY||a.clientY+(b&&b.scrollTop||c&&c.scrollTop||0)-(b&&b.clientTop||c&&b....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Hammer(l,r,j){var g=this;var x={prevent_default:false,css_hacks:true,cancel_event:true,swipe:true,swipe_time:200,swipe_min_distance:20,drag:true,drag_vertical:true,drag_horizontal:true,drag_min_distance:20,transform:true,scale_treshold:0.1,rotation_treshold:15,tap:true,tap_double:true,tap_max_interval:300...
[ "0.7545288", "0.7259858", "0.7180192", "0.7177634", "0.7055816", "0.7055816", "0.7055816", "0.7055816", "0.7055816", "0.69345933", "0.6898339", "0.67377454", "0.66824365", "0.66468006", "0.6609418", "0.64521724", "0.6095414", "0.5981968", "0.59379447", "0.577939", "0.571007",...
0.6878379
11
Mostrar datos de LocalStorage en la lista
function localStorageListo(){ let tweets; tweets = obtenerTweetsLocalStorage(); tweets.forEach(function(tweet){ //crear boton eliminar const botonBorrar = document.createElement('a'); botonBorrar.classList ='b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatos(){\n let auxLista = JSON.parse(localStorage.getItem('anunciosAnimales')) || [];\n return auxLista;\n}", "function loadData() {\n\tlet data = JSON.parse(localStorage.getItem(\"tasks\"))\n\tlet li = \"\";\n\tfor (let i = 0; i < data.length; i++) {\n\t\tli += dataGenerat(data[i], i);\n\t\...
[ "0.7157153", "0.71509707", "0.7041261", "0.70221514", "0.70115465", "0.70049804", "0.69615906", "0.6918914", "0.6897478", "0.68907166", "0.68704975", "0.6853622", "0.68515015", "0.68347394", "0.68255365", "0.6819448", "0.6813997", "0.67245764", "0.67212445", "0.67161375", "0....
0.6407039
58
Agrega tweet a local storage
function agregarTweetLocalStorage(tweet){ let tweets; //muestra los tweets en local storage tweets = obtenerTweetsLocalStorage(); //Añadir el nuevo tweet tweets.push(tweet); //Convertir de arreglo a string para local storage //en local storage solo acepta cadenas de textos, st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function agregarTweetLocalSt(tweet) {\n let tweets = obtenerTweetsLocalSt();\n\n //Añadir el nuevo tweet\n tweets.push(tweet);\n\n //Convertir a string a arreglo para ls\n localStorage.setItem('tweets', JSON.stringify(tweets))\n\n}", "function agregarTweetLocalStorage(tweet) {\n let tweets;\n ...
[ "0.8272889", "0.82339513", "0.8187244", "0.81781703", "0.81530577", "0.8146083", "0.8142588", "0.81132495", "0.8107232", "0.81045485", "0.81017315", "0.8099394", "0.80926126", "0.8052368", "0.79222596", "0.7906116", "0.7892299", "0.7869739", "0.7863132", "0.78560615", "0.7812...
0.825471
1
esta funcion se llama apenas se agregue un tweet
function obtenerTweetsLocalStorage(){ let tweets; //revisamos los valores del local storage if(localStorage.getItem('tweets')===null){ tweets=[]; } else { //muestra los tweets en una cadena de texto y en un arreglo tweets = JSON.parse(localSt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tweet(message){\n\n\t}", "function tweets(tweet) { cb(tweet) }", "function tweetIt(txt) {\n\n\tvar tweet = {\n\t\tstatus: txt\n\t}\n\tT.post('statuses/update', tweet, tweeted);\n\n}", "function makeTweet(mytweet) {\r\n\r\n console.log('Atttempting Tweet...');\r\n // .post takes an object as in...
[ "0.76552606", "0.7651702", "0.7484001", "0.7426192", "0.74013454", "0.7314272", "0.73020965", "0.7256193", "0.7237308", "0.72167325", "0.7161631", "0.71394795", "0.7073737", "0.70715547", "0.7068139", "0.7060656", "0.70539695", "0.70115817", "0.6980036", "0.6965618", "0.69654...
0.0
-1
eliminar tweet de Local Storage
function borrarTweetLocalStorage(tweet){ let tweets, tweetBorrar; //elimina la 'X' del tweet //para eliminar la 'X' aplicamos -1 asi se mostrará solo el texto del tweet tweetBorrar = tweet.substring(0, tweet.length - 1); tweets = obtenerTweetsLoca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eliminarLocalStorage(tweet){\n let tweets, tweetBorrar;\n tweets = obtenerLocalStorage();\n tweetBorrar = tweet.substring(0,tweet.length - 1);\n\n tweets.forEach(function(tweet, index){\n if(tweetBorrar === tweet){\n tweets.splice(index, 1)\n }\n });\n localStora...
[ "0.8580195", "0.8426111", "0.8416741", "0.8399487", "0.836455", "0.83576965", "0.8352134", "0.83225846", "0.83058083", "0.82822186", "0.82743645", "0.82019615", "0.80906326", "0.80060273", "0.7928993", "0.74832046", "0.7226618", "0.70775694", "0.6981526", "0.69732666", "0.692...
0.83512837
7
["0C0A3E", "e500ff", "54B1D9", "00CC99", "5dff00"];
function preload() { song = loadSound('../assets/music/song5.mp3'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayOfHexaColors() {\n let output = [];\n let arglength = arguments.length;\n if (arglength > 0) {\n let input = arguments;\n for (let i = 0; i < arglength; i++) {\n output.push(arguments[i].toString(16));\n }\n }\n return output;\n}", "function getAZArray () {\n const result = []...
[ "0.64721817", "0.6329063", "0.6101023", "0.6070502", "0.6063316", "0.58301425", "0.5824051", "0.5820016", "0.5820016", "0.5820016", "0.5802208", "0.5780508", "0.5762895", "0.5734244", "0.57289505", "0.5714456", "0.5708972", "0.5704126", "0.56979436", "0.56661516", "0.56483406...
0.0
-1
forward all other plugin hooks
serverStop(...args) { return baseHmrPlugin.serverStop && baseHmrPlugin.serverStop(...args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bindHooks() {\n //\n }", "function hooks(){return hookCallback.apply(null,arguments)}", "function hooks(){return hookCallback.apply(null,arguments)}", "_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }", "merge(hooks) {\n ...
[ "0.6716264", "0.6599156", "0.6599156", "0.62971014", "0.62186295", "0.62098575", "0.61787045", "0.6115495", "0.59631306", "0.5874724", "0.5796302", "0.5796302", "0.57159966", "0.570535", "0.56336206", "0.5619198", "0.5607311", "0.5584003", "0.55813295", "0.5541462", "0.553304...
0.0
-1
end filde upload menu
async menu({session,request, response, view}){ var language_ad = JSON.parse(fs.readFileSync('public/language/'+session.get('lang_ad')+'/back.json', 'utf8')); return view.render('back.menu.list',{ menu: 'active', title: language_ad.menu_config, heading:language_ad.menu_co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function click_lyrMenu_업로드(ui) {\n var args = { targetid: \"lyrServer\", control: { by: \"DX\", id: ctlUpload } };\n gw_com_module.uploadFile(args);\n }", "function changeInputTypeFile(){\n\n //show loaded file name\n\n $('.blog-form input[type=\"file\"]').change(functi...
[ "0.67782915", "0.66258067", "0.659569", "0.65326697", "0.65244544", "0.6520426", "0.64533925", "0.6420389", "0.6420389", "0.6395238", "0.63727826", "0.6366448", "0.6353457", "0.6332216", "0.63319194", "0.62955475", "0.6287764", "0.6273844", "0.6255208", "0.624417", "0.6205163...
0.0
-1
login history news category
async news_categorys({session,request, response, view}){ var language_ad = JSON.parse(fs.readFileSync('public/language/'+session.get('lang_ad')+'/back.json', 'utf8')); return view.render('back.news_categorys.news_cat',{ news_cat: 'active', title: language_ad.a_m_news_catgory, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getList(){\n\t\t\tHistoryService.getList($rootScope.userLogin.token).success(function(res){\n\t\t\t\t$scope.list_categories = res;\n\t\t\t}).error(function(err, status, res){\n\t\t\t\tif (err.detail){\n toastr.error(err.detail);\n }\n for( var key in err){\...
[ "0.6063063", "0.581411", "0.570141", "0.56781495", "0.5661518", "0.56361544", "0.55562603", "0.55498046", "0.54855347", "0.5463648", "0.54575837", "0.545636", "0.5439216", "0.54241806", "0.540824", "0.53870684", "0.5367357", "0.5352149", "0.5349214", "0.5345565", "0.53382003"...
0.5807137
2
Extract Subflow definition from JSON data
function getSubflowDef(flow) { const newFlow = []; let sf = null; flow.forEach((item) => { if (item.hasOwnProperty("meta") && item.meta.hasOwnProperty("module")) { if (sf !== null) { throw new Error("unexpected subflow definition"); } s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseSubBreed() {\n let parsedSub = JSON.parse(this.responseText);\n renderSubText(parsedSub.message);\n}", "function getSubflow(_, ctx) {\n var spec = _.$subflow;\n return function(dataflow, key$$1, parent) {\n var subctx = parseDataflow(spec, ctx.fork()),\n op = subctx.get(spec.o...
[ "0.51417565", "0.50004756", "0.49857727", "0.48333344", "0.48333344", "0.4827001", "0.47475997", "0.474531", "0.47409227", "0.47240835", "0.4587443", "0.45870966", "0.45615503", "0.4556494", "0.45538443", "0.45532787", "0.45508075", "0.45406723", "0.4534133", "0.45159414", "0...
0.5930136
0
get flow encoding method
function getEncoder(encoding) { if (encoding === "AES") { return function (flow, key) { var data = JSON.stringify(flow); var enc = crypt.AES.encrypt(data, key); return enc.toString(); } } throw new Error("encoding not defined:" +encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder() {}", "function Encoder()...
[ "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "0.6641072", "...
0.6065659
78
Create JSON data file
function createJSON(dstPath, flow, encoding, key) { const [sf, newFlow] = getSubflowDef(flow); if (encoding && (encoding !== "none")) { const encode = getEncoder(encoding); const encStr = encode(newFlow, key); sf.flow = { encoding: encoding, flow: encStr }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create (file,data) {\n fs.open(`${baseDir}/${file}.json`,'wx',(err,identifier)=>{\n if(!err && identifier){\n //Overide default to place objects inside of an array\n //let jsonArray = [];\n\n //jsonArray.push(data);\n\n let stringData = ...
[ "0.7855771", "0.75466627", "0.737031", "0.7217505", "0.7210132", "0.72064245", "0.71773183", "0.7120466", "0.7058782", "0.6971438", "0.692653", "0.69225574", "0.69114953", "0.6875773", "0.68702567", "0.68417376", "0.682763", "0.6768766", "0.676326", "0.66966945", "0.66895914"...
0.622969
58
Listen to scroll to change header opacity class
function checkScroll(){ var startY = $('.navbar').height() * 2; //The point where the navbar changes in px if($(window).scrollTop() > startY){ $('.navbar').removeClass("scrolled"); }else{ $('.navbar').addClass("scrolled"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function headerHomeScroll() {\n var headerHome = document.querySelector(\"header\");\n var main = document.querySelector(\"main\");\n const checkpoint = 75;\n\n main.addEventListener(\"scroll\", () => {\n const currentScroll = main.scrollTop;\n if (currentScroll <=...
[ "0.724402", "0.7124144", "0.6674734", "0.6570427", "0.6552146", "0.6533448", "0.65045166", "0.64682215", "0.6420382", "0.6410565", "0.6375139", "0.6371729", "0.6332411", "0.6331498", "0.63300645", "0.6311357", "0.6301815", "0.62930477", "0.6291796", "0.62599754", "0.6248467",...
0.0
-1
END: Listen to scroll to change header opacity class GET RECEIPTS LIST
function pageInit(){ $.ajax({url: "/personalData", dataType: 'json', processData: false, success: function(data){ var parsedData = JSON.parse(data); if (parsedData.error) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function headerHomeScroll() {\n var headerHome = document.querySelector(\"header\");\n var main = document.querySelector(\"main\");\n const checkpoint = 75;\n\n main.addEventListener(\"scroll\", () => {\n const currentScroll = main.scrollTop;\n if (currentScroll <=...
[ "0.5762019", "0.5726563", "0.56360847", "0.56326914", "0.5593063", "0.5526659", "0.5486826", "0.54834324", "0.5482005", "0.5428003", "0.5416748", "0.54077107", "0.5387975", "0.53854716", "0.535017", "0.5330703", "0.53187364", "0.5303757", "0.5294647", "0.5293629", "0.52868986...
0.0
-1
Element class can define custom element reactions
connectedCallback() { super.connectedCallback(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RElement() { }", "function RElement() { }", "function RElement() {}", "function RElement() {}", "function RElement() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function CustomElementRegistry() {}", "function ...
[ "0.5942351", "0.5942351", "0.59385777", "0.59385777", "0.59385777", "0.5709466", "0.5709466", "0.5709466", "0.5709466", "0.5709466", "0.5654664", "0.5631742", "0.55450183", "0.55027896", "0.549022", "0.5480653", "0.54583305", "0.54442555", "0.54386663", "0.54235494", "0.53968...
0.0
-1
To discretize a CAD object of the document in an SPoly
function CADFromName(Name) { var result; result = SCADSurface.FromName( Name ); if ( result.length > 1 ) // Check for import success throw new Error('there is more than one object named: ' + Name); if ( result.length == 1 ) // Check for import success return result[0]; throw new Error('Impossible...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compactCagSide (cagSide) {\n return {pos: [\n [cagSide.vertex0.pos._x, cagSide.vertex0.pos._y],\n [cagSide.vertex1.pos._x, cagSide.vertex1.pos._y]\n ]}\n}", "function AstroGeometry() {}", "function CubicPoly() {\n\n\t \t}", "clone() {\n return new CSG(this.polygons.map(p => p.clone...
[ "0.5117646", "0.51167774", "0.49497527", "0.49332115", "0.4931897", "0.4916139", "0.48621494", "0.48613518", "0.48599443", "0.48568317", "0.48320353", "0.48073804", "0.48073804", "0.48073804", "0.48073804", "0.48073804", "0.48046502", "0.48046502", "0.47780392", "0.47727284", ...
0.50283045
2
[GitHub] wearefractal / replaceext
function replaceExtension(npath, ext) { if (typeof npath !== 'string') return npath; if (npath.length === 0) return npath; var nFileName = path.basename(npath, path.extname(npath))+ext; return path.join(path.dirname(npath), nFileName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceMath(text) {\n\t\t text = text.replace(/@@(\\d+)@@/g, function(match, n) {\n\t\t return math[n]\n\t\t });\n\t\t math = null;\n\t\t return text\n\t\t }", "function processReplacements(body)\n{\n //make links clickable\n body = linkify(body);\n\n /...
[ "0.6041271", "0.59441984", "0.5904374", "0.585734", "0.57576334", "0.5690112", "0.5647753", "0.5645934", "0.5611664", "0.5588871", "0.556705", "0.556705", "0.5552797", "0.55431974", "0.55431974", "0.5536194", "0.5535193", "0.5522934", "0.55214375", "0.55122066", "0.54967934",...
0.0
-1
[GitHub] jonschlinkert / gulphtmlmin
function minifyHtml(file, cb) { if(file.isStream()) { return cb(new Error('htmlmin: Streaming not supported')); } if(file.isNull()) { return cb(null, file); } if(file.isBuffer()) { file.contents = new Buffer( minify( String( file.contents ), options ) ); } return cb(null, file); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minifyHTML() {\n\treturn gulp\n\t\t.src(\"./src/*.html\")\n\t\t.pipe(\n\t\t\thtmlMin({\n\t\t\t\tcollapseWhitespace: true,\n\t\t\t\tremoveComments: true\n\t\t\t})\n\t\t)\n\t\t.pipe(gulp.dest(\"./build/\"));\n}", "function html() {\n return src('src/*.html')\n .pipe(changed('build'))\n .p...
[ "0.7587315", "0.74834335", "0.74159396", "0.74005055", "0.73247194", "0.7280983", "0.718675", "0.71283394", "0.7124257", "0.6961257", "0.6934453", "0.6921505", "0.6914985", "0.6861223", "0.68388504", "0.6796982", "0.6736744", "0.670407", "0.6652731", "0.66289675", "0.66174716...
0.6108601
45
based on: [GitHub] marklagendijk / gulpnghtml2js
function ngHtml2Js(file, cb) { if(file.isStream()) { return cb(new Error('html2js: Streaming not supported')); } if(file.isNull()) { return cb(null, file); } if(file.isBuffer()) { var filePath = getFileUrl(file); file.contents = new Buffer( generateModuleDeclaration( filePath, String...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exportPNG() {\n var canvas = document.getElementById('myCanvas');\n var html = \"<img src='\" + canvas.toDataURL('image/png') + \"' />\"\n if ($.browser.msie) {\n window.winpng = window.open('/static/html/export.html');\n window.winpng.document.write(html);\n window.winpng.document.body.style....
[ "0.60378647", "0.60127336", "0.60070497", "0.5993784", "0.5814271", "0.57428527", "0.57428306", "0.5742777", "0.5719102", "0.57124525", "0.5704049", "0.5696391", "0.5679945", "0.56377333", "0.562029", "0.5594265", "0.559113", "0.55745375", "0.5570846", "0.556052", "0.5556991"...
0.0
-1
as all our css should depend on the main container size, not screen size like sapUiMediaStdTablet...
function toggleSizeClasses(iSize) { var sCurrentSizeClass = 'sapMSize' + iSize, i, sClass; for (i = 0; i < 3; i++) { sClass = 'sapMSize' + i; if (sClass === sCurrentSizeClass) { this.addStyleClass(sClass); } else { this.removeStyleClass(sClass); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateSize() {\n if (qx.ui.mobile.core.Blocker.ROOT == this.getLayoutParent()) {\n this.getContainerElement().style.top =\n qx.bom.Viewport.getScrollTop() + \"px\";\n this.getContainerElement().style.left =\n qx.bom.Viewport.getScrollLeft() + \"px\";\n this.getContainer...
[ "0.70150113", "0.6482564", "0.6386819", "0.63658327", "0.6365135", "0.635951", "0.6339353", "0.63119704", "0.62074196", "0.6203659", "0.61956364", "0.6187917", "0.61530006", "0.6148588", "0.6143079", "0.61427313", "0.61138284", "0.61138284", "0.61077654", "0.60947734", "0.609...
0.0
-1
There will always be only one integer that appears an odd number of times.
function findOdd(A) { let map = new Map(); for (let i = 1; i <= A.length; i++) { if (A.length == 1) { return A[0]; } else { map.set(A[i], A.filter(value => value == A[i])); } } for (let value of map) { if (value[1].length % 2 != 0) { return value[0]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findOdd(A) {\n var occurrences = { };\n for (var i = 0; i < A.length; i++) {\n var num = A[i];\n occurrences[num] = occurrences[num] ? occurrences[num] + 1 : 1;\n }\n for (num in occurrences) {\n let count = occurrences[num]\n if (count % 2 == 1) {\n return parseInt(...
[ "0.6796152", "0.67575836", "0.6745245", "0.6724354", "0.6713898", "0.667076", "0.6646893", "0.66381603", "0.6624114", "0.6597783", "0.6596954", "0.6594503", "0.659408", "0.65857965", "0.65796673", "0.64798146", "0.6454883", "0.6449026", "0.6448096", "0.64449495", "0.64420205"...
0.62480766
65
Compares two subparts (`style` elements with STYLE_NAME name attribute) of given elements disregarding comments
function areStyleElementsEqual(a, b) { var _a, _b, _c, _d; const styleA = (_b = (_a = a.elements) === null || _a === void 0 ? void 0 : _a[0].elements) === null || _b === void 0 ? void 0 : _b.find(({ name, attributes }) => name === 'style' && (attributes === null || attributes === void 0 ? void 0 : attributes.na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCompareFunction( styles ) {\n\t\t\t\t\tvar order = CKEDITOR.tools.array.map( styles, function( item ) {\n\t\t\t\t\t\treturn item.selector;\n\t\t\t\t\t} );\n\n\t\t\t\t\treturn function( style1, style2 ) {\n\t\t\t\t\t\tvar value1 = isClassSelector( style1.selector ) ? 1 : 0,\n\t\t\t\t\t\t\tvalue2 = isCla...
[ "0.5909653", "0.5372862", "0.5326913", "0.5222618", "0.5214858", "0.51709723", "0.51512855", "0.50978315", "0.5056355", "0.50312567", "0.50099796", "0.49999714", "0.49484172", "0.49484172", "0.49266687", "0.48893288", "0.48787004", "0.48787004", "0.48787004", "0.48787004", "0...
0.6490214
0
Removes `style` element with STYLE_NAME name attribute from given element. Function assumes that the structure of the input `element` is correct (`element.elements[name = resources].elements[name = style, attributes.name = STYLE_NAME]`).
function removeStyleElement(element) { var _a, _b, _c, _d; const resources = (_a = element.elements) === null || _a === void 0 ? void 0 : _a.find(el => el.name === 'resources'); const idxToBeRemoved = (_c = (_b = resources === null || resources === void 0 ? void 0 : resources.elements) === null || _b === vo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromElement(style, element) {\n var def = style._.definition,\n overrides = getOverrides(style),\n attributes = Utils.mix(def[\"attributes\"],\n (overrides[ element._4e_name()] || overrides[\"*\"] || {})[\"attributes\"]),\n styles = Utils.mix(de...
[ "0.69139534", "0.6807105", "0.65822154", "0.6561341", "0.6468984", "0.61502093", "0.60528964", "0.6028695", "0.6028695", "0.5943658", "0.5863253", "0.5833477", "0.5666959", "0.5608961", "0.5598087", "0.5559695", "0.55505574", "0.5542618", "0.5472749", "0.54522634", "0.5452263...
0.77493757
0
Creates proper element structure with single `style` element disregarding all other styles. Use to create more specific configuration file, but preserving previous attributes. Function assumes that the structure of the input `element` is correct (`element.elements[name = resources].elements[name = style, attributes.nam...
function elementWithStyleElement(element) { var _a, _b; const result = { ...element }; const resources = (_a = element.elements) === null || _a === void 0 ? void 0 : _a.find(el => el.name === 'resources'); if (!resources) { return; } const styleElement = (_b = resources === null || resou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStyle(element, elementStyle) {\n\n if(element && elementStyle instanceof Object ){\n Object.keys(elementStyle).map(function (cssProp) {\n element.style[cssProp] = elementStyle[cssProp];\n });\n }\n\n}", "function removeStyleElement(element) {\n var _a, _b, _c, _d;...
[ "0.6880315", "0.6432365", "0.6357589", "0.6070842", "0.6070842", "0.6070842", "0.6070842", "0.60618895", "0.6013988", "0.6007031", "0.5956938", "0.59506464", "0.59465957", "0.5933056", "0.5921432", "0.5911415", "0.5851023", "0.5819198", "0.58178383", "0.57974297", "0.5749594"...
0.6947923
0
Renders numbers 19 to use as input for the user to change the board
function MappingNums (props) { const array = []; for (let i = 1; i <= 9; i++) array.push(i); return ( <div> <p>Click on a number &#128071; then on a white cell in the board &#128070; </p> <div className='numbers'> {array.map((i) => { return <button key={i} className...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBoard() {\n var s = '<table class=\"table\">\\n';\n\n for (var i = 0; i < 9; ++i) {\n s += '<tr>';\n for (var j = 0; j < 9; ++j) {\n var c = 'cell';\n if ((i + 1) % 3 == 0 && j % 3 == 0) {\n c = 'cell3';\n } else if ((i + 1) % 3 == 0) {\n c = 'cel...
[ "0.7042262", "0.6445367", "0.63505715", "0.62679446", "0.624846", "0.61729014", "0.61367637", "0.607598", "0.6074307", "0.60670453", "0.6022856", "0.6001023", "0.5995923", "0.59818643", "0.59435433", "0.59404", "0.59276825", "0.5902105", "0.5896877", "0.5896709", "0.58898413"...
0.5849782
22
Returns a constructed cell component
function Cell (props) { return ( <div className={props.className} onClick={props.onClick}>{props.val}</div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ELEMENT_CELL$static_(){LayoutPreviewRenderer.ELEMENT_CELL=( LayoutPreviewRenderer.BLOCK.createElement(\"cell\"));}", "clone(){\n\n let clonedCell = new Cell();\n\n clonedCell.row = this.row;\n clonedCell.col = this.col;\n clonedCell.x = this.x;\n clonedCell.y = this.y;...
[ "0.666857", "0.6621713", "0.6591424", "0.65705574", "0.6522173", "0.6490508", "0.64240015", "0.63838387", "0.6378484", "0.63614213", "0.6339102", "0.6333175", "0.63302666", "0.62837785", "0.6239891", "0.62359744", "0.6232781", "0.6225248", "0.621277", "0.6203876", "0.61959267...
0.6395959
7
Constructs and renders the puzzle's board/grid Manages the state of the grid, the current selected number, and the status of the game. Returns a rendered Sudoku grid
function Board () { const [grid, dispatch] = useReducer(reducer, generatePuzzle()); const [selectedNum, setSelectedNum] = useState(1); const [checked, setChecked] = useState(''); function updateCell (payload) { dispatch({ type: 'update', payload: payload }); } return ( <div className='container'> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderGrid() {\n let { C, cols, rows, px, grid_color, render_border } = state\n C.gx.clearRect(\n -render_border,\n -render_border,\n C.gx.canvas.width,\n C.gx.canvas.height\n )\n C.gx.strokeStyle = grid_color\n C.gx.lineWidth = 1\n C.gx.strokeRect(0.5, 0.5, sub(mul(cols, px), 1), sub(mu...
[ "0.68622285", "0.6856718", "0.6816136", "0.6725043", "0.66905385", "0.6430888", "0.6420207", "0.6408395", "0.63946813", "0.63648057", "0.6344001", "0.63433415", "0.6327878", "0.6311452", "0.63046783", "0.63028723", "0.6301938", "0.629137", "0.6275655", "0.6273212", "0.6271159...
0.5964408
64
Wrapper function that calls Board function
function Sudoku () { return ( <Board /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Board(){}", "function boardWin() {\r\n}", "function ticTacToe(board) {\n\n}", "function applyBoard(){\n g_wall = new Wall(g_newBoard,0,0);\n reset();\n}", "getPossibleMoves( board ) {\n\n }", "updateBoardPiece(piece, move) {\r\n return this.updateBoard([piece], [move]);\r\n }", "funct...
[ "0.714684", "0.6823062", "0.655919", "0.64774156", "0.6437695", "0.6317751", "0.6314773", "0.62814033", "0.6253426", "0.6235013", "0.6184007", "0.6160241", "0.6160241", "0.6160241", "0.6132734", "0.61317456", "0.61222345", "0.6113857", "0.61083794", "0.61003536", "0.6044754",...
0.0
-1
select random planet and play whacamole game
function randomPlanet() { planets.forEach(planet => { planet.classList.remove('landed') }) let randomPlanet = planets[Math.floor(Math.random() * 9)]; randomPlanet.classList.add('landed'); hitPosition = randomPlanet.id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "maybePlanet(){\n\t\tlet randnum = random(2000);\n\t\tif (randnum < 1){\n\t\t\tthis.makePlanet(random(width - 300));\n\t\t}\n\t}", "function createPlanet() {\n //This randomizes a single planet. Maybe one could give parameters\n //to instruct what kind of planet it will be. parameters could be\n //in key...
[ "0.7711765", "0.73283595", "0.69176304", "0.6549716", "0.65477973", "0.6468876", "0.63792133", "0.6364507", "0.6314499", "0.6311353", "0.629391", "0.6222514", "0.62152827", "0.62108743", "0.62047553", "0.6177957", "0.61722785", "0.6159287", "0.61553544", "0.6153679", "0.61529...
0.73449194
1
game timer + final score card
function countDown() { currentTime -- timeLeft.textContent = currentTime; if (currentTime == 0) { clearInterval(countDownTimerId); clearInterval(timerId); finalCard.classList.remove('d-none'); parFinalCard.innerHTML = `You've been on ${result} planets`; start.classList.remove('d-none'); stopBtn....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scoreTimer(){\n timerEl.innerHTML = time;\n\n \n //this makes sure the time (score) never goes negative.\n if (time <= 0) {\n time = 0; \n }\n else{ \n time = time -1;\n \n }\n }", "function timeDisp() {\n MY_SCORE = MY_SCORE + 1;\...
[ "0.74890226", "0.73221034", "0.72525364", "0.7232906", "0.7230262", "0.71363175", "0.71129394", "0.70779854", "0.7069909", "0.7051293", "0.7037947", "0.70175093", "0.6959412", "0.69488865", "0.6945859", "0.6914898", "0.68890584", "0.688643", "0.6877774", "0.6875589", "0.68745...
0.0
-1
MD5 encryption let md5 = crypto.createHash("md5"); let newPas = md5.update(password).digest("hex");
function encrypt(str, secret) { var cipher = crypto.createCipher('aes192', secret); var enc = cipher.update(str, 'utf8', 'hex'); // var enc=cipher.update(new Buffer(str, 'utf-8')); enc += cipher.final('hex'); return enc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encryptePassword(password) {\n var md5 = crypto.createHash('md5');\n md5.update(secretSalt+password);\n return md5.digest('hex');\n}", "function encryption(pwd){\n var MD5 = new Hashes.SHA256().hex(pwd)\n return MD5;\n}", "function getHashPass(password) {\n const passwordSha1 = cry...
[ "0.8385863", "0.8154047", "0.77315295", "0.7521138", "0.74774283", "0.7449409", "0.7407863", "0.7318452", "0.724106", "0.7237537", "0.72248894", "0.72024316", "0.7174133", "0.7167289", "0.7142047", "0.7102233", "0.70870364", "0.70870364", "0.70870364", "0.70870364", "0.708703...
0.0
-1
2. write a function isUniform() which takes an array as an arguement and returns true if all elements in the array are identical.
function isUniform(array) { var firstElement = array[0]; for (var i = 1; i < array.length; i++) { if (firstElement !== array[i]) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUniform(array) {\r\n\tvar first = array[0];\r\n\tfor(var i = 1; i < array.length; i++) {\r\n\t\tif(array[i] !== first) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function isUniform(array){\n\tvar first = array[0];\n\tfor(var i = 1; i< array.length; i++){\n\t\tif(array[i] !== fi...
[ "0.87142104", "0.8683783", "0.86766523", "0.8675357", "0.86734104", "0.8533729", "0.8498995", "0.8497032", "0.8495212", "0.8490823", "0.84905803", "0.8484097", "0.8475216", "0.845264", "0.84045917", "0.8322316", "0.82902", "0.8243368", "0.7851395", "0.75460166", "0.7262699", ...
0.86970484
1
3. write a funciton sumArray() that accepts an array of numbers and returns the sum of all numbers in the array.
function sumArray(array) { var sum = 0; for (var i = 0; i < array.length; i++) { sum += array[i]; } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumArr(array){\n\n}", "function arraySum(array) {\n var total = 0;\n for (var i = 0; i < array.length; i++) {\n total += array[i];\n }\n return total;\n}", "function sumOfArray(array) {\r\n var sum = 0;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n sum += array[i...
[ "0.89092445", "0.8872382", "0.8864174", "0.8853662", "0.88457614", "0.87848157", "0.87809557", "0.8768139", "0.87414485", "0.8730846", "0.87229437", "0.8694824", "0.86891174", "0.8680036", "0.8677201", "0.8639209", "0.86100495", "0.85895413", "0.8580772", "0.85745454", "0.857...
0.8938814
0
4. write a function max() that accepts an array of numbers and returns the maximum number in the array.
function max(array) { var maxNum = array[0]; for (var i = 0; i < array.length; i++) { if (maxNum < array[i]) { maxNum = array[i]; } } return maxNum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxNumber(array) {\n return Math.max.apply(null, array);\n}", "function findMax(array) {\n}", "function Max( array ){\n\t\treturn Math.max.apply( Math, array );\n\t}", "function max(array){\n\tvar number= array[0];\n\tvar num1;\n\tfor (var i=0; i < array.length; i++){\n\t\tnum1= array[i];\n\t\tn...
[ "0.8894287", "0.8859305", "0.88385546", "0.88072044", "0.87753814", "0.873046", "0.8726954", "0.8726954", "0.8726794", "0.87249434", "0.8716531", "0.8672595", "0.86710715", "0.8662924", "0.86405534", "0.86193717", "0.8616292", "0.8614923", "0.8612483", "0.8571176", "0.8531246...
0.8691711
11
For every round, copy a "", populate it with interesting information, then put all elements into the browser.
function showRounds() { const roundTemplateNode = document.getElementById('apollon-round-template'); const fragment = { 'friday': document.createDocumentFragment(), 'saturday': document.createDocumentFragment(), }; apollon.roundsDetailed(registrations).forEach(ent...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printGame() {\n let game = document.getElementById(\"game\");\n game.innerHTML = \"\";\n for (let i = 0; i < gameSize; i++) {\n for (let j = 0; j < gameSize; j++) {\n let htmlElem = document.createElement(\"div\");\n htmlElem.setAttribute(\"id\", i + ',' + j);\n ...
[ "0.59338987", "0.58239275", "0.57587254", "0.5727264", "0.57061666", "0.5703164", "0.5697411", "0.5667065", "0.55837697", "0.55800897", "0.5571996", "0.55408365", "0.54459757", "0.54365426", "0.54250216", "0.538548", "0.53854334", "0.5385093", "0.53792083", "0.5359652", "0.53...
0.50845766
79
BB USA salary formula.
function computeSalaryUS(skills) { var getSal = function(ratings, coefs) { var sal = 1; for (i = 0; i<10; i++) { sal = sal * Math.pow(coefs[i], ratings[i]); } sal = sal * coefs[10]; return sal; }; var PG = [1.0319, 1.0460, 1.0728, 1.0725, 1.0360, 1.1515, 1.0005, 1.0010, 1.0361, 0.9996,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function salaryBonus ( salary ) {\n console.log(Number(salary));\n \n if ( Number(salary) > 65000 ){\n return -0.01;\n } else {\n return 0;\n }\n} // end currentSalary", "function salaryRangeCalculator(brutoSalary, months) {\n let salaryNett, totalBPJS;\n let golongan = getGolongan(brutoSalary);...
[ "0.6868376", "0.68667006", "0.68419176", "0.6540808", "0.65114176", "0.650246", "0.64607763", "0.6449724", "0.64152163", "0.6377791", "0.63705945", "0.6349446", "0.63487875", "0.6328192", "0.63046163", "0.629903", "0.61973375", "0.617572", "0.6163639", "0.6145357", "0.6133338...
0.6689098
3
Assumes item is visible performs tests using filters, labels to determine if it is not.
getVisibleTodos(filterSelected) { var totalActiveLabels = this.uniqLabels.filter(l => l.active); return this.todos.filter(todo => { var isVisible = true // Check if we have selected "all", "active", or "completed" items switch (filterSelected) { ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkVisible() {\r\n var $items = ['registration', 'messages', 'sponsors'];\r\n $('.ipWidget').find('.myl-module-game').each(function(){\r\n var $name = $(this).attr('data-module-name');\r\n var $active = $(this).children('div').data('module-visible');\r\n\r\n ...
[ "0.6124224", "0.6070154", "0.60298455", "0.5986133", "0.5934503", "0.59304285", "0.5714103", "0.57034564", "0.5701236", "0.56069726", "0.5596955", "0.55920404", "0.55392057", "0.55346626", "0.55076295", "0.54987556", "0.54755014", "0.5474678", "0.5466827", "0.5440188", "0.543...
0.61508554
0
Refreshes the current page given time duration until refresh
function refresh(duration){ setTimeout(function() {$route.reload();}, duration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refresh() {\n setTimeout(function () {\n location.reload();\n }, 60000);\n }", "function refresh() {\r\nsetInterval(\"location.reload()\",2000);\r\n}", "function setRefresh () {\n setInterval( function() {window.location.reload();}, 20000);\n}", "function reload_page() {...
[ "0.75425327", "0.7313091", "0.73123986", "0.72752655", "0.7237831", "0.7145903", "0.7105972", "0.70841014", "0.7082472", "0.7043479", "0.70141286", "0.6948643", "0.686391", "0.68278724", "0.6824285", "0.68010986", "0.6775443", "0.6762626", "0.67414", "0.670345", "0.6697619", ...
0.72873545
5
Clears the localStorage saved in the web browser and scope variables
function clearStorage(){ $window.localStorage.clear(); $scope = $scope.$new(true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lclear() {\n localStorage.clear()\n }", "function clear() {\n window.localStorage.clear();\n}", "function clearLocalStorage (): void {\n window.localStorage.clear()\n}", "function emptyLocalStorage() {\r\n localStorage.clear();\r\n}", "static clear() {\n\t\tlocalStorage.clear();\n\t}", "fu...
[ "0.8622166", "0.8579802", "0.8508384", "0.8474581", "0.8424677", "0.8393552", "0.83584195", "0.8357141", "0.83410174", "0.8331412", "0.83209056", "0.82888734", "0.82798445", "0.82682836", "0.82581496", "0.82581496", "0.8244441", "0.8244441", "0.8216682", "0.82051206", "0.8203...
0.7423784
78
Universal method for updating group alias (for tabs, fieldsets etc.)
function updateGroupAlias(group) { const localAlias = contentTypeHelper.generateLocalAlias(group.name), oldAlias = group.alias; let newAlias = contentTypeHelper.updateLocalAlias(oldAlias, localAlias); // Ensure unique alias, otherwise we would be tran...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setGroup(group) { \n this.group = group; // a real implementation may need to do more than just this\n }", "modifyAlias(){\n this.setState(function({ keyDisplay, keyTypes, currKey, keyContext, edit, create }){\n const currAlias = keyDisplay[currKey];\n const aliases = keyCo...
[ "0.6221986", "0.6130452", "0.6045215", "0.591142", "0.58475703", "0.58165216", "0.58125186", "0.5748055", "0.5706628", "0.56864053", "0.56680465", "0.5622839", "0.55908775", "0.55732197", "0.5569321", "0.55627334", "0.555217", "0.555217", "0.5533852", "0.5511064", "0.5508735"...
0.74737215
0
returns a new QueryPreparationTimes instance that is the addition of this and the arguments.
add(...queryPreparationTimesArray) { if (arguments == null || arguments.length === 0) { throw new Error("arguments was null or empty"); } let queryCompilationTime = this.queryCompilationTime; let logicalPlanBuildTime = this.logicalPlanBuildTime; let physicalPlanBuildT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createFromArray(queryPreparationTimesArray) {\n if (queryPreparationTimesArray == null) {\n throw new Error(\"queryPreparationTimesArray is null or undefined item(s)\");\n }\n return QueryPreparationTimes.zero.add(...queryPreparationTimesArray);\n }", "beforeTime(before)...
[ "0.6422762", "0.5433821", "0.53270376", "0.52463007", "0.5228966", "0.5072192", "0.5038964", "0.5028338", "0.49255908", "0.4890786", "0.4838311", "0.4804738", "0.47748792", "0.47332004", "0.47288173", "0.4707276", "0.47042716", "0.4643287", "0.4641031", "0.46313912", "0.46204...
0.73478806
0
Output the QueryPreparationTimes as a delimited string.
toDelimitedString() { return (`${queryMetricsConstants_1.default.QueryCompileTimeInMs}=${this.queryCompilationTime.totalMilliseconds()};` + `${queryMetricsConstants_1.default.LogicalPlanBuildTimeInMs}=${this.logicalPlanBuildTime.totalMilliseconds()};` + `${queryMetricsConstants_1.default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prettyPrintTime() {\n let minutes = Math.floor(timeInSeconds / 60);\n let seconds = Math.floor(timeInSeconds - (minutes * 60));\n\n if (minutes < 10) {\n minutes = `0${minutes}`;\n }\n\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n\n ...
[ "0.5180021", "0.5081475", "0.49673063", "0.49429715", "0.49358773", "0.48848975", "0.4854471", "0.48153874", "0.4806291", "0.47833416", "0.4767999", "0.4744453", "0.47426754", "0.47360843", "0.47215515", "0.47172034", "0.47159383", "0.47110337", "0.46971667", "0.46956363", "0...
0.65978044
0
Returns a new instance of the QueryPreparationTimes class that is the aggregation of an array of QueryPreparationTimes.
static createFromArray(queryPreparationTimesArray) { if (queryPreparationTimesArray == null) { throw new Error("queryPreparationTimesArray is null or undefined item(s)"); } return QueryPreparationTimes.zero.add(...queryPreparationTimesArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(...queryPreparationTimesArray) {\n if (arguments == null || arguments.length === 0) {\n throw new Error(\"arguments was null or empty\");\n }\n let queryCompilationTime = this.queryCompilationTime;\n let logicalPlanBuildTime = this.logicalPlanBuildTime;\n let physi...
[ "0.7108527", "0.5207974", "0.5023288", "0.49837244", "0.49035576", "0.4817316", "0.4806431", "0.46770105", "0.46456167", "0.4621578", "0.46199673", "0.4604241", "0.46018925", "0.459795", "0.4574152", "0.45595652", "0.45469752", "0.45212802", "0.4513437", "0.44428375", "0.4422...
0.7877559
0
Returns a new instance of the QueryPreparationTimes class this is deserialized from a delimited string.
static createFromDelimitedString(delimitedString) { const metrics = queryMetricsUtils_1.QueryMetricsUtils.parseDelimitedString(delimitedString); return new QueryPreparationTimes(queryMetricsUtils_1.QueryMetricsUtils.timeSpanFromMetrics(metrics, queryMetricsConstants_1.default.QueryCompileTimeInMs), quer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createFromArray(queryPreparationTimesArray) {\n if (queryPreparationTimesArray == null) {\n throw new Error(\"queryPreparationTimesArray is null or undefined item(s)\");\n }\n return QueryPreparationTimes.zero.add(...queryPreparationTimesArray);\n }", "getP() {\r\n le...
[ "0.5556931", "0.5422499", "0.52414805", "0.5223174", "0.5059896", "0.4896834", "0.48702887", "0.46273035", "0.46136272", "0.44935423", "0.44905275", "0.4387913", "0.438111", "0.43406615", "0.43322963", "0.4299588", "0.4262187", "0.42410204", "0.42361167", "0.42279732", "0.422...
0.77024007
0
Class: Buffer ============= The Buffer constructor returns instances of `Uint8Array` that are augmented with function properties for all the node `Buffer` API functions. We use `Uint8Array` so that square bracket notation works as expected it returns a single octet. By augmenting the instances, we can avoid modifying t...
function Buffer (subject, encoding, noZero) { if (!(this instanceof Buffer)) return new Buffer(subject, encoding, noZero) var type = typeof subject // Workaround: node's base64 implementation allows for non-padded strings // while base64-js does not. if (encoding === 'base64' && type === 'string') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0...
[ "0.738729", "0.738729", "0.738729", "0.738729", "0.738729", "0.738729", "0.738729", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.7383567", "0.73835...
0.0
-1
BUFFER INSTANCE METHODS =======================
function hexWrite (buf, string, offset, length) { offset = Number(offset) || 0 var remaining = buf.length - offset if (!length) { length = remaining } else { length = Number(length) if (length > remaining) { length = remaining } } // must be an even number of digits var strLen = str...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function baseBuffer()\n{\n\n\tthis.fillState = new Object();\t// will hold the fill state of the buffer, in time and in bytes\n\tthis.fillState.bytes = 0;\n\tthis.fillState.seconds = 0;\t\t// only seconds are used in the time domain, feel free to use fractions\n\tthis.bufferSize = new Object(); // holds the size o...
[ "0.7648803", "0.7163817", "0.7161", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0.71106577", "0...
0.0
-1
We have to make sure that the value is a valid integer. This means that it is nonnegative. It has no fractional component and that it does not exceed the maximum allowed value.
function verifuint (value, max) { assert(typeof value === 'number', 'cannot write a non-number as a number') assert(value >= 0, 'specified a negative value for writing an unsigned value') assert(value <= max, 'value is larger than maximum value for type') assert(Math.floor(value) === value, 'value has a fractio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSafeInteger(value){return isInteger(value)&&value<=MAX_SAFE_INTEGER&&value>=MIN_SAFE_INTEGER;}", "function isSafeInteger(value) {\n return isInteger(value) && Math.abs(value) <= exports.MAX_SAFE_INTEGER;\n }", "function isSafeInteger(value) {\n return isInteger(value) && value <= MAX_...
[ "0.7890445", "0.75163484", "0.748034", "0.7354397", "0.726366", "0.726366", "0.726366", "0.72515494", "0.7242937", "0.7242937", "0.72404987", "0.72254133", "0.7225413", "0.7225413", "0.7225413", "0.7225413", "0.7225413", "0.7225413", "0.7211346", "0.72072333", "0.72072333", ...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.6147453", "0.54213846", "0.5392579", "0.53675246", "0.53675246", "0.53675246", "0.5339895", "0.5319325", "0.5319325", "0.5319325", "0.5308741", "0.5262595", "0.5256283", "0.5254879", "0.5254879", "0.5254879", "0.5254879", "0.5254879", "0.5254879", "0.5254879", "0.5254879",...
0.0
-1
NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) { return Array.isArray(ar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOfType(obj, type) {\n obj = Object(obj)\n return typeof type === \"string\"\n ? obj.constructor.name === type\n : obj instanceof type\n}", "function isType(obj, type) {\n return obj instanceof type\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "functio...
[ "0.63982826", "0.63873047", "0.6361072", "0.6344499", "0.6319065", "0.6296201", "0.6275683", "0.62698543", "0.62322557", "0.62190986", "0.6205903", "0.62046295", "0.61962634", "0.6161163", "0.6112339", "0.60521585", "0.603978", "0.6039746", "0.60234046", "0.6019949", "0.60169...
0.0
-1
Inline Lexer & Compiler
function InlineLexer(links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; this.renderer = this.options.renderer || new Renderer; this.renderer.options = this.options; if (!this.links) { throw new Error('Tokens array requires a `links` proper...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }", "static lexInline(src, options) {\n const lexer = new Lexer(options);\n return lexer.inlineTokens(src);\n }", "static lexInline(src, options) {\n const lexer = new Lexer(options);\n ...
[ "0.71313274", "0.71313274", "0.71313274", "0.70938486", "0.70413303", "0.70077187", "0.6918261", "0.6893087", "0.6699029", "0.6694871", "0.64784354", "0.64784354", "0.64784354", "0.64693296", "0.6402557", "0.6387189", "0.63408005", "0.6296867", "0.6278616", "0.6278616", "0.62...
0.621309
58
Simple explanation: Factories are functions that create and return objects. Constructor for defining new cars
function Car(options) { // Defaults this.doors = options.doors || 4; this.state = options.state || "New"; this.color = options.color || "Black"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CarFactory(make, model) {\n this.make = make;\n this.model = model;\n}", "function CarMaker(){}", "function CarMaker() {}", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory(){}", "function VehicleFactory() { }", "fun...
[ "0.80689377", "0.7245674", "0.7241126", "0.723335", "0.723335", "0.723335", "0.71423715", "0.7142123", "0.7142123", "0.7070125", "0.7021502", "0.6937416", "0.6933869", "0.6890621", "0.66839963", "0.66765225", "0.6638569", "0.6632809", "0.6632273", "0.6632273", "0.6625341", ...
0.0
-1
Constructor for defining new trucks
function Truck(options) { this.state = options.state || "used"; this.wheelsize = options.wheelsize || "large"; this.color = options.color || "blue"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Truck(make, model, year, color, seats, capacity, cargo) {\n\tthis.make = make,\n\tthis.model = model,\n\tthis.year = year,\n\tthis.color = color,\n\tthis.seats = 3;\n\tthis.capacity = 0;\n\tif(capacity){\n\t\tthis.capacity = capacity;\n\t};\n\tthis.cargo = 0;\n\tif(cargo){\n\t\tthis.cargo = cargo;\n\t};\n...
[ "0.73153716", "0.7191492", "0.71465635", "0.70883304", "0.7074456", "0.70332706", "0.70332706", "0.69701433", "0.69390965", "0.68225914", "0.6797647", "0.67333865", "0.6683277", "0.6674039", "0.66305447", "0.66073275", "0.66022354", "0.65901834", "0.65798825", "0.64246774", "...
0.6799865
10
FactoryExample.js Define skeleton of vehicle factory
function VehicleFactory() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VehicleFactory(){}", "function VehicleFactory() { }", "function VehicleFactory() { }", "function CarFactory(make, model) {\n this.make = make;\n this.model = model;\n}", "function Factory(){}", "function factory() {}", "function factory() {}", "function TruckFactory(){}", "function robot...
[ "0.8332234", "0.8283643", "0.8283643", "0.70508295", "0.6937906", "0.6578392", "0.6578392", "0.6544572", "0.650575", "0.6446236", "0.6446236", "0.64448047", "0.6411326", "0.6411326", "0.6386679", "0.6229884", "0.62040997", "0.620136", "0.6158737", "0.61556655", "0.6151908", ...
0.83968663
1
Approach 2: Subclass VehicleFactory to create a factory class that builds Trucks
function TruckFactory() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VehicleFactory() { }", "function VehicleFactory() { }", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory() {}", "function VehicleFactory(){}", "function TruckFactory(){}", "function CarFactory(make, model) {\n this.make = make;\n this.model = model;\...
[ "0.821464", "0.821464", "0.8164143", "0.8164143", "0.8164143", "0.8036995", "0.7638781", "0.6904095", "0.65471196", "0.61127645", "0.61077243", "0.6077244", "0.6055082", "0.60288405", "0.6018123", "0.59851825", "0.59639615", "0.59093857", "0.5870536", "0.5840431", "0.58322734...
0.7598775
8
Attempts to log out the current user. A request will be sent to the API to logout, but the local data will be cleared and the Promise will resolve no matter what response the API sends.
logout ({ commit }) { return new Promise((resolve, reject) => { commit(USER.LOGOUT) commit(PROFILE.LOGOUT) commit(GAMES.CLEAR_ALL) commit(PLATFORMS.CLEAR_ALL) resolve() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async logout () {\n this.state = 'pending'\n const token = this.rootStore.user.token\n if (!token) {\n this.state = 'done'\n console.info('No user was logged in')\n return\n }\n try {\n await Api({ token }).post('/logout/', {})\n runInAction(() => {\n this.state = 'do...
[ "0.7716634", "0.760221", "0.7583962", "0.74678504", "0.73584306", "0.7343154", "0.7338551", "0.7312891", "0.72850513", "0.72432077", "0.71907395", "0.71500194", "0.7141831", "0.7133047", "0.71066475", "0.7096611", "0.7089727", "0.7083486", "0.7066134", "0.70543444", "0.704099...
0.0
-1
Attempts to create a new user with the supplied data. If a new user is successfully created, the user is automatically logged in.
createUser ({ dispatch, commit }, userData) { return new Promise((resolve, reject) => { const request = apiHelper.axPost(apiUrls.register, userData) commit(USER.AJAX_BEGIN) axios(request) .then(res => { const authToken = res.data.key if (authToken) { commi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n ...
[ "0.76889634", "0.7546871", "0.7500126", "0.7404917", "0.73201644", "0.7271126", "0.7225281", "0.7190117", "0.7137502", "0.71367323", "0.7121348", "0.70974845", "0.7096131", "0.7094092", "0.70910174", "0.7082902", "0.7080592", "0.7078053", "0.70749635", "0.7046728", "0.7045290...
0.0
-1
Attempts to fetch user data from the API with the supplied auth token. If the attempt is successful, the returned data is committed to localStorage.
loadUserDataFromToken ({ dispatch, commit }, authToken) { // GET request to User API endpoint function userReq () { const request = apiHelper.axGet(apiUrls.user, authToken) return axios(request) } // GET request to Profile API endpoint function profileReq () { const request = apiH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async fetchUserData() {\n let token = localStorage.getItem('token');\n try {\n dispatch.breaks.setIsLoadingData(true);\n let response = await breakURL.get('/auth/me', {\n headers: { Authorization: `Bearer ${token}` },\n });\n dispatch.breaks.setUserData(response.data.data);\n ...
[ "0.6955281", "0.6568576", "0.64507395", "0.6353064", "0.6313865", "0.6306081", "0.6285472", "0.6245396", "0.6218115", "0.6218115", "0.618036", "0.6034379", "0.6011287", "0.5989749", "0.5979874", "0.5966258", "0.5966258", "0.5958045", "0.592214", "0.5919163", "0.5890304", "0...
0.0
-1
GET request to User API endpoint
function userReq () { const request = apiHelper.axGet(apiUrls.user, authToken) return axios(request) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "user(username) {\n return this.request(`/users/${username}`);\n }", "getUserById(id) {\n return this.http.get(\"http://localhost:8080/api/users/\" + id);\n }", "getUser(token,username){\n var myHeaders = new Headers();\n myHeaders.append('Content-Type', 'application/json');\n ...
[ "0.763761", "0.7366916", "0.7356878", "0.7355027", "0.7239064", "0.7211449", "0.71891093", "0.7152871", "0.7133169", "0.7116502", "0.70552737", "0.70550835", "0.70035154", "0.6995978", "0.69836175", "0.6965661", "0.6960265", "0.6953392", "0.6950008", "0.694397", "0.69393814",...
0.73088616
4
GET request to Profile API endpoint
function profileReq () { const request = apiHelper.axGet(apiUrls.profiles, authToken) return axios(request) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getProfileData(){\n let headers = loadHeaders();\n callAPI(server + \"api/mdm/profiles/search\",headers,\"profilesData\"); //get main profiles list\n\n}", "async getProfile() {\n const url = endpoints.accounts.get_profile;\n try {\n const response = await this.apiClient.get(url);\n if ...
[ "0.7455824", "0.7422001", "0.73742276", "0.7369401", "0.7300142", "0.7161758", "0.7161758", "0.714595", "0.7101363", "0.70907", "0.7051865", "0.7047092", "0.69896", "0.69663954", "0.6934381", "0.6926237", "0.6912155", "0.6896793", "0.68450123", "0.6842472", "0.68082356", "0...
0.7967861
0
Attempts to "relogin" from credentials stored in localStorage. Should be called first upon reloading the app.
checkForStoredLogin ({ getters, dispatch, commit }) { return new Promise((resolve, reject) => { let storedToken = localStorage.getItem('authToken') if (storedToken) { if (getters.userData.id) { resolve(getters.userData) } else { dispatch('loadUserDataFromToken', store...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reauthenticate(password, loginSuccess, loginError) {\n // fetch the current email\n let email = localStorage.getItem('email') \n\n this.login(email, password, loginSuccess, loginError);\n }", "prepareReauthenticate() {\n localStorage.removeItem('authToken');\n }", "_reauth...
[ "0.7350389", "0.6941698", "0.6797342", "0.6719209", "0.6532687", "0.6496992", "0.6427264", "0.64165795", "0.63725656", "0.6304876", "0.6278944", "0.62780476", "0.6252457", "0.62001455", "0.61344725", "0.6084086", "0.60578847", "0.60414606", "0.601127", "0.6007886", "0.5990153...
0.0
-1
0.Try to write all of the exercises using both the for loop and while loop. 1.Write a function sum that computes the sum of the numbers in an array.
function sum (array) { var total = 0 ; for (var i=0 ; i<array.length ; i++) { total += array[i] } return total ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeSum(arr){\n let sum =0;\n let input = prompt parseFloat(\"enter your numbers\");\n for(let i =0; i<arr.length; i++){\n sum = sum+arr[i];\n\n\n }\nreturn sum;\n\n}", "function sumArray(numbers) {\n// numbers.reduce((accumulator, currentValue) => accumulator + currentValue)\n//...
[ "0.7314928", "0.7287917", "0.72272205", "0.71572", "0.71153617", "0.7105448", "0.708724", "0.7075621", "0.70512646", "0.7028152", "0.70039135", "0.6986385", "0.6971587", "0.6963153", "0.69486606", "0.69477063", "0.6941838", "0.6918419", "0.6894821", "0.6878957", "0.6875237", ...
0.0
-1
2.Write a function max that accepts an array of numbers and returns the largest number in the array.
function max (array) { var a = 0; for (var i = 0 ; i < array.length ; i++) { if (array[i] > a) { a = array[i] ; } } return a ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function largest(array){\r\n\treturn Math.max.apply(Math,array);\r\n}", "function findMax(array) {\n}", "function getMax(array) {\n if (array.length === 0) return undefined;\n\n // let max = array[0];\n\n // for (let i = 1; i < array.length; i++) {\n // if (array[i] > max) {\n // max = array[i];\n ...
[ "0.8992243", "0.8835265", "0.873945", "0.8734597", "0.8727123", "0.87246794", "0.8718926", "0.8706693", "0.8706072", "0.8692525", "0.86874795", "0.8679588", "0.860716", "0.8594406", "0.8583995", "0.8583707", "0.857768", "0.8576551", "0.855656", "0.8554561", "0.85503906", "0...
0.86055064
13
3.Try the following at a console: 'the quick brown fox jumped over the lazy dog'.split(' '); 'Hello, world!'.split('') '1,2,3,4,5,6'.split(',') What is returned by split (You can read more about it here ( and how does it work? Use split to write a function longestWord that takes a string as an argument and returns the ...
function longestWord (str) { var arr = str.split(' ') var a = ''; for (i=0 ; i<arr.length ; i++) { if (arr[i].length > a.length) { a = arr[i] ; } } return a ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findLongestWord(sentence){\n\n var wordArray = sentence.split(' ')\n\n\n\n\n\n}", "function longestWord(sentence) {\n//Declaring variables used in the function longestWord\n var wordSeparator = sentence.split(' ');\n var longestLength = wordSeparator.length;\n var longerWord = ' ';\n //for loop t...
[ "0.78492475", "0.7736024", "0.76187056", "0.76065093", "0.75664556", "0.7551516", "0.75355536", "0.7515861", "0.75129735", "0.748157", "0.7469099", "0.7464325", "0.744032", "0.7437666", "0.7433979", "0.74127585", "0.7409942", "0.73847294", "0.7382227", "0.7379141", "0.7373332...
0.7198947
55
5.Write a function evens that accepts an array as an argument, and returns an array consisting of all of the even numbers in that array.
function even (array) { var arr = [] ; var j = 0 ; for (var i = 1 ; i < array.length ; i++) { if (array[i] % 2 === 0) { arr [j] = array [i] ; j++; } } return arr ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEvens(array){\n var evenArray = [];\n array.forEach(function (element) {\n if (element % 2 == 0){\n evenArray.push(element);\n }\n });\n return evenArray;\n}", "function evenNums(numArray) {\n var evens = [];\n for (var i = 0; i < numArray.length; i++) {\n if...
[ "0.85823065", "0.8537205", "0.8417332", "0.84146905", "0.8343574", "0.82777315", "0.8239947", "0.8192246", "0.81331736", "0.8094393", "0.806539", "0.80154586", "0.801169", "0.8008954", "0.797774", "0.7954011", "0.79532725", "0.7920367", "0.7878525", "0.7872571", "0.7859376", ...
0.79490715
17
More Practice 1.Write a function called average that takes an array of numbers as a parameter and returns the average of those numbers.
function average (array) { var n = array.length ; var a = 0 ; for (var i=0 ; i<n ; i++) { a+= array[i] } return a/n ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function average(array){\n function plus(a,b){return a+b}\n return array.reduce(plus)/array.length;\n}", "function average(array){\n function plus(a, b){return a + b;}\n return array.reduce(plus) / array.length;\n}", "function average(array) {\n function plus(a, b) {\n return a + b;\n }\n ret...
[ "0.8701117", "0.870056", "0.86915976", "0.8657277", "0.8656668", "0.865578", "0.865578", "0.865578", "0.865578", "0.865578", "0.865578", "0.86316526", "0.8571016", "0.8440771", "0.8388304", "0.8384008", "0.83729315", "0.8365046", "0.83532", "0.8344211", "0.83179575", "0.831...
0.8477165
13
2. Write a function called min that finds the smallest number in an array of numbers.
function min(array) { var a = Infinity; for (var i = 0 ; i < array.length ; i++) { if (array[i] < a) { a = array[i] ; } } return a ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function min(array){\n\tvar num1= array[0];\n\tvar num2;\n\tfor (var i = 0; i< array.length; i++){\n\t\tnum2= array[i]\n\t\tnum1= Math.min(num1, num2);\n\t}\n return num1;\n}", "function smallestNumber(array) {\n return Math.min(...array) \n}", "function min(arr){\n return sortNumbers(arr)[0];\n }", "fu...
[ "0.8801344", "0.87657773", "0.8755625", "0.8751055", "0.86882704", "0.8677516", "0.86730266", "0.86145586", "0.86020684", "0.8576688", "0.85212094", "0.85007954", "0.8476844", "0.8443339", "0.8422531", "0.84184605", "0.841253", "0.84117997", "0.8411261", "0.84041274", "0.8399...
0.8452246
13
3.Write a function shortestWord that works like longestWord, but returns the shortest word instead.
function shortestWord (str) { var arr = str.split(' ') var a = arr[0]; for (i=0 ; i<arr.length ; i++) { if (arr[i].length < a.length) { a = arr[i] ; } } return a ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shortestWord(string){\n\tvar array= string.split(' ');\n\tvar str1;\n\tvar str= array[0];\n\tfor (var i= 0; i < array.length; i++){\n\t\tif(array[i].length < str.length){\n\t\t\tstr1 = array[i];\n\t\t}\n\t}\n\treturn str1;\n}", "function shortestWords(words) {\n // Write your code here\n\n}", "func...
[ "0.7993145", "0.79691964", "0.78167987", "0.76808506", "0.7606862", "0.7473975", "0.74209756", "0.7275052", "0.71767735", "0.710153", "0.7096083", "0.69540405", "0.6874207", "0.67852527", "0.67594415", "0.67557263", "0.66726685", "0.6629389", "0.66093636", "0.65974826", "0.65...
0.80784625
0
4.Write a function countChar that takes two arguments: any string, and a character (string of one letter), and returns the number of times that the character occurs in the string.
function countChar(str,element){ var arr = str.split(''); var total = 0 ; for(i=0;i<arr.length;i++){ if(arr[i]=== element) total++; } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countCharacter(str, char) \r\n{\r\n if (!str)\r\n return 0;\r\n\r\n var count = 0;\r\n for(var i = 0; i < str.length; i++)\r\n {\r\n if(str.charAt(i) === char)\r\n count++;\r\n }\r\n \r\n return count;\r\n}", "function countChar(string, char) {\n var count = 0;\n for (var number = 0;...
[ "0.86216235", "0.8580482", "0.8572493", "0.85551023", "0.84987944", "0.8424085", "0.83873266", "0.838096", "0.8380724", "0.83631516", "0.8342174", "0.8332136", "0.8310113", "0.83097875", "0.82810044", "0.81318265", "0.8125658", "0.8049026", "0.7983929", "0.7973059", "0.796429...
0.75216556
32
5.Write a function evenLengthWords that takes an array of strings as an argument, and returns an array of just the words that have an even length.
function evenLengthWords (array) { var arr = [] ; var j = 0 ; for (var i = 0 ; i < array.length ; i++) { if (array[i].length % 2 === 0) { arr [j] = array [i] ; j++; } } return arr ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evenLengthWords(array){\n\tvar newArray= [];\n\tfor (var i=0; i < array.length; i++){\n\t\tif (array[i].length % 2 === 0){\n\t\t\tnewArray.push(array[i]);\n\t\t}\n\t}\n\treturn newArray;\n}", "function evenLength(arr) {\n let result = [];\n each(arr, function(word) {\n if(word.length % 2 === 0) {\n...
[ "0.8674105", "0.82586217", "0.7723268", "0.765842", "0.6665769", "0.6662714", "0.6659341", "0.6655495", "0.665087", "0.6619586", "0.66130024", "0.66065305", "0.6582697", "0.6554183", "0.65118533", "0.65022594", "0.64983696", "0.6433111", "0.6394597", "0.6387614", "0.6379805",...
0.8535915
1
Advanced 1.Read about the join method on MDN and use it to implement a function that accepts a string as an argument and returns that string reversed
function reverse(str){ var arr = str.split(''); var array = [] ; var j = 0 ; for (var i=arr.length-1 ; i >=0 ; i--) { array[j] = arr[i] ; j++ } return array.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverseMethod(string) {\r\n return [...string].reverse().join('');\r\n}", "function FirstReverse(str) { \nvar splitMe = str.split(\"\"); //split individual string characters into array\nvar reverseMe = splitMe.reverse(); //reverse the array\nvar joinMe = reverseMe.join(\"\"); //jo...
[ "0.78436047", "0.74431574", "0.7396843", "0.73525697", "0.7342747", "0.7285783", "0.7271317", "0.72659045", "0.7255337", "0.7251941", "0.72325224", "0.7175066", "0.7170412", "0.7168265", "0.7162536", "0.7151422", "0.7141815", "0.7066723", "0.70508546", "0.7046278", "0.7027888...
0.0
-1
2.Write a function keep that 'keeps' certain elements in an array. The function will need to take two arguments, an array, and something else the second argument will be what is used to determine which elements to keep. You should be able to use this function to write evens, evenLengthWords, a hypothetical odds functio...
function keep (array,element) { var arr = [] ; var j = 0 ; for (var i=0 ; i < array.length ; i++) { if (array[i] === element) { arr [j] = array[i] j++ } } return arr ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keepSingleWords(words) {\n\n}", "function destroyer(arr) {\n let newArr = [...arguments].slice(1);\n return arr.filter(a => !newArr.includes(a));\n}", "function task_3(){\nvar arrWord = ['can','the','a', 'an', 'top','button','peep', 'under', 'success'];\nvar newWord = arrWord.filter(function(elt){\...
[ "0.63552386", "0.6119123", "0.59956247", "0.5974087", "0.59456855", "0.59414893", "0.59234744", "0.5914361", "0.5906566", "0.58888215", "0.58888215", "0.5871497", "0.5855083", "0.5843992", "0.5837726", "0.582684", "0.5820936", "0.5798378", "0.57863146", "0.5753524", "0.574680...
0.59613454
4
Add element to the end of the list
add(element){ let node = new Node(element); let index = 0; let current; // First element if(this.head === null) this.head = node; // Add element to the end else{ current = this.head; // Iterate until we get to the end ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(element){\n this.addLast(element);\n }", "function addElementLast(element, array) {\n var idx = $.inArray(element, array);\n if (idx > -1) {\n array.splice(idx, 1);\n }\n array.push(element);\n}", "insert(element) {\n this.list[this.size] = element;\n this.size = this.size + 1;\n }"...
[ "0.77903694", "0.70424414", "0.6972977", "0.6893912", "0.685909", "0.6819303", "0.68156374", "0.6808986", "0.67926687", "0.6778807", "0.6754247", "0.67444247", "0.6736921", "0.67315054", "0.6710562", "0.6702228", "0.6666656", "0.66531754", "0.66347545", "0.663424", "0.6628414...
0.61381245
72
Add element at a certain index
insertAt(element, index){ // Index is at the end of the list if(index > this.size) return -1; let node = new Node(element); // Replacing the head if(index === 0){ node.next = this.head; this.head = node; } else{ le...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addOnIndex(index, value) {\n if (index < 0) {\n console.error(`Index must be greater than 0!`);\n return false;\n }\n\n index = Math.floor(index);\n\n if (this.length <= index) {\n this.add(value);\n } else {\n const temp = this.get(index);\n this.data[index] = value;\n\n ...
[ "0.76905555", "0.7583971", "0.7454234", "0.70608646", "0.69626", "0.6894156", "0.6883575", "0.6849179", "0.683059", "0.6779371", "0.67562866", "0.67399013", "0.67296183", "0.6721763", "0.6704269", "0.66921127", "0.6682155", "0.6681215", "0.66619503", "0.663159", "0.6625445", ...
0.61865664
67
Remove an element at a specific index
removeFrom(index){ if(index > this.size) return -1; let current = this.head; let previous = null; let i = 0; // Delete head if(index === 0){ this.head = current.next; } else{ // Get to the index we are removing...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(index) {\n // If the index argument is out of bounds\n if (index < 0 || index >= this.length) {\n // Throw an error if invalid index\n throw new Error('Index error');\n }\n // Move the array in memory to accomodate the removed item\n memory.copy(this.ptr + index, this.ptr + index + ...
[ "0.8235775", "0.8232277", "0.8159513", "0.81238276", "0.8011409", "0.7943267", "0.79412776", "0.7867277", "0.77822524", "0.77748775", "0.7699505", "0.76816386", "0.76724285", "0.76638025", "0.766195", "0.76496935", "0.7640821", "0.76374745", "0.76198727", "0.76188785", "0.760...
0.75123966
28
Get index of element
indexOf(element){ let count = 0; let current = this.head; // Iterate to our index while(current != null){ if(current.element === element) return count; count++; current = current.next; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get index() {\n\t\treturn parseInt(this.getAttribute('index'));\n\t}", "function getElementIndex(element, vect) {\n\tfor (var i = 0; i < vect.length; i++) {\n\t\tif (vect[i] == element) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}", "index(element) {\n return [].slice.call(this.node.childNodes).indexOf(e...
[ "0.7618706", "0.74171114", "0.73591095", "0.7312852", "0.72018033", "0.7197031", "0.719478", "0.7008239", "0.6977583", "0.69764507", "0.6914339", "0.6879228", "0.68698925", "0.6861215", "0.68198824", "0.67833215", "0.6776931", "0.67490435", "0.6743363", "0.67420727", "0.67350...
0.0
-1
Get element at index
elementAt(index){ if(index > this.size) return false; let i = 0; let current = this.head; // Iterate to our index while(i < index){ i++; current = current.next; } return current.element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getElementAtIndex(index) {\n return this.data[index];\n }", "getElement(name, index = 0) {\n return (this._elements[name] || this._makeElements(name))[index];\n }", "get(index) {\n this.rangeCheck(index);\n return this.elementData[index];\n }", "function accessElementInArray(array, i...
[ "0.8060264", "0.7702541", "0.76949275", "0.7651891", "0.7560714", "0.74759936", "0.74205226", "0.7231347", "0.72269964", "0.72249144", "0.7213815", "0.72121245", "0.7182569", "0.71813565", "0.71813565", "0.71813565", "0.7134925", "0.71152234", "0.7059307", "0.70564777", "0.70...
0.6871937
27
Get size of list
getSize(){ return this.size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function length() {\n\treturn this.listSize;\n}", "@expression(\"length of <List>\", {\n\t\talias: [\"size of <List>\", \"number of items (of|in) <List>\"]\n\t\ttypes: [ List ],\n\t\treturns: Integer\n\t})\n\tstatic length(list) {\n\t\tif (!(list instanceof List)) return undefined\n\t\treturn list.items.length\n...
[ "0.8350416", "0.82052696", "0.81346387", "0.8088315", "0.80882263", "0.79675317", "0.7961909", "0.7961909", "0.79572654", "0.7887066", "0.7867076", "0.78263736", "0.7768537", "0.77535826", "0.7703174", "0.76999", "0.7519909", "0.751031", "0.74795717", "0.74558055", "0.7384643...
0.0
-1
Print all elements to console
print(){ let current = this.head; let str = ""; while(current){ str += `${current.element} `; current = current.next; } return str.trim(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printAll(args) {\n args.forEach(function (element) { return console.log(element); });\n}", "function printAll(array) {\n\t\tconsole.log(\"prints...\");\n\t\tarray.forEach(function(string) {\n\t\t\tconsole.log(string);\n\t\t});\n\t}", "function print(element){\n\tconsole.log(element);\n}", "printA...
[ "0.7448552", "0.7359194", "0.72751147", "0.7213476", "0.7213476", "0.7059285", "0.68824494", "0.6876916", "0.6864329", "0.6772537", "0.6771792", "0.6763292", "0.67568266", "0.67388755", "0.6704166", "0.67032355", "0.6653879", "0.6639627", "0.66195065", "0.65924805", "0.658385...
0.660659
19
SSV 121620 import Button from "../Button"; import ButtonLink from './components/ButtonLink';
function Menu() { return ( <nav className="Menu"> <BrowserRouter> <Link to="/"> <img className="Logo" src={Logo} alt="Diego Vilela Logo" /> </Link> </BrowserRouter> </nav> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ButtonLink(_ref) {\n var props = _extends({}, _ref);\n\n return /*#__PURE__*/react_default.a.createElement(Button_Button[\"d\" /* default */], _extends({\n as: StyledButtonLink\n }, props));\n}", "function ButtonLink({ href, className, children }) {\n return (\n\n <a href={href} className={cla...
[ "0.60726357", "0.6017888", "0.58932954", "0.5812751", "0.57964104", "0.5770225", "0.5708288", "0.5707471", "0.5701245", "0.56912434", "0.56912434", "0.56871665", "0.56632376", "0.56576544", "0.56063265", "0.5600821", "0.5593399", "0.557695", "0.557695", "0.5554113", "0.554336...
0.0
-1
================== Approved_Orders List =================
function UpdateApproveRequestOrdeTable() { // Update order data from csv approve_order_request_table.rows().remove(); upload_approve_order_request_table(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrdersAwaitingApproval() {\n var criteria = {Type: \"Standard\", Status: \"AwaitingApproval\", DisplayName: \"Awaiting Approval\", LastN: 0, OrderID: null};\n $scope.orderLoadingIndicator = true;\n OrderSearch.search(criteria, function(list, count) {\n $scope.orderLoadin...
[ "0.7023568", "0.683067", "0.6627179", "0.65590435", "0.6523707", "0.65147156", "0.6274789", "0.6251685", "0.6247405", "0.6235716", "0.6204138", "0.6198815", "0.61269176", "0.6123018", "0.607538", "0.6044658", "0.6039505", "0.60238326", "0.60218644", "0.5974689", "0.59649724",...
0.0
-1
================== Placed_Orders List =================
function UpdatePlaceRequestOrdeTable() { // Update order data from csv place_order_request_table.rows().remove(); upload_place_order_request_table(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayOrders() {\n\n let data = FooBar.getData();\n let json = JSON.parse(data);\n\n //------------------------------ORDERS IN QUEUE-------------------------------------------\n // queue template\n orderTemplate = document.querySelector(\"#queue-template\").content;\n ...
[ "0.6838468", "0.6813952", "0.6784829", "0.6767761", "0.6710258", "0.6686043", "0.6646691", "0.66361415", "0.6603561", "0.6508461", "0.64950067", "0.64749056", "0.64622235", "0.64412075", "0.6404109", "0.6397866", "0.63496697", "0.6329318", "0.631299", "0.62769234", "0.6251832...
0.0
-1
"CCC.G...R...", // 0 initial state as passed ".CCCG...R...", // 1 "..CCC...R...", // 2 show 1st car, not the green light "..CCGC..R...", // 3 2nd car cannot enter intersection because 1st car blocks the exit "...CC.C.R...", // 4 show 2nd car, not the green light "...COC.CG...", // 5 3rd car stops for the orange light "...
function trafficLights(initialState, rounds) { const result = []; const statesEnum = { ROAD: '.', CAR: 'C', RED_LIGHT: 'R', ORANGE_LIGHT: 'O', GREEN_LIGHT: 'G', }; const getSpaceModel = (state) => { const type = getType(state); const iterations = getIterations(state, type); re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finePartita(){\n //controllo le righe\n if (this.state[0]!==\"\" && this.state[0]===this.state[1] && this.state[1]===this.state[2]){\n return this.state[0]\n }\n if (this.state[3]!==\"\" && this.state[3]===this.state[4] && this.state[4]===this.state[5]){\n return this.state[3]\n }\n ...
[ "0.5627166", "0.538113", "0.5254822", "0.5246452", "0.5203838", "0.51696265", "0.5164161", "0.51425713", "0.5125522", "0.51211244", "0.5115897", "0.5107382", "0.50635123", "0.5060613", "0.50512934", "0.50268924", "0.50199366", "0.494664", "0.49448112", "0.49393538", "0.493292...
0.45769048
68
Works by selecting one element called the "pivot" adn finds the index where the pivot should end up.
function quickSort(arr, left = 0, right = arr.length-1){ if(left < right){ let pivotIndex = pivot(arr, left, right); quickSort(arr, left, pivotIndex - 1); quickSort(arr, pivotIndex + 1, right); } return arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pivotColumn() {\n\t\tlet lastRow = this.tableau[this.tableau.length - 1];\n\t\tlet lowest = 0;\n\t\tfor (let i = 1; i < lastRow.length; i++) {\n\t\t\tif (lastRow[i] < lastRow[lowest]) lowest = i;\n\t\t}\n\t\tconsole.log(\"Pivot Column: \" + lowest);\n\t\tthis.pivColumn = lowest;\n\t}", "function findPivot(arr) {...
[ "0.68757564", "0.67296666", "0.6719227", "0.65793157", "0.65454423", "0.64993066", "0.6439911", "0.6418322", "0.63831866", "0.63368845", "0.6333255", "0.6322024", "0.63184005", "0.6315239", "0.63145965", "0.6280416", "0.62676823", "0.622228", "0.62222177", "0.62222177", "0.61...
0.0
-1
PROCESS AND PARSE JSON NOTE: write redundancy safeguard
function processJson(subAction) { // SET DEFAULT CANVAS $('#episode_inner_wrapper').show().empty(); // JSON PARSER $.getJSON('assets/json/content.json', function (data) { switch (subAction) { case 'episode': var search = data.episode; break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processJSON(JSONstr){\n var data = JSON.parse(JSONstr);\n doStuffWithJSON(data.fishyDevices);\n}", "function parseJSONPost(req, res, onResult) {\n\t\t\tvar postBody = \"\";\n\t\t\t\n\t\t\treq.on('data', function(chunk) {\n\t\t\t\tpostBody += chunk;\n\t\t\t});\n\t\t\t\n\t\t\treq.on('end', function(...
[ "0.66699463", "0.65834993", "0.65320754", "0.64890456", "0.6460807", "0.63905936", "0.63129395", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015", "0.62485015",...
0.0
-1
NOTES if screen is larger then just go maximum height of content or of items x amount SUB MODULE OPEN AND LOAD
function loadSubModule() { // CAPTURE MODULE SIZING ON TRANSITION var contentModule = $('#content_module'); contentModule .height(contentModule.height()) .width(contentModule.width()); // HANDLE SELECTED STATES $('.navigation_item').removeClass('selected'); el.addCl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setModulesListHeightAndScroll(isFirstTime) {\n\tvar height = $(window).height() - ($('.navbar').innerHeight());\n\tvar $el = $('.modules_list');\n\n\tif (!isFirstTime){\n\t\t$el.slimScroll({ destroy: true }).height('auto');\n\t\t$el.parent().find('.slimScrollBar, .slimScrollRail').remove();\n\t}\n\n\t$el....
[ "0.62032396", "0.61138785", "0.6095588", "0.6080353", "0.6058301", "0.60215485", "0.5941203", "0.5908876", "0.587106", "0.5866966", "0.5832428", "0.5810191", "0.5801592", "0.57872325", "0.57844377", "0.5766744", "0.5760874", "0.57388484", "0.5734292", "0.57340395", "0.5732188...
0.61486405
1
SET THE INDEX FOR ITEMS
function setZindex() { var zindex = 0 $('.single_card').reverse().each(function () { $(this).css({ zIndex: zindex }); zindex += 1; }); zindex = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setIndex(indx) {\n index = indx;\n}", "addIndices() {\n const children = this.getAllChildren()\n children.each((index, item) => {\n $(item).attr('data-index', index)\n })\n }", "set index(value) {\n\n }", "function setIndexes() {\n pa...
[ "0.6621519", "0.6533846", "0.6491374", "0.6486879", "0.62399596", "0.623316", "0.61923903", "0.6158607", "0.61396676", "0.60423374", "0.6037313", "0.5955745", "0.59343654", "0.59063494", "0.5793791", "0.5785667", "0.57708687", "0.575498", "0.5751791", "0.574805", "0.5700525",...
0.0
-1
SET SCALE OF EACH ITEM
function setScale() { visualEffects = []; cachedSiblings = []; var initScale = 1; var initOffset = 380; var setPerspective = 0; $('.single_card').each(function (i) { $this = $(this); // kickstart the gpu TweenMax.to($this, 0.0, { opacity: 1.0, scaleX: initS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setScale(sx, sy, sz){\n let e = this.elements;\n e[0] = sx; e[4] = 0; e[8] = 0; e[12] = 0;\n e[1] = 0; e[5] = sy; e[9] = 0; e[13] = 0;\n e[2] = 0; e[6] = 0; e[10] = sz; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n return this;...
[ "0.73342156", "0.713415", "0.6976131", "0.69271106", "0.68632984", "0.68160474", "0.6740986", "0.67137563", "0.6653305", "0.660885", "0.6599103", "0.6586854", "0.65558714", "0.65434986", "0.6536818", "0.6505473", "0.6505473", "0.64618796", "0.6460349", "0.6428095", "0.6421320...
0.6258789
35
SET SINGLE STACK CARD HANDLERS
function setHandler() { $('.single_card').off('click').on('click', function () { var siblingsInfront = $(this).prevAll(); roloToCard(siblingsInfront); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setHandler(){\n\t$('.single_card').off('click').on('click',function(){\n\t\tvar siblingsInfront = $(this).prevAll();\n\t\t\troloToCard(siblingsInfront);\n\t});\n}", "function Assign_Stack() {\r\n}", "reset() { // stackOperations = 2\r\n\r\n this.activeState = this.config.initial;\r\n thi...
[ "0.5880071", "0.58750635", "0.58541155", "0.57800114", "0.56717193", "0.5610298", "0.5605391", "0.55819964", "0.5563835", "0.5545015", "0.55357707", "0.5524975", "0.5496266", "0.54911983", "0.5482474", "0.54812115", "0.5428804", "0.54164493", "0.5373576", "0.5366264", "0.5322...
0.580151
3
Daniel's code ends Nick's code begin
function gridToStack(){ subNavHandler(0, 'singlestack', 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "static private internal function m121() {}", "private public function m246() {}", "static get END() { return 6; }", "transient protected internal function m189() {}", "function Yielder() {}", "function Main()\n {\n ...
[ "0.6186737", "0.6151157", "0.61015195", "0.60986614", "0.59997845", "0.58455205", "0.57515174", "0.57003206", "0.56217676", "0.5600505", "0.55966413", "0.557402", "0.5551365", "0.5548396", "0.55417067", "0.5532932", "0.55328935", "0.5515334", "0.5515334", "0.55079657", "0.550...
0.0
-1
Sending login data to server The server will create a token and send it back if the user is registered we store the token in local storage and isAuthenticated to true And we send a notification then we push the user to the account page
async function sendreq(e) { try { e.preventDefault(); const quest = {"email" : email,"password" : password} // console.log(quest) const resp = await axios.post('http://127.0.0.1:8000/login', quest); console.log(resp.data.jwt); localStorage....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login(){\n\tfetch(config.server+'/user/login', {\n method: 'post',\n body: JSON.stringify({\n \"token\":token,\n \"code\":get(\"code\")\n\t\t\t})\n\t})\n\t.then(function(response) {\n\t\treturn response.json();\n\t})\n\t.then(function(json){\n\t\tif(json.code==0){\n\t\t...
[ "0.7132994", "0.71092194", "0.69504386", "0.69221157", "0.68875194", "0.6868315", "0.6858611", "0.6852787", "0.68414104", "0.68406504", "0.678536", "0.67847687", "0.6769609", "0.6769483", "0.6769483", "0.67544705", "0.6731568", "0.67273545", "0.67151016", "0.67058873", "0.669...
0.626136
81
var date = new Date(); var s = date.toString();
function sortTable(table, order) { var asc = order === 'asc', tbody = table.find('tbody'); tbody.find('tr').sort(function(a, b) { if (asc) { return $('td:first', a).text().localeCompare($('td:first', b).text(), false, {numeric: true}); } else { return $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDate() {\n document.write((new Date()).toDateString());\n}", "function dateString () {\n now = new Date();\n year = \"\" + now.getFullYear();\n month = \"\" + (now.getMonth() + 1); if (month.length == 1) { month = \"0\" + month; }\n day = \"\" + now.getDate(); if (day.length == 1) { day = \"0\...
[ "0.8011572", "0.7864881", "0.77834827", "0.7644507", "0.76436", "0.76148766", "0.7609566", "0.7609566", "0.75816387", "0.75501853", "0.74381936", "0.74086064", "0.74051315", "0.73824143", "0.7379033", "0.7370584", "0.7370584", "0.73647726", "0.73467875", "0.7344325", "0.73440...
0.0
-1
delete quan ly truong School
function deleteSchoolManagement() { // $('#listUserManager tbody').on('click', '.btn', function(){ // var currow = $(this).closest('tr'); // var col1 = currow.find('td:eq(0)').text(); // alert(col1); // }) var address = $('#deleteModal .modal-body p').text(); // var address = "0x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deletehsSubject(hssubject){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('subjectModel').indexOf(hssubject);\n var restemp = this.get('subjectModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n...
[ "0.65325016", "0.65022665", "0.64670926", "0.64532375", "0.6345281", "0.6334316", "0.62997043", "0.6292392", "0.62048775", "0.61743176", "0.61727524", "0.6100487", "0.60810727", "0.60567534", "0.605628", "0.6052699", "0.60520434", "0.6045194", "0.60387766", "0.6032186", "0.60...
0.0
-1
switch statement for correct answers
function getResponse() { switch (correctAnswer) { case 0: alert('You didn\'t get any correct! Time to study'); break; case 1: alert('You only got one correct. Shameful.'); break; case 2: alert('Two correct is marginal.'); break; case 3: alert('Th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determineAnswer() {\n switch (answer) {\n case 'Yes':\n timeGTOne = 1\n GettingBlobsOfDoom()\n break;\n case 'No':\n writeText('All righty then. See ya later!')\n InInn()\n break;\n }\n }", "function checkAnswer(answer, answerSelection) {\n //W...
[ "0.74831593", "0.7206412", "0.71646416", "0.7129329", "0.7103398", "0.70754135", "0.7055524", "0.70506054", "0.7036399", "0.7014475", "0.7005349", "0.6997174", "0.6996977", "0.69889885", "0.69543606", "0.69351375", "0.6926386", "0.6878356", "0.6867719", "0.68583375", "0.68434...
0.7519057
0
Faz uma varredura em todas as colunas
function gameComplete() { var linhas = ["A", "B", "C", "D", "E", "F", "G", "H", "I"]; var gameComplete = false; for (var i = 1; i <= 9; i++) { consoleDebug('Coluna: ', i); for (var j = 0; j < 9; j++) { if (hasValue(linhas[j] + i)) gameComplete = true;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function armarColumnasGlobal() {\n\n inicioTiempo = new Date();\n\n for (let i = 0; i < datosEntrada.length; i++) {\n datosEntrada[i] = datosEntrada[i].split(/\\t/g);\n };\n\n // Comprueba que estén todas las columnas\n if (datosEntrada[0].length > 7) {\n bootbox.alert(\"El máximo perm...
[ "0.6577649", "0.6545022", "0.6478006", "0.64244133", "0.6271354", "0.6264946", "0.6254503", "0.6115193", "0.60944724", "0.6039619", "0.59945786", "0.59907913", "0.5953925", "0.58537406", "0.5817865", "0.5765348", "0.5765004", "0.57442194", "0.5723583", "0.56955683", "0.5691",...
0.0
-1
Coloca os possiveis valores num temporario
function setPossibleValues(line, column) { //Line letter, column: number var defaultArray = [1, 2, 3, 4, 5, 6, 7, 8, 9]; var tmpLine = checkline(line); var tmpColumn = checkColumn(column); var tmpSquare = checkSquare(getQuadrante(line + column)); consoleDebug(tmpLine); console...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lagalNumOfSearchRecipes(num) {\n if (inRange(num, 0, 5)) {\n num = 5;\n } else if (inRange(num, 6, 10)) {\n num = 10;\n } else {\n num = 15;\n }\n return num;\n}", "function number(numbers) { }", "function sequencia3(num) {\n return 0\n}", "function ejercicio3(){\n let numero4=prom...
[ "0.61570567", "0.61265355", "0.6104517", "0.6081579", "0.6030927", "0.60308737", "0.5992923", "0.59920394", "0.59848475", "0.5961609", "0.59302855", "0.5877299", "0.5871016", "0.5848218", "0.58004946", "0.579355", "0.5793447", "0.5791481", "0.5781784", "0.5778029", "0.577332"...
0.0
-1
Remove duplicidade de um array
function unique(array) { return array.filter(function (el, index, arr) { return index == arr.indexOf(el); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dedupeArr(arr){\n\n}", "function removeDuplicates(array) {\n return array.filter((arr, index) => array.indexOf(arr) === index);\n }", "function dedupe(arr) {\n return arr.reduce(function(newArray, item) {\n if(newArray.indexOf(item) < 0) {\n newArray....
[ "0.8026306", "0.7610876", "0.76028186", "0.75397646", "0.74989194", "0.7479078", "0.7473973", "0.74634385", "0.74315524", "0.7425926", "0.7423978", "0.7423815", "0.7419348", "0.7406239", "0.7402202", "0.73871267", "0.7381017", "0.7362572", "0.73157036", "0.7313534", "0.730781...
0.0
-1
check SVG SMIL animation support
function isSVG() { var ret, svgNode, name, create = document.createElementNS, SVG_URL = 'http://www.w3.org/2000/svg'; if (create) { create = create.bind(document); svgNode = create(SVG_URL, 'animate'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsSvg() {\n\t\treturn !! document.createElementNS &&\n\t\t\t!! document.createElementNS(\"http://www.w3.org/2000/svg\",\"svg\").createSVGRect;\n\t}", "animate() {\n if(this.finishedAnimating) {\n return false;\n }\n\n const svg = this.shadowRoot.querySelector(\"svg\...
[ "0.6536779", "0.6531135", "0.6431802", "0.6431233", "0.63198006", "0.62712485", "0.61704934", "0.6088595", "0.60374075", "0.59883296", "0.5981457", "0.5896632", "0.58426905", "0.5809646", "0.5803605", "0.5796509", "0.5796399", "0.57887286", "0.5760543", "0.57526135", "0.57206...
0.7223655
0
Called by index.html as frame selection was changed
function selectFrame(){ mode = SEQUENCE; let lastIndex = index; index = Number(frameInput.value); // Init first slide, only one slide, last slide not validated if( ( (index == 1) && (nbslides == 1)) || ( (index == 0) && (nbslides == 1)) /*|| (index == lastIndex)*/ ){ sequence.slides.push({d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onFrameChange(index) {\n changedFromWithin = true;\n window.location.hash = '#' + (index + 1);\n }", "checkSelection_() {\n const {activeElement} = this.win_.document;\n\n if (!activeElement) {\n return;\n }\n\n const changeOccurred = activeElement !== this.lastSelectio...
[ "0.6744829", "0.67190266", "0.66993976", "0.65835255", "0.64128244", "0.64128244", "0.62803173", "0.62803173", "0.62803173", "0.62803173", "0.62533396", "0.62147343", "0.60703933", "0.60609764", "0.602291", "0.59590256", "0.590773", "0.590773", "0.5906852", "0.5903119", "0.58...
0.5709852
29
expands text area on contact page based on amount of text typed
function expandTextarea(id) { document.getElementById(id).addEventListener('keyup', function() { this.style.overflow = 'hidden'; this.style.height = 0; this.style.height = this.scrollHeight + 'px'; }, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CharTextarea(){\n\t\t\tvar maxChar = 350;\n\t\t\tvar textAreaDesc = $('.description_textarea');\n\t\t\tvar lengthLeft = $('.length-left');\n\n\t\t\tlengthLeft.html( textAreaDesc.val().length );\n\t\t\t\n\t\t\ttextAreaDesc.on('keyup', function(){\n\t\t\t\tif( $(this).val().length > maxChar ){\n\t\t\t\t\tre...
[ "0.681955", "0.6779717", "0.67676026", "0.66854066", "0.66211885", "0.6614638", "0.6596697", "0.6556306", "0.64704293", "0.6396137", "0.63296443", "0.6316145", "0.63009083", "0.6297782", "0.6291869", "0.62742436", "0.61872125", "0.6138429", "0.6134422", "0.612945", "0.6092250...
0.6054002
24