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
Spotify This Song Declaration
function songSearch(searchTerm) { spotify.search({ type: "track", query: searchTerm}, function(err, data) { if (err) { return console.log("Error occurred: " + err); } console.log("Song Name : " + data.tracks.items[0].name); console.log("Album Name : " + data.tracks.items[0].album.name); console...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spotifyThisSong(){\n\n var spotify = new spotify({\n \tid: keys.spotify.id,\n \tsecret: keys.spotify.secret\n });\n\n\tvar searchSong;\n\tif(userInput2 === undefined){\n\t\tsearchSong = \"What's My Age Again?\";\n\t}else{\n\t\tsearchSong = userInput2;\n\t}\n\n\tspotify.search({type:'track', query:sear...
[ "0.75549436", "0.7448532", "0.74404746", "0.74301296", "0.7422182", "0.7409571", "0.7366489", "0.7344798", "0.73334706", "0.7325881", "0.7299676", "0.7277671", "0.72775257", "0.72644013", "0.7255136", "0.72502863", "0.72398895", "0.7231037", "0.72052175", "0.71638006", "0.713...
0.6588851
87
Do What It Says Declaration
function randomSearch() { fs.readFile("random.txt", "utf8", function(err, data) { if (err) { return console.log(err); } console.log(data); data = data.split(","); SC(data[0], data[1]); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Declare() {\r\n}", "function doSomething() {\n console.log(\"declaration\");\n}", "function foo() {\n a = 1; // no declaration\n}", "function sayHello(){\n console.log('Hello, from Declaration');\n}", "function functionDeclaration() {}", "function foo() {\n\ta = 1;\t// `a` not formally decl...
[ "0.68639904", "0.6375953", "0.619493", "0.6113572", "0.60994565", "0.60557234", "0.6004544", "0.5965478", "0.5963801", "0.5933583", "0.5893463", "0.58917296", "0.58862823", "0.58482766", "0.58428484", "0.5775253", "0.5760134", "0.57120484", "0.5692012", "0.56873584", "0.56839...
0.0
-1
TODO: Expand this out, make everything more modular and cleaner builds a dictionary of string > color, in HSL format
function colorHashStrings(arr) { var color_hash = {}; for(var i=0,N=arr.length;i<N;i++) { var title = arr[i]; color_hash[title] = "hsl(" + Math.floor((i+0.5)/N * 360) + ",100%,60%)"; } return color_hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateHSL(){\n\n // get the maximum and range of the RGB component values\n var maximum = Math.max(rgb.r, rgb.g, rgb.b);\n var range = maximum - Math.min(rgb.r, rgb.g, rgb.b);\n\n // determine the lightness in the range [0,1]\n var l = maximum / 255 - range / 510;\n\n // store the H...
[ "0.7535816", "0.73860615", "0.73344064", "0.7271034", "0.7264309", "0.7230506", "0.71453935", "0.7144785", "0.71157527", "0.7088299", "0.7072979", "0.7061943", "0.70421094", "0.701669", "0.6994497", "0.6972261", "0.6970622", "0.6970504", "0.6889793", "0.68860203", "0.6853088"...
0.64503866
97
Javascript promises utilites. I like promises <3
function get(url) { return new Promise(function(resolve, reject) { var req = new XMLHttpRequest(); req.open('GET', url); req.onload = function() { if (req.status == 200) { resolve(req.response); } else { reject(Error(req.statusText)); } }; req.onerror = func...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forkingPromises(promise, resolutionHandler, rejectionHandler) {}", "function r(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "function r(e,t,a,i){return new(a||(a=Promise))(function(n,r){function s(e){try{l(i.next(e))}catch(t){r(t)}}function o(e){try{l(i[\"throw\"](...
[ "0.7225605", "0.70647925", "0.6919579", "0.6893217", "0.6873702", "0.6861232", "0.685952", "0.685952", "0.6840935", "0.6797118", "0.6797118", "0.6748507", "0.67428625", "0.67177474", "0.66712224", "0.66618764", "0.66583407", "0.66444397", "0.66341376", "0.6623009", "0.6622093...
0.0
-1
takes window and key events (ew and ek) and assigns key events to windows. Returns the total number of keys pressed in every window. Uses a mergesortlike strategy
function computeKeyStats(ew, ek) { var key_stats = {}; var i = 0; var j = 0; var ewn = ew.length; var ekn = ek.length; var cur_window = ''; // merge sort, basically while(i<ewn && j<ekn) { var popw; // pop window event? if(i>=ewn) { popw = false; } else if(j>=ekn) { popw = true; } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_registerKeyPressEvents() {\n window.addEventListener(\"keydown\", ((event) => {\n const increase = 1;\n this._handleKeyEvent(event.keyCode, increase);\n }));\n window.addEventListener(\"keyup\", ((event) => {\n const increase = -1;\n this._handleKeyEvent(event.keyCode, increase);\n ...
[ "0.6177083", "0.5790267", "0.5551154", "0.54256696", "0.54096866", "0.536796", "0.536756", "0.53666615", "0.533392", "0.5329581", "0.5315139", "0.52757806", "0.5184331", "0.51278234", "0.51254714", "0.50987405", "0.50823516", "0.50757736", "0.5071406", "0.5059031", "0.5042129...
0.73372036
0
same idea as computeKeyStats, but outputs "hacking" events, which are contiguous areas of high keystroke activity. That means that the person is in hacking mode! :)
function computeHackingStats(ew, ek, hacking_titles) { var hacking_stats = {}; var hacking_events = []; var i = 0; var j = 0; var ewn = ew.length; var ekn = ek.length; var cur_window = ''; var hacking_title = false; var hacking_counter = 0; var hacking_reset_counter = 0; var hacking_now = false;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeKeyStats(ew, ek) {\n var key_stats = {};\n var i = 0;\n var j = 0;\n var ewn = ew.length;\n var ekn = ek.length;\n var cur_window = '';\n \n // merge sort, basically\n while(i<ewn && j<ekn) {\n var popw; // pop window event?\n if(i>=ewn) { popw = false; }\n else if(j>=ekn) { popw ...
[ "0.60581124", "0.5921833", "0.574813", "0.5459411", "0.53844744", "0.53443843", "0.5288618", "0.525054", "0.52375317", "0.5235757", "0.52350885", "0.52053475", "0.51827514", "0.51816916", "0.5171738", "0.516006", "0.5151047", "0.51479715", "0.51255846", "0.51203495", "0.50986...
0.7435242
0
redraw to current canvas according to what is currently stored in recordedPattern add numbers to each stroke
function redraw() { ctx.clearRect(0, 0, w, h); for(var i = 0;i<recordedPattern.length;i++) { var stroke_i = recordedPattern[i] ctx.font = "20px Arial"; ctx.fillText(i.toString(), stroke_i[0][0]+20, stroke_i[0][1]+20); for(var j = 0; j<stroke_i.length-1;j++) { prevX = stroke_i[j...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n if (this.currentPatternScale !== this.requestedPatternScale) {\n // Set pattern width\n this.gl.uniform1f(this.uPatternWidth, this.requestedPatternScale);\n this.gl.drawArrays(this.gl.TRIANGLES, 0, 6);\n this.currentPatternScale = this.requestedPatternS...
[ "0.6717918", "0.62450117", "0.61408937", "0.6075303", "0.603928", "0.60214674", "0.60206974", "0.5986003", "0.59269714", "0.59257597", "0.59145004", "0.5913596", "0.57858366", "0.577495", "0.5774138", "0.5753165", "0.57143384", "0.5703828", "0.5700059", "0.57000476", "0.56957...
0.8101636
0
linear normalization for recordedPattern
function normalizeLinear() { var normalizedPattern = new Array(); newHeight = 256; newWidth = 256; xMin = 256; xMax = 0; yMin = 256; yMax = 0; // first determine drawn character width / length for(var i = 0;i<recordedPattern.length;i++) { var stroke_i = recordedPattern[i]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalize() {\r\n this.scale(1 / this.norm());\r\n }", "function momentNormalize() {\n\t\t\t\n\t\tnewHeight = 256;\n\t\tnewWidth = 256;\n\t\txMin = 256;\n\t\txMax = 0;\n\t\tyMin = 256;\n\t\tyMax = 0;\n\t\t// first determine drawn character width / length\n\t\tfor(var i = 0;i<recordedPattern.length;i++)...
[ "0.6418644", "0.63349575", "0.63224775", "0.6319757", "0.6316619", "0.614222", "0.60110265", "0.5895922", "0.5852229", "0.5752786", "0.5700738", "0.56833214", "0.56552345", "0.5619101", "0.56130403", "0.5532494", "0.55004597", "0.5478936", "0.54216975", "0.54075044", "0.53899...
0.7025181
0
helper functions for moment normalization
function m10(pattern) { var sum = 0; for(var i=0;i<pattern.length;i++) { var stroke_i = pattern[i]; for(var j=0;j<stroke_i.length;j++) { sum += stroke_i[j][0]; } } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalize(date) {\n if (date instanceof moment) {\n return date.valueOf()\n } else {\n return moment(date).valueOf();\n }\n}", "function oldMomentFormat(mom,formatStr){return oldMomentProto.format.call(mom,formatStr);// oldMomentProto defined in moment-ext.js\n}", "function M(c,d,e){var f,g,h...
[ "0.66081023", "0.6044043", "0.5962719", "0.59273267", "0.58715636", "0.5859778", "0.5836313", "0.58284295", "0.58044887", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952", "0.5802952"...
0.0
-1
main function for moment normalization
function momentNormalize() { newHeight = 256; newWidth = 256; xMin = 256; xMax = 0; yMin = 256; yMax = 0; // first determine drawn character width / length for(var i = 0;i<recordedPattern.length;i++) { var stroke_i = recordedPattern[i]; for(var j = 0; j<stroke_i.length;j++) { x = stroke_i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async normalize () {\n\t}", "function normalize(date) {\n if (date instanceof moment) {\n return date.valueOf()\n } else {\n return moment(date).valueOf();\n }\n}", "normalize() {var m = this.magnitude();return new M.XY(this.x/m,this.y/m);}", "function DateNorm(date1)\n{\n var day1 = addZero(date1....
[ "0.5693115", "0.5648308", "0.5586692", "0.5453007", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.53055406", "0.5291558", "0.5276469", "0.5256818", "0....
0.6646768
0
extract points in regular intervals
function extractFeatures(kanji, interval) { var extractedPattern = new Array(); var nrStrokes = kanji.length; for(var i = 0;i<nrStrokes;i++) { var stroke_i = kanji[i]; var extractedStroke_i = new Array(); var dist = 0.0; var j = 0; while(j < stroke_i.length) { // always ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointsToIntervals(points) {\n\t\t\tvar sections = [];\n\t\t\tfor (var i = 0; i < points.length - 1; i++) {\n\t\t\t\tsections.push({\n\t\t\t\t\tstart: points[i],\n\t\t\t\t\tend: points[i+1],\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn sections;\n\t\t}", "getPointsToMeasure(i, points) {\n const len = this....
[ "0.69084364", "0.6207982", "0.6190064", "0.6170224", "0.6073109", "0.5989368", "0.5976063", "0.59128726", "0.5912003", "0.5912003", "0.59043187", "0.5903332", "0.5888096", "0.58859086", "0.5868255", "0.58656204", "0.5851879", "0.58258677", "0.58193684", "0.5791396", "0.578261...
0.60055786
5
given to pattern, determine longer (more strokes) and return quadruple with sorted patterns and their stroke numbers [k1,k2,n,m] where n >= m and they denote the of strokes of k1 and k2
function getLargerAndSize(pattern1, pattern2) { var l1 = pattern1.length; var l2 = pattern2.length; // definitions as in paper // i.e. n is larger var n = l1; var m = l2; var k1 = pattern1; var k2 = pattern2; if(l1 < l2) { m = l1; n = l2; k1 = pattern2; k2 = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMap(pattern1, pattern2, distanceMetric) {\n var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t // larger is now k1 with length n\n\t var L = 3;\n\t var map = initStrokeMap(k1, k2, distanceMetric);\n\t for(var l=0;l<L;l++) {\n\t for(var i=0;i<map.length;i++) {\n\t\t if...
[ "0.599916", "0.587939", "0.5777811", "0.57579035", "0.5703892", "0.5668299", "0.55634385", "0.55430466", "0.54920954", "0.54695654", "0.54334766", "0.5402139", "0.53998893", "0.53371435", "0.53319514", "0.52785337", "0.52666193", "0.52535033", "0.5243156", "0.52260876", "0.52...
0.6226737
0
initialize Nstroke map by greedy initialization
function initStrokeMap(pattern1, pattern2, distanceMetric) { var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2); // larger is now k1 with length n var map = new Array(); for(var i=0;i<n;i++) { map[i] = -1; } var free = new Array(); for(var i=0;i<n;i++) { free[i] = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initMap() {\n}", "function initialize() {\n initMap();\n initMap2();\n initMap3();\n initMap4();\n initMap5();\n initMap6();\n initMap7();\n initMap8();\n initMap9();\n initMap10();\n initMap11();\n initMap12();\n initMap13();\n}", "initialiserMap() {\n this.terrain = {};\n this.arr...
[ "0.66272783", "0.6602634", "0.6408805", "0.6308139", "0.6307251", "0.62891483", "0.6201576", "0.6196556", "0.618178", "0.61779195", "0.61768484", "0.6156613", "0.61179537", "0.60312945", "0.6013377", "0.59621954", "0.59573394", "0.59537625", "0.59531325", "0.5937233", "0.5907...
0.5679974
48
get best Nstroke map by iterative improvement
function getMap(pattern1, pattern2, distanceMetric) { var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2); // larger is now k1 with length n var L = 3; var map = initStrokeMap(k1, k2, distanceMetric); for(var l=0;l<L;l++) { for(var i=0;i<map.length;i++) { if(map[i] != -1) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFreePointsMap(){\n var index=0;\n for (var i = 0; i < 20; i++){\n for (var j = 0; j < 20; j++){\n /*if((j==0 && i == 1) || (j==0 && i == 18) || (j==1 && i >=1 && i <= 8) || (j==1 && i == 11) || (j==1 && i == 14) || (j==1 && i == 18) || (j>=2 && j<=3 && i == 1) || (j>=2 && j<=...
[ "0.6094158", "0.6045113", "0.58593327", "0.58511907", "0.5826497", "0.57855105", "0.5747024", "0.57104266", "0.56700873", "0.566276", "0.5630469", "0.55850697", "0.5577344", "0.55050623", "0.5470205", "0.54644924", "0.54357827", "0.5435143", "0.54227835", "0.5414984", "0.5409...
0.5465297
15
from optimal Nstroke map create MN stroke map
function completeMap(pattern1, pattern2, distanceMetric, map) { var [k1,k2,_,_] = getLargerAndSize(pattern1, pattern2); if(!map.includes(-1)) { return map; } // complete at the end var lastUnassigned = map[map.length]; var mapLastTo = -1; for(var i = map.length -1; i>=0;i--) { if(map[i] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWalls(map)\n{\n //var n = [];\n for (var y = 0; y < map.length; y++)\n {\n for (var x = 0; x < map[0].length; x++)\n {\n if (map[y][x] === 1 && map[y][x] !== 2)\n {\n if (y > 0 && y < map.length - 1 && x > 0 && x < map[0].length - 1)\n ...
[ "0.61773795", "0.59888643", "0.5980804", "0.59603465", "0.5868056", "0.5815594", "0.57776827", "0.5740632", "0.570288", "0.5688215", "0.5637423", "0.56132686", "0.55946493", "0.5532609", "0.5530165", "0.55299824", "0.5509947", "0.5494562", "0.5475377", "0.54525065", "0.543963...
0.0
-1
given two patterns, MN stroke map and distanceMetric function, compute overall distance between two patterns
function computeDistance(pattern1, pattern2, distanceMetric, map) { var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2); var dist = 0.0; var idx = 0; while(idx < n) { var stroke_idx = k2[map[idx]]; var start = idx; var stop = start+1; while(stop<map.length && map[stop] == map[idx])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeWholeDistanceWeighted(pattern1, pattern2, map) {\n\t var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t\t var dist = 0.0;\n\t\t var idx = 0;\n\t\t while(idx < n) {\n\t\t var stroke_idx = k2[map[idx]];\n\t\t\t var start = idx;\n\t\t\t var stop = start+1;\n\t\t\t while(stop<map.leng...
[ "0.79045045", "0.7536395", "0.66416645", "0.6639337", "0.62904197", "0.6246151", "0.6208707", "0.61748123", "0.6099089", "0.60825825", "0.60693264", "0.6055923", "0.6053753", "0.60351485", "0.6018034", "0.601684", "0.60049057", "0.5996952", "0.599511", "0.5985751", "0.598191"...
0.8480378
0
given two patterns, MN strokemap, compute weighted (respect stroke length when there are concatenated strokes using the wholeWhole distance
function computeWholeDistanceWeighted(pattern1, pattern2, map) { var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2); var dist = 0.0; var idx = 0; while(idx < n) { var stroke_idx = k2[map[idx]]; var start = idx; var stop = start+1; while(stop<map.length && map[stop] == map[idx]) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeDistance(pattern1, pattern2, distanceMetric, map) {\n\t var [k1,k2,n,m] = getLargerAndSize(pattern1, pattern2);\n\t\t var dist = 0.0;\n\t\t var idx = 0;\n\t\t while(idx < n) {\n\t\t var stroke_idx = k2[map[idx]];\n\t\t\t var start = idx;\n\t\t\t var stop = start+1;\n\t\t\t while(stop<map.l...
[ "0.6859111", "0.6382046", "0.61846435", "0.6070335", "0.60025054", "0.58618987", "0.58518267", "0.57752645", "0.5589332", "0.55762297", "0.5543692", "0.54629177", "0.53604156", "0.5351157", "0.5324184", "0.53175575", "0.5310477", "0.53043723", "0.5255477", "0.52330554", "0.52...
0.7996782
0
apply coarse classficiation w.r.t. inputPattern considering _all_ referencePatterns using endpoint distance
function coarseClassification(inputPattern) { var inputLength = inputPattern.length; var candidates = []; for(var i=0;i<refPatterns.length;i++) { var iLength = refPatterns[i][1]; if(inputLength < iLength + 2 && inputLength > iLength-3) { var iPattern = refPatterns[i][2]; var iMa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fineClassification(inputPattern, inputCandidates) {\n\t var inputLength = inputPattern.length;\n\t var candidates = [];\n\t for(var i=0;i<Math.min(inputCandidates.length, 100);i++) {\n\t var j = inputCandidates[i][0];\n\t var iLength = refPatterns[j][1];\n\t\t var iPattern = refPattern...
[ "0.5921935", "0.5556369", "0.48734698", "0.48211762", "0.4745715", "0.46848297", "0.4624537", "0.46141455", "0.4598729", "0.45914596", "0.45419237", "0.45419237", "0.45066944", "0.4456125", "0.4450597", "0.44405288", "0.44295958", "0.44140202", "0.44038263", "0.43932876", "0....
0.7219334
0
fine classfication. returns best 100 matches for inputPattern and candidate list (which should be provided by coarse classification
function fineClassification(inputPattern, inputCandidates) { var inputLength = inputPattern.length; var candidates = []; for(var i=0;i<Math.min(inputCandidates.length, 100);i++) { var j = inputCandidates[i][0]; var iLength = refPatterns[j][1]; var iPattern = refPatterns[j][2]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coarseClassification(inputPattern) {\n\t var inputLength = inputPattern.length;\n\t var candidates = [];\n\t for(var i=0;i<refPatterns.length;i++) {\n\t var iLength = refPatterns[i][1];\n\t\t if(inputLength < iLength + 2 && inputLength > iLength-3) {\n\t\t var iPattern = refPatterns[i...
[ "0.7861092", "0.58152467", "0.54839766", "0.54727143", "0.5471432", "0.54102844", "0.5397284", "0.5379573", "0.53636396", "0.535234", "0.5347628", "0.52943146", "0.51500577", "0.50474834", "0.50456893", "0.50259835", "0.50075644", "0.49941665", "0.4994114", "0.4981108", "0.49...
0.73681766
1
cancel Makes it possible to stop an advertisement while its loading or playing. This will clear out the adsManager, stop any ad playing and allowing new ads to be called.
cancel() { if (this.requestRunning === false) return; this.requestRunning = false; this._resetAdsLoader(); // Hide the advertisement. this._hide("cancel"); // Send event to tell that the whole advertisement thing is finished. let eventName = "AD_SDK_CANCELED"; let eventMessage = "Ad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancel() {\n // Destroy the adsManager so we can grab new ads after this.\n // If we don't then we're not allowed to call new ads based\n // on google policies, as they interpret this as an accidental\n // video requests. https://developers.google.com/interactive-\n // media-ads/...
[ "0.77802217", "0.65146774", "0.6308173", "0.61965173", "0.60743743", "0.6072606", "0.60478765", "0.6023323", "0.59886", "0.59022933", "0.58486533", "0.58408046", "0.5736544", "0.5732994", "0.57099277", "0.56860787", "0.56614375", "0.5639219", "0.5635877", "0.5619881", "0.5608...
0.77993554
0
startInterstitialAd Call this to start showing the ad set within the adsManager instance.
async _startInterstitialAd(options) { if (this.requestRunning) { this.eventBus.broadcast("AD_IS_ALREADY_RUNNING", { status: "warning" }); return; } this.requestRunning = true; let autoPlayOptions = await this._initDisplayContainerWithAutoPlay(); await this._loadInterstitialAd({ ...aut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showInterstitial(){\n\tif(AdMob) AdMob.showInterstitial();\n}", "function showInterstitial(){\n\tif(AdMob) AdMob.showInterstitial();\n}", "function createInterstitial(){\n //if(AdMob) AdMob.prepareInterstitial( {adId:defaultID.interstitial, autoShow:false} );\n AdMob.prepareInterstitial({\n ...
[ "0.64787364", "0.64787364", "0.55048424", "0.55048424", "0.53527766", "0.5059318", "0.5059318", "0.49123105", "0.4867438", "0.48338205", "0.47489", "0.4685632", "0.4678501", "0.4662127", "0.4638413", "0.45501038", "0.45480895", "0.4490956", "0.44702825", "0.44274828", "0.4412...
0.6946199
0
_startRewardedAd Call this to start showing the ad set within the adsManager instance.
async _startRewardedAd(options) { if (this.requestRunning) { this.eventBus.broadcast("AD_IS_ALREADY_RUNNING", { status: "warning" }); return; } this.requestRunning = true; let autoPlayOptions = await this._initDisplayContainerWithAutoPlay(); await this._loadRewardedAd({ ...autoPlayOpt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _gotoNextAd()\n\t\t{\n\t\t\tnextAd++;\n\t\t\tif(nextAd >= player.clip.ads.length)\n\t\t\t{\n\t\t\t\tnextAd = null;\n\t\t\t}\n\t\t}", "function _playNextAd(position)\n\t\t{\n\t\t\tif(nextAd != null && player.clip.ads[nextAd].position == position)\n\t\t\t{\n\t\t\t\t_log('_playNextAd(' + position + ')', ne...
[ "0.53995645", "0.5220226", "0.5106474", "0.5100223", "0.4941922", "0.49321213", "0.4918336", "0.4843559", "0.48256403", "0.48222125", "0.48039752", "0.47962463", "0.47861508", "0.47851598", "0.47478628", "0.47309965", "0.4729501", "0.47003418", "0.46974865", "0.46962696", "0....
0.7381019
0
_hide Show the advertisement container.
_hide(trigger) { this.video_ad_player.src = ""; if (this.activeAdContainer) this.activeAdContainer.style.visibility = "hidden"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_show() {\n if (this.activeAdContainer)\n this.activeAdContainer.style.visibility = \"visible\";\n }", "_hide() {\n this.adContainer.style.margin = '0';\n this.adContainer.style.padding = '0';\n this.adContainer.style.opacity = '0';\n setTimeout(() => {\n this.adCo...
[ "0.7826864", "0.77583957", "0.7661352", "0.7121333", "0.69990826", "0.6985137", "0.6925106", "0.6874557", "0.6857169", "0.68062866", "0.6802802", "0.67938995", "0.6785331", "0.6785331", "0.67625535", "0.67574805", "0.672168", "0.671688", "0.6707791", "0.66900915", "0.66859937...
0.7267625
3
_show Hide the advertisement container
_show() { if (this.activeAdContainer) this.activeAdContainer.style.visibility = "visible"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_show() {\n this.adContainer.style.display = 'block';\n setTimeout(() => {\n this.adContainer.style.margin = '0 0 1rem 0';\n this.adContainer.style.padding = '0 0 56.25% 0'; // 16:9\n this.adContainer.style.opacity = '1';\n }, 10);\n }", "_hide() {\n ...
[ "0.7449939", "0.7409313", "0.7265741", "0.7083206", "0.7038014", "0.7002465", "0.6994191", "0.6940982", "0.69345933", "0.6870419", "0.6847763", "0.67537147", "0.66931766", "0.66669667", "0.66582745", "0.6656765", "0.65667707", "0.65667707", "0.6566484", "0.65396464", "0.65308...
0.8150947
0
_createPlayer Creates our staging/ markup for the advertisement.
_createPlayer() { const body = document.body || document.getElementsByTagName("body")[0]; this.adContainer = document.createElement("div"); this.adContainer.id = `${this.prefix}advertisement`; this.adContainer.style.position = this.thirdPartyContainer ? "absolute" : "fixed"; this.adCont...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_createPlayer() {\n this.adContainer = document.createElement('div');\n this.adContainer.id = this.options.prefix + 'advertisement';\n this.adContainer.style.display = 'none';\n this.adContainer.style.position = 'relative';\n this.adContainer.style.height = '0';\n this.adC...
[ "0.6769659", "0.6663247", "0.643328", "0.62005246", "0.61497474", "0.61391705", "0.60479534", "0.60225815", "0.5977505", "0.59643906", "0.59597635", "0.5948209", "0.59392226", "0.5900592", "0.58988076", "0.5865485", "0.5830978", "0.58223224", "0.5760061", "0.5732068", "0.5718...
0.66787785
1
_setUpIMA Create's a the adsLoader instance.
_setUpIMA() { // In order for the SDK to display ads on our page, we need to tell // it where to put them. In the html above, we defined a div with // the id "adContainer". This div is set up to render on top of // the video player. Using the code below, we tell the SDK to render // ads in that div....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setUpIMA() {\n // In order for the SDK to display ads on our page, we need to tell\n // it where to put them. In the html above, we defined a div with\n // the id \"adContainer\". This div is set up to render on top of\n // the video player. Using the code below, we tell the SDK to ren...
[ "0.74640006", "0.5872493", "0.5720066", "0.56043065", "0.5530415", "0.5530102", "0.5498046", "0.5498046", "0.5457894", "0.5447324", "0.5345004", "0.5278662", "0.5233099", "0.5208906", "0.51654816", "0.51237845", "0.5101646", "0.50849223", "0.5065646", "0.5055673", "0.50507194...
0.7086647
1
Errechnet einen Floatwert zwischen zwei Zahlen
function randomFloat(min, max) { return min + Math.random() * (max - min); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get floatValue() {}", "static SetFloat() {}", "toUnsafeFloat() { return parseFloat(this.toString()); }", "function float(v) {\n\treturn v ? parseFloat(v.toString().replace(/[^\\d.-]/g, '')) || 0 : 0;\n}", "set floatValue(value) {}", "function enforceFloat() {\r\n var valid = /^\\-?\\d+\\.\\d*$|^\\-?[\\d...
[ "0.7362969", "0.71012986", "0.69161254", "0.6915497", "0.6828689", "0.67181027", "0.6693683", "0.65554255", "0.6471106", "0.6449977", "0.6423648", "0.64171094", "0.63441914", "0.63399136", "0.63380915", "0.63244116", "0.63229", "0.63191956", "0.63128483", "0.63072234", "0.628...
0.0
-1
setzt die X Position des Schiffes 5px weiter nach Links (Y5) Sperrt den Spieler im Canvas ein (bei x>=0px)
moveLeft() { if (this.posX >= 10 && pause == false) this.posX = this.posX - 5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setStartPosition() {\n this.x = DrunkenSailor.canvas.width - 20;\n this.y = 560;\n }", "function canvas_x5(x) {\r\n var u = (x - scene_minx5)/(scene_maxx5 - scene_minx5);\r\n return canvas_minx5 + u*(canvas_maxx5 - canvas_minx5);\r\n }", "resetPosition(...
[ "0.6506791", "0.64117765", "0.6125566", "0.60371953", "0.59972936", "0.5928869", "0.59068406", "0.5905019", "0.58831644", "0.5874376", "0.57747155", "0.5750632", "0.5739471", "0.5706717", "0.5688897", "0.5682633", "0.566244", "0.56138694", "0.56134653", "0.5595459", "0.557456...
0.0
-1
setzt die X Position des Schiffes 5px weiter nach rechts Sperrt den Spieler im Canvas ein (bei x>=670px)
moveRight() { if (this.posX <= 670 && pause == false) this.posX = this.posX + 5; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setStartPosition() {\n this.x = DrunkenSailor.canvas.width - 20;\n this.y = 560;\n }", "setX(x) {\n this.setXY(toInt(x), this.position[1]);\n }", "function canvas_x5(x) {\r\n var u = (x - scene_minx5)/(scene_maxx5 - scene_minx5);\r\n return canvas_minx5 + ...
[ "0.71507907", "0.6836413", "0.6812598", "0.67994714", "0.6768449", "0.671583", "0.6711865", "0.6684583", "0.6663094", "0.646401", "0.6426915", "0.6417965", "0.6385309", "0.63407123", "0.6337633", "0.63225865", "0.6248974", "0.62465703", "0.62154436", "0.619744", "0.6193248", ...
0.0
-1
Update des hitListArrays je Spiel danach Update der HTML Elemente score wird aus hitList[N]Faktor berechnet
updateHitlist(art) { if (art < 5) { this.hitList[art]++; } document.getElementById('a1').innerHTML = this.hitList[0]; document.getElementById('a2').innerHTML = this.hitList[1]; document.getElementById('a3').innerHTML = this.hitList[2]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateScore() {\n if(Dashboard.candyMachted.length) {\n this.score += 1;\n this.levelUp();\n this.scoreUpdateView();\n Dashboard.candyMachted.pop();\n }\n }", "function updateScore(newScoreArray) {\n for (let i = 0; i < 13; i++) {\n if (!currentPla...
[ "0.65109324", "0.638839", "0.6371892", "0.630087", "0.6241896", "0.6193233", "0.61833996", "0.6141632", "0.6136696", "0.6116462", "0.6094411", "0.6082903", "0.60765934", "0.603258", "0.6016567", "0.60086405", "0.59924453", "0.5963673", "0.5955202", "0.5905967", "0.58911175", ...
0.7600395
0
schiebt das Alien 1px weiter nach rechts und wechselt das Bild random (Animation)
move(direction) { direction = spiel.moveDirection; if (direction == "R" && !this.isExploding) { this.posX++; let newBild = this.images[Math.floor(Math.random() * this.images.length)]; if (newBild != null) this.img.src = newBi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runIt() {\n\n var startPos = Math.floor(Math.random() * 50) + '%' // random start position 0 - 50%\n var endPos = Math.floor(Math.random() * 50) + '%' // random end position 0 - 50%\n var width = Math.floor(Math.random() * (150-20) + 20) + 'px' ...
[ "0.7205109", "0.6883016", "0.6835465", "0.67617214", "0.6754722", "0.6747196", "0.67413163", "0.6715794", "0.6708372", "0.67064905", "0.6701615", "0.6671893", "0.6670717", "0.6668922", "0.6622124", "0.6612789", "0.6590203", "0.65811133", "0.6575401", "0.65652317", "0.6520296"...
0.0
-1
Schiebt das Alien 10px weiter nach unten, wenn eine YPosition von 280 erreich wird und CoverBelts vorhanden sind, explodieren diese und werden auf NULL gesetzt.
movedown() { this.posY = this.posY + 10; //change if (spiel.cover != null) { if (this.posY >= 280 && spiel.cover.length > 0) { document.getElementById('playerExp').play(); spiel.cover[0].explode(); spiel.cover.splice(0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_point_y(c) {\n\treturn 94 + c * 75;\n}", "function virtical_location(y, sizey){\n\t \tif(((y+sizey)/tileHeight)%1 >= 0.5){\n\t \t\treturn Math.ceil((y+sizey)/tileHeight)+1\n\t \t} else {\n\t \t\treturn Math.floor((y+sizey)/tileHeight)+1;\n\t \t}\n\t }", "function yPosition(d,i){\n return Math.f...
[ "0.598522", "0.58904934", "0.5879734", "0.5799985", "0.57796425", "0.57416755", "0.5715201", "0.5703985", "0.5698972", "0.5656536", "0.55859774", "0.5516754", "0.55116516", "0.5482752", "0.5473271", "0.5466671", "0.54474145", "0.5440703", "0.54336375", "0.5425025", "0.541266"...
0.5405337
23
Zeichnet das Alien an seiner X und Y Position. 20px breit, 13px hoch.
draw() { spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getimagePosition7(d,i){\n let x1=-13;\n let y1 =-10;\n return \"translate(\"+x1+\",\"+y1+\") scale(0.10)\"\n\n}", "function getimagePosition2(d,i){\n let x1=-10;\n let y1 =-10;\n return \"translate(\"+x1+\",\"+y1+\") scale(0.40)\"\n\n}", "resetPosition() {\n // 505 is width, 101 is on...
[ "0.68891674", "0.6864663", "0.66462094", "0.6627922", "0.6573078", "0.65676767", "0.649893", "0.64768344", "0.62485176", "0.6230735", "0.62131995", "0.61966103", "0.61878514", "0.617893", "0.61751586", "0.6138215", "0.6135363", "0.61211526", "0.611428", "0.61134374", "0.61066...
0.0
-1
Zeichnet das Ufo an seiner X und Y Position. 20px breit, 13px hoch.
draw() { spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetPosition() {\n // 505 is width, 101 is one block, so 202 will be center\n this.x = 202;\n // 606 is height, 171 is one block, so 435 will be center, but we need to be be off a bit,\n // so it will be 435 - 45px\n this.y = 390;\n }", "function controllo_posizione(loc)\n{...
[ "0.68004125", "0.6685416", "0.66342413", "0.66024613", "0.6496484", "0.63909966", "0.63519835", "0.6339158", "0.63383085", "0.63044894", "0.6300319", "0.62912065", "0.6286772", "0.6272621", "0.6262053", "0.6261169", "0.6255579", "0.62547356", "0.624408", "0.6239288", "0.62387...
0.0
-1
Zeichnet den CoverPunkt an seiner X und Y Posiition mit width und height (standard = 5x5)
draw() { spiel.ctx.beginPath(); spiel.ctx.fillStyle = "ghostwhite"; spiel.ctx.fillRect(this.posX, this.posY, this.height, this.width); spiel.ctx.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function X(){var t=c.getBoundingClientRect(),e=\"offset\"+[\"Width\",\"Height\"][i.ort];return 0===i.ort?t.width||c[e]:t.height||c[e]}", "drawCover(x = 0, y = 0, oX = 0.5, oY = 0.5) {\n const img = this.image;\n const w = this.context.canvas.width;\n const h = this.context.canvas.height;\n\n // Defau...
[ "0.6529053", "0.6421031", "0.61892664", "0.6165176", "0.616402", "0.61482126", "0.6135096", "0.61104405", "0.6100127", "0.6049281", "0.6034887", "0.59719175", "0.5968277", "0.59563684", "0.58627564", "0.5828022", "0.5812418", "0.58063686", "0.57958245", "0.5753745", "0.575374...
0.0
-1
Zeichnet den gesamten Belt nutzt die .draw() Methode eines jeden Cover Objects im Array
draw() { for (let i = 0; i < this.belt.length; i++) { this.belt[i].draw(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw(){\n for(var i=0;i<this.elements.length;i++){\n var e=this.elements[i]\n e.draw()\n }\n }", "function drawObjects() {\n\t\t\tfor(var i in blackRects)\n\t\t\t\tblackRects[i].draw(ctx);\n\t\t\t\n\t\t\tfor(var i in lanes)\n\t\t\t\tlanes[i].draw(ctx);\n\t\t\t\n\t\t\tcar.dr...
[ "0.6853917", "0.6725445", "0.66478205", "0.6553855", "0.65126455", "0.6464842", "0.64583176", "0.64440763", "0.64429027", "0.64136523", "0.63986343", "0.6387153", "0.63846165", "0.63722837", "0.6348255", "0.6346407", "0.63119245", "0.62851125", "0.6278144", "0.62754726", "0.6...
0.7891247
0
Wenn Daten im localStorage hinterlegt sind, werden diese durch loadData() im playerData Objekt gespeichert und in die entsprechenden Variablen bzw. HTMLElemnte geschrieben. "Name" und "Leben" werden immer gesetzt, die restlichen Daten nur, wenn das Window in der vorherigen Sitzung geschlossen wurde
function setData() { if (localStorage.length != 0) { loadData(); document.getElementById('name').value = playerData.name; document.getElementById('l1').innerHTML = playerData.live; } if (playerData.close == "true") { document.getElementById('name'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function data() {\n\n localStorage.setItem('name', 'vladica');\n}", "function loadData() {\n //load names into an array from local storage\n if (localStorage.getItem('playerId') !== null) {\n playerId = parseInt(localStorage.getItem('playerId'));\n }\n\n if (localStorage.getItem('highScores...
[ "0.6537324", "0.6498148", "0.63677686", "0.63147944", "0.6207709", "0.6200321", "0.61994386", "0.6187541", "0.6159344", "0.6063822", "0.60636926", "0.6058034", "0.60146356", "0.60138863", "0.6006502", "0.60025775", "0.5992357", "0.5987553", "0.5983218", "0.5972738", "0.596607...
0.7365713
0
This funcation takes in the path of the test file, the extention of the file type and the fixture location. It then replaces either the helper part of the file path with fixtures/extention and fixture location.
function fixturePath(path, extension, fixtureLocation) { var split_path = path.split('/'); split_path.splice(-1, 1); var index = split_path.indexOf('helpers'); split_path[index] = 'fixtures/' + extension + '/' + fixtureLocation; return split_path.join('/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateHelperTemplates() {\n const { hookApi, hookImage, hookType, projectName } = this.props;\n const helperFile = this.destinationPath('templates/_helpers.tpl');\n const helperTemplate = Buffer.from(`\n{{/*\nContainer image for ${hookApi}:${hookType}\n*/}}\n{{- define \"${projectName}.${hookA...
[ "0.59245723", "0.58940136", "0.5729292", "0.5503302", "0.5503302", "0.5503302", "0.54787225", "0.5419484", "0.5403763", "0.5266514", "0.5182528", "0.51663095", "0.5141786", "0.5040506", "0.5020558", "0.5004345", "0.49935395", "0.49799976", "0.49187908", "0.4896573", "0.489096...
0.73132575
0
Ref is used to persist values between renders
function ChartTwo(props) { const chartRef = useRef(null); // set the dimensions and margins of the graph var width = 650; var height = 650; var margin = 60; // The radius of the pieplot is half the width or half the height (smallest one). I subtract a bit of margin. var radius = Math.min(width, height) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "storeRefs(ref) {\n this.el = ref;\n this.props.setRef(ref);\n }", "function ref() {\n refresh(true);\n }", "getReferenceValue() {\n return (this.refs || []).map((ref) => ref.value);\n }", "function setRef(ref, value) {\n if (typeof ref === 'function') {\n...
[ "0.7716715", "0.69618076", "0.6907079", "0.68528193", "0.6809452", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", "0.66756326", ...
0.0
-1
This is only a demo class to show how you can send data from c to a js class. Keep in mind to locate all your js classes in the Plugins folder for the right compilation order.(As we call js from c the js classes need to be compiled first)
function Start () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Start () {\n\told_color = GetComponent.<Renderer>().material.color;\n//\tcs1 = GetComponent(\"testC\");\n// print(\"c#变量\" + cs1.GetType().GetField(\"move_speed\").GetValue(cs1) + \"在js中调用 \");//调用C#变量\n// cs1.PrintCS(\"testC\");\n DataHandler.handler = GetComponent(\"DataHandler\");// = GetCompo...
[ "0.6071262", "0.6049432", "0.5984528", "0.5942457", "0.592189", "0.56732935", "0.56440055", "0.55935585", "0.5563965", "0.5461234", "0.5400704", "0.5338027", "0.53375477", "0.53075224", "0.5296264", "0.5264287", "0.5264287", "0.5257911", "0.5204001", "0.5182708", "0.51596016"...
0.0
-1
track mouse movement on the table row/column header and display a resizer when hovering over a cell border
function containerMousemoveHandler(event){ var found = false; if (!active){ for (var i = 0; i < positions.length; i++){ if (event.clientX + scrollContainer.scrollLeft() - resizerContainer.offset().left > positions[i] - 3 && event.clientX + scrollContainer.scrol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addResizeHandle(cell, colIndex) {\n // add resize handle\n const handle = new Element(document.createElement('div'), {\n class: CLASS_CELL_HANDLE\n });\n cell.append(handle);\n\n handle.on('hover', () => {\n if (this._draggedColumn === null) {\n ...
[ "0.7008321", "0.697508", "0.65981114", "0.6586803", "0.6552509", "0.6354249", "0.6300524", "0.6280469", "0.6255491", "0.6145362", "0.6100155", "0.6055196", "0.60520905", "0.60469043", "0.60447174", "0.6004029", "0.59727", "0.5951628", "0.5906794", "0.5902845", "0.58836794", ...
0.0
-1
Handles the logic after the user has entered something in the searchbar. If valid input then it checks if the set exists. Sets error message if the set doesn't exist, and redirects to set if it does exist.
function playSet(e) { e.preventDefault(); // Checks that the user has only entered integer values in the search bar. if (!/^\d+$/.test(playId)) { setNotExistError(true); } else { axios .head(`${process.env.REACT_APP_API_URL}/api/sets/${playId}`, { headers: { 'Co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitClicked () { \n let foodInput = $('#food').val();\n if(foodInput == \"\"){\n $('.noFoodItem').text(\"please enter a food item in the search bar\").css('color','red');\n return; \n }\n $('.noFoodItem').text('');\n food = $(\"#food\").val()\n initAutocomplete();...
[ "0.57368255", "0.5713582", "0.564979", "0.55605346", "0.55482125", "0.5489336", "0.5471211", "0.54511523", "0.5382293", "0.53725344", "0.53559667", "0.5294041", "0.5253063", "0.52461356", "0.5243864", "0.5219664", "0.51584667", "0.51576525", "0.51423174", "0.51405287", "0.512...
0.5503109
5
PRELOAD IS THE PLACE TO LAOD ALL YOUR FILES
preload(){ this.load.spritesheet("avatar", "/assets/avatar.png", { frameWidth: 48, frameHeight: 48 }); this.load.spritesheet("bird", "/assets/bird.png", { frameWidth: 48, frameHeight: 48 }) this.load.image("shit", "/assets/shit.png...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "preload() {\n \n }", "preload() {\n\n }", "preload() {\n\n }", "preload() {\n\n }", "preload() {\n\n }", "preload() {\n\n }", "function preload() {}", "preload() {\n }", "function preLoad() {\n return;\n}", "preload() {}", "preload () {}", "function preload() {\n // Step 1....
[ "0.73665327", "0.7297235", "0.7293374", "0.7293374", "0.7293374", "0.7293374", "0.72810143", "0.717675", "0.71694463", "0.7130237", "0.7088531", "0.695878", "0.692801", "0.6885402", "0.68731177", "0.68731177", "0.68731177", "0.68731177", "0.68731177", "0.68731177", "0.6873117...
0.0
-1
ADD ALL FUNCTIONS USED IN THE MAINSCENE sprite create functions
function createAvatar(scene, x, y) { createAvatarAnimations(scene, "avatar"); scene.avatar = new Avatar(scene, x, y, "avatar").setSize(20, 30); scene.avatar.anims.play("stand-left") scene.avatar.hitCount = 0; scene.avatar.setPushable(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create() {\n //add background\n this.background = new Background(this, this.game.config.width * 0.5, this.game.config.height * 0.5, \"backgroundstars\"); // add background image first\n //END background image\n\n //CREATE GRID\n this.aGrid = new AlignGrid({ scene: this, rows: 11,...
[ "0.6706169", "0.6692632", "0.668123", "0.6672419", "0.66283756", "0.6623514", "0.6582601", "0.6542089", "0.6523924", "0.65198827", "0.6516392", "0.65142125", "0.65044343", "0.64789873", "0.64714557", "0.6463072", "0.64447397", "0.64372873", "0.6418136", "0.6386927", "0.633533...
0.0
-1
event function to create bird shit
function onEvent(){ this.birds.getChildren().forEach(bird => { createShit(this, "shit", bird.getBounds()); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Bird(){}", "function makeBirdFly( bird )\n{\n bird.fly();\n}", "function Bird() {}", "function Bird() { }", "function Bird() { }", "function Bird() { }", "function Bird() { }", "function Bird25() { }", "function Bird(xPos,yPos,bRad,accel) {\n this.x = xPos;\n this.y = yPos;\n this.r ...
[ "0.70094097", "0.6910874", "0.680833", "0.6672816", "0.6672816", "0.6672816", "0.6672816", "0.6509562", "0.62680453", "0.6243074", "0.618289", "0.6176606", "0.6162468", "0.61323386", "0.6102743", "0.60711664", "0.5986827", "0.5978876", "0.5957316", "0.5951836", "0.59516406", ...
0.7603982
0
Retrieves the value of a cookie by the given key.
function getCookie (key) { var result = ( new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)') ).exec(document.cookie); return result ? result[1] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCookie(key) {\n\tif (process.browser) {\n\t\treturn cookie.get(key);\n\t}\n}", "function getCookie(key) {\n\n var result;\n\n // adapted from the jQuery Cookie plugin\n\n return (result = new RegExp('(?:^|; )' + encodeUR...
[ "0.7904224", "0.7690227", "0.76848537", "0.76567346", "0.76270527", "0.760675", "0.75085086", "0.7438", "0.7305771", "0.72718436", "0.72657216", "0.7136619", "0.7135822", "0.65950257", "0.65950257", "0.64485914", "0.6435119", "0.64228255", "0.6401271", "0.6384572", "0.6376806...
0.7757254
1
Checks if our host matches the request's host.
function sameOrigin (url) { // Url could be relative or scheme relative or absolute var sr_origin = '//' + document.location.host, origin = document.location.protocol + sr_origin; // Allow absolute or scheme relative URLs to same origin return (url == origin || url.slice(0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHostnameMatch(url) {\n // return urlWithoutProtocol(url).substring(hostReg, host.length) === host;\n return false;\n }", "function checkingHosting() {\n if (window.location.hostname === \"localhost\") {\n //checkingLocalHostURLS();\n console.log(\"User is on LOCALHOST\");\n ...
[ "0.7011688", "0.6975806", "0.6770074", "0.6544859", "0.6470922", "0.64590085", "0.63471866", "0.62870824", "0.62782717", "0.6255406", "0.61679476", "0.61564857", "0.60996675", "0.601737", "0.60158557", "0.59956735", "0.59194106", "0.5916424", "0.587728", "0.58415604", "0.5833...
0.0
-1
function for the header component
function Header () { return ( <div className= 'headerContainer'> <h1 className = 'header-Title'>Dakota And Andrea's Star Wars Chat App</h1> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LogoHeaderComponent() {\n }", "header(name, info) {\n this.headingName.setContent(name)\n this.headingInfo.setContent(info)\n }", "renderHeader () {\n this.header = this.renderSubview(\n new ListHeader({ title: this.title }),\n this.queryByHook('header-container')\n )\n re...
[ "0.82463473", "0.74979734", "0.7266458", "0.71921533", "0.71921533", "0.7168553", "0.7134133", "0.7103879", "0.70794344", "0.70249647", "0.70102644", "0.70065933", "0.7006583", "0.70022506", "0.69953084", "0.69940925", "0.69472265", "0.69222635", "0.69028795", "0.69028795", "...
0.0
-1
Three different popups available in JS. Be warned, they are bad practice and very annoying
function annoyingPopups() { // Alert is simply a message to your user alert("Hello World!"); // Confirm let resultFromConfirm = confirm("Are you sure you want to leave this page"); console.log(`resultFromConfirm = ${resultFromConfirm}`); // Prompt let name = prompt("What is your name?"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDialogPopups (){\n //Bug 18403444 \n removePopupCloseBar();\n showPopup(document.getElementById(DEFAULT_DIALOG_POPUP_ID),DEFAULT_DIALOG_POPUP_ID); \n}", "function s36_open_popup_widget(){\r\n\tvar s36_popupmodalbox \t= document.getElementById('s36PopupWidgetBox');\r\n\tvar s36_popupmodalshadow = ...
[ "0.6961668", "0.6934399", "0.6912164", "0.6900999", "0.6898939", "0.6882215", "0.6875653", "0.68661064", "0.6803408", "0.67966384", "0.6771263", "0.6717351", "0.669366", "0.66934186", "0.6658786", "0.66532946", "0.65843", "0.6572183", "0.65569746", "0.6536181", "0.6510099", ...
0.0
-1
Function that is called when the document is ready.
function initializePage() { console.log("Javascript connected!"); //$("a.nameClick").click(replaceName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function documentReadyFunction() {\n onPageLoadOrResize();\n onPageLoad();\n }", "function initOnDomReady() {}", "function init() {\n documentReady(documentLoaded);\n}", "function DOMReady() {\n }", "function edgtfOnDocumentReady() {\n edgtfHeaderBehaviour();\n edgtfSideAre...
[ "0.8023159", "0.8007992", "0.7956702", "0.7820052", "0.7702887", "0.7538332", "0.75203747", "0.7455419", "0.74510646", "0.7423488", "0.74148506", "0.7392936", "0.73824", "0.7378388", "0.7252092", "0.722355", "0.72147304", "0.7209649", "0.7186503", "0.7171581", "0.7167555", ...
0.0
-1
Halaman Manipulasi Data Halaman add, edit, delete
function showAdd() { var workField = document.getElementById('workField'); var param = ""; function respon() { if (con.readyState == 4) { if (con.status == 200) { busy_off(); if (!isSaveResponse(con.responseText)) { alert('ERROR TR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function manageDataWilayah() {\n $.ajax({\n dataType: 'json',\n url: '/wilayah/show',\n data:{page:page}\n }).done(function(data){\n manageRow(data.data);\n });\n }", "function simpanData(id, nama, stok, harga, deskripsi) {\n let tx = undefined...
[ "0.6067207", "0.6062753", "0.601556", "0.601556", "0.59800935", "0.59539306", "0.5940982", "0.5935266", "0.5935266", "0.5923317", "0.591531", "0.59065604", "0.5904631", "0.58884555", "0.58786094", "0.58680964", "0.5861536", "0.58540595", "0.58152336", "0.5809425", "0.5801976"...
0.0
-1
Manipulasi Data add, edit, delete
function addDataTable() { var hutangunit=''; var pemilikhutang=getValue('pemilikhutang'); var noakunhutang=getValue('noakunhutang'); if(document.getElementById("hutangunit").checked==true){ hutangunit='1'; }else{ pemilikhutang=''; noakunhutang=''; } var param = "notra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EditDataFunct() {\n\n //debugger;\n\n $(\"#tableRow_\" + Intern_LineEditedNum).html(GenerateTableLine(Intern_LineEditedNum));\n AddEvents(Intern_LineEditedNum);\n Intern_LineEditedNum = null;\n ClearAllInputs();\n $('#' + Intern_AddButtonId).html(Disp_TextAdd);\n ...
[ "0.683218", "0.6490654", "0.6139998", "0.6120606", "0.61157197", "0.61129665", "0.6112119", "0.6071654", "0.6016521", "0.601195", "0.5966542", "0.593803", "0.5937114", "0.5935542", "0.5933485", "0.5926853", "0.5922337", "0.59161365", "0.59098595", "0.59006435", "0.589878", ...
0.0
-1
Update No Urut di halaman absensi
function updNoUrut() { var tabBody = document.getElementById('mTabBody'); var nourut = document.getElementById('nourut'); var maxNum = 0; if(tabBody.childNodes.length>0) { for(i=0;i<tabBody.childNodes.length;i++) { var tmp = document.getElementById('nourut_'+i); if(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n this.$nonces.textContent = this.nonces;\n this.$hashes.textContent = this.totalHashes;\n this.$hashrate.textContent = this.hashrate || 'N/A';\n }", "function updateAushubHoehen() {\n $(\"#aushubHoehenWerte tbody\").empty();\n var summe = 0;\n for (var i = 0; i < aushubHoehen.lengt...
[ "0.60962325", "0.607479", "0.6026398", "0.6026398", "0.6026398", "0.60208887", "0.6013017", "0.5935617", "0.5878339", "0.5873873", "0.5840687", "0.5773312", "0.57631487", "0.5753211", "0.5732558", "0.5650347", "0.5646166", "0.5644986", "0.56446344", "0.5633409", "0.5632366", ...
0.0
-1
Update Field Aktif berdasarkan akun yang dipilih
function updFieldAktif() { var id='ftPrestasi_'; var noakun = document.getElementById(id+'noakun').childNodes; var kodekegiatan = document.getElementById(id+'kodekegiatan').childNodes; var kodeasset = document.getElementById(id+'kodeasset').childNodes; var kodebarang = document.getElementById(id+'ko...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateField(event) {\n const val = event.target.value;\n changeAct(val);\n }", "updateField(field) {\n this.setState({\n [field.target.id]: field.target.value\n });\n console.log(\"ESTADO :\" + field.target.id + \" Valor :\" + field.target.value);\n }", "update(){}", ...
[ "0.6951035", "0.68383306", "0.6796167", "0.6796167", "0.6796167", "0.673542", "0.6565595", "0.6565595", "0.6535608", "0.6489592", "0.6473342", "0.6437975", "0.64205295", "0.64162564", "0.63515687", "0.62856954", "0.6248217", "0.62438834", "0.62357545", "0.6231842", "0.6206695...
0.5732867
93
afterCrud Function execute after CRUD (create, read, update, delete)
function afterCrud() { var jumlah = getValue('jumlah').replace(/,/g,''), tBody = document.getElementById('tbody_ftPrestasi'), tBodyLen = tBody.childNodes.length, jmlHeadEl = document.getElementById('ftPrestasi_jumlah').firstChild, tbodyLen = document.getElementById('tbody_ftPrestasi').childNodes.length; jmlD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "afterCreate(result) {}", "onAfterSaveEntity(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "onAfterDeleteEntity(data_obj) {\n\t\t//TODO: Override this as needed;\n\t}", "_afterSave(entity, error, afterAction) {\n if (error) {\n this.setState({\n showLoading: false\n }, () => {\n...
[ "0.5879734", "0.5875334", "0.5817374", "0.56850505", "0.5561052", "0.5553949", "0.5553949", "0.5473933", "0.53563285", "0.5330222", "0.53234214", "0.52793896", "0.5273757", "0.52441645", "0.52313596", "0.5194947", "0.51826507", "0.5146618", "0.51063997", "0.5101469", "0.50708...
0.5380708
8
richiede tutte le gifs
function loadAllGifs(nickname) { $.ajax({ type: 'GET', url: '/tweb/home/gifsToJson', dataType: 'json', success: function (data) { $.each(data, function (i) { var loveBtn = 'loveBtn_' + data[i].id; var src = "/tweb/app/uploads/" + data[i].s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processGifs(obj){\n let imageTags = obj.data.map(gif => `<img src=\"${gif.images.original.url}\" width=\"200px\"/>`).join(\"\\n\")\n document.querySelector(\"#giphy-div\").innerHTML = imageTags\n}", "function verMasGifos(valorTextoBuscador) {\r\n contGeneralBusquedas = document.getElementById(\"contG...
[ "0.69793236", "0.68922096", "0.684906", "0.6807756", "0.6785388", "0.66944796", "0.66923076", "0.66131127", "0.66119623", "0.6590747", "0.65682566", "0.6558962", "0.6534239", "0.65307945", "0.65218157", "0.6513689", "0.6509102", "0.65060663", "0.64911175", "0.6486748", "0.645...
0.6368315
28
invia i dati dell'untente
function fingerprintData(nickname) { $.ajax({ type: 'POST', url: '/tweb/home/getFingerprint', data: {user: nickname}, beforeSend: function () { $("#msg").fadeOut(); }, success: function (data) { }, error: function () { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modificado(t) {\n datos();\n}", "function impostaDati (importo, indice) {\n capVarImp.impostaValutaEAllineaADestra(\"#totaleCompetenzaTrovatoAnno\" + indice, importo.stanziamento);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleResiduiTrovatoAnno\" + indice, importo.stanziamentoResid...
[ "0.5920801", "0.5916862", "0.57357365", "0.5547258", "0.54996145", "0.5494411", "0.54735726", "0.5454501", "0.5454501", "0.5454501", "0.54482913", "0.54289687", "0.5375993", "0.535827", "0.53220826", "0.5293773", "0.52657825", "0.5253534", "0.52449167", "0.52367485", "0.52342...
0.0
-1
Accepts types as variadic arguments and checks if the function follows any of the following given ones prop.ofType(Foo) prop.ofType(Bar, Bar)
ofType(...AllowedClasses){ const validTypeNames = AllowedClasses.map( TClass => TClass.typeName || TClass.name ).join(' or '); return this.addTest((obj) => { const isObjectOfValidType = AllowedClasses.some( AllowedClass => isInstance(obj, AllowedClass) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFunctionCompositionArgs(args) {\n if (args.length <= 1) {\n return false;\n }\n\n let count = 0;\n\n for (const arg of args) {\n if (isFunctionOrArrowExpression(arg)) {\n count += 1;\n\n if (count > 1) {\n return true;\n }\n } else if (isCallOrOptionalCallExpression(ar...
[ "0.60500365", "0.58916944", "0.57467777", "0.5720309", "0.5686137", "0.55872166", "0.55376524", "0.5491344", "0.5464955", "0.54614013", "0.54589766", "0.5433951", "0.5425499", "0.5410243", "0.54067945", "0.54056686", "0.5367761", "0.5269433", "0.5255604", "0.5253024", "0.5247...
0.0
-1
Declares that the prop must be one of the the passed values. By convention it uses `Object.is` to compare values ``` prop.isOneOf('woo'); prop.isOneOf('hello', 'world'); prop.isOneOf(...possibleValues); ```
isOneOf(...posVals){ return this.addTest((obj) => { const isObjOneOfPosVals = posVals.some( posVal => Object.is(posVal, obj) ); return new Validity(isObjectOfValidType, `${this.name} can only be one of ${posVals.join(', ')}`); }, 'isOneOf'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valueCheck(props, ...args) {\n if (props.multiple) return p.arrayOf(valueShape).isRequired(props, ...args)\n return valueShape(props, ...args)\n}", "function $Teiw$export$isOneOf(a, b) {\n if (b === void 0) {\n b = [];\n }\n\n return b.some(function (v) {\n return a === v;\n });\n} //# sourc...
[ "0.64600223", "0.54792935", "0.5461619", "0.5398073", "0.53664607", "0.522406", "0.518252", "0.5177444", "0.5103881", "0.50540423", "0.50540423", "0.50252426", "0.5001663", "0.48955733", "0.48772115", "0.48624817", "0.48399833", "0.48335746", "0.48295227", "0.48265332", "0.48...
0.7156871
0
defines that the can't be empty prop.cannotBeEmpty();
cannotBeEmpty(){ return this.addTest((obj) => { return new Validity(!!obj, `${this.name} cannot be empty`); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get nonEmpty() {\n return this.addValidator({\n message: (_, label) => `Expected ${label} to not be empty`,\n validator: value => value !== ''\n });\n }", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "get empty() {\n ...
[ "0.7501689", "0.72872", "0.709534", "0.7053291", "0.7033697", "0.69248694", "0.69248694", "0.6910192", "0.6744762", "0.6626144", "0.6625632", "0.65573734", "0.65016085", "0.6481335", "0.6361441", "0.63516396", "0.6333167", "0.63273025", "0.6314084", "0.628307", "0.626022", ...
0.7669703
0
Splits a search string into an array of individual regexps to be used to match results.
tokenize(query, respect_word_boundaries, weights) { if (!query || !query.length) return []; const tokens = []; const words = query.split(/\s+/); var field_regex; if (weights) { field_regex = new RegExp('^(' + Object.keys(weights).map(utils.escape_regex).join('|') + ')\:(.*)$'); } wor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitOnRegex(pattern) {\n return function(s) {\n return withRegex (pattern, function() {\n var result = [];\n var lastIndex = 0;\n var match;\n while ((match = pattern.exec (s)) != null) {\n if (pattern.lastIndex === lastIndex && match[0] === '') {\n ...
[ "0.6900256", "0.6837832", "0.6837832", "0.6521919", "0.6502149", "0.6502149", "0.6502149", "0.64518505", "0.6327329", "0.6289557", "0.61448014", "0.61411667", "0.60943395", "0.60598683", "0.60101926", "0.59980524", "0.5863736", "0.5820494", "0.5794721", "0.5758195", "0.565802...
0.5105453
38
Returns a function that can be used to compare two results, for sorting purposes. If no sorting should be performed, `null` will be returned.
getSortFunction(query, options) { var search = this.prepareSearch(query, options); return this._getSortFunction(search); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function sortFunction( a, b ) {\n\n\t\t\treturn a - b;\n\n\t\t}", "function compareFunc(a, b) {\n retur...
[ "0.68932605", "0.68932605", "0.68932605", "0.68932605", "0.6881954", "0.66020375", "0.66012466", "0.65460056", "0.65056103", "0.64692324", "0.6455979", "0.6437326", "0.643576", "0.64102757", "0.63997996", "0.6381244", "0.6338095", "0.6321445", "0.6317408", "0.6317408", "0.630...
0.0
-1
Parses a search query and returns an object with tokens and fields ready to be populated with results.
prepareSearch(query, optsUser) { const weights = {}; var options = Object.assign({}, optsUser); utils.propToArray(options, 'sort'); utils.propToArray(options, 'sort_empty'); // convert fields to new format if (options.fields) { utils.propToArray(options, 'fields'); if (Array.isArray(op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseQuery(query) {\r\n let finalQuery;\r\n if (typeof query === \"string\") {\r\n finalQuery = { Querytext: query };\r\n }\r\n else if (query.toSearchQuery) {\r\n finalQuery = query.toSearchQuery();\r\n }\r\n else {\r\n finalQuery = query;...
[ "0.6468812", "0.645908", "0.63140774", "0.61765623", "0.61274976", "0.6124417", "0.6003177", "0.59789795", "0.5877199", "0.58408594", "0.58190054", "0.5795616", "0.5775354", "0.5757242", "0.5729075", "0.5718722", "0.56848335", "0.5626802", "0.5589479", "0.55850613", "0.558099...
0.52700543
45
Searches through all items and returns a sorted array of matches.
search(query, options) { var self = this, score, search; var fn_sort; var fn_score; search = this.prepareSearch(query, options); options = search.options; query = search.query; // generate result scoring function fn_score = options.score || self._getScoreFunction(search); //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchItems() {\n let filteredAry = [];\n if (search.length == 0) {\n filteredAry = items;\n } else {\n let searchedSet = new Set();\n for (let eachSearch of search) {\n items.forEach((item) => {\n if (\n item.display_name.toLowerCase()....
[ "0.68170744", "0.5997728", "0.5850462", "0.58145255", "0.5806354", "0.5694058", "0.5640132", "0.563631", "0.5598675", "0.558141", "0.5532239", "0.5485699", "0.5470315", "0.54685193", "0.544166", "0.5432341", "0.5428487", "0.5392253", "0.5383497", "0.5344728", "0.53446597", ...
0.0
-1
NOTE: THIS TAKES A TON OF TIME BE PATIENT
function writeData() { console.log('writting data') var writeStream = fs.createWriteStream("oldTweetSentiments.csv"); var csvWriteStream = csv.createWriteStream({headers: true}); csvWriteStream.pipe(writeStream); for (var i in oldTweetObjs) { if (i % 1000 == 0) { console.log(i); } var oldTweet = oldTweetOb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "static private internal function m121() {}", "static transient final private internal function m43() {}", "function pos...
[ "0.58074933", "0.57637334", "0.56570476", "0.5570635", "0.5561174", "0.5532221", "0.54828906", "0.54317", "0.5407513", "0.5389881", "0.5306532", "0.5303247", "0.5204344", "0.5185844", "0.5184396", "0.51696545", "0.5159916", "0.5131215", "0.5117954", "0.5110457", "0.51081336",...
0.0
-1
prepend 'actor.' to keys
function prependActorStr(args) { var d = {}; for (var k in args) { var k1 = 'actor.'+k; d[k1] = args[k]; } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prependActorStr(args) {\n var d = {};\n for (var k in args) {\n var k1 = 'actor.'+k;\n d[k1] = String(args[k]);\n }\n return d;\n }", "function prependActor(s) {\n return 'actor.'+s;\n }", "function formal_key_join(keyparts) {\n return keyparts.join(\".\");\n}", "key(...a...
[ "0.7473054", "0.7099733", "0.59134483", "0.5767699", "0.55738986", "0.53074825", "0.52872825", "0.5232651", "0.5187378", "0.5182462", "0.5150161", "0.51494986", "0.51314944", "0.5109713", "0.5085684", "0.5085138", "0.5076945", "0.5051441", "0.504976", "0.50475496", "0.5036533...
0.76204395
0
run a sequence of commands each command is a javascript function that has the signature function command(callback) callback will be called when command is done.
function runCmds(cmds) { if (cmds.length==1) return cmds[0](); return cmds[0]( runCmds(cmds.slice(1)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function executeCallbacks() {\n while (callbacks.length > 0) {\n var callback = callbacks.shift();\n callback();\n }\n}", "async execute() {\n let command;\n let i = 0;\n do {\n command = this.commands[i];\n if (command instanceof Loop) {\n if (command.count > 0)...
[ "0.6658151", "0.64436674", "0.63930666", "0.63917905", "0.636588", "0.6281845", "0.613102", "0.6123616", "0.6123616", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", "0.6119279", ...
0.6433786
2
eslam 25 oct 2020
function HeaderTemplate_ThreeElements(headerTitle, element_1, element_2) { var tbl = DocumentActions.CreateElement("table"); tbl.style.width = "100%"; var headerTr = DocumentActions.CreateElement("tr"); headerTr.innerHTML = "<td style='text-align:center;'>" + headerTitle + "</td>"; var cellTr = Docu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jour(){\n let date_actuelle = date.getDate();\n let mois = date.getMonth()+1;\n let annee = date.getFullYear();\n mois < 10 ? mois = `0${mois}` : mois\n document.getElementById(\"date\").innerHTML=\"\"+date_actuelle+\"/\"+mois+\"/\"+annee;\n console.log(date);\n}", "function DarFechaTe...
[ "0.60636765", "0.59142846", "0.5895583", "0.5895583", "0.5875721", "0.5868458", "0.5851243", "0.5850071", "0.58359945", "0.57572883", "0.5730421", "0.57245034", "0.57241803", "0.5707362", "0.5701452", "0.56994504", "0.56825393", "0.56743616", "0.56636536", "0.56510216", "0.56...
0.0
-1
eslam 25 oct 2020
function CreateLabelElement(defaultValue, id) { var element = DocumentActions.CreateElement("label"); element.style.textAlign = "center"; element.id = id; element.innerText = defaultValue; return element; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jour(){\n let date_actuelle = date.getDate();\n let mois = date.getMonth()+1;\n let annee = date.getFullYear();\n mois < 10 ? mois = `0${mois}` : mois\n document.getElementById(\"date\").innerHTML=\"\"+date_actuelle+\"/\"+mois+\"/\"+annee;\n console.log(date);\n}", "function DarFechaTe...
[ "0.60636765", "0.59142846", "0.5895583", "0.5895583", "0.5875721", "0.5868458", "0.5851243", "0.5850071", "0.58359945", "0.57572883", "0.5730421", "0.57245034", "0.57241803", "0.5707362", "0.5701452", "0.56994504", "0.56825393", "0.56743616", "0.56636536", "0.56510216", "0.56...
0.0
-1
to be validated in insert / update all trnasacations
function CheckDate(TrDate, StDt, EdDt) { ////debugger var check = Date.parse(TrDate); var from = Date.parse(StDt); var to = Date.parse(EdDt); if ((check <= to && check >= from)) return (true); else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIntegrity(tx){\n\t\tsync.log.trace(\"Entering com.kony.ESS.myprofile.Department.createAll->checkIntegrity\");\n\t\tarrayLength = valuesArray.length;\n\t\tfor (var i=0; valuesArray != null && i < arrayLength; i++ ){\n\t\t\tvar relationshipMap={}; \n\t\t\trelationshipMap = com.kony.ESS.myprofile.Depa...
[ "0.63107", "0.6219566", "0.6091255", "0.60066164", "0.58737516", "0.58247477", "0.58226836", "0.5747349", "0.57412255", "0.55941653", "0.5537857", "0.549904", "0.54866", "0.54395884", "0.5437534", "0.5430939", "0.54189944", "0.5416885", "0.541625", "0.54152095", "0.53936845",...
0.0
-1
let can be reassigned and take new value. It creates a mutable variable. let is the same as const in that both are blockedscope. It means that the variable is only available within its scope. Arrow functions The arrow function is really awesome, and makes your code more readable, more structured, and look like modern c...
function myFunc(name) { return 'Hello' + name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function example3() {\n var a = 1;\n // let a = 2 // * Error\n}", "function sample() {\r\n const a = 5;\r\n \r\n if (true) {\r\n let a = 10; \r\n console.log(\"const with let: \" + a); // Output: const with let: 10\r\n }\r\n}", "function start(){\n {\n var a = ...
[ "0.68138784", "0.65768903", "0.6546509", "0.6423017", "0.62897956", "0.6284117", "0.6246414", "0.62074083", "0.6131971", "0.612426", "0.6123734", "0.60916", "0.59596556", "0.5942145", "0.5936489", "0.59136343", "0.58844197", "0.58832836", "0.58124554", "0.5807373", "0.5786301...
0.0
-1
help prints help information to stdout
function help() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showHelp() {\n\t//Use figlet npm package to convert text to art/drawing.\n\tfiglet('LIRI help', function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\tvar helpInfo = \"Usage: node liri.js <comman...
[ "0.7891238", "0.78614026", "0.78570515", "0.7833456", "0.7798171", "0.77137434", "0.76752776", "0.76666033", "0.76666033", "0.76543576", "0.7653372", "0.7634417", "0.7618392", "0.7618392", "0.7591261", "0.75538737", "0.7528928", "0.7475535", "0.7442176", "0.7414934", "0.73866...
0.76188934
12
Storing data to sessionStorage using React lifeCycles declared a variable to get items fro localStaorage
componentDidMount() { this.userData = JSON.parse(sessionStorage.getItem('user')) if (sessionStorage.getItem('user')) { this.setState({ Username: this.userData.Username, // Email: this.userData.Email, Password: this.userData.Password ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateStorage() {\n sessionStorage.setItem(`${this._storagePrefix}`, JSON.stringify(Object.entries(this._items).map(([, item]) => item.data)));\n }", "function saveinStorage() {\n\tsessionStorage.setItem('idList', JSON.stringify(idList));\n\tsessionStorage.setItem('currentL', currentL);\n\tsessionStor...
[ "0.7684169", "0.73316103", "0.7284222", "0.7276759", "0.71763355", "0.71512157", "0.7076534", "0.7053968", "0.7044679", "0.7041559", "0.7033406", "0.6995864", "0.6989036", "0.6924625", "0.689958", "0.68877715", "0.68584657", "0.6851494", "0.68394536", "0.6836842", "0.682517",...
0.0
-1
type: success, danger, warning, info eslintdisablenextline maxlen
function showMsg(txt = 'Note was saved. Thank you!', type = 'success', form = formAddNotes) { const element = document.createElement('div'); element.innerHTML = txt; element.className = `alert alert-${type} my-2`; form.append(element); removeElement(element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_maxLineHack() {\n var display = this.cm.display, curOp = this.cm.curOp;\n const CLEARANCE = 3; /* space added to the right, in characters */\n display.maxLineChanged = false;\n if (curOp) {\n curOp.updateMaxLine = false;\n curOp.adjustWidthTo = (display.maxLine.t...
[ "0.5677976", "0.5577611", "0.55227774", "0.5491282", "0.5489513", "0.5387775", "0.5386772", "0.53479314", "0.5324842", "0.5312823", "0.52798843", "0.52739745", "0.52685887", "0.5163436", "0.51249444", "0.5098494", "0.5052932", "0.50475925", "0.50454676", "0.5025682", "0.50109...
0.0
-1
Read the file and find out how many blocks we would need to split it.
function handleFileSelectUploadDirectly(e) { resetUploadUploadDirectly(); maxBlockSize = 256 * 1024; currentFilePointer = 0; totalBytesRemaining = 0; var files = e.target.files; selectedFile = files[0]; var fileSize = selectedFile.size; if (selectedFile....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getBlockHeight() {\n let i=0;\n let self = this;\n return new Promise(function(resolve,reject) {\n self.chain.createReadStream()\n .on('data',function(data) {\n i++;\n }).on('end',function() {\n if (i > 0) {\n i--;\n }\n resolve(i);\n ...
[ "0.6019978", "0.59197783", "0.5766273", "0.5763228", "0.5687644", "0.56642187", "0.56471795", "0.5645501", "0.5593621", "0.5507733", "0.54939735", "0.54827434", "0.5455231", "0.54263335", "0.5425483", "0.54135096", "0.5411143", "0.5386859", "0.5315978", "0.52962536", "0.52809...
0.0
-1
Send download link to email form OnBegin
function SendDownloadLinkToEmailOnBegin() { //Show spinner $('#modal-direct-upload-send-email-spin').css('display', ''); //Hide text $('#modal-direct-upload-send-email-text').css('display', 'none'); //Blur input $('#modal-direct-upload-send-email-input').blur(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendDownloadLinkToEmailOnSuccess(json) {\n //Blur input\n $('#modal-direct-upload-send-email-input').blur();\n\n //Error\n if (json.message === undefined) {\n $('#modal-upload-directly-complete-error-container').find('.alert-danger').html($('#modal-direct-upload-send...
[ "0.6806606", "0.6562793", "0.6434724", "0.63498414", "0.60505676", "0.6016439", "0.59692717", "0.5952206", "0.5835738", "0.5799853", "0.57845044", "0.5783418", "0.577272", "0.57400763", "0.5734925", "0.57202786", "0.5713657", "0.57132345", "0.56835467", "0.56745195", "0.56469...
0.8506648
0
Send download link to email form OnSuccess
function SendDownloadLinkToEmailOnSuccess(json) { //Blur input $('#modal-direct-upload-send-email-input').blur(); //Error if (json.message === undefined) { $('#modal-upload-directly-complete-error-container').find('.alert-danger').html($('#modal-direct-upload-send-email-form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SendDownloadLinkToEmailOnBegin() {\n //Show spinner\n $('#modal-direct-upload-send-email-spin').css('display', '');\n //Hide text\n $('#modal-direct-upload-send-email-text').css('display', 'none');\n\n //Blur input\n $('#modal-direct-upload-send-email-input').blur...
[ "0.77843755", "0.6617792", "0.64809203", "0.6344924", "0.6141517", "0.610525", "0.6057448", "0.60462904", "0.5959767", "0.58954614", "0.5850395", "0.58467567", "0.5807512", "0.57627445", "0.5759874", "0.57537466", "0.57527775", "0.57481575", "0.57135874", "0.5703964", "0.5680...
0.7987198
0
Registers helpers needed for extend logic
function registerHelpers() { // TODO - Improve helper injection /* eslint-disable global-require */ helpers.hpa = require('./src/hpaHelper'); helpers.cluster = require('./src/clusterHelper'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define_helpers_registrator(Klass) {\n Klass.registerHelper = function (name, helper, options) {\n // Scenario: registerHelper('foo', foo_helper[, foo_opts]);\n if (_.isString(name)) {\n Klass.prototype[name] = helper;\n Klass.prototype.__helpers__[name] = {\n helper: ...
[ "0.68316734", "0.67509854", "0.6687218", "0.6628123", "0.63830036", "0.63830036", "0.6380481", "0.6376937", "0.63652766", "0.63084084", "0.62933505", "0.6292845", "0.62693423", "0.61959815", "0.61363775", "0.5984866", "0.5896609", "0.58899736", "0.5848173", "0.5847066", "0.58...
0.710213
0
Obtains k8s current status for all environments and creates HTML report
async function getK8sInfo() { try { // Register helpers registerHelpers(); // Get resources for (const environment of config.environments) { // eslint-disable-next-line no-await-in-loop await getK8sResources(environment); } // Create template...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function go(initial) {\n // totals for --status\n var totals = {\n hosts: [ 0, 0, 0, 0 ],\n services: [ 0, 0, 0, 0 ],\n };\n var problems = 0;\n\n // read the status file\n var data;\n try {\n data = parse(fs.readFileSync(opts.file, 'utf8'));\n } catch (e) {\n if (initial) {\n console.erro...
[ "0.59558755", "0.55665976", "0.5558983", "0.555748", "0.55123025", "0.5449964", "0.54086286", "0.5396337", "0.5358206", "0.5331727", "0.5307758", "0.52996594", "0.52754056", "0.52632016", "0.5262366", "0.5238126", "0.52140903", "0.5211355", "0.5147599", "0.51000184", "0.50847...
0.6632897
0
This function receives the Authentication and issue new tokens
async function getNewToken(oAuth2Client, callback) { return new Promise((resolve, reject) => { // Url to give Authentication access generated using generateAuthUrl method const authorizeUrl = oAuth2Client.generateAuthUrl({ access_type: 'offline', scope: SCOPES.join(' '), }); /* Redi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForAuth() {\n var token = getToken();\n processToken(token); \n }", "function getNewToken(credentials, scopes=[]) {\n return new Promise((resolve, reject) => {\n const action = 'authorize';\n const params = {\n 'client_id': credentials.clien...
[ "0.6697742", "0.6376958", "0.63061476", "0.625354", "0.6228773", "0.6219173", "0.61854714", "0.6164492", "0.6157031", "0.609601", "0.60362154", "0.60075754", "0.6007529", "0.5984341", "0.5977711", "0.59678537", "0.5960222", "0.59552515", "0.5947173", "0.593632", "0.59103245",...
0.0
-1
get the version from package.json file or whatever is defined in config.tasks.release.versionFiles[0]
function getCurrentVersion() { var vFilePath = path.resolve(config.root.project, config.tasks.release.versionFiles[0]); var pkg = JSON.parse(fs.readFileSync(vFilePath, 'utf8')) return pkg.version; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static version_lookup() {\n return require('../package.json').version;\n }", "function getVersion(){\n // skip this commit if there isn't a package.json to get the version\n if (!fs.existsSync('package.json')) {\n return null;\n }\n var pkg = fs.readFileSync('package.json');\n // get the version of t...
[ "0.74143934", "0.74045074", "0.73794174", "0.7307921", "0.6950216", "0.6940115", "0.6805057", "0.68015474", "0.68015474", "0.6791312", "0.6610417", "0.63580245", "0.6331458", "0.62112087", "0.62046975", "0.61758137", "0.6174762", "0.6171888", "0.6171388", "0.6128266", "0.6113...
0.842569
0
vuex v3.1.1 (c) 2019 Evan You
function n(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('v...
[ "0.71108335", "0.7005665", "0.6747788", "0.6744202", "0.66214895", "0.66214895", "0.66214895", "0.66179764", "0.6592311", "0.64870083", "0.6356956", "0.6351742", "0.63500285", "0.63500285", "0.63500285", "0.63500285", "0.63500285", "0.63388646", "0.6321889", "0.6284441", "0.6...
0.0
-1
! vuerouter v3.1.3 (c) 2019 Evan You
function r(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private public function m246() {}", "function TM(t,e,n,i,r,o,a,s){var u=(\"functio...
[ "0.59251934", "0.5888637", "0.583437", "0.5811496", "0.57647955", "0.57306296", "0.5667137", "0.56517833", "0.5648825", "0.56283003", "0.561249", "0.56105435", "0.56063324", "0.5538492", "0.5530003", "0.549551", "0.5491841", "0.546825", "0.54276705", "0.54228723", "0.54159206...
0.0
-1
Defines (or redefines) all Postman BDD globals
function initPostmanBDD () { log.info('Using Postman BDD'); initBDD(); initSuperAgent(); initChai(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGlobals() {\n const env = (global || window);\n if (!env.hasOwnProperty(\"FormData\")) {\n env.FormData = require(\"form-data\");\n }\n if (!env.hasOwnProperty(\"fetch\")) {\n env.fetch = require(\"node-fetch\");\n }\n}", "function initBDD () {\n var postmanBDD = new Pos...
[ "0.6206862", "0.6167896", "0.61043423", "0.58315456", "0.58088315", "0.5805516", "0.5641461", "0.5594039", "0.55707973", "0.555999", "0.55329055", "0.5525061", "0.552015", "0.54314137", "0.5388507", "0.5387629", "0.5379884", "0.52979624", "0.52979624", "0.52979624", "0.529217...
0.6128717
2
Defines (or redefines) BDD globals
function initBDD () { var postmanBDD = new PostmanBDD(); before = postmanBDD.before; after = postmanBDD.after; beforeEach = postmanBDD.beforeEach; afterEach = postmanBDD.afterEach; describe = postmanBDD.describe; it = postmanBDD.it; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function globals() {\n\t\textend(window, {\n\t\t\tconsole: {\n\t\t\t\tlog: function() {},\n\t\t\t\tdebug: function() {},\n\t\t\t\twarn: function() {},\n\t\t\t\terror: function() {}\n\t\t\t}\n\t\t});\n\t}", "function setGlobals() {\n const env = (global || window);\n if (!env.hasOwnProperty(\"FormData\")) {...
[ "0.65014577", "0.6436733", "0.6258823", "0.61276317", "0.6114898", "0.6032744", "0.60211015", "0.5996042", "0.59934586", "0.59859174", "0.5931369", "0.5867729", "0.58460563", "0.57693386", "0.57684773", "0.57661647", "0.576114", "0.5739004", "0.5733972", "0.57175183", "0.5694...
0.0
-1
Defines (or redefines) SuperAgent globals
function initSuperAgent () { response = new superAgent.Response(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set UseGlobal(value) {}", "function globals() {\n\t\textend(window, {\n\t\t\tconsole: {\n\t\t\t\tlog: function() {},\n\t\t\t\tdebug: function() {},\n\t\t\t\twarn: function() {},\n\t\t\t\terror: function() {}\n\t\t\t}\n\t\t});\n\t}", "function setGlobals() {\n const env = (global || window);\n if (!env.ha...
[ "0.6251264", "0.62326735", "0.6227729", "0.5949678", "0.5900019", "0.58928627", "0.5859916", "0.58021235", "0.5717724", "0.5711012", "0.5703398", "0.5686404", "0.5620766", "0.5615742", "0.5613495", "0.56110984", "0.5600492", "0.55967504", "0.55654675", "0.55440164", "0.553051...
0.5864963
6
Defines (or redefines) Chai.js globals
function initChai () { chai = require('chai'); assert = chai.assert; expect = chai.expect; chai.should(); // Chai-HTTP Assertions chai.use(assertions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "before() {\n /**\n * Setup the Chai assertion framework\n */\n const chai = require(\"chai\")\n global.expect = chai.expect\n global.assert = chai.assert\n global.should = chai.should()\n }", "function globals() {\n\t\textend(window, {\n\t\t\tconsole: {\n\t...
[ "0.64750606", "0.6441204", "0.62571067", "0.6114225", "0.60381526", "0.6006156", "0.57783717", "0.5644674", "0.5625781", "0.55488497", "0.55444145", "0.5537365", "0.5535361", "0.5503019", "0.5503019", "0.5503019", "0.5496829", "0.5493243", "0.5488671", "0.5477491", "0.5426189...
0.6035042
5
meshes in scene ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// MAIN ENTRY POINT ////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////...
function main() { // do all the initializations init(); // create event listeners window.document.addEventListener('mouseup', onMouseUpWindow, false) document.getElementById("renderer").addEventListener("mousedown", onMouseDown, false); document.getElementById("renderer").addEventListener("mousemove", on...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\r\n onResize();\r\n\r\n if (gl) {\r\n gl.clearColor(0.75, 0.85, 0.8, 1.0);\r\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\r\n gl.enable(gl.DEPTH_TEST);\r\n gl.enable(gl.CULL_FACE);\r\n gl.frontFace(gl.CCW);\r\n gl.cullFace(gl.BACK);\r\n ...
[ "0.71466756", "0.7054961", "0.6967158", "0.68417174", "0.6788764", "0.6754871", "0.67210186", "0.6713875", "0.6649581", "0.66464686", "0.6629148", "0.66154003", "0.6611259", "0.65949446", "0.6547967", "0.65437543", "0.6543348", "0.6534593", "0.6493975", "0.64742255", "0.64687...
0.0
-1
////////////////////////////////////////////////////////////////////////////// RENDERING CODE ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////...
function renderFrame() { // query frame time var time = clock.getElapsedTime(); // register render() to be called for rendering the next frame requestAnimationFrame(renderFrame); // set the camera according to the current rotation around the y-axis setCamera(); // call custom rendering function ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderFrame(evt) {\n wasm.exports.renderFrame(evt);\n}", "renderFrame() {\r\n this.context.fillStyle = \"#f8dcb5\";\r\n this.context.fillRect(0,0,this.render.width, this.render.height);\r\n this.handleAccDec();\r\n this.handleTurning();\r\n // Check if player tries ...
[ "0.7574517", "0.7560169", "0.72220063", "0.7156954", "0.71513516", "0.70568883", "0.697374", "0.69526285", "0.6941189", "0.6935512", "0.68993485", "0.6849158", "0.6807392", "0.67970514", "0.6730867", "0.6626615", "0.66079384", "0.6596087", "0.65728724", "0.6563448", "0.655251...
0.7425384
2
function renderSceneNode(node, pointMatrix, normalMatrix) This function renders a single scene node. I.e., node is set to visible and pointMatrix and normalMatrix are passed to the resp. shader.
function renderSceneNode(node, pointMatrix, normalMatrix) { // simple error handling if ((node.shape != undefined) && (pointMatrix != undefined) && (normalMatrix != undefined)) { if ((node.shape >= 0) && (node.shape < uniforms.length)) { uniforms[node.shape].customPointMatrix.value = poi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawNode(node) {\n var draw_object = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff } ) );\n\n var area = 5000;\n var phi = (90 - node.position.x) * Math.PI / 180;\n var theta = (180 - node.position.y) * Math.PI / 180;\n node.position.x = area * Ma...
[ "0.6314717", "0.6269664", "0.61229247", "0.6076726", "0.60612506", "0.59429574", "0.58892775", "0.58892775", "0.58892775", "0.5798856", "0.57914275", "0.5735912", "0.5733743", "0.5658315", "0.56569225", "0.56477475", "0.56145716", "0.56065965", "0.55853045", "0.5578628", "0.5...
0.92268974
0
setCamera() Sets camera position and rotation.
function setCamera() { var v = 0.0025; // camera tool speed var r = 950.0; // camera to origin distance var alphaX = v * camRotationX * Math.PI; var alphaY = v * camRotationY * Math.PI; alphaX = Math.max(alphaX, -0.5 * Math.PI) alphaX = Math.min(alphaX, 0.0) var sX = Math.sin(alphaX); var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setCamera() {\r\n // set up camera\r\n this.camera = new Camera({\r\n time: this.time,\r\n sizes: this.sizes,\r\n renderer: this.renderer,\r\n debug: this.debug,\r\n config: this.config\r\n });\r\n\r\n // add to scene\r\n thi...
[ "0.76112753", "0.74846166", "0.7127347", "0.69788116", "0.6916464", "0.686441", "0.67257005", "0.6674691", "0.6616835", "0.6577431", "0.6479507", "0.6471992", "0.6426041", "0.64258534", "0.6415016", "0.64101666", "0.6397556", "0.63928443", "0.6387962", "0.63359565", "0.633486...
0.77805537
0
////////////////////////////////////////////////////////////////////////////// INITIALIZATIONS ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////...
function renderer(width, height) { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); // store globals renderWidth = width; renderHeight = height; // create renderer and set its attributes renderer = new THREE.WebGLRenderer( { clearColor: 0x000000, clearAlpha: 1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Renderer() {}", "function Renderer() {\n}", "function renderer_factory(props = []) {\n const canvas = document.createElement('canvas')\n const renderer = util_assignArr(\n [\n '',\n document.createElement('div'),\n 500,\n 500,\n canvas,\n canvas.getContext('2d'),\n ...
[ "0.733513", "0.72440165", "0.6822286", "0.6808914", "0.67273736", "0.66537607", "0.66329724", "0.6600881", "0.65943694", "0.6594294", "0.656042", "0.65277416", "0.648096", "0.64634264", "0.64634264", "0.6457151", "0.64385533", "0.643583", "0.6420429", "0.63887554", "0.6343063...
0.7243122
2
function init() This function initializes the scene.
function init() { // frame clock clock = new THREE.Clock(); // scene scene = new THREE.Scene(); // camera camera = new THREE.PerspectiveCamera(38, renderWidth / renderHeight, 1, 10000); camRotationX = -25; camRotationY =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeScene(){}", "function init(){\r\n \t\tinitPhysijs();\r\n\t\tscene = initScene();\r\n\t\tcreateEndScene();\r\n\t\tcreateEndLoseScene();\r\n\t\tinitRenderer();\r\n\t\tcreateMainScene();\r\n\t}", "function init() {\n\t\t//console.log(\"scene.init()\");\n\t\t// Check if there is already a canvas in the...
[ "0.85067767", "0.83095807", "0.7946418", "0.7844495", "0.7832971", "0.77600604", "0.75877255", "0.7529925", "0.75261986", "0.75099117", "0.7476454", "0.74478537", "0.7434846", "0.74326605", "0.7432011", "0.74269205", "0.7421069", "0.7418019", "0.7409944", "0.74064684", "0.739...
0.75984126
6
////////////////////////////////////////////////////////////////////////////// CONVENIENCE FUNCTIONS ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////...
function CreateSun() { var id = addUniforms(new THREE.Vector3(1.0, 0.75, 0.0)); meshes.push(new THREE.Mesh(new THREE.SphereGeometry(50.0, 24, 24), new THREE.ShaderMaterial({ uniforms: uniforms[id], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Shape() {}", "function Shape(){}", "function Shape(){}", "function Shape4(){}", "function Shape () {\n}", "function Shape2(){}", "function Shape() {\n\n}", "function Shape5(){}", "function Shape3(){}", "makeShape(){\n rect(this.x, this.y, this.w, this.w);\n }", "function shap...
[ "0.78260577", "0.77306", "0.77306", "0.7481763", "0.74641573", "0.7389645", "0.7349795", "0.7339029", "0.73352915", "0.727094", "0.7186275", "0.7095582", "0.7044251", "0.7026048", "0.7017553", "0.6970176", "0.69418746", "0.6790376", "0.67710483", "0.6700524", "0.66569924", ...
0.0
-1
addUniforms(color) Adds a new set of uniform parameters with specified color and returns its id.
function addUniforms(color) { uniforms.push({ customColor: {type: "v3", value: color}, customPointMatrix: {type: "m4", value: new THREE.Matrix4(1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeColorUniforms(id, newColor) {\n uiColorUniforms[id] = '#' + newColor;\n}", "function addColor(){\n var color = vec4(Math.random(), Math.random(), Math.random(), 1.0);\n tempColors.push(color);\n colors.push(color);\n}", "setColor(color) {\n return this.material.uniforms.lightColor.v...
[ "0.6848553", "0.6371437", "0.6129331", "0.5811371", "0.5687983", "0.5677254", "0.5657423", "0.5512682", "0.5506788", "0.5466015", "0.54145133", "0.53510123", "0.53116775", "0.52208114", "0.5161838", "0.5143491", "0.51193327", "0.5116973", "0.508548", "0.508548", "0.508548", ...
0.8183281
0
vertexShaderSun() Returns the vertex shader code for sun.
function vertexShaderSun() { return ["varying vec3 color;", "varying vec2 uvCoordinates;", "uniform mat4 customPointMatrix;", "uniform mat4 customNormalMatrix;", "uniform vec3 customColor;", "void main() {", "uvCoordinates = uv;", "gl_Position = ",...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateSun()\n{\n var id = addUniforms(new THREE.Vector3(1.0, 0.75, 0.0));\n \n meshes.push(new THREE.Mesh(new THREE.SphereGeometry(50.0, 24, 24),\n new THREE.ShaderMaterial({\n uniforms: uniforms[id],\n ...
[ "0.6509022", "0.5989416", "0.5989416", "0.5812683", "0.5798559", "0.5693682", "0.560109", "0.5547074", "0.55226886", "0.5495951", "0.54818314", "0.54765946", "0.54743403", "0.5472219", "0.5465679", "0.54557836", "0.5405433", "0.54014206", "0.5385398", "0.53813607", "0.5381360...
0.66776615
0
vertexShaderOther() Returns the vertex shader code for other objects.
function vertexShaderOther() { return ["varying vec3 color;", "varying vec2 uvCoordinates;", "uniform mat4 customPointMatrix;", "uniform mat4 customNormalMatrix;", "uniform vec3 customColor;", "void main() {", "uvCoordinates = uv;", "vec4 wsPos = c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get additionalVertexShader() {\n return `\n void paintgl_additional() {\n }\n `;\n }", "function createShaderHelper(sourceString, vertex = true){\n //if vertex shader, create vertex shader else framgent shader\n var shader = ((vertex) ? gl.createShader( gl.VERTEX_SHADER ) :\n ...
[ "0.574345", "0.55568254", "0.5425074", "0.53926766", "0.5391933", "0.53906274", "0.53895295", "0.5369604", "0.53421885", "0.53385586", "0.5298164", "0.5295392", "0.5288528", "0.5263791", "0.5263791", "0.5258293", "0.5226914", "0.5202351", "0.52003235", "0.5196681", "0.51889",...
0.68136
0
fragmentShader() Returns the fragmens shader code for sun and other objects.
function fragmentShader() { return ["varying vec3 color;", "varying vec2 uvCoordinates;", "void main() {", "float u = mod(80.0 * uvCoordinates.x, 10.0);", "float uu = (u - 1.0) * (u - 1.0);", "float v = mod(80.0 * uvCoordinates.y, 10.0);", "float vv = (v - 1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFragmentShader()\n {\n return dedent\n `#version 300 es\n precision mediump float;\n in vec2 frgTexCoord;\n\n const float PI = 3.14159;\n\n out vec4 glFragColor;\n\n void main()\n {\n // distance entre les coor...
[ "0.7260523", "0.6794071", "0.6775346", "0.6727858", "0.66369337", "0.6587351", "0.6387333", "0.62376565", "0.6153414", "0.60619557", "0.60567856", "0.60079944", "0.60007346", "0.59968567", "0.5989645", "0.5973", "0.5967674", "0.5964774", "0.59268343", "0.5922569", "0.59215385...
0.6143598
9
////////////////////////////////////////////////////////////////////////////// EVENT HANDLING ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////...
function onMouseDown(event) { dragging = true; var pos = getRelative(event); mouseDragStartX = pos.x; mouseDragStartY = pos.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleMouseDown(event) {\n mouseDown = true; // initiates camera rotation\n lastMouseX = event.clientX;\n lastMouseY = event.clientY;\n}", "function onMouseDown(event) {\n // Allows rotation based on the mouse X and Y.\n mouseDown = true;\n mousePositionX = event.clientX;\n...
[ "0.7902542", "0.77251446", "0.7472461", "0.74686265", "0.73150563", "0.7309183", "0.7277735", "0.72551805", "0.72159296", "0.72099996", "0.72099996", "0.7209664", "0.71376115", "0.7132224", "0.7132224", "0.7126997", "0.7096484", "0.7086692", "0.7086692", "0.70743436", "0.7055...
0.6939289
28
onMousMove(event) Handles mouse movements, i.e., evaluates dragging the camera rotation.
function onMouseMove(event) { if (dragging) { var pos = getRelative(event); var deltaX = mouseDragStartX - pos.x; var deltaY = mouseDragStartY - pos.y; if (!isNaN(deltaX) && !isNaN(deltaY)) // check if mouse is inside div element { camRotationY += deltaX; camRotationX += deltaY; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseMove(event) {\n if (dragging) {\n yaw += (event.clientX - lastX) * 0.5;\n pitch += (event.clientY - lastY) * 0.5;\n\n var scene = SceneJS.scene(\"theScene\");\n\n yawRotate.set(\"angle\", yaw);\n pitchRotate.set(\"angle\", pitch);\n\n lastX = event.clientX...
[ "0.7187642", "0.71271145", "0.6929422", "0.68718374", "0.6859298", "0.685517", "0.6723607", "0.66961575", "0.66837674", "0.66690195", "0.65809345", "0.6566315", "0.6529903", "0.65259546", "0.6474782", "0.64700913", "0.64052886", "0.6381608", "0.6355075", "0.6299293", "0.62891...
0.73821014
0