query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
clicking on start element will initiate scroll to destination element offset: +/ to move destination position down/up style: if false, will not reformat CSS cursor
function scrollTo(start, destination, speed, offset, style) { var end = $(destination); var position = 0; if (offset) position = offset; if (style != false) $(start).css("cursor", "pointer"); $(start).on("click", function() { $("html, body").animate({scrollTop: end.offset().t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickStart(hide, show)\n{\n document.getElementById(hide).style.display=\"none\";\n document.getElementById(show).style.display = \"block\";\n window.scrollTo(0,0); \n}", "start() {\n const styles = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_4__[\"coerceElem...
[ "0.638307", "0.6295399", "0.6280864", "0.62756413", "0.6242516", "0.6229564", "0.61341095", "0.61209303", "0.6103413", "0.6066964", "0.6028421", "0.6009536", "0.6001002", "0.59491414", "0.5931457", "0.59089804", "0.59060216", "0.59045154", "0.5894234", "0.5884968", "0.5868292...
0.7353476
0
fade out footer as you scroll up fade in footer as you scroll down
function ghostFooter(element) { $(window).scroll(function(){ var scrollDistance = $(this).height() + $(this).scrollTop(); var startOfElement = $(element).offset().top; var bottomOfElement = $(element).offset().top + $(element).outerHeight(); var opacity = (scrollDistance - start...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animateFooter() {\n if ($(window).scrollTop() + $(window).height() === $(document).height()) {\n $('#footer:hidden').removeClass('hide');\n } else {\n $('#footer').addClass('hide');\n }\n }", "function scrolltop() {\n\n\n var wind = $(window);\n\n wind...
[ "0.74797934", "0.6600419", "0.6387902", "0.6365053", "0.62946457", "0.62384", "0.62152857", "0.61931485", "0.6185907", "0.61655545", "0.61586815", "0.61490226", "0.60913795", "0.6028432", "0.60274696", "0.60268295", "0.59777373", "0.5950282", "0.5934163", "0.5889132", "0.5853...
0.69455683
1
change the CSS property of elementTwo by hovering over elementOne elementOne and elementTwo can be the same cssProperty: a string with a CSS property cssValueOne: a string with a CSS value (will show on mouseenter) cssValueTwo: a string with a CSS value (will show on mouseleave) transition: "slow", "normal", "fast", 10...
function cssHover(elementOne, elementTwo, cssProperty, cssValueOne, cssValueTwo, transition) { if (transition) { if (transition == "fast") { transition = 200; } else if (transition == "normal") { transition = 400; } else if (transition == "slow") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hoverOpacity(elem, valueOne, valueTwo, transition){\n mouseIn = 1; \n mouseOut = .7;\n opacTransition = 0; \n \n if (valueOne) \n mouseIn = valueOne; \n if (valueTwo) \n mouseOut = valueTwo; \n if (transition || transition == 0)\n opacTransition = transition; \n ...
[ "0.6720299", "0.59755725", "0.58285695", "0.5754484", "0.5692475", "0.5644207", "0.56392574", "0.53229344", "0.5219509", "0.51658386", "0.51554954", "0.5093697", "0.5039699", "0.49904838", "0.4900292", "0.48876387", "0.4881349", "0.48811677", "0.48612592", "0.4854236", "0.485...
0.8335005
0
load an image as a fullscreen background image (w/o choppiness) path: path of image
function backgroundImg(path) { var img = new Image(); img.src = path; img.onload = function() { $('body').css({'background': 'url(' + path + ')' + 'no-repeat 50% 50% fixed', 'background-size': 'cover'}); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showImage(path) {\n\n const img = new Image();\n img.src = path;\n img.onload = function() {\n body.style.backgroundImage = `url(${ path })`;\n };\n}", "drawBackgroundImage(path = GAME_SETTINGS.getBackgroundImgPath()){\n\t\t\tvar backgroundImg = new Image();\n\t\t\tbackgroundImg.src = path;\n\n...
[ "0.7557084", "0.7207305", "0.6891972", "0.687077", "0.6708739", "0.6604886", "0.6569743", "0.6567141", "0.65478396", "0.65478396", "0.65396297", "0.64476764", "0.64370245", "0.6427982", "0.6403436", "0.6370729", "0.63605607", "0.6334441", "0.63095754", "0.6256572", "0.6204686...
0.73238724
1
give element shadow on hover transition: time to display/fade shadow (optional) depth: strength of shadow (optional) color: shade of shadow (optional)
function hoverShadow(elem, transition, depth, color) { shadowOne = shadowTwo = 10; shadowThree = 5; shadowColor = '#888'; shadowTransition = 500; if (depth) { shadowOne *= depth; shadowTwo *= depth; shadowThree *= depth; } if (color) shadowColor = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function glow() {\n $(\".card__face--front\").css('box-shadow', ' 0 10px 35px #8B76C2');\n $(\".card__face--front\").css('transition', ' box-shadow 2s ease-in-out')\n}", "function shadow() {\n stroke(0, 0, 0);\n translate(2, 2);\n }", "handleMouseover(e, d) {\n select('#t'...
[ "0.68557966", "0.62877995", "0.61868644", "0.5913986", "0.5853033", "0.5777999", "0.57606953", "0.5716154", "0.5662931", "0.5656311", "0.55867004", "0.5550734", "0.5544377", "0.5532137", "0.5507482", "0.547113", "0.5418348", "0.5406405", "0.53718704", "0.53321075", "0.5311044...
0.8424118
0
change element opacity on hover valueOne: opacity on mouseIn: 0 1 (optional) valueTwo: opacity on mouseOut: 0 1 (optional) transition: time to change (optional)
function hoverOpacity(elem, valueOne, valueTwo, transition){ mouseIn = 1; mouseOut = .7; opacTransition = 0; if (valueOne) mouseIn = valueOne; if (valueTwo) mouseOut = valueTwo; if (transition || transition == 0) opacTransition = transition; cssHover(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssHover(elementOne, elementTwo, cssProperty, cssValueOne, cssValueTwo, transition) {\n if (transition) {\n if (transition == \"fast\") {\n transition = 200; \n }\n else if (transition == \"normal\") {\n transition = 400; \n }\n else if (transiti...
[ "0.6900077", "0.66818213", "0.6652266", "0.63629603", "0.629022", "0.6225695", "0.62174976", "0.6196765", "0.6178882", "0.61196625", "0.6104562", "0.60940516", "0.6047865", "0.60226595", "0.5999599", "0.5992255", "0.59862673", "0.5961397", "0.5953697", "0.5948233", "0.5947460...
0.8873264
0
zoom element on hover scale: magnitude of zoom (optional) transition: time to change (optional)
function hoverScale(elem, scale, transition) { scaleSize = 1.2; scaleTransition = 500; if (scale) scaleSize = scale; if(transition || transition == 0) scaleTransition = transition; cssArgOne = 'scale('+scaleSize+')'; cssArgTwo = 'scale(1)'; cssHover(elem,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoom(event) {\n event.preventDefault();\n\n scale += event.deltaY * -0.01;\n\n // Restrict scale\n scale = Math.min(Math.max(0.125, scale), 4);\n\n // Apply scale transform\n el.style.transform = `scale(${scale})`;\n}", "zoom(delta) {\n\n // Adjust the zoom\n const zoom = (this.scale + delta...
[ "0.74865365", "0.7249094", "0.71492743", "0.7114901", "0.7114283", "0.70701253", "0.7046562", "0.7031231", "0.7029916", "0.7007822", "0.69716775", "0.69716775", "0.69637513", "0.69578785", "0.6937322", "0.6937322", "0.69213045", "0.69187105", "0.69069266", "0.6892589", "0.682...
0.78142333
0
cycle text of element textArray: list of strings to cycle time: cycle time (optional)
function cycleText(elem, textArray, time) { var cycleTime = 1000; if (time || time == 0) cycleTime = time; var index = -1; var interval = setInterval(function() { index++; if (index >= textArray.length) index = 0; $(elem).html(textArray[index]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderText() {\n let i = 0,\n max = 0,\n line;\n\n max = this.textArray.length;\n\n for (i = 0; i < max; ++i) {\n line = this.textArray[i];\n this.drawLine(line);\n }\n }", "function SlideText( arrSlides, displayID, timerID ) {\n //VAR...
[ "0.55319405", "0.5435131", "0.5405561", "0.534469", "0.53417253", "0.5302759", "0.5290579", "0.526354", "0.5261883", "0.52526385", "0.52520907", "0.51961374", "0.5161486", "0.5156385", "0.5155172", "0.51472646", "0.5146061", "0.5137937", "0.5123411", "0.50893575", "0.50871766...
0.8117666
0
cycle background image of element picArray: list of image urls to cycle time: cycle time (optional) fade: fade time (optional)
function cyclePic(elem, picArray, time, fade) { var cycleTime = 5000; var fadeTime = 1000; if (time || time == 0) cycleTime = time; if (fade || fade == 0) fadeTime = fade; var picProperties = []; picArray.forEach(function(path) { property = 'url(' + path + ')' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cycleBackgrounds() {\n\tvar index = 0;\n\n\t$imageEls = $('.toggle-image'); // Get the images to be cycled.\n\t\n\t\tsetInterval(function () {\t\t\t\n\t\t\t\t// Get the next index. If at end, restart to the beginning.\n\t\t\t\tindex = index + 1 < $imageEls.length ? index + 1 : 0;\n\t\t\t\t// Show the nex...
[ "0.7231991", "0.70360035", "0.6713498", "0.65794265", "0.6566568", "0.6549309", "0.6467607", "0.64023083", "0.6267106", "0.6216773", "0.62160814", "0.6215992", "0.61906505", "0.6162708", "0.61570096", "0.6114293", "0.61067545", "0.60948426", "0.6084298", "0.60822785", "0.6081...
0.86115575
0
15. Step 51: In the same way we played sound in nextSequence() , when a user clicks on a button, the corresponding sound should be played. e.g if the Green button is clicked, then green.mp3 should be played. Step 52: Create a new function called playSound() that takes a single input parameter called name.
function playSound(name) { //16. Step 5-3: Take the code we used to play sound in the nextSequence() function and add it to playSound(). var audio = new Audio("sounds/" + name + ".mp3"); audio.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playSound(name) {\n\n //5.3 Take the code we used to play sound in the nextSequence() function and add it \n // to playSound(). \n var audio = new Audio(\"sounds/\" + name + \".mp3\");\n audio.play();\n\n}", "function playSound(name) {\n\n // 5.3 take code we used to play sound in the ...
[ "0.859194", "0.8331616", "0.8030682", "0.78726006", "0.78510445", "0.7657399", "0.75569975", "0.7538526", "0.75336605", "0.75213933", "0.7517245", "0.7516292", "0.7516292", "0.7516292", "0.7516292", "0.7516292", "0.7513479", "0.75118446", "0.7511491", "0.75017226", "0.7500941...
0.87494594
0
34. Step 101: Create a new function called startOver().
function startOver() { //36. Step 10-3: Inside this function, you'll need to reset the values of level, gamePattern and started variables. level = 0; gamePattern = []; started = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startOver() {\n\n //10.3 Inside this function, you'll need to reset the values of level, gamePattern \n // and started variables.\n level = 0;\n gamePattern = [];\n started = false;\n }", "function mainThing() {\n outOf()\n genNum= generatedNumber();\n \n // startOver(...
[ "0.69837147", "0.6790458", "0.6713888", "0.657544", "0.6536388", "0.6526375", "0.6526017", "0.65137166", "0.6509822", "0.648129", "0.6469008", "0.6466056", "0.646187", "0.64146477", "0.6404615", "0.6403927", "0.6403927", "0.6346411", "0.6304888", "0.6296304", "0.62729055", ...
0.6829294
1
Renders the top navigation allowing the User to log out when isAuthenticated == true
renderNavigation() { if (this.props.auth.isAuthenticated) { return (<nav class="navbar navbar-default"> <div class="container-fluid"> <ul class="nav navbar-nav"> <li><a class="clickable" onClick={() => this.handleLog...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNavBarLogIn() {\n //hide logout button and display login form\n $('#navbar-logout-button').addClass('hide');\n $('#navbar-login-form').show();\n }", "function showNavForLoggedInUser() {\n\t\t$navLogin.hide();\n\t\t$navLogOut.show();\n\t\t$('.nav-when-logged-in').show();\n\t...
[ "0.6783062", "0.67694074", "0.6748006", "0.6636782", "0.6576003", "0.64999527", "0.6469615", "0.6400033", "0.6363746", "0.6363113", "0.6353159", "0.632399", "0.63231885", "0.6321832", "0.6275741", "0.6273957", "0.6226344", "0.6204477", "0.61999947", "0.6190472", "0.6181746", ...
0.6911624
0
Task 2, create a static function called getMovies the static methos should fetch movies from the url the function should return a promise that resolves an array of Movie class objects
static getMovies() { return fetch(url) .then(response => response.json()) .then(data => data.results.map(movie => new Movie(movie))) .catch(error => console.log(error)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async fetchMovies(filter) {\n const url = APIService._constructUrl(`movie/${filter}`)\n const response = await fetch(url)\n const data = await response.json()\n return data.results.map(movie => new Movie(movie))\n }", "getMovies() {\n return new Promise((resolve, reject) => {\n axios\...
[ "0.76943636", "0.76651293", "0.7654407", "0.7297139", "0.7283106", "0.72754323", "0.72673583", "0.7228417", "0.71178716", "0.7104153", "0.7066437", "0.70649403", "0.6998719", "0.69616604", "0.6943442", "0.6928468", "0.6924571", "0.6912209", "0.6887751", "0.686976", "0.6866206...
0.81870127
0
Task 3, create an instance method called renderMovie the method should create an html element for its properties and display it to the dom attach the movie item to moviesList ul to load an image, put this link at the begining of this.image
static renderMovie(movie) { moviesList.insertAdjacentHTML( "beforeend", ` <li> <img src=${"https://image.tmdb.org/t/p/w500" + movie.image} alt="poster" class="poster"/> <hr> <h3>${movie.title}</h3> <hr> <span>${movie.release_date}</span> <hr> </li> ` ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(movie){\n const director_list_template = movie.Director.split(',').map(director => '<li>'+director+'</li>')\n const actor_list_template = movie.Actors.split(',').map(actor => '<li>'+actor+'</li>')\n const writer_list_template = movie.Writer.split(',').map(writer => '<li>'+writer+'</li>')\n...
[ "0.6910494", "0.69088733", "0.6728827", "0.66884804", "0.6688352", "0.66841424", "0.6651813", "0.6610492", "0.65729904", "0.6568336", "0.6568057", "0.6554843", "0.6544632", "0.65087616", "0.6491796", "0.6485385", "0.64750355", "0.64106876", "0.6410598", "0.6404001", "0.636968...
0.7858616
0
Task 4, create a static function called render, it takes an array of Movie instances, and loops over them Calling the element's renderMovie method
static render(movies) { movies.forEach(movie => { Movie.renderMovie(movie); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(movie){\n const director_list_template = movie.Director.split(',').map(director => '<li>'+director+'</li>')\n const actor_list_template = movie.Actors.split(',').map(actor => '<li>'+actor+'</li>')\n const writer_list_template = movie.Writer.split(',').map(writer => '<li>'+writer+'</li>')\n...
[ "0.6832845", "0.6774829", "0.65078264", "0.6504769", "0.649043", "0.6345555", "0.6278094", "0.6269178", "0.61749023", "0.6102801", "0.6099327", "0.60972863", "0.607299", "0.6064299", "0.6063145", "0.60547966", "0.6053677", "0.6041139", "0.602869", "0.59880453", "0.598122", ...
0.76953536
0
daca un li este extras si lista nu mai are copii => the folding buttons should be removed
function check_statusFolding(){ $('ol.sortable li>ol li').map(function() { id_this = $(this).attr('id'); id_ch = $(this).find('li:first-child').attr('id'); if(id_ch==undefined) removeFolding(id_this); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUnfoldSidebar(elt = null) {\n if (!elt){ \n elt = document.querySelector(\"#sidebar\"); \n }\n for (item of elt.querySelectorAll(\"li.can_fold\")) {\n let arrow = item.firstElementChild;\n liFolding(arrow);\n arrow.addEventListener(\"click\", function () {\n ...
[ "0.63697845", "0.61367023", "0.58690846", "0.57554847", "0.56341726", "0.55539805", "0.5538994", "0.55271286", "0.5484689", "0.54799587", "0.54246205", "0.542223", "0.5414542", "0.53923553", "0.5366528", "0.5364088", "0.53507304", "0.53342545", "0.53331804", "0.53240687", "0....
0.65427005
0
Basic Basic Basic Basic Basic Basic Basic Basic Basic Basic Basic Basic /mouseover:outside click:top dblclick:full /outside set outside set outside set outside set outside set function
function setsource_outside(){ //show $('.source').mouseover(function(event){ var sourceid=$(this).attr('id'); $('#HiddeN_projectitemsourceid').val(sourceid); to=event.clientY; to=to-75; le=event.clientX; le=le+25; $('#MenU_pagesourcemouseover').css({top:to+'px',left:le+'px',display:'block'})...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseDownDefault() {\r\n\t\r\n}", "function clickedOutsideFunction(e){\n\t\t \t\tif(e.target != cell){\n\t\t \t\t\tconsole.log(\"clicked outside function! target: \" + e.target.id);\n\t\t \t\t\tclickedOutside = true;\n\t\t \t\t\teditSubGoal(e, id, subId);\n\t\t \t\t}\n\t\t \t}", "setup_mouse_events(){...
[ "0.595398", "0.59078634", "0.5868323", "0.58138573", "0.5746187", "0.57219523", "0.57020634", "0.5691496", "0.56820035", "0.56740224", "0.56643474", "0.56643474", "0.5662245", "0.5660926", "0.56382614", "0.56358033", "0.5619022", "0.5610205", "0.56064206", "0.5582061", "0.555...
0.6536577
0
show the source set menu function
function showmenu_sourcesetpage(itemid){ /*sourcesourcesourcesourcesourcesourcesourcesource * */ var itemid='#'+itemid; //Frame var framew=150; var frameh=150; //url var sourceconid=itemid+' .con'; var url=$(sourceconid).attr('src'); //object var object='#SourceBset'; //s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSource()\n{\n var lang = 'en';\n if ('lang' in args)\n lang = args.lang;\n var idsr\t = this.id.substring(4);\n openFrame(\"source\",\n\t\t \"/FamilyTree/Source.php?idsr=\" + idsr + \"&lang=\" + lang,\n\t\t \"right\");\n return false;\n}", "function ...
[ "0.70620555", "0.62215716", "0.61641616", "0.60800445", "0.59785753", "0.59479684", "0.59118325", "0.5886974", "0.5879214", "0.58585566", "0.58570343", "0.5847413", "0.5831619", "0.5829385", "0.5735751", "0.56790245", "0.56767195", "0.5654858", "0.5648686", "0.56415784", "0.5...
0.67888445
1
action /hide the source set menu function
function hidemenu_sourceset(){ //hide $('#InfossetMbacK,#InfossetM').css('display','none'); //hide the tip /*resetresetresetresetresetreset * ***********************************************/ //reset the form var form=document.getElementById('InfossetM_form');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showmenu_sourcesetpage(itemid){\n\t/*sourcesourcesourcesourcesourcesourcesourcesource\n\t * \n\t */\n\t\t\tvar itemid='#'+itemid;\t\t \t\t\t\t\t\t\t\t\t\t\t\n\t//Frame\n\t\tvar framew=150;\n\tvar frameh=150;\n\t\t\t\n\t//url\n\tvar sourceconid=itemid+' .con';\n\t\tvar url=$(sourceconid).attr('src');\t\t\t...
[ "0.6669947", "0.6421874", "0.63115126", "0.6308229", "0.62185806", "0.6163805", "0.61206627", "0.6091258", "0.6071007", "0.6052998", "0.6014177", "0.5980178", "0.5962119", "0.59439623", "0.5911484", "0.58765906", "0.58261144", "0.58159673", "0.5804582", "0.5801389", "0.578894...
0.72124064
0
Checks possible movements player, gameSquare, boardSize
function checkIfMovable(id, player, type, gameSquare, boardSize) { let pieceRow = getMatrixParameter(id,boardSize,'row'); let pieceColumn = getMatrixParameter(id,boardSize,'column'); let movableRow, upperRow, lowerRow, movable; let [movableRColumn, movableLColumn] = moveColumnSelector(pieceRow, pieceCol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canMove(squareFrom, squareTo, player=this.player) {\n if(!squareFrom.piece || squareFrom.piece.color !== player) return false\n const indexFrom = this.squares.indexOf(squareFrom)\n const indexTo = this.squares.indexOf(squareTo)\n\n let colDiff = squareTo.col - squareFrom.col\n let rowDiff = squareTo...
[ "0.72504866", "0.6981251", "0.6929294", "0.69216776", "0.68886906", "0.6878211", "0.6782696", "0.6765541", "0.67517257", "0.6722127", "0.6719185", "0.6711748", "0.67025733", "0.66888434", "0.668635", "0.6668751", "0.66621995", "0.66298795", "0.6624676", "0.66238403", "0.66175...
0.70889723
1
Gets the available challenge types for a community
function getChallengeTypes(community) { var deferred = $q.defer(); if (!community || community === '') { deferred.resolve([]); return deferred.promise; } ChallengesService.getChallengeTypes(community).then(function (data) { _.each(data, function (type) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCaseTypes() {\n\treturn retrieveCaseTypes(\"/api/openesdh/casetypes\");\n}", "function getCaseTypesForCaseCreator(){\n\treturn retrieveCaseTypes(\"/api/openesdh/casetypes/casecreator\");\n}", "getIntegrationsCredentialsTypes() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/integrations/cr...
[ "0.5789671", "0.575525", "0.5628326", "0.5510198", "0.5372162", "0.53033227", "0.5274504", "0.5261189", "0.5239929", "0.52390116", "0.5231553", "0.5215604", "0.51937175", "0.5167449", "0.5165993", "0.5111577", "0.5108105", "0.5063534", "0.5028019", "0.49954978", "0.4990151", ...
0.8079669
0
updateRequired is received from Add Post component and is passed down to Feed component to render Feed component again
updateFeedFromApp() { this.setState({ updateRequired: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PostEditForm(props) {\n const { match } = props;\n const [postId, setPostId] = useState(null);\n const [title, setTitle] = useState(\"\");\n const [content, setContent] = useState(\"\");\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState(\"\");\n const [file, ...
[ "0.61670595", "0.6125117", "0.6033012", "0.58037066", "0.5773021", "0.5771541", "0.5760969", "0.5748368", "0.57210535", "0.5693173", "0.56790274", "0.5658484", "0.5649184", "0.56357765", "0.56265265", "0.5594322", "0.55941933", "0.5581528", "0.5575861", "0.5573812", "0.556397...
0.68000066
0
Returns an instance of an object previously stringified by JSON
function getObjectFromJSON( stringifiedObject ) { parsedObject = JSON.parse( stringifiedObject ); //console.log( "Parsed Object: " ); //console.log( parsedObject ); dataType = parsedObject.instanceType; return new window[dataType]( parsedObject); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deserialize(object) { return object; }", "static fromJSON(json) {\n return this.fromString(json);\n }", "static fromJSON(json) {\n return this.fromString(json);\n }", "static returnObject(stg){\n return JSON.parse(stg);\n}", "static fromJSON(jsonOrString) {\n if (typeof jsonOr...
[ "0.6943668", "0.6377183", "0.6377183", "0.63702273", "0.63486546", "0.6298752", "0.62745047", "0.6260853", "0.6260853", "0.6239778", "0.62354964", "0.6219016", "0.6140371", "0.6103907", "0.6094056", "0.6057164", "0.6056292", "0.60538346", "0.6045422", "0.6031169", "0.60172856...
0.73232764
0
Render the week number element. If `onWeekNumberClick` is passed to DayPicker, it renders a button, otherwise a span element.
function WeekNumber(props) { var weekNumber = props.number, dates = props.dates; var _a = contexts_1.useDayPicker(), onWeekNumberClick = _a.onWeekNumberClick, styles = _a.styles, classNames = _a.classNames, locale = _a.locale, labelWeekNumber = _a.labels.labelWeekNumber, formatWeekNumber = _a.formatters.formatW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RenderWeek(event) {\n return <CalendarWeek />;\n // console.log(\"Week function\");\n }", "function formatWeekNumber(weekNumber) {\n return \"\" + weekNumber;\n}", "getWeekNumerals(weekNumber) { return `${weekNumber}`; }", "getWeekNumerals(weekNumber) { return `${weekNumber}`; }", "getWe...
[ "0.6752906", "0.62990075", "0.61745596", "0.61745596", "0.61745596", "0.57656074", "0.5721229", "0.55928916", "0.558394", "0.5512528", "0.5509511", "0.5501293", "0.5488635", "0.54109174", "0.5401022", "0.5347335", "0.53321356", "0.5275876", "0.5275814", "0.52502424", "0.52316...
0.79439074
0
Selected camera object Grab all camera data from data.gov.sg API
async function grabCameraData() { var parsedData = ""; let promise = new Promise((resolve, reject) => { request("https://api.data.gov.sg/v1/transport/traffic-images", function(error, response, body) { if (!error && response.statusCode == 200) { parsedData = JSON.parse(body); resolve(JSON.parse(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getCamera() {\n const cameras = await http.get(CAMERA_URL)\n setCamera(new Map(cameras.map(camera => [camera.id, camera.label])))\n }", "_getCamera() {\n navigator.mediaDevices.enumerateDevices()\n .then(devices => {\n this._dissectDevices(devices);\n ...
[ "0.6671735", "0.6283461", "0.62487954", "0.6131314", "0.6111949", "0.6066165", "0.6061405", "0.6043679", "0.60173243", "0.58771676", "0.577691", "0.5749897", "0.5749796", "0.56814826", "0.56577945", "0.5638274", "0.5628432", "0.56127274", "0.5608979", "0.5607953", "0.5568711"...
0.63649595
1
add42 is an example of a synchronous function.
function add42 (a, b) { return a + b + 42; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function add(x, y) {\n return x + y;\n}", "function addAsync(a, b) {\n setTimeout(() => {\n let sum = a + b;\n console.log(sum);\n }, 2000)\n}", "function addAsync(x, y, cb) {\n setTimeout(function() {\n cb( x + y );\n }, 1000);\n}", "function asyncAdd(a, b) {\n ret...
[ "0.7180018", "0.6671736", "0.66697484", "0.66160154", "0.63677335", "0.63281554", "0.61950463", "0.6181614", "0.6162942", "0.61474174", "0.6123589", "0.6099892", "0.60962003", "0.60907763", "0.60435194", "0.6027019", "0.601643", "0.601643", "0.60141206", "0.59937066", "0.5992...
0.7530152
0
secondHighestTemp is a function that accepts and uses a range of data. The range is sent to the function as a parameter.
function secondHighestTemp(temperatures){ var highest = -273, secondHighest = -273; for(var i = 0; i < temperatures.length;i++){ for(var j = 0; j < temperatures[i].length;j++){ if(temperatures[i][j] >= highest){ secondHighest = highest; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findSecondHighest() {\n \n }", "findSecondHighest() {\n \n }", "findSecondHighest() {\n \n }", "function secondLowestSecondHighest(array) {\nconst sortedArray = array.sort((a, b) => a - b)\nconst secLow = sortedArray[1]\nconst secHigh = sortedArray[array.length -2]\nreturn [secLow,secHigh]\n}", ...
[ "0.71693236", "0.71693236", "0.71693236", "0.6715378", "0.6705231", "0.6647932", "0.6619163", "0.66171485", "0.6486852", "0.64695436", "0.63930625", "0.63086146", "0.63021815", "0.6193776", "0.61721617", "0.61603606", "0.6113088", "0.6073297", "0.6065249", "0.6065249", "0.602...
0.7850347
0
The following are helper functions. sendWebRequestExample is intended to simulate a web request to read a temperature. The code in this function does not actually make a web request.
function sendWebRequestExample(input, callback){ var result = {}; // Generate a temperature. result["temperature"] = 42 - (Math.random() * 10); setTimeout(function(){ callback(result); }, 250); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendRequest(url){\t\r\n\tvar xmlhttp = new XMLHttpRequest();\r\n\txmlhttp.onreadystatechange = function() {\r\n\t\tif (xmlhttp.readyState === 4){\r\n\t\t\tif ( xmlhttp.status === 200){\r\n\t\t\tvar data = JSON.parse(xmlhttp.responseText);\r\n\t\t\tvar weather = {};\r\n\t\t\t// can get more of these on web...
[ "0.6219954", "0.620475", "0.5783413", "0.56760854", "0.5581471", "0.5558116", "0.5538653", "0.54979014", "0.54914486", "0.5421699", "0.53954095", "0.5386252", "0.53796685", "0.5352832", "0.5350249", "0.5304121", "0.5300369", "0.52950484", "0.5291613", "0.5286803", "0.5257005"...
0.73749685
0
Method used as a callback to the ReactInterval component. Once play starts this method will be called once per second. A random ball is removed from 'ballsRemaining' and added to the start of 'calledNumbers', which are both held in state. The resulting state changes update all components in the app as props are updated...
_startDrawingBalls() { const ball = this.state.ballsRemaining.splice(this.state.ballsRemaining.length * Math.random() | 0, 1)[0] const state = this.state; state.calledNumbers.unshift(ball); this.setState(state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame () {\n timerID = window.setInterval(updateClock, 1000)\n console.log(countDown)\n ballerID = window.setTimeout(ballGenerator, 500)\n console.log(ballerID)\n }", "pocketedBalls(ballNums) {\n // If no balls made, switch turns\n if (ballNums.length == 0) {\n ...
[ "0.65443635", "0.6184371", "0.6117345", "0.607472", "0.6068838", "0.6033299", "0.60292757", "0.60037196", "0.59953535", "0.5971028", "0.59617925", "0.5923993", "0.5881957", "0.58793914", "0.58667195", "0.5860733", "0.5832466", "0.5818599", "0.5817383", "0.5786156", "0.5771633...
0.72922856
0
Validate if the key entered is valid email ID format
function isEmailIDformat(evt) { var returnValue = true; var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) { returnValue = false; } if ((charCode > 64 && charCode < 91) || (charCode > 96 && charC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateEmailId(emailId) {\t\n\tvar filter = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\tif (!filter.test(emailId)) {\n\t\treturn false;\n }\n return true;\n}", "function email_validate(email){\n var email_regex = new RegExp(/[a-zA-Z0-9\\._-]+@[a-zA-Z0-9]+\\.[a-zA-Z...
[ "0.6922952", "0.68413407", "0.6830358", "0.668799", "0.6620423", "0.6617692", "0.6473771", "0.6429471", "0.6426694", "0.6400068", "0.6379856", "0.637441", "0.63651776", "0.6364048", "0.63566786", "0.6350775", "0.63155186", "0.6298993", "0.62632656", "0.62573844", "0.6206459",...
0.76442075
0
Validate if the key entered is an integer/floating point
function isFloatingNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 45 || charCode > 57) && charCode != 47) { return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateInput(value){\n let integer = Number.isInteger(parseFloat(value));\n let sign = Math.sign(value);\n\n if(integer && (sign===1)){\n return true;\n }else{\n return 'Please enter whole number';\n }\n}", "function checkIfKeyAnInteger(key)\n{\n if(!Number.isInteger(key))\n {\n alert(\...
[ "0.7185651", "0.7160279", "0.7124694", "0.7117489", "0.705294", "0.70382464", "0.70248413", "0.7019858", "0.7019858", "0.7019858", "0.70190454", "0.70166695", "0.6968612", "0.6902241", "0.6871954", "0.6864683", "0.6849209", "0.68479365", "0.6835101", "0.6811227", "0.67801076"...
0.719808
0
send the data to the web service
function sendData(method,serviceName,soapBodyElement) { if (xmlhttp) { // alert("sending data ..."); xmlhttp.open(method,serviceName, true); xmlhttp.setRequestHeader("SOAPACTION", serviceFunction); // construct SOAP body var soapBody = "<?xml version='1.0' encoding='UTF-8'?>\n"; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendData(params){\n // For sending data to the service\n var xhttp = new XMLHttpRequest();\n var url = \"http://localhost:9999/storeActivity?\";\n xhttp.open(\"GET\", url + params, true);\n xhttp.send();\n // console.log(\"Data sent to \" + url + params);\n}", "function sendToSDWS(data...
[ "0.6593655", "0.65299124", "0.64981925", "0.6462009", "0.6451135", "0.63705343", "0.6344174", "0.6340834", "0.6255115", "0.62548906", "0.6250807", "0.623956", "0.6202329", "0.6200821", "0.61902916", "0.61839783", "0.61252904", "0.6108359", "0.61083144", "0.60934263", "0.60930...
0.66570413
0
getActiveTab() Returns the active tab. Defaults to 'tab1' if no active tab is set.
function getActiveTab() { var activeTab = window.sessionStorage.getItem('activeTab'); if (!activeTab || (activeTab != 'tab1' && activeTab != 'tab2' && activeTab != 'tab3')) { activeTab = 'tab1'; window.sessionStorage.setItem('activeTab', activeTab); } return activeTab; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentTab() {\n return currentTab;\n }", "function get_active_tab_index(){\n\treturn tab_index;\n}", "function getActiveTab() {\n return browser.tabs.query({ active: true, currentWindow: true });\n}", "activateCurrentTab() {\n let id = this.getActiveTabId();\n if (id) {\n ...
[ "0.73808885", "0.70095456", "0.6832679", "0.6746599", "0.66910446", "0.66285604", "0.6456945", "0.6397678", "0.6309297", "0.628083", "0.62770504", "0.6184091", "0.6112086", "0.60779345", "0.6061071", "0.60470814", "0.6006226", "0.6002378", "0.5868485", "0.58590555", "0.583535...
0.7159744
1
getDomainPortion(host, baseDomain) For the given host, returns a portion of the domain name. If baseDomain is empty, returns the root domain. If baseDomain is populated, returns the baseDomain plus the next subdomain, if it exists. Examples: getDomainPortion(' returns 'example.com' getDomainPortion(' 'example.com') ret...
function getDomainPortion(host, baseDomain) { var domain; host = host || ''; baseDomain = baseDomain || ''; if (baseDomain.length) { var regex = new RegExp('[^.]*\\.?' + escapeDots(baseDomain) + '$'); var matches = host.match(regex); domain = matches ? matches[0] : undefined...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDomain(host) {\n let parts = host.split(\".\");\n if (parts.length >= 2) {\n return parts[parts.length - 2] + \".\" + parts[parts.length - 1];\n } else return host;\n}", "function getSubdomain$1(hostname, domain) {\n // If `hostname` and `domain` are the same, then there is no sub-...
[ "0.7207673", "0.69215226", "0.68874145", "0.67585284", "0.67541194", "0.66429883", "0.65948063", "0.65611213", "0.65183914", "0.645433", "0.6418246", "0.6128549", "0.61079437", "0.60955334", "0.59613997", "0.5946045", "0.5915161", "0.5909272", "0.59013766", "0.5899112", "0.58...
0.85054
0
extractHost(url) Returns the hostname portion of the given url. Example: extractHost(' returns '
function extractHost(url) { var matches = url.match(/^.+?:\/\/(?:[^:@]+:[^@]+@)?([^\/?:]+)/); return matches ? matches[1] : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractHostname(url) {\r\n var hostname;\r\n //find & remove protocol (http, ftp, etc.) and get hostname\r\n\r\n if (url.indexOf(\"://\") > -1) {\r\n hostname = url.split('/')[2];\r\n }\r\n else {\r\n hostname = url.split('/')[0];\r\n }\r\n\r\n //find & remove port number\r\n hostname = host...
[ "0.8434345", "0.83957213", "0.83877456", "0.8361027", "0.8349578", "0.8323788", "0.81110364", "0.8041241", "0.80053", "0.7962911", "0.7616448", "0.76139694", "0.7613929", "0.75676644", "0.75676644", "0.75676644", "0.75676644", "0.75676644", "0.75676644", "0.7553862", "0.75538...
0.8458864
0
domainMatch(host, domain_filter) Returns true if host matches the given domain_filter. If no domain_filter is given, returns true. Examples: domainMatch('news.google.com', 'news.google.com') returns true domainMatch('news.google.com', 'google.com') returns true domainMatch('news.google.com', 'example.com') returns fals...
function domainMatch(host, domain_filter) { host = host || ''; if (!domain_filter) { return 1; } if (host == domain_filter) { // matched full domain return 1; } else { // matched partial domain var regex = new RegExp(escapeDots('.' + domain_filter) +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isIgnoredDomain(host, ignoredDomains) {\n\tconst hostParts = host.split(\".\");\n\tfor (let filter of ignoredDomains) {\n\t\tfilter = filter.trim();\n\t\tif (filter.length > 0) {\n\t\t\tconst filterParts = filter.split(\".\");\n\t\t\tif (filterParts.length === hostParts.length) {\n\t\t\t\tlet match = true...
[ "0.6473942", "0.59175545", "0.5764992", "0.5685608", "0.56414074", "0.5493188", "0.5471103", "0.53848517", "0.52788043", "0.52526927", "0.52009475", "0.51698923", "0.5088532", "0.50379705", "0.5034572", "0.5024145", "0.50185496", "0.4913846", "0.4902254", "0.48682937", "0.483...
0.87292343
0
Set a tiled layer Data
function setLayerData(layer, bounds, data) { let idx = 0; let width, height; // layer provide rows and cols, chunk width and height if (typeof bounds.rows === "undefined") { width = bounds.width; height = bounds.height; } else { width = bounds.cols; height = bounds.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setImageData(id, frame, map, newData) {\n\tvar drawing = getImage(id, map);\n\tvar drw = drawing.drw;\n\tvar img = bitsy.renderer.GetImageSource(drw).slice();\n\timg[frame] = newData;\n\tbitsy.renderer.SetImageSource(drw, img);\n}", "function SetTile (X, Y, type, tileset, color) {\n\tif (!CheckBounds(0,...
[ "0.64587796", "0.6336791", "0.62495786", "0.6248738", "0.6167651", "0.60704994", "0.5993227", "0.5937008", "0.5898751", "0.5874301", "0.5805154", "0.5764507", "0.57392967", "0.57006043", "0.56988394", "0.5636508", "0.5632959", "0.5616552", "0.56094944", "0.56094944", "0.56037...
0.7569733
0
update animations in a tileset layer
update(dt) { let result = this.isDirty; if (this.isAnimated) { for (let i = 0; i < this.animatedTilesets.length; i++) { result = this.animatedTilesets[i].update(dt) || result; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refreshTileset() {\n const bitmaps = this.bitmaps.map(\n x => (x._baseTexture ? new PIXI.Texture(x._baseTexture) : x)\n )\n this.lowerLayer.setBitmaps(bitmaps)\n this.upperLayer.setBitmaps(bitmaps)\n }", "refreshTileset() {}", "function updateAnimations(){\n\tfor(var i = 0; i < animationList....
[ "0.6659998", "0.65857035", "0.6563698", "0.6545722", "0.6464465", "0.64225584", "0.64092237", "0.6328118", "0.63138413", "0.6313373", "0.6277167", "0.62697446", "0.62594515", "0.62230015", "0.61611664", "0.6128362", "0.60375255", "0.60266435", "0.59792864", "0.5978872", "0.59...
0.672986
0
Quand le joueur clique sur une reponse, cette fonction est appelee Elle actualise la musique, la question et les reponses Quand la derniere question a ete repondue, elle met fin au jeu
function changementQuestion( event ) { actualiserScore( event ); // S'il y a encore des questions if( questions.length > indiceCourantQuestions ) { // On cree notre lecteur audio pour actualiser la musique var lecteurAudio = '<audio id="lecteur-audio" src="' + musiques[ indiceCourantQuestions ] + '" autop...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "retourNiveau1() {\n //si le jeu vient d'être terminé\n if (this.termine) {\n //retire le message\n this.message.remove();\n this.message = null;\n //débloque les boutons\n bloqueBouton('demarrer');\n bloqueBouton('recommencer');\n ...
[ "0.6635951", "0.66232467", "0.63770026", "0.63087916", "0.62857515", "0.62321866", "0.61846817", "0.6161353", "0.6144741", "0.6136387", "0.6132677", "0.6121392", "0.6100858", "0.60856104", "0.60653406", "0.60550714", "0.6038333", "0.6008386", "0.59957063", "0.59723896", "0.59...
0.68143827
0
Sets the shock collar sensitivity
function InventoryItemNeckAccessoriesCollarAutoShockUnitSetSensitivity(Modifier) { // Gets the current item and character var C = (Player.FocusGroup != null) ? Player : CurrentCharacter; if ((CurrentScreen == "ChatRoom") || (DialogFocusItem == null)) { DialogFocusItem = InventoryGet(C, C.FocusGroup.Name); Inven...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set stereoConvergence(value) {}", "sustain(val) {\n this.env.gain.value = val;\n }", "set stereoActiveEye(value) {}", "function adjustSlider(sim) {\n\tif( sim*100 > similarityThresholdMax ) {\n\t\tsimilarityThresholdMax = sim*100; \n\t} else if( sim*100 < similarityThresholdMin ) {\n\t\tsimilarityT...
[ "0.5905062", "0.5763467", "0.5438822", "0.5331185", "0.5320335", "0.52981955", "0.52375644", "0.52266467", "0.51605874", "0.51450026", "0.51441914", "0.5134715", "0.51123536", "0.51111424", "0.5102455", "0.50915635", "0.5067524", "0.5051916", "0.50404894", "0.50352585", "0.50...
0.6103884
0
Conexion BD de position
async function consultaBDPosition() { try { const response = await customAxios.get("/position"); console.log(response); let consulta = response.data; if (consulta.error === false) { setRenderPosition(consulta.data); } } catch (error) { console.log(error); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formulaireConnexion() {\n let modeleConnexion = new ModeleMagasin(\"modele-connexion\");\n modeleConnexion.appliquerModele('', \"milieu-page\");\n}", "async persist() {\n\t\tlet hash = await this.idHash();\n\t\t\n const sql = \n `INSERT INTO osoba (punoime, idosobe, motpismo, dat...
[ "0.5774104", "0.5730493", "0.5693085", "0.56709063", "0.5586707", "0.55816466", "0.54956305", "0.54718024", "0.5468377", "0.54544204", "0.5443336", "0.54154533", "0.5389452", "0.5375471", "0.5338394", "0.53360355", "0.5315147", "0.5310542", "0.5295691", "0.5277365", "0.527697...
0.5759865
1
Dismisses the navigation drawer
function dismiss(){ // *Checking if both the drawer and its overlay is set, returning if they aren't: if(!$drawer || !$drawer_overlay) return; // *Removing the 'active' class: $drawer.removeClass('active'); $drawer_overlay.removeClass('active'); // *Setting a timer for when the ani...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeDrawer()\n{\n\tlet d = document.querySelector('.mdl-layout');\n\td.MaterialLayout.toggleDrawer();\n}", "function closeModal() {\n onClose(false);\n setIsModalVisible(false);\n navigation.navigate(\"Drawer\");\n }", "function hideDrawer() {\n\t\tvar nav = document.querySelector('nav');\n...
[ "0.6937182", "0.68960726", "0.6613536", "0.6610896", "0.65837514", "0.6470419", "0.6463041", "0.6413609", "0.64127505", "0.6376032", "0.63431257", "0.6335954", "0.6323179", "0.63219416", "0.6315987", "0.6297882", "0.62628675", "0.6251213", "0.6239147", "0.6223519", "0.6223274...
0.7236177
0
Returns the total volume of buy and sells of oTokens in 1 day, and the buys and sells in $value of insurance coverage bought and sold per day.
static calculateDailyVolume() { let oTokensBuyVolume = 0; let oTokensSellVolume = 0; let boughtInsuranceCoverage = 0; let soldInsuranceCoverage = 0; graph.data.buyOTokensActions.forEach(buyOToken => { if(parseInt(buyOToken.timestamp) >= timestamp && parseInt(buyOTok...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inventoryValue() {\n return this.inventory.reduce(\n (accumulator, book) => total + book.price,\n 0\n );\n }", "calculateNetGainAmount() {\n var schedules = this.generateRepaymentSchedule();\n var netGainAmount = 0; \n \n for(var i = 0; i < schedules....
[ "0.56279904", "0.5605991", "0.5593218", "0.55721235", "0.5528846", "0.54014814", "0.5380888", "0.53740096", "0.5373473", "0.52900785", "0.52755773", "0.525431", "0.5248356", "0.5243359", "0.5237478", "0.523686", "0.52313566", "0.5211778", "0.520835", "0.5200965", "0.51929194"...
0.7224795
0
Render a file list table
render () { return ( <div className="column"> <table className="table is-narrow is-striped file-list"> <thead> <tr> <th>Name</th> <th>Modified</th> <th>Size</th> </tr> </thead> </table> <div className...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const content = this.props.files.map((file) => (\n <tr>\n <td>{file.filename}</td>\n <td>{file.hash}</td>\n </tr>\n ));\n return (\n <div>\n <table>\n <thead>\n <tr>\n <th>Path</th>\n ...
[ "0.72433275", "0.69571286", "0.6948588", "0.68944633", "0.66674817", "0.6607503", "0.63625693", "0.6329985", "0.6288008", "0.62869424", "0.62649935", "0.62398803", "0.6223667", "0.6181136", "0.6176453", "0.61392313", "0.609494", "0.60917664", "0.601916", "0.6018488", "0.59708...
0.7306943
0
Returns aggregate borrower APR for charting
function rateAvg(leaves) { return d3.mean(leaves, function(d) { return d['BorrowerAPR']; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedAdjustmentTotal(r) {\n let round = this.store.utils.roundToTwo;\n return round(r.getNewBudget());\n }", "function avgValue() {\n var totalSum = total();\n var avgSum = totalSum / accounts.length;\n return avgSum;\n}", "adjBA() {\n let minPA = 502\n // Used to set the re...
[ "0.58810294", "0.57100666", "0.5661204", "0.5625886", "0.5613574", "0.560784", "0.56034034", "0.56032896", "0.5563972", "0.55460036", "0.5535715", "0.5519723", "0.5516852", "0.5500503", "0.5490578", "0.5487442", "0.5472129", "0.5455039", "0.54427475", "0.5411581", "0.5407276"...
0.647331
0
Returns total loaned amount for charting
function totalAmount(leaves) { return d3.sum(leaves, function(d) { return d['LoanOriginalAmount']; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nbloanamt(){\n\tvar needLoans = needbasedLoans();\n\tvar needLoansAmt = 0;\n\tvar length = needLoans.length;\n\tfor(var i= 0; i < length; i++){\n\t\tneedLoansAmt += needLoans[i].amt;\n\t}\n\t//(needLoansAmt);\n\treturn needLoansAmt;\n}", "calculateTotalAmount() {\n var tipPerPerson = this.calculateTi...
[ "0.6933219", "0.6538643", "0.64692086", "0.6452381", "0.64506733", "0.6364003", "0.6360995", "0.6327354", "0.63172156", "0.62976", "0.6292386", "0.62915045", "0.62756896", "0.6250541", "0.6243679", "0.62288177", "0.6220229", "0.6180697", "0.61416566", "0.6136636", "0.6134046"...
0.74207824
0
sets end time of the session param time: session end time
function setEndTime(time) { endTime = time }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetSessionTime ()\n{\n\t\tvar d = new Date();\n\t\tCurrentTime = d.getTime();\n\t\t\n\t\tvar TimeElapsed = CurrentTime - StartSessionTime;\n\t\n\t\tvar StrTime = GetEllapsedTime(TimeElapsed/1000);\n\t\t\n\t\t// on set la value\n\t\tSetValue(\"cmi.core.session_time\",StrTime);\n\t\t\n\t\t//on commit\n\t\tc...
[ "0.7407682", "0.6905975", "0.6882582", "0.6589613", "0.6168852", "0.6037812", "0.6020338", "0.60184336", "0.60097283", "0.59425944", "0.59254223", "0.59177697", "0.58237994", "0.5817406", "0.58046705", "0.5803985", "0.58007365", "0.57843024", "0.5776631", "0.5764386", "0.5753...
0.7150159
1
sets list of users online param users: list of users
function setUsers(list) { users = list }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateOnlineUsers() {\n io.emit('onlineUsers', users);\n }", "setUserData(users) {\r\n this.userList.push(users);\r\n }", "function refreshUsersList(users = []) {\n const usersListEl = document.querySelector('#usersList');\n\n //clear all current users elements\n usersLi...
[ "0.77290803", "0.73678637", "0.7167123", "0.7146568", "0.69660544", "0.69572914", "0.69226635", "0.68713284", "0.6854649", "0.6816633", "0.6807604", "0.67522144", "0.67367923", "0.6711109", "0.66755813", "0.6646941", "0.66154027", "0.6614613", "0.6612861", "0.6605522", "0.657...
0.80427486
0
sets title param title: session title
function setSessionTitle(title) { sessionTitle = title }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTitle(title) {\n\tdocument.getElementsByTagName(\"title\")[0].innerHTML=title;\n\tdocument.getElementById(\"title\").innerHTML=title;\n}", "function getTitle (){\n \n userdata.title = (document.title);\n \n}", "setTitle(title) {\n document.title = title\n }", "setTitle(title) {...
[ "0.7819262", "0.7766603", "0.76963454", "0.7684252", "0.7661118", "0.7616276", "0.7585185", "0.7584502", "0.7512096", "0.74903446", "0.74891317", "0.7485015", "0.74608344", "0.7456598", "0.74084324", "0.7369755", "0.7342168", "0.73236984", "0.7301214", "0.7281836", "0.7267974...
0.9052711
0
if going to where player was last spotted
if (m_dtDestination == DT_PLAYERSPOTTED) { // if you see the target //if (IsVisible(m_penEnemy)) if (IsVisible(GetTargetEntity(m_wPetState))) { // switch to following player m_dtDestination = DT_PLAYERCURRENT; } // if you don't see him // if using pathfinding ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLastSate() {\n // Record previous state\n MariolastX = mario.position.x; // check if Mario stuck at the ledge side\n }", "function playerGo() \n{\n\tif ( players.current >= ( players.players.length - 1 ) ) \n\t{\n\t\tplayers.current = 0;\n\t} \n\telse \n\t{\n\t\tplayers.current++;\n\t}\n}", ...
[ "0.65840256", "0.6494234", "0.6405639", "0.6352509", "0.6330561", "0.6292034", "0.6275614", "0.6208122", "0.62024426", "0.61838955", "0.6173153", "0.6167741", "0.6166656", "0.61504835", "0.6091978", "0.6080885", "0.60771865", "0.6049746", "0.60027784", "0.5979002", "0.5978449...
0.6556805
1
if (CalcDist(m_penEnemy) < GetProp(m_fAttackDistance) && CanAttackEnemy(m_penEnemy, Cos(AngleDeg(45.0f))))
if (CalcDist(GetTargetEntity(m_wPetState)) < GetProp(m_fAttackDistance) && CanAttackEnemy(GetTargetEntity(m_wPetState), Cos(AngleDeg(45.0f)))) { // make fuss // AddToFuss(); // stop moving (rotation and translation) StopMoving(); // set next shoot time //if (CalcDist(m_penEnemy) < GetProp(m_fCloseDi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "attack(dt){\n if((((this.x - mainShip.x)*(this.x - mainShip.x)) + ((this.y - mainShip.y)*(this.y - mainShip.y))) < 5000){\n this.isAlive = false;\n mainShip.takeDamage(20+levelNum, \"nerf\");\n }\n\t}", "function checkCollectable(t_collectable)\n{\n if(dist(gameChar_world_x...
[ "0.6800786", "0.67254096", "0.6698308", "0.6669064", "0.6656039", "0.66298497", "0.6602071", "0.6576276", "0.65704775", "0.6562043", "0.6557402", "0.6552705", "0.6542549", "0.6540053", "0.6517183", "0.649164", "0.6470802", "0.6468988", "0.6451846", "0.64510775", "0.64359504",...
0.75911874
0
FONT SIZE TOGGLE FUNCTIONS
function toggle_font_size(x) { var fs_label = $('.' + x + '-fs-label') var fsl = font_size_label(x); var fs_counter; if(x == 'p') { fs_counter = p_font_size_counter } else if(x == 'h') { fs_counter = h_font_size_counter } else if(x == 'sh'){ fs_counter = sh_font_size_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ToggleTextSize(Toggle) {\n\tcalcStop();\n\tthermoM(\"start\"); //start a progress dialog\n\t\n\tvar ToggleSize = Toggle !== undefined && !isNaN(Toggle) ? parseFloat(Toggle) : (typePF ? 7 : 5.74);\n\tthermoM(\"Changing the font size to \" + (ToggleSize ? \"'Auto'\" : ToggleSize) + \"...\"); //change the pr...
[ "0.69062525", "0.67970777", "0.6738697", "0.6721657", "0.66381925", "0.66022116", "0.6553559", "0.65179455", "0.64954305", "0.64880997", "0.6466695", "0.6432256", "0.6396802", "0.63939965", "0.6380968", "0.6380497", "0.6379854", "0.6348335", "0.6322357", "0.62866753", "0.6283...
0.79241616
0
2D polygons are now supported through the CAG class. With many improvements (see documentation): shapes do no longer have to be convex union/intersect/subtract is supported expand / contract are supported But we'll keep CSG.Polygon2D as a stub for backwards compatibility
function Polygon2D (points) { const cag = CAG.fromPoints(points) this.sides = cag.sides }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function b2PolygonShape() {\nthis.position = {};\nthis.vertices = [];\nthis.type = b2Shape_Type_e_polygon;\n}", "function Polygon2D (points) {\n const cag = fromPoints(points)\n this.sides = cag.sides\n}", "function cvjs_drawSpaceObject_Polygon() {\n\t\tcvjs_addHandleFunc_Polygon();\n}", "function Polygon(...
[ "0.7113881", "0.7020479", "0.67417145", "0.6445849", "0.6273552", "0.6262246", "0.6179978", "0.61427695", "0.611036", "0.6082762", "0.6057667", "0.60539687", "0.60531396", "0.60501283", "0.5981085", "0.5977401", "0.59472877", "0.59418863", "0.5931843", "0.590934", "0.5904284"...
0.73815143
0
Converts an CSS color name to RGB color.
function css2rgb (s) { return cssColors[s.toLowerCase()] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorFromRouteName(name, dim) {\n var hashCode = function(s) {\n return s.split(\"\").reduce(function(a, b) {\n a = ((a << 5) - a) + b.charCodeAt(0);\n return a & a\n }, 0);\n };\n var colnum = Math.floor(15485863 * Math.abs(hashCode(name))) % 16777215;\n var colnum_str = colnum.toStri...
[ "0.66628534", "0.6654908", "0.6527684", "0.652696", "0.6474432", "0.6428042", "0.6417467", "0.6401956", "0.6385765", "0.6364064", "0.6364064", "0.63631535", "0.63631535", "0.63631535", "0.6354489", "0.6350058", "0.6350058", "0.634478", "0.6304153", "0.6297101", "0.62840325", ...
0.7887222
0
Converts RGB color value to HTML5 color value (string) Conversion forumla: convert R, G, B into HEX strings return HTML formatted string "RRGGBB"
function rgb2html (r, g, b) { if (r.length) { r = r[0] g = r[1] b = r[2] } let s = '#' + Number(0x1000000 + r * 255 * 0x10000 + g * 255 * 0x100 + b * 255).toString(16).substring(1, 7) return s }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RGB2HTML(red, green, blue)\n{\n var decColor = parseInt(red) + 256 * parseInt(green) + 65536 * parseInt(blue);\n return decColor.toString(16);\n}", "function rgb(r, g, b){\n return [r, g, b].map( color => {\n if (color > 255) return \"FF\"\n else if (color <= 0) return \"00\"\n l...
[ "0.8246021", "0.77430665", "0.77302873", "0.77263033", "0.76022875", "0.7533345", "0.7507587", "0.7507587", "0.74919116", "0.7449211", "0.7449054", "0.74473184", "0.7429182", "0.7425128", "0.7414815", "0.7409912", "0.7407764", "0.74059904", "0.7384539", "0.7368036", "0.735767...
0.82029074
1
emit the group (code and value) to asorbers
function emitgroup (reader, group, value) { // console.log(group+": "+value) // emit this group to all listeners if (reader.absorbers !== undefined) { var absorber = reader.absorbers.get(group) if (absorber !== undefined) { absorber(reader, group, value) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBPLabel(codeValue, group){\r\n if (group instanceof MPageGrouper) {\r\n var bpGroups = group.getGroups();\r\n for (var y = 0; y < bpGroups.length; y++) {\r\n if (bpGroups[y] instanceof MPageEventCodeGroup) {\r\n var groupName = bpGroups[y]....
[ "0.551959", "0.53700083", "0.5243638", "0.5145047", "0.51415706", "0.5128048", "0.5095883", "0.5031062", "0.5014736", "0.50142086", "0.5008198", "0.49952275", "0.4992597", "0.4972599", "0.49645254", "0.49597353", "0.49203137", "0.49161503", "0.49056378", "0.49002036", "0.4893...
0.6375792
0
parse the given data in the context of the given reader
function parse (reader, data) { // check reader state if (reader.error) { throw reader.error // throw the last error } if (reader.isclosed) { return emiterror(reader, 'Cannot write after close') } emitstart(reader) if (data === null) { return emitend(reader) } // i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseData() { }", "function customRead(data) {\n // manipulate parsed data with switch case\n return data;\n}", "_parse(data) {\n const me = this\n\n // Creating the state in the closure and passing it as a parameter is more\n // efficient and allows to use the same parser instance asynchronously.\n...
[ "0.65244246", "0.64215857", "0.58309466", "0.55230534", "0.5508772", "0.55013025", "0.54952025", "0.54606855", "0.54468846", "0.5442771", "0.5366894", "0.531931", "0.5311145", "0.52963936", "0.5282278", "0.5282278", "0.5282278", "0.5275397", "0.5221033", "0.51996976", "0.5181...
0.74430585
0
handle a entity as provided by the reader groups: 0 special handling to set defaults as per DXF specifications
function handleEntity (reader, group, value) { // console.log('entity: '+group+','+value) let obj = null switch (value) { case 'LAYER': obj = {type: 'layer'} // entity defaults obj[getTLA(48)] = 1.0 obj[getTLA(60)] = 0 // obj[getTLA(62)] = 256 obj[getTLA(67)] = 0 // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_entity( raw ) {\n raw = _.isObject( raw ) ? raw : {}\n\n if( raw.entity$ ) {\n return seneca.make$( raw )\n }\n else {\n _.each( raw, function(v,k){\n if( _.isObject(v) && v.entity$ ) {\n raw[k] = seneca.make$( v )\n }\n })\n return raw\n }\...
[ "0.6061958", "0.560713", "0.5516638", "0.53667104", "0.5316574", "0.5292688", "0.5292688", "0.52411604", "0.52205527", "0.51627403", "0.51463044", "0.51126367", "0.5092663", "0.5076023", "0.50636643", "0.503856", "0.5033878", "0.5016453", "0.49989548", "0.49973458", "0.499078...
0.7113644
0
handle a varible as provided by the reader groups: 9
function handleVariable (reader, group, value) { // console.log('variable: '+group+','+value) let obj = {type: 'variable', name: value} reader.objstack.push(obj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleVariable() {\n var string = getParameter();\n var selectionData = parseString(string);\n readSelectionData(selectionData);\n}", "function handleInt (reader, group, value) {\n // console.log('int: '+group+','+value)\n let obj = reader.objstack.pop()\n if ('type' in obj) {\n obj[getTL...
[ "0.6347422", "0.60152644", "0.56703067", "0.56543845", "0.55903697", "0.55667245", "0.55349964", "0.5480811", "0.5470374", "0.5442243", "0.54297966", "0.54255617", "0.5376265", "0.5375006", "0.5333672", "0.5289353", "0.5280714", "0.52381444", "0.5219918", "0.5197287", "0.5163...
0.679805
0
handle a int as provided by the reader groups: 62, 70, 71, 72, 73, 74, 75, 210, 220, 230
function handleInt (reader, group, value) { // console.log('int: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { obj[getTLA(group)] = parseFloat(value) } reader.objstack.push(obj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "function parse_PtgInt(blob) { blob.l++; return blob.read_shift(2); }", "function parse_PtgI...
[ "0.63396585", "0.63396585", "0.63396585", "0.63396585", "0.63396585", "0.63396585", "0.63396585", "0.63396585", "0.61197144", "0.57097226", "0.57093835", "0.56152606", "0.5503383", "0.5440582", "0.5430755", "0.5414613", "0.5394639", "0.53712493", "0.5370462", "0.53545934", "0...
0.69926083
0
handle a double as provided by the reader groups: 11, 12, 13, 21, 22, 23, 31, 32, 33, 39, 40, 41, 50, 51
function handleDouble (reader, group, value) { // console.log('double: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { obj[getTLA(group)] = parseFloat(value) } reader.objstack.push(obj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleInt (reader, group, value) {\n // console.log('int: '+group+','+value)\n let obj = reader.objstack.pop()\n if ('type' in obj) {\n obj[getTLA(group)] = parseFloat(value)\n }\n reader.objstack.push(obj)\n}", "function restrictInputDouble(e) {\n var pattern = /[0-9\\.]/g;\n return restr...
[ "0.5815695", "0.57716376", "0.5512186", "0.54614043", "0.53913075", "0.5388695", "0.5378836", "0.53234494", "0.5318801", "0.5268464", "0.5255066", "0.5236483", "0.5231743", "0.522726", "0.5177333", "0.51743287", "0.5161314", "0.5161314", "0.5149995", "0.5139141", "0.5094265",...
0.79496557
0
handle a X coordinate as provided by the reader groups: 10 special handling of (lwpolyline and mesh) float values
function handleXcoord (reader, group, value) { // console.log('xcoord: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'lwpolyline') { // special handling to build a list of vertices if (obj['pptxs'] === undefined) { obj['pptxs'] = [] obj['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "coord(x) { return this.field.value(x); }", "function getRealX(px, ech) {\n if (ech == undefined) ech = echelle\n var val = (px - ech.pxoff) * ech.scale + ech.xoff\n // val = arrondi(val,digitsGeom )\n return val\n}", "function calcFloatValuesForX(x_values, xmin, xmax, xr) {\n\n for(var kx = 0; kx < xr; ...
[ "0.6424854", "0.62064284", "0.617551", "0.6098147", "0.59623605", "0.59429765", "0.58920956", "0.58920956", "0.58920956", "0.58920956", "0.5839183", "0.5812017", "0.57929146", "0.5790568", "0.57871556", "0.5758236", "0.5745361", "0.5733473", "0.57173723", "0.57173723", "0.571...
0.7925609
0
handle a Y coordinate as provided by the reader groups: 20 special handling of (lwpolyline and mesh) float values
function handleYcoord (reader, group, value) { // console.log('ycoord: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'lwpolyline' || obj['type'] === 'mesh') { // special handling to build a list of vertices if (obj['pptys'] === undefined) { obj['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get yValue() {\r\n return this.i.d;\r\n }", "get Y() { return Math.round(this.#axes[1]) }", "mapY(y) {\n return this.HEIGHT - ((y - this.minimumY()) /\n (this.maximumY() - this.minimumY())) * (this.HEIGHT - 5);\n }", "_findCoordsForY(y) {\n let bisect = (b, yInvert) => {\n ...
[ "0.6535425", "0.64859635", "0.63111067", "0.627506", "0.62475383", "0.6244392", "0.6232298", "0.6156107", "0.61516345", "0.6141983", "0.6110775", "0.6084067", "0.60814095", "0.6077727", "0.6047263", "0.60395825", "0.60383964", "0.60046357", "0.5938494", "0.59033054", "0.58907...
0.7992028
0
handle a Z coordinate as provided by the reader groups: 30 special handling of (mesh) float values
function handleZcoord (reader, group, value) { // console.log('ycoord: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'mesh') { // special handling to build a list of vertices if (obj['pptzs'] === undefined) { obj['pptzs'] = [] } obj['...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function layer(z) {\r\n return Math.round(z / stepz);\r\n}", "function UTM_xy2fl(XX, YY, z, Hemisphere) {\n\n if (Hemisphere == 1) { YY = YY - 10000000; }\n\n\n Out = new Array();\n\n\n var FE; //False Easting\n var FN; //False Northing\n var k0; \t//Scale\n var F0;\n var ...
[ "0.64248455", "0.6253158", "0.6217785", "0.62169224", "0.61992496", "0.6130076", "0.6127304", "0.60866237", "0.60622936", "0.5963834", "0.5951843", "0.59425986", "0.59029937", "0.59029937", "0.58825684", "0.5871316", "0.58607227", "0.58236957", "0.5794406", "0.5765623", "0.57...
0.75612986
0
handle a bulge as provided by the reader groups: 41 special handling of (lwpolyline) float values
function handleBulge (reader, group, value) { // console.log('bulg: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'lwpolyline') { // special handling to build a list of vertices let bulgs = obj['bulgs'] if (bulgs !== undefined) { let pptxs ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set RGFloat(value) {}", "get RGFloat() {}", "set RFloat(value) {}", "set linear( v ){ this.dv.setFloat32( 52, v, true ); }", "function t$1p(e){e.varyings.add(\"linearDepth\",\"float\");}", "convertF()\n {\n this.c = parseFloat(((this.f - 32) / 1.8).toFixed(2));\n this.k = parseFloat((((this....
[ "0.6142983", "0.59658146", "0.5957458", "0.59513533", "0.57514024", "0.5681992", "0.5669432", "0.56277287", "0.5576974", "0.5545959", "0.552997", "0.5509145", "0.5508308", "0.5429876", "0.5428483", "0.54001695", "0.53909737", "0.5368013", "0.53331524", "0.532202", "0.5239788"...
0.7499933
0
handle a len as provided by the reader groups: 91, 92, 93, 94, 95 special handling of (mesh) float values based on group and state
function handleLen (reader, group, value) { // console.log('len: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'mesh') { // mesh has an order of lengths let state = obj['state'] // console.log('mesh len: '+group+','+value+','+state) switch (g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleValue (reader, group, value) {\n // console.log('int: '+group+','+value)\n let obj = reader.objstack.pop()\n if ('type' in obj) {\n if (obj['type'] === 'mesh') {\n let state = obj['state']\n // console.log('mesh value: '+group+','+value+','+state)\n // mesh has an order of value...
[ "0.6259122", "0.5322253", "0.5261869", "0.5258304", "0.5182002", "0.510616", "0.5098214", "0.5088835", "0.49754053", "0.48841035", "0.48724636", "0.48353642", "0.4818195", "0.48019704", "0.47816202", "0.47776276", "0.4772781", "0.47624272", "0.47584763", "0.47488382", "0.4738...
0.7677435
0
handle a value as provided by the reader groups: 90 special handling of (mesh) float values based on state
function handleValue (reader, group, value) { // console.log('int: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj['type'] === 'mesh') { let state = obj['state'] // console.log('mesh value: '+group+','+value+','+state) // mesh has an order of values based on s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set RGFloat(value) {}", "set Float(value) {}", "set RFloat(value) {}", "get RGFloat() {}", "set floatParameter(value) {}", "function handleDouble (reader, group, value) {\n // console.log('double: '+group+','+value)\n let obj = reader.objstack.pop()\n if ('type' in obj) {\n obj[getTLA(group)] = par...
[ "0.68336797", "0.6596117", "0.64435637", "0.63289857", "0.63181007", "0.6299011", "0.6140832", "0.6126645", "0.6104707", "0.6052385", "0.5992268", "0.58822644", "0.58695245", "0.5827434", "0.5804599", "0.57483256", "0.5734997", "0.5703736", "0.5702368", "0.5661248", "0.565793...
0.7779789
0
handle a string as provided by the reader groups: 1,6,7,8,
function handleString (reader, group, value) { // console.log('string: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { obj[getTLA(group)] = value } reader.objstack.push(obj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static parse( str , format = 'ABCDEFGHI' ){\n // Validate format\n SSNFormatter.validateInputFormat( str, format );\n // Remove any non numeric characters\n const numbers = str.replace(/[^0-9]/g, '');\n // Remove any non format characters\n const letters = format.replace(/[^ABCDEFGHI]/g, '');\n ...
[ "0.53949094", "0.5383851", "0.5355189", "0.5280022", "0.5272024", "0.5248418", "0.5199013", "0.5186036", "0.5165747", "0.51565266", "0.5149687", "0.51453954", "0.51171845", "0.5088446", "0.50864154", "0.5067026", "0.50455105", "0.5023265", "0.5022766", "0.5017784", "0.4984939...
0.6318203
0
handle a name as provided by the reader groups: 2,3
function handleName (reader, group, value) { // console.log('name: '+group+','+value) let obj = reader.objstack.pop() if ('type' in obj) { if (obj[getTLA(group)] === undefined) { obj[getTLA(group)] = value } } reader.objstack.push(obj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getName(name){\n \n}", "function handleNames(msg) {\r\n var channel;\r\n\r\n if (msg.command === 'rpl_namreply') {\r\n channel = irc.channels[msg.args[2]];\r\n if (!channel) { return msg; }\r\n\r\n // Save names to channel stream object.\r\n msg.args[3].trim().split(/ +/).fo...
[ "0.6191297", "0.5981849", "0.5909285", "0.58264303", "0.5806578", "0.57922375", "0.57920176", "0.57920176", "0.57920176", "0.57724434", "0.5764154", "0.57618845", "0.57618845", "0.5748112", "0.57444984", "0.57444984", "0.57444984", "0.5738152", "0.573394", "0.5733856", "0.571...
0.7003877
0
Create a DXF reader using the given source and options. This routine sets up a series of callbacks (absorb calls) to handle the various DXF groups, then starts the reader. While reading, the callback routine (handle) converts the value and then: pushes a new group onto the objstack OR adds a new attribute to the curren...
function createReader (src, options) { // create a reader for the DXF let reader = dxf.reader(options) // setup event handling from the reader reader.on('error', handleError) reader.on('start', handleStart) reader.on('end', handleEnd) // setup group handling reader.absorb(0, handleEntity) reader.abs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parse (reader, data) {\n // check reader state\n if (reader.error) {\n throw reader.error // throw the last error\n }\n if (reader.isclosed) {\n return emiterror(reader, 'Cannot write after close')\n }\n\n emitstart(reader)\n\n if (data === null) {\n return emitend(reader...
[ "0.512036", "0.49299383", "0.47512078", "0.473238", "0.46585375", "0.46325684", "0.46029067", "0.45858482", "0.44628856", "0.44497558", "0.44174224", "0.4396068", "0.4394959", "0.4361831", "0.4347865", "0.43396273", "0.4322175", "0.4316171", "0.4290455", "0.42901403", "0.4290...
0.7449123
0
instantiate the give DXF definition (src) into a set of CSG library objects
function instantiate (src, filename, options) { let reader = createReader(src, options) let objs = instantiateAsciiDxf(reader, options) return objs }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createReader (src, options) {\n // create a reader for the DXF\n let reader = dxf.reader(options)\n\n // setup event handling from the reader\n reader.on('error', handleError)\n reader.on('start', handleStart)\n reader.on('end', handleEnd)\n\n // setup group handling\n reader.absorb(0, handleEntit...
[ "0.5630147", "0.5390996", "0.52899426", "0.52625316", "0.51997024", "0.5080263", "0.5032511", "0.49954754", "0.4989808", "0.4989808", "0.49441046", "0.49167445", "0.4914101", "0.48824784", "0.4833622", "0.47920507", "0.47211757", "0.47053605", "0.47018912", "0.4688791", "0.46...
0.6952735
0
translate the give DXF definition (src) into a JSCAD script
function translate (src, filename, options) { let reader = createReader(src, options) let code = `// Produced by JSCAD IO Library : DXF Deserialization (${options.version}) ` // code += '// date: ' + (new Date()) + '\n' // code += '// source: ' + filename + '\n' code += translateAsciiDxf(reader, options) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createScriptSource() {\n var source = [\"// ==UserScript==\"];\n\n var name = document.getElementById(\"name\").value;\n if (name == \"\") {\n alert(bundle.getString(\"newscript.noname\"));\n return false;\n }\n source.push(\"// @name \" + name);\n\n var namespace = document.getEleme...
[ "0.5822457", "0.5746665", "0.57199115", "0.56330293", "0.5432177", "0.53920174", "0.5377256", "0.53724074", "0.53601384", "0.5354564", "0.5324979", "0.5322674", "0.53137255", "0.53000253", "0.526236", "0.5254913", "0.52333885", "0.52293664", "0.52284855", "0.52214944", "0.519...
0.72065747
0
instantiate the given object (3dface) as a polygon
function instantiatePolygon (obj, layers, options) { let vertices = [] // FIXME: should check global variable to instantiate in the proper orientation vertices.push(new CSG.Vertex(new CSG.Vector3D([obj['pptx'], obj['ppty'], obj['pptz']]))) vertices.push(new CSG.Vertex(new CSG.Vector3D([obj['sptx'], obj['spty'],...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initPolygon(){\n var geometry = new THREE.PlaneGeometry(20, 20);\n var material = new THREE.MeshBasicMaterial( {color: 0xa0a0ff, side: THREE.DoubleSide} );\n var polygon = new THREE.Mesh( geometry, material );\n \n polygon.position.set(planeAttr.p[0], planeAttr.p[1], planeAttr.p[2]);\n ...
[ "0.68081653", "0.67729956", "0.6648425", "0.64873785", "0.6482954", "0.6386775", "0.6370714", "0.63602895", "0.62631273", "0.62554187", "0.6243022", "0.6167682", "0.61429393", "0.60779744", "0.604685", "0.6041384", "0.603327", "0.5998408", "0.599733", "0.5982906", "0.59821945...
0.7643788
0
instantiate the given object (line) as CSG.Line2D or CSG.Line3D
function instantiateLine (obj, layers, options) { let csg = null if (obj['pptz'] === obj['sptz'] & obj['pptz'] === 0) { let p1 = new CSG.Vector2D([obj['pptx'], obj['ppty']]) let p2 = new CSG.Vector2D([obj['sptx'], obj['spty']]) csg = CSG.Line2D.fromPoints(p1, p2) } else { let p1 = new CSG.Vector3D...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LineDraw(ctor) {\n this._ctor = ctor || Line_1$1;\n this.group = new graphic.Group();\n}", "function Line(){}", "function Line(){}", "function Line() {}", "function Line() {}", "function Line() {}", "static Linecast() {}", "function Line(objectID_1, objectID_2) {\n\tthis.point1 = objectID_...
[ "0.71977174", "0.7192657", "0.7192657", "0.71661115", "0.71661115", "0.71661115", "0.7106815", "0.69994116", "0.6684263", "0.6676959", "0.6658539", "0.664767", "0.66056585", "0.65256256", "0.64933157", "0.64846814", "0.64417696", "0.64161277", "0.6393934", "0.63926864", "0.63...
0.7460416
0
instantiate the give object as CSG.Vector2D or CSG.Vector3D
function instantiateVector (obj) { const d3line = parseInt('00000000000100000', 2) const d3mesh = parseInt('00000000001000000', 2) const d3face = parseInt('00000000010000000', 2) let flags = obj['lflg'] let vtype = null if ((flags & d3line) === d3line) { vtype = new CSG.Vector3D([obj['pptx'], obj['ppty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(x1, y1, x2, y2) {\r\n this.a = createVector(x1, y1);\r\n this.b = createVector(x2, y2);\r\n }", "function vector(x, y) {\n if ( !(this instanceof vector) ) { // dont need new\n var new_vec = new vector(x, y);\n return new_vec;\n }\n this.x = x || 0;\n ...
[ "0.6955227", "0.67760104", "0.665343", "0.65999264", "0.65754014", "0.6573558", "0.63762295", "0.6370729", "0.6361174", "0.6358521", "0.63113356", "0.6286688", "0.6284121", "0.6252999", "0.62335455", "0.6230689", "0.62023425", "0.6202109", "0.6202109", "0.61975515", "0.619389...
0.7404037
0
append a section to the given path
function addSection (path, x1, y1, bulg) { if (bulg === 0) { // add straight line to the end of the path path = path.appendPoint([x1, y1]) } else { // add arc to the end of the path let prev = path.points[path.points.length - 1] let curr = new CSG.Vector2D(x1, y1) let u = prev.distanceTo(curr) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "append(pathPart) {\n this.data.url = combine(this.data.url, pathPart);\n }", "addSection(header, firstTag) {\n this.sections.push({ header, firstTag })\n }", "function appendFile(path, content) {\n var file = new java.io.File(path);\n org.suikasoft.SharedLibrary.IoUtils.append(file,...
[ "0.60094947", "0.57835954", "0.57507247", "0.57220834", "0.56317765", "0.5622732", "0.55491406", "0.5519559", "0.54316056", "0.5422374", "0.53902113", "0.53785455", "0.5372068", "0.5362788", "0.53625906", "0.53625906", "0.53459185", "0.53459185", "0.53459185", "0.5340464", "0...
0.6208847
0
instantiate the given object (lwpolyline) into a CSG.Path2D
function instantiatePath2D (obj, layers, options) { const closed = parseInt('00000000000000001', 2) // expected values let vlen = obj['vlen'] let pptxs = obj['pptxs'] let pptys = obj['pptys'] let bulgs = obj['bulgs'] let flags = obj['lflg'] // conversion let path = new CSG.Path2D() let isclosed =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateAs2Dline(obj, layers, parts, options) {\n // console.log('##### completing Path2D using vectors')\n // convert the parts to a series of X/Y/BULG lists\n obj['vlen'] = parts.length\n obj['pptxs'] = []\n obj['pptys'] = []\n obj['bulgs'] = []\n for (let vector of parts) {\n obj['pptxs'].pu...
[ "0.6856052", "0.6267322", "0.62467897", "0.6169037", "0.613675", "0.6089445", "0.6051618", "0.6014407", "0.59591043", "0.58983946", "0.589041", "0.588054", "0.5875932", "0.58739805", "0.5872429", "0.5853202", "0.5846616", "0.5839892", "0.5825947", "0.5768705", "0.576244", "...
0.6573002
1
instantiate the given object (arc) into CSG.Path2D or CSG??
function instantiateArc (obj, layers, options) { // expected values let lthk = obj['lthk'] let pptx = obj['pptx'] let ppty = obj['ppty'] // let pptz = obj['pptz'] let swid = obj['swid'] let ang0 = obj['ang0'] // start angle let ang1 = obj['ang1'] // end angle // FIXME need to determine resolution from...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantiatePath2D (obj, layers, options) {\n const closed = parseInt('00000000000000001', 2)\n\n // expected values\n let vlen = obj['vlen']\n let pptxs = obj['pptxs']\n let pptys = obj['pptys']\n let bulgs = obj['bulgs']\n let flags = obj['lflg']\n\n // conversion\n let path = new CSG.Path2D()\...
[ "0.6400734", "0.62344205", "0.6132408", "0.6008943", "0.58474994", "0.5839378", "0.5757933", "0.57355547", "0.56903803", "0.56718826", "0.56156033", "0.5594964", "0.55724585", "0.55671835", "0.55493695", "0.54948705", "0.5490801", "0.54100066", "0.5406094", "0.53560627", "0.5...
0.6762445
0
instantiate the given object (circle) into CAG.circle (or extrude to CSG)
function instantiateCircle (obj, layers, options) { // expected values let lthk = obj['lthk'] let pptx = obj['pptx'] let ppty = obj['ppty'] // let pptz = obj['pptz'] let swid = obj['swid'] // conversion // FIXME add color when supported // let cn = getColorNumber(obj,layers) // let shared = getColo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCircle ( o ) {\n\tvar elem = document.createElementNS(ns, \"circle\");\n\n\telem.setAttributeNS(null,\"cx\", o.cx);\n\telem.setAttributeNS(null,\"cy\", o.cy);\n\telem.setAttributeNS(null,\"r\", o.r);\n\t\n\tif ( o.id !== undefined ) {\n\t\telem.setAttribute(\"id\", o.id);\n\t}\n\n\tif ( o.class !== ...
[ "0.68771183", "0.6690466", "0.6630529", "0.6524364", "0.64900273", "0.6461177", "0.64330256", "0.63980687", "0.63430154", "0.62984174", "0.62979424", "0.6292531", "0.62821966", "0.6273528", "0.62581515", "0.6254807", "0.62372494", "0.6225061", "0.62213457", "0.62188816", "0.6...
0.7870552
0
instantiate the give object (ellipse) into CAG.ellipse (or extrude to CSG)
function instantiateEllipse (obj, layers, options) { // expected values let pptx = obj['pptx'] // center point let ppty = obj['ppty'] let pptz = obj['pptz'] let sptx = obj['sptx'] // MAJOR axis point (about center point) let spty = obj['spty'] let sptz = obj['sptz'] let swid = obj['swid'] // Ratio of mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(center, radiusX, radiusY, rotation) {\n super();\n this.type = 'ellipse';\n this.center = center;\n this.radiusX = radiusX;\n this.radiusY = radiusY;\n this.rotation = rotation || 0;\n this.edgeColor = new Color(0, 0, 0);\n this.fillColor = new Color(255, 255, 255);\n }", "fu...
[ "0.6511216", "0.6377353", "0.6257914", "0.6205363", "0.6108318", "0.59719604", "0.5898383", "0.5847543", "0.5847543", "0.5847543", "0.581536", "0.5772269", "0.5749004", "0.5728259", "0.56397223", "0.56206805", "0.5610115", "0.5598644", "0.5587318", "0.55208087", "0.55148125",...
0.7520101
0
instantiate the given object (mesh) into a CSG Note: See FaceVertex meshes on Wikipedia
function instantiateMesh (obj, layers, options) { // expected values let vlen = obj['vlen'] let pptxs = obj['pptxs'] // vertices let pptys = obj['pptys'] let pptzs = obj['pptzs'] let flen = obj['flen'] let fvals = obj['fvals'] // faces // conversion let cn = getColorNumber(obj, layers) let shared...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SimpleMeshObject () {\n this.objectmatrix = new Matrix3D(); \n this.vertexdatagpu = null;\n this.indexdatagpu = null; \n this.color = [ 1,1,1,1 ]; \n }", "constructor(mesh, scene, interaction, faces) {\n this._mesh = mesh;\n this._interaction = interaction;\n let...
[ "0.6798248", "0.6515475", "0.64272505", "0.636699", "0.623692", "0.6216035", "0.6099263", "0.6098335", "0.6096462", "0.6062361", "0.60387915", "0.59587896", "0.59538704", "0.5938348", "0.5936116", "0.59139854", "0.59133166", "0.5898152", "0.58956295", "0.58675355", "0.5859996...
0.66730845
1
find the layer referenced by the given object
function findLayer (obj, layers) { let lname = obj['lnam'] || '0' for (let layer of layers) { if (layer['name'] === lname) { return layer } } return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i2uiLocateLayer(obj, name)\r\n{\r\n if (obj.layers)\r\n {\r\n var len = obj.layers.length;\r\n var num;\r\n for (var i=0; i<len; i++)\r\n {\r\n if (obj.layers[i].name == name)\r\n return obj.layers[i];\r\n var found = i2uiLocateLayer(obj.layers[i].document, name);\r\n i...
[ "0.7572116", "0.74091923", "0.71696645", "0.6805358", "0.66431576", "0.62771285", "0.6107244", "0.6033089", "0.58989376", "0.5843106", "0.5829676", "0.58219486", "0.58132696", "0.58049566", "0.5784847", "0.57528746", "0.5713535", "0.5682323", "0.5628298", "0.5558018", "0.5554...
0.7681609
0
get the color number of the object, possibly looking at layer returns 1 if a color number was not found
function getColorNumber (obj, layers) { let cn = obj['cnmb'] || -1 if (cn === BYLAYER) { // use the color number from the layer cn = -1 let layer = findLayer(obj, layers) if (layer !== null) { cn = layer['cnmb'] || -1 } } else if (cn === BYBLOCK) { // use the color number from the bloc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColorNumber (obj, layers) {\n let cn = obj['cnmb'] || -1\n if (cn === BYLAYER) {\n // use the color number from the layer\n cn = -1\n let layer = findLayer(obj, layers)\n if (layer !== null) {\n cn = layer['cnmb'] || -1\n }\n } else\n if (cn === BYBLOCK) {\n // use the color ...
[ "0.8034862", "0.6726864", "0.66704273", "0.6630806", "0.65222985", "0.64475876", "0.6415331", "0.6308488", "0.62996185", "0.62706006", "0.6235369", "0.6208977", "0.61409396", "0.60684216", "0.60583705", "0.60511273", "0.6047632", "0.59957635", "0.59875774", "0.59637314", "0.5...
0.81039906
0
instantiate Polygon.Shared(color) using the given index into the given color index
function getColor (index, colorindex) { if (index < 0) { return null } index = mod(index, colorindex.length) let rgba = colorindex[index] // FIXME : colors should be cached and shared return new CSG.Polygon.Shared(rgba) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColor (index, colorindex) {\n if (index < 1) { return null }\n\n index = mod(index, colorindex.length)\n let rgba = colorindex[index-1]\n return new CSG.Polygon.Shared.fromColor([rgba[0]/255,rgba[1]/255,rgba[2]/255,rgba[3]/255])\n}", "addPolygon(poly, color) {\n // Array of Point insta...
[ "0.72949487", "0.60394454", "0.5849019", "0.5684237", "0.5575428", "0.54970145", "0.5388173", "0.53333974", "0.5313087", "0.51937187", "0.518952", "0.51661456", "0.51376915", "0.51349396", "0.51022816", "0.5081982", "0.5073319", "0.5069957", "0.5067301", "0.5059064", "0.50581...
0.74859226
0
complete a complex object from the given base object and parts a series of 3dfaces => polygons => CSG a series of vertex => vectors => Path2D
function completeCurrent (objects, baseobj, polygons, vectors, options) { if (baseobj instanceof CSG.Path2D) { // console.log('##### completing Path2D') objects.push(new CSG.Path2D(vectors, baseobj.closed)) } if (baseobj instanceof CSG) { // console.log('##### completing CSG') objects.push(CSG.fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateCurrent (obj, layers, parts, options) {\n if (obj === null) return null\n\n let type = obj.type\n // console.log('##### translating Current as '+type)\n if (type === '2dline') {\n return translateAs2Dline(obj, layers, parts, options)\n }\n\n if (type === '3dline') {\n // FIXME what to...
[ "0.62238634", "0.59785193", "0.5967573", "0.59405804", "0.59306514", "0.5915562", "0.58755684", "0.58395666", "0.5589098", "0.55488485", "0.5532102", "0.55274993", "0.5524797", "0.5504424", "0.54529047", "0.54507905", "0.5447404", "0.5429583", "0.5383817", "0.538157", "0.5359...
0.6858261
0
translate the give 2D vector to JSCAD script
function translateVector2D (vector) { let script = `new CSG.Vector2D(${vector.x},${vector.y})` return script }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateVector3D (vector) {\n let script = `${vector.x},${vector.y},${vector.z}`\n return script\n}", "function convertVector(element) {\n return (vector, direction, type) => {\n // Matrix representing transforms from element coordinates to dom coordinates\n // (It actual...
[ "0.6358678", "0.6239069", "0.62309486", "0.61980295", "0.6191439", "0.6177335", "0.61721754", "0.60715854", "0.60672057", "0.59860003", "0.59583485", "0.59339774", "0.59319866", "0.592921", "0.5928433", "0.5909112", "0.58821607", "0.5870373", "0.582459", "0.5806893", "0.58059...
0.7574618
0
translate the give 3D vector to JSCAD script
function translateVector3D (vector) { let script = `${vector.x},${vector.y},${vector.z}` return script }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function v(x,y,z){ \n return new THREE.Vector3(x,y,z); \n }", "function v(x,y,z){\n return new THREE.Vector3(x,y,z);\n }", "function v(x,y,z){\r\n return new THREE.Vector3(x,y,z);\r\n }", "function makeV3D(v) {\n return new Vector3d(scale * v[0], scale * v[1], sca...
[ "0.6770378", "0.67448896", "0.67355955", "0.67000073", "0.6688678", "0.66765094", "0.6615118", "0.66134673", "0.65948814", "0.65502423", "0.6320518", "0.6316145", "0.6308508", "0.6299941", "0.62664026", "0.62279445", "0.62022513", "0.61773115", "0.6171485", "0.6157609", "0.61...
0.75283235
0
translate the given CSG.Polygon into JSCAD script
function translatePolygon (polygon) { let script = 'createPolygon([' for (let vertex of polygon.vertices) { script += `${translateVertex(vertex)},` } script += `],${translateShared(polygon.shared)},${translatePlane(polygon.plane)})` return script }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _arrayPolygonToSAT(srcPolygon) {\n return new sat.Polygon(\n new sat.Vector(),\n srcPolygon.map(pt => new sat.Vector(pt[0], pt[1]))\n );\n}", "function convertToGeojsonPolygon(polygon) {\r\n\tpolygon=polygon.replace(\" \",\" \"); //cleanup polygon\r\n\tvar inputCoordinates=polygon.split(\" \");...
[ "0.67578906", "0.62475395", "0.6183388", "0.6183388", "0.60156476", "0.59287435", "0.5906536", "0.5841778", "0.5841778", "0.580591", "0.57574666", "0.5721672", "0.5702558", "0.5675265", "0.55990535", "0.5579039", "0.55775875", "0.5566048", "0.5564669", "0.5564233", "0.5559664...
0.76330864
0
translate the given CSG.Plane to JSCAD script
function translatePlane (plane) { let script = `[${translateVector3D(plane.normal)},${plane.w}]` return script }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plane(){}", "function individual_plane_Data(plane){\n if(plane.Trak > 180){\n console.log(\"It's west bound\");\n } else {\n console.log(\"It's east bound\");\n }\n console.log(plane.Mdl);\n console.log(plane.Alt);\n console.log(plane.Icao);\n }", "function...
[ "0.5462621", "0.5447907", "0.509499", "0.5060589", "0.5012036", "0.5012036", "0.50066346", "0.49750474", "0.4945379", "0.4945379", "0.49201864", "0.4910242", "0.48900768", "0.484456", "0.4809735", "0.47559318", "0.47481477", "0.4744866", "0.4739505", "0.47143385", "0.46992028...
0.6871858
0
translate the given CSG.Vertex to JSCAD script
function translateVertex (vertex) { let script = `[${translateVector3D(vertex.pos)}]` return script }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toSourceCSGVertex (ver) {\n return 'new CSG.Vertex(new CSG.Vector3D(' + ver._x + ',' + ver._y + ',' + ver._z + '))'\n}", "function toSourceCSGVertex (ver) {\n return 'new CSG.Vertex(new CSG.Vector3D(' + ver._x + ',' + ver._y + ',' + ver._z + '))'\n}", "function vt2jscad (positions, triangles, normal...
[ "0.68131375", "0.68131375", "0.55171496", "0.5478714", "0.5456394", "0.5455142", "0.5437239", "0.5437239", "0.54210913", "0.53971535", "0.5346205", "0.5297201", "0.5266414", "0.5263046", "0.5255839", "0.5211219", "0.52005", "0.51726675", "0.51398635", "0.5129792", "0.5122939"...
0.7114355
0
translate the given DXF object (line) into 2D or 3D line
function translateLine (obj, layers, options) { let name = obj['name'] let script = '' if (obj['pptz'] === obj['sptz'] & obj['pptz'] === 0) { let p1 = new CSG.Vector2D([obj['pptx'], obj['ppty']]) let p2 = new CSG.Vector2D([obj['sptx'], obj['spty']]) script = ` let ${name} = CSG.Line2D.fromPoints(${tr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateAs2Dline(obj, layers, parts, options) {\n // console.log('##### completing Path2D using vectors')\n // convert the parts to a series of X/Y/BULG lists\n obj['vlen'] = parts.length\n obj['pptxs'] = []\n obj['pptys'] = []\n obj['bulgs'] = []\n for (let vector of parts) {\n obj['pptxs'].pu...
[ "0.7225124", "0.6725208", "0.6487629", "0.6451497", "0.6240717", "0.6203381", "0.61238766", "0.6116751", "0.6107211", "0.60544145", "0.60544145", "0.60544145", "0.60368204", "0.6030887", "0.602831", "0.60176545", "0.597228", "0.59241366", "0.59130293", "0.59011", "0.5880485",...
0.6876499
1
translate the given obj (lwpolyline) into a CSG.Path2D
function translatePath2D (obj, layers, options) { const closed = parseInt('00000000000000001', 2) // expected values let vlen = obj['vlen'] let pptxs = obj['pptxs'] let pptys = obj['pptys'] let bulgs = obj['bulgs'] let flags = obj['lflg'] let name = obj['name'] // translation let script = ` let...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translateAs2Dline(obj, layers, parts, options) {\n // console.log('##### completing Path2D using vectors')\n // convert the parts to a series of X/Y/BULG lists\n obj['vlen'] = parts.length\n obj['pptxs'] = []\n obj['pptys'] = []\n obj['bulgs'] = []\n for (let vector of parts) {\n obj['pptxs'].pu...
[ "0.75866044", "0.63276446", "0.6196375", "0.6132719", "0.5924378", "0.58815354", "0.5854723", "0.58197635", "0.5813836", "0.58013594", "0.57828", "0.57684994", "0.57037383", "0.5663843", "0.5663701", "0.5654775", "0.5638073", "0.56205696", "0.5612303", "0.5592582", "0.5566642...
0.6589421
1
translate the given object (arc) into CAG.Path2D or CSG??
function translateArc (obj, layers, options) { // expected values let lthk = obj['lthk'] let pptx = obj['pptx'] let ppty = obj['ppty'] let pptz = obj['pptz'] let swid = obj['swid'] let ang0 = obj['ang0'] // start angle let ang1 = obj['ang1'] // end angle let name = obj['name'] // convert to 2D object...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translatePath2D (obj, layers, options) {\n const closed = parseInt('00000000000000001', 2)\n\n // expected values\n let vlen = obj['vlen']\n let pptxs = obj['pptxs']\n let pptys = obj['pptys']\n let bulgs = obj['bulgs']\n let flags = obj['lflg']\n let name = obj['name']\n\n // translation\n le...
[ "0.66935676", "0.6236518", "0.616912", "0.6166025", "0.60177314", "0.5847405", "0.5834263", "0.58152825", "0.58018404", "0.5702577", "0.57021415", "0.5689297", "0.5670523", "0.5613316", "0.55571634", "0.55550796", "0.55462474", "0.5527503", "0.5502149", "0.54857284", "0.54801...
0.68863493
0
translate the given obj (circle) into CAG.circle (or extrude to CSG)
function translateCircle (obj, layers, options) { // expected values let lthk = obj['lthk'] let pptx = obj['pptx'] let ppty = obj['ppty'] let pptz = obj['pptz'] let swid = obj['swid'] let name = obj['name'] // FIXME add color when supported // let cn = getColorNumber(obj,layers) // let shared = getCo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantiateCircle (obj, layers, options) {\n // expected values\n let lthk = obj['lthk']\n let pptx = obj['pptx']\n let ppty = obj['ppty']\n // let pptz = obj['pptz']\n let swid = obj['swid']\n\n // conversion\n // FIXME add color when supported\n // let cn = getColorNumber(obj,layers)\n // let ...
[ "0.73724985", "0.6503859", "0.6438483", "0.6325275", "0.6193005", "0.60970354", "0.60634494", "0.6039136", "0.5802662", "0.57826483", "0.57690275", "0.5729616", "0.57109773", "0.5638902", "0.56366456", "0.5600641", "0.5589324", "0.558879", "0.5580148", "0.5574208", "0.5562315...
0.77010065
0
translate the given object (ellipse) into CAG.ellipse or CSG??
function translateEllipse (obj, layers, options) { // expected values let pptx = obj['pptx'] // center point let ppty = obj['ppty'] let pptz = obj['pptz'] let sptx = obj['sptx'] // MAJOR axis point (about center point) let spty = obj['spty'] let sptz = obj['sptz'] let swid = obj['swid'] // Ratio of minor ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantiateEllipse (obj, layers, options) {\n // expected values\n let pptx = obj['pptx'] // center point\n let ppty = obj['ppty']\n let pptz = obj['pptz']\n let sptx = obj['sptx'] // MAJOR axis point (about center point)\n let spty = obj['spty']\n let sptz = obj['sptz']\n let swid = obj['swid'] /...
[ "0.6495338", "0.60859144", "0.5794304", "0.56940037", "0.5545728", "0.54125714", "0.54025656", "0.53946024", "0.5394141", "0.5288288", "0.52814204", "0.52686423", "0.5234451", "0.5203436", "0.5201255", "0.51976186", "0.5182615", "0.51196855", "0.50411814", "0.50278586", "0.50...
0.70079434
0
get the color number of the object, possibly looking at layer returns 1 if a color number was not found
function getColorNumber (obj, layers) { let cn = obj['cnmb'] || -1 if (cn === BYLAYER) { // use the color number from the layer cn = -1 let layer = findLayer(obj, layers) if (layer !== null) { cn = layer['cnmb'] || -1 } } else if (cn === BYBLOCK) { // use the color number from the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColorNumber (obj, layers) {\n let cn = obj['cnmb'] || -1\n if (cn === BYLAYER) {\n // use the color number from the layer\n cn = -1\n let layer = findLayer(obj, layers)\n if (layer !== null) {\n cn = layer['cnmb'] || -1\n }\n } else\n if (cn === BYBLOCK) {\n // use the color numb...
[ "0.81029564", "0.67273843", "0.6671685", "0.663143", "0.65230286", "0.64479333", "0.6415366", "0.63087595", "0.6299425", "0.6271494", "0.62353873", "0.6209228", "0.6140855", "0.60697895", "0.60593843", "0.605127", "0.6047691", "0.599689", "0.5987837", "0.5964621", "0.59629214...
0.8033773
1
instantiate Polygon.Shared(color) using the given index into the given color index Note: 0 > index <= length of colorindex
function getColor (index, colorindex) { if (index < 1) { return null } index = mod(index, colorindex.length) let rgba = colorindex[index-1] return new CSG.Polygon.Shared.fromColor([rgba[0]/255,rgba[1]/255,rgba[2]/255,rgba[3]/255]) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColor (index, colorindex) {\n if (index < 0) { return null }\n\n index = mod(index, colorindex.length)\n let rgba = colorindex[index]\n // FIXME : colors should be cached and shared\n return new CSG.Polygon.Shared(rgba)\n}", "addPolygon(poly, color) {\n // Array of Point instances\n ...
[ "0.77592164", "0.5762891", "0.5690745", "0.5431524", "0.5396116", "0.5392704", "0.53820616", "0.53770316", "0.5370484", "0.5370484", "0.5370484", "0.53443956", "0.53443956", "0.5336996", "0.5336996", "0.5336157", "0.53283125", "0.53283125", "0.53283125", "0.53283125", "0.5328...
0.75766814
1
get the (internal) object type from the given object This assumes the given object is a POLYLINE. DXF POLYLINE entities are overloaded objects with various shapes. 2D line, with following 2D VERTEX entities 3D line, with following 3D VERTEX entities 3D polymesh, with following 3D VERTEX entities 3D polyface, with follo...
function getPolyType (obj) { const closedM = parseInt('00000000000000001', 2) const d3line = parseInt('00000000000001000', 2) const d3mesh = parseInt('00000000000010000', 2) const closedN = parseInt('00000000000100000', 2) const d3face = parseInt('00000000001000000', 2) let flags = obj['lflg'] let pty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPolyType (obj) {\n const closed = parseInt('00000000000000001', 2)\n const d3line = parseInt('00000000000001000', 2)\n const d3mesh = parseInt('00000000000010000', 2)\n\n let flags = obj['lflg']\n let ptype = null\n if ((flags & d3line) === d3line) {\n ptype = null // FIXME what to do?\n } el...
[ "0.74501306", "0.6593338", "0.6387692", "0.6290624", "0.61342555", "0.61342555", "0.61342555", "0.6048208", "0.60141087", "0.59877014", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244", "0.5976244...
0.73373556
1
Instantiate the facets of the POLYLINE polymesh as a set of polygons. DXF POLYLINE entities can contain a mesh defined by a MxN set of vertices. The mesh is defined in terms of a matrix of M and N vertices, like a grid consisting of columns and rows. M and N specify the column and row position, respectively, of any giv...
function instantiateFacets (meshM, meshN, vectors, shared, options) { // console.log('##### instantiateFacets('+meshM+','+meshN+')') function getVector (x, y) { let n = (((x - 1) * meshN) + (y - 1)) return vectors[n] } let facets = [] // sanity check let fcount = meshM * meshN if (fcount !== ve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantiatePolyFaces (meshM, meshN, vectors, shared, options) {\n // console.log('##### instantiatePolyFaces('+meshM+','+meshN+')')\n let faces = []\n\n // sanity check\n if ((meshM + meshN) !== vectors.length) {\n return faces\n }\n // conversion\n let i = meshM // skip to the faces\n while (i...
[ "0.63676065", "0.61447734", "0.60876894", "0.58844405", "0.58748716", "0.58744085", "0.57933646", "0.5749772", "0.56192815", "0.559679", "0.5535314", "0.5511928", "0.5466647", "0.5459482", "0.542349", "0.5423352", "0.53603745", "0.53446734", "0.53414464", "0.5327636", "0.5320...
0.64102894
0
Instantiate the faces of the POLYLINE facemesh as a set of polygons. DXF POLYLINE entities can contain a face mesh defined by a series of vertices. The first part of the series are the (meshM) vertices. The second part of the series are the (meshN) faces. Each face of the mesh is defined by the indexes provided by the ...
function instantiatePolyFaces (meshM, meshN, vectors, shared, options) { // console.log('##### instantiatePolyFaces('+meshM+','+meshN+')') let faces = [] // sanity check if ((meshM + meshN) !== vectors.length) { return faces } // conversion let i = meshM // skip to the faces while (i < vectors.leng...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeFaces() {\n let faces = [];\n for (const [faceType, normalVector] of Object.entries(this.normalVectors)) {\n // Plane goes to infinity in all directions. Position, in direction of normal vectork, is half of edge length\n faces.push(new Face(faceType, normalVector));\n }\n return faces;\n ...
[ "0.6845111", "0.6473418", "0.6397077", "0.6210712", "0.6132275", "0.60863066", "0.60304004", "0.6010028", "0.5921197", "0.5913434", "0.58484524", "0.5789809", "0.5753984", "0.5746664", "0.57256156", "0.5722112", "0.5697439", "0.5666335", "0.5587669", "0.55827284", "0.55761784...
0.7352288
0