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
randomly place the charger
function _placeCharger() { if(_canPlace) { _canPlace = false; _hackTimeout = setTimeout(function() { _canPlace = true; },200); var x = Math.floor(Math.random() * $game.VIEWPORT_WIDTH), y = Math.floor(Math.random() * $game.VIEWPORT_HEIGHT); _charger.x = x; _charger.y = y; _charger.revealed = false;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computerMove() {\n const emptySpaces = document.getElementsByClassName('free');\n const move = Math.floor(Math.random() * emptySpaces.length);\n\n document.getElementsByClassName('free')[move].click();\n }", "function ChanceToShoot(){\n\t\treturn Math.round((Math.random()*...
[ "0.6100697", "0.60633016", "0.59992594", "0.596653", "0.5878708", "0.5875101", "0.58489484", "0.58482957", "0.5836151", "0.57905287", "0.577024", "0.5761609", "0.5755882", "0.57495195", "0.5747982", "0.5734248", "0.57196116", "0.57160926", "0.570778", "0.56927913", "0.5686138...
0.7719679
0
calculate how far from the charger the tile is
function _distFromCharger(pos) { var delta = Math.abs(pos.x - _charger.x) + Math.abs(pos.y - _charger.y); return delta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computeRefuel() {\n return ((100 - this._fuelLevel) / 100) * this._capacity;\n }", "_getRemainingDistance()\r\n {\r\n let distanceList = this._navPath.distances;\r\n let distRemaining = 0;\r\n\r\n // Add distance to next waypoint.\r\n distRemaining += this._distanceToNext...
[ "0.6384347", "0.62641174", "0.61868906", "0.6178593", "0.605427", "0.60483164", "0.6007617", "0.59449494", "0.5923935", "0.58928317", "0.58693", "0.5864163", "0.58410347", "0.5837735", "0.5827084", "0.58166665", "0.5804447", "0.57986194", "0.5796799", "0.5775755", "0.57656103...
0.66539913
0
check if they are out of seeds and the charger hasn't been revealed
function _checkFail() { if(!_charger.revealed || _currentCharger < _numChargers) { _fail(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkMoves() {\n if (picked.length !== null) {\n if (opponentPicked.length !== null) {\n checkWinner();\n }\n }\n }", "function collectWheatSeeds()\n\t\t\t{\n\t\t\t\twheatSeedBank += randInt(1,3);\n\t\t\t\tif (randInt(1,20) == 1)\n\t\t\t\t{\n\t\t\t\t...
[ "0.6251475", "0.6177703", "0.6148457", "0.60931045", "0.6091791", "0.6075366", "0.60680115", "0.60534", "0.60416263", "0.603083", "0.5987059", "0.59834373", "0.59554696", "0.59399176", "0.59344256", "0.5930568", "0.5930243", "0.5908469", "0.5899671", "0.5881889", "0.5866622",...
0.6609822
0
create a random item
function _makeRandomItem() { var ran = Math.floor(Math.random() * 200); if(ran < 4) { return ran; } else { return -1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random_item(items) {\n\n return items[Math.floor(Math.random() * items.length)];\n\n}", "function randomItem(level){ return randomSomthing(level, \"item\"); }", "function _makeItem(){\n var index = Utils.randMath(0, allItems.length - 1);\n var item = allItems[index];\n var retItem = undefined;\n...
[ "0.7379382", "0.7352581", "0.72373474", "0.7180565", "0.71419364", "0.7088073", "0.68878746", "0.6870064", "0.6868411", "0.6865018", "0.68197197", "0.6795679", "0.6785389", "0.6772229", "0.6770324", "0.676764", "0.67408997", "0.6713545", "0.67086464", "0.66403633", "0.6638486...
0.75496954
0
the player reveals the charger
function _foundCharger(x,y) { _grid[x][y].charger = 1; $game.statusUpdate({message:'you found a charger! Go to it to disable it.',input:'status',screen: true,log:false}); _charger.revealed = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function charging(){\n\t\t\t//console.log(\"c\"+charge);\n\t\t\troot.batt_discharge.stop();\n\t\t\troot.batt_charge.gotoAndPlay(charge);\n\t\t\troot.batt_charge.visible = true;\n\t\t\troot.batt_discharge.visible = false;\n\t\t\troot.dot_path4.visible = false;\n\t\t\troot.dot_path5.visible = false;\n\t\t\troot.dot_...
[ "0.6806659", "0.66532534", "0.63710326", "0.63118947", "0.6137557", "0.609013", "0.60781187", "0.6020194", "0.60144186", "0.59701043", "0.59031516", "0.5881163", "0.58702457", "0.5865523", "0.5858046", "0.5851746", "0.5848448", "0.58373153", "0.583596", "0.5832461", "0.582611...
0.6716702
1
load all cut scene videos up at start
function _loadVideo(num) { vid = document.createElement('video'); if(CivicSeed.ENVIRONMENT === 'development') { vid.src = Modernizr.video.h264 ? _videoPath + num + '.mp4' : _videoPath + i + '.webm?VERSION=' + Math.round(Math.random(1) * 1000000000); } else { vid.src = Modernizr.video.h264 ? _videoPath + num +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vidLoad() {\n\tvid.noLoop();\n}", "function vidLoad() {\n movie.loop();\n movie.volume(0);\n}", "function vidLoad() {\n movie.loop();\n movie.volume(0);\n}", "function initVideo(){\n\t\t//fit all videos in their parent container\n\t\tjQuery(\".scalevid\").fitVids();\n\t}", "function preload(){...
[ "0.6881027", "0.6725427", "0.6725427", "0.6632793", "0.6505071", "0.6473371", "0.63743746", "0.63157356", "0.6310278", "0.6234261", "0.62203157", "0.61915606", "0.61592734", "0.6133762", "0.61204237", "0.6118627", "0.611427", "0.6110168", "0.60636735", "0.6061642", "0.6053234...
0.67717975
1
put the game time on
function timeOn(){ gameTime = setInterval(function(){ t++; $("#time").html(t); },1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTime() {\n\n}", "updateTime() {\r\n if (this.state == STATES.play) {\r\n if (this.remain === 0) {\r\n return this.winner();\r\n }\r\n this.time += 0.1; \r\n this.htmlScore.innerHTML = (this.mines-this.flags) +\r\n \" / \" + this...
[ "0.7475945", "0.74569523", "0.7430035", "0.74183804", "0.7279866", "0.7103237", "0.7062004", "0.70542705", "0.7040108", "0.7018346", "0.7007497", "0.70045424", "0.69953555", "0.6969931", "0.692331", "0.692269", "0.69005024", "0.6898465", "0.6894245", "0.68901795", "0.6884108"...
0.75912917
0
open a new window to save the current score
function saveScore(){ window.open("http://localhost/Test/prov/saveScore.php?time="+t, "", "width=400, height=500, top=130, left=470"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scores(){\n\twindow.open(\"http://localhost/Test/prov/scores.php\", \"\", \"width=400, height=500, top=130, left=470\");\n}", "function viewScores() {\n window.location.href = \"highScores.html\";\n}", "function displayHighscores() {\n window.location = \"highscores.html\";\n}", "function reco...
[ "0.7305433", "0.6661274", "0.6639428", "0.6630133", "0.6539412", "0.65248907", "0.64844996", "0.6441804", "0.64180934", "0.6414945", "0.6392195", "0.6342955", "0.6327715", "0.6323724", "0.6313354", "0.6313348", "0.630627", "0.62861353", "0.6253101", "0.6202236", "0.6201807", ...
0.7958038
0
open the scores window
function scores(){ window.open("http://localhost/Test/prov/scores.php", "", "width=400, height=500, top=130, left=470"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openLeaderboard() {\n leaderboardScreen.style.display = 'flex';\n homeScreen.style.display = 'none';\n endQuiz.style.display = 'none';\n quizPrompts.style.display = 'none';\n timer.style.visibility = 'hidden';\n generateScore();\n}", "function viewScores() {\n window.location.href =...
[ "0.7062646", "0.66269594", "0.65637594", "0.6547797", "0.64448714", "0.64375937", "0.6423309", "0.63951904", "0.6318823", "0.62487984", "0.62433285", "0.62174016", "0.61783904", "0.6117008", "0.61130524", "0.61110234", "0.6106375", "0.61032534", "0.60957074", "0.6094648", "0....
0.80320466
0
open a mail window for suggestions
function suggestion(){ window.open("Suggestions.html", "", "width=400, height=400, top=150, left=200"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEmail(url = gContextMenu.linkURL) {\n var addresses = getEmail(url);\n window.openDialog(\n \"chrome://messenger/content/addressbook/abNewCardDialog.xhtml\",\n \"\",\n \"chrome,resizable=no,titlebar,modal,centerscreen\",\n { primaryEmail: addresses }\n );\n}", "function showAddress(){\...
[ "0.64592946", "0.6451828", "0.6260062", "0.6226177", "0.6220342", "0.6084243", "0.60586226", "0.6025411", "0.5992248", "0.5967253", "0.59247917", "0.588981", "0.587993", "0.5843825", "0.58399665", "0.58231866", "0.58198935", "0.5798883", "0.5744801", "0.5737224", "0.57176274"...
0.7031745
0
handle offline network state
function offlineState() { //handle offline network state console.log("app is now offline"); //show ons alert dialog... ons.notification.alert('your app is now offline...'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doOffline() {\n console.log('Event: offline\\n' + 'Network Type: ' + navigator.network.connection.type + '\\n');\n //setNetworkType();\n }", "_changeToOffline() {\n if (this.isOnline) {\n logger.info('OnlineStateManager: Connection lost');\n this.isOnline = fals...
[ "0.7942846", "0.77409136", "0.75036246", "0.7421776", "0.73861223", "0.72700083", "0.7224391", "0.7141226", "0.69867635", "0.68999064", "0.68543875", "0.67981154", "0.67735034", "0.6707752", "0.66188765", "0.6616672", "0.6594854", "0.65814805", "0.65795046", "0.65314233", "0....
0.8058033
0
handle online network state
function onlineState() { // Handle the online event var networkState = navigator.connection.type; console.log('Connection type: ' + networkState); if (networkState !== Connection.NONE) { //use connection state to update app, save data &c. } ons.notification.alert('Connection type: ' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_online() {\n // if we've requested to be offline by disconnecting, don't reconnect.\n if (this.currentStatus.status != \"offline\") this.reconnect();\n }", "function doOnline() {\n console.log('Event: online\\n' + 'Network Type: ' + navigator.network.c...
[ "0.7666078", "0.7624921", "0.75707746", "0.74839693", "0.73220885", "0.7204013", "0.7182061", "0.7176776", "0.6979669", "0.6977749", "0.6948387", "0.69478095", "0.6910594", "0.6891228", "0.6889886", "0.6866683", "0.68533766", "0.68210006", "0.6790327", "0.6738092", "0.6724381...
0.8035785
0
Group nodes with their material, vertex format and layer.
function GroupNodes(nodesData, meshesData) { nodesData.sort(function(a, b) { var ret = a.material.localeCompare(b.material); if (ret !== 0) { return ret; } ret = a.layer.localeCompare(b.layer); if (ret !== 0) { return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processObject( o ) {\n\n\t\t\tvar node = \"<node name=\\\"\" + (o.name) + \"\\\">\";\n\n\t\t\tnode += getTransform( o );\n\n\t\t\tif ( o instanceof Mesh && o.geometry != null ) {\n\n\t\t\t\t// function returns the id associated with the mesh and a \"BufferGeometry\" version\n\t\t\t\t// of the geometry in ...
[ "0.58038056", "0.57331157", "0.56492674", "0.56484854", "0.5440569", "0.5377111", "0.53728664", "0.5366619", "0.5361697", "0.5353939", "0.534275", "0.5339088", "0.5320203", "0.5259511", "0.5245443", "0.52395403", "0.52322596", "0.522312", "0.5201541", "0.5193288", "0.5186745"...
0.71407455
0
printedBlock printed window function make new block from window need to print add to this block class .toprint and .noprint class to other blocks on page print block with class .toprint remove class .noprint delete block with class .toprint
function printBlock(printedBlock) { var printUnit = $(printedBlock).html(); $('div.container').addClass('noprint'); $('body').append('<div class="toprint">' + printUnit + '</div>'); $(".toprint").find(".img-recipe-modal").unwrap(); $(".toprint").find("#markers").remove(); window.print(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printerFriendly() {\n\t$('#header').hide();\n\t$('#content').hide();\n\t$('#footer').hide();\n\t$('body').append(\"<div id='printerFriendly'>\" +\n\t\t\t\t\t\t\"<span class='no-print'>\" +\n\t\t\t\t\t \t\t\"<button class='btn btn-default' onclick='exitPrinter()'><span class='glyphicon glyphicon-circle-arr...
[ "0.62801754", "0.6208079", "0.6129658", "0.61263585", "0.5989474", "0.59862834", "0.59647006", "0.5885478", "0.5839668", "0.5820172", "0.5811659", "0.5806867", "0.5798136", "0.57940865", "0.57935673", "0.5771293", "0.57633626", "0.57372755", "0.5722611", "0.56987137", "0.5695...
0.80622005
0
adding componentDidMount to handle initialization, will find stored current location
componentDidMount() { console.log('Initializing'); this.findLocation(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "UNSAFE_componentWillMount() {\n this.getUserLocation();\n }", "componentDidMount() {\n\t\tthis.getLocations();\n\t}", "componentDidMount () {\n this.getCurrentLocation()\n }", "componentWillMount() {\r\n this.getLocation();\r\n }", "componentDidMount() {\n this.getBrowserLocation()\n ...
[ "0.7663052", "0.7645029", "0.7635797", "0.7626882", "0.755482", "0.7540659", "0.74546754", "0.74505633", "0.7406589", "0.73715746", "0.7328906", "0.7321831", "0.7306129", "0.7259293", "0.7252966", "0.7244434", "0.72170764", "0.7210539", "0.7195731", "0.71848583", "0.7175377",...
0.842079
0
show figure with changed properties and return a time stamp
function showFigure() { document.getElementById("figures").style.display = "block"; changeColor(); changeSize(); changeShape(); changePosition(); figureTime = (new Date()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delayFigure() {\n\t\t\t\tsetTimeout(showFigure, Math.random() * 2000);\n\t\t\t\t\n\t\t\t}", "function showGraphHistory() {\n simData.timeScales.short.xmin = 1750;\n simData.timeScales.long.xmin = 1750;\n carbonGraph.updateAxes();\n simulation.updateNetCO2();\n\n var t1 = document.getEleme...
[ "0.5942866", "0.5933537", "0.5695849", "0.5576084", "0.55179423", "0.55172706", "0.548442", "0.5476212", "0.5465544", "0.54358953", "0.5414651", "0.5385732", "0.53365636", "0.5313714", "0.5312698", "0.5310152", "0.5275006", "0.52694285", "0.52236897", "0.5212573", "0.5211497"...
0.66220117
0
delay showing figure with changed properties
function delayFigure() { setTimeout(showFigure, Math.random() * 2000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showFigure() {\n\t\t\t\tdocument.getElementById(\"figures\").style.display = \"block\";\n\t\t\t\tchangeColor();\n\t\t\t\tchangeSize();\n\t\t\t\tchangeShape();\n\t\t\t\tchangePosition();\n\t\t\t\tfigureTime = (new Date());\n\t\t\t\t\n\t\t\t}", "function figureAnimate() {\n requestAnimationFrame(figure...
[ "0.7338683", "0.6684287", "0.6426777", "0.6426132", "0.62245435", "0.61745155", "0.61573577", "0.6118801", "0.6104616", "0.6098703", "0.60634387", "0.60634387", "0.60634387", "0.6046363", "0.60324633", "0.6032333", "0.6025416", "0.6017733", "0.59707415", "0.5955067", "0.59506...
0.79356015
0
Normalize treatment of CSS display for form controls across browsers. Firefox says that form controls have an inline style, but really treats them as inlineblock. For example the label of an will not wrap to the next line like a normal inline does. Since they act like inlineblock let's treat it as one while normalize t...
function getNormalizedDisplay(style, node, height, zoom, traits) { function getApproximateLineHeight() { // See http://meyerweb.com/eric/thoughts/2008/05/06/line-height-abnormal/ return (parseFloat(style.lineHeight) || parseFloat(style.fontSize)) * 1.5; } var doTreatAsInlineBlock = false; i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeControls()\n { \n // Selector\n var showSelector = false;\n if(templates.length > 1){\n for(var t in templates){\n if(templates[t].canAddForm()){\n showSelector = true;\n ...
[ "0.5442136", "0.5300618", "0.5100745", "0.50768346", "0.5054851", "0.5007521", "0.4919862", "0.48198903", "0.4815949", "0.48105514", "0.47902897", "0.47765777", "0.47711653", "0.4742583", "0.4731794", "0.47260866", "0.47153023", "0.46546903", "0.4628562", "0.45722884", "0.455...
0.54413754
1
Get an element's rectangle In most cases, we use the fastest approach (cached getBoundingClientRect results) However, a block parent of an inline or visible text needs the more exact approach, so that the element does not appear to be much wider than it really is
function getRect(element, traits, fastRect) { var exactRect, display = traits.normDisplay, WIDE_ELEMENT_TO_BODY_RATIO = 0.7; // Use exact approach for: // * inline-block, because it lies about height when media is inside // * wide blocks, because they lie about width when there is a float ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLayoutRect$1(element){var clientRect=getBoundingClientRect$1(element);// Use the clientRect sizes if it's not been transformed.\n// Fixes https://github.com/popperjs/popper-core/issues/1223\nvar width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clie...
[ "0.70941377", "0.70910937", "0.70640206", "0.70640206", "0.70640206", "0.70640206", "0.70594203", "0.70594203", "0.70594203", "0.70594203", "0.70594203", "0.70594203", "0.7055438", "0.70530117", "0.70530117", "0.7025526", "0.7025526", "0.7025526", "0.7010874", "0.69999593", "...
0.7229199
0
In general we should use currentSrc because that's the image that's currently displayed, especially within tags or with srcset. In these cases there can be multiple sources and the best one is probably the one being displayed, thus currentSrc.
function imageSrc(image) { if (image.currentSrc) return image.currentSrc; return image.src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentImage() {\n\t\treturn this.options.folder ?\n\t\t\t\tthis.options.folder + \"/\" + this.options.images[this.current] :\n\t\t\t\tthis.options.images[this.current];\n\t}", "displayCurrentReleaseImage(imageSource) {\n this.currentReleaseImage.setAttribute('src', imageSource);\n }", "f...
[ "0.7055688", "0.69608253", "0.6695989", "0.66637486", "0.6663381", "0.6619382", "0.65962833", "0.6578428", "0.6498818", "0.6473325", "0.64475846", "0.6371311", "0.6329278", "0.62990135", "0.6264752", "0.6244197", "0.62433904", "0.6229436", "0.62209916", "0.61845815", "0.61813...
0.77471197
0
Cleans up element by removing all its invisible children (which we don't want to render as Markdown) And hardcode the image dimensions so that the information can be used by the clipper server to display them at the right sizes in the notes.
function cleanUpElement(convertToMarkup, element, imageSizes, imageIndexes) { const childNodes = element.childNodes; const hiddenNodes = []; for (let i = 0; i < childNodes.length; i++) { const node = childNodes[i]; const nodeName = node.nodeName.toLowerCase(); const isHidden ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fCleanUp() // CLEANS: This function cleans up the data after the previously loaded image\r\n{\r\n expandedImg.innerHTML = \"\";\r\n}", "destroy() {\n if (!isNullOrUndefined(this.resizeContainerDiv)) {\n this.resizeContainerDiv.innerHTML = '';\n }\n if (!isNullOrUnde...
[ "0.66194546", "0.60230154", "0.60224795", "0.60115784", "0.601088", "0.60034746", "0.5950408", "0.58668756", "0.5852886", "0.58450013", "0.58380663", "0.5827048", "0.58055556", "0.5752758", "0.5749102", "0.5722706", "0.5674426", "0.5646318", "0.5632891", "0.55984724", "0.5593...
0.67598724
0
When we clone the document before cleaning it, we lose some of the information that might have been set via CSS or JavaScript, in particular whether an element was hidden or not. This function preprocess the document by adding a "joplinclipperhidden" class to all currently hidden elements in the current document. This ...
function preProcessDocument(element) { const childNodes = element.childNodes; for (let i = childNodes.length - 1; i >= 0; i--) { const node = childNodes[i]; const nodeName = node.nodeName.toLowerCase(); const nodeParent = node.parentNode; const nodeParentName = nodeParent ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_make_hidden(...html_elements) {\n for (const element of html_elements) {\n if (element.className.search(\"is-hidden\") == -1) element.className += \" is-hidden\";\n }\n }", "_make_visible(...html_elements) {\n for (const element of html_elements) {\n element.className = element.className.rep...
[ "0.60297674", "0.5903019", "0.5642302", "0.5618051", "0.54108465", "0.52427644", "0.5210953", "0.51428026", "0.513062", "0.5126823", "0.51170945", "0.5107436", "0.51052105", "0.5095911", "0.5076075", "0.5072405", "0.50691015", "0.50691015", "0.50691015", "0.50691015", "0.5069...
0.71434116
0
settings home SEF restrict to alphanumeric
function SEFrestrict(x) { if (window.event) { var key = window.event.keyCode; } else if (x) { key = x.which; } else { return true; } var keychar = String.fromCharCode(key); keychar.toLowerCase(); if (key == (null || 0 || 8 || 13 || 27) || ("abcdefghijklmnopqrstuvwxyz0123456789-_").indexOf(keychar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loginOnChange() {\n const pattern = \"^[a-zA-Z][a-zA-Z0-9-_\\\\.]{3,20}$\";\n validate(this, pattern);\n}", "validateInput(value) {\n if (value.search(/^[0-9A-Z\\-\\.\\*\\$\\/\\+\\ %\\ ]+$/) === -1) {\n return 'Supports A-Z, 0-9, and symbols ( - . $ / + % SPACE).';\n }\n ...
[ "0.613567", "0.61264265", "0.60391116", "0.59944785", "0.5994261", "0.5983076", "0.59621954", "0.5940302", "0.5934808", "0.59064007", "0.5893162", "0.58856755", "0.5883458", "0.587269", "0.5871426", "0.58661985", "0.5862287", "0.5827573", "0.58143836", "0.57993007", "0.579853...
0.6537877
0
Create the Order object, which has: 1. the constructor, which takes the string representation of an Order ("Tables1,Chairs2,Beds3" for example) and adds the different furniture types along with their respective quantities into the object 2. the method "addFurniture", which takes pairs of (Furniture (String) Quantity (N...
function Order(orderString) { if (typeof orderString !== "string") return; const furnitures = orderString.split(","); if (furnitures.length > 1) { for (let furniture of furnitures) { let parts = furniture.split("-"); this[parts[0]] = Number([parts[1]]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Order(priceString, amountString, dateString, type) {\n // orders on the order book will not have a date.\n //assert(priceString && amountString && type);\n this.price = parseFloat(priceString);\n this.amount = parseFloat(amountString);\n this.date = new Date(dateString);\n this.type = type;\n this....
[ "0.6247031", "0.5835097", "0.57157475", "0.5672015", "0.55709606", "0.55679107", "0.5528724", "0.55276066", "0.54176664", "0.53085536", "0.52898127", "0.5282038", "0.52729857", "0.5229604", "0.5209023", "0.51863915", "0.517191", "0.517191", "0.51596767", "0.5120897", "0.50994...
0.6392219
0
Create a Stock object, which has: 1. the constructor, which parses a stock string representation into pairs of (Furniture (String) Quantity (Number)) which will represent the furniture available for processing orders 1. the method "hasEnoughFurniture", which takes an Order object, and returns true if there is enough fu...
function Stock(stockString) { const stock = new Order(stockString); for (let key in stock) { if (stock.hasOwnProperty(key)) this[key] = stock[key]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Stock (stockID,stockName,quantity,price,upperTargetPrice,lowerTargetPrice) {\n\tthis.stockID=stockID;\n\tthis.stockName = stockName;\n\t// Implementing quantity, purchaseDate and purchasePrice as corresponding \n\t// arrays - purchase is +quantity, sell is -quantity...\n\tthis.quantity=[quantity];\n\tthis...
[ "0.663364", "0.6101135", "0.60759103", "0.581652", "0.55568546", "0.5508774", "0.53521144", "0.52613294", "0.5254027", "0.515755", "0.5140139", "0.5121654", "0.51212883", "0.51153517", "0.5087791", "0.50707304", "0.505895", "0.50579315", "0.501573", "0.5013395", "0.50081885",...
0.7073483
0
Return previous reverseTransform result if given modelValue is the same as reverseTransform source Return transformed value otherwise
getTransformValue (modelValue) { return transform(modelValue, this.state.reverseTransform.source, this.props); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transformModel(sourcemodel) {\n this._transformModel(sourcemodel);\n return;\n }", "inverse() {\nreturn (TRX.fromTRX(this)).setInvert();\n}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "reverseInPlace() { const a = this._radians0; ...
[ "0.5533307", "0.5250662", "0.52212644", "0.52212644", "0.52212644", "0.52212644", "0.51957697", "0.513437", "0.513437", "0.513437", "0.513437", "0.5124779", "0.51235455", "0.5107655", "0.5099964", "0.50367624", "0.5027747", "0.502546", "0.501273", "0.49837148", "0.49632382", ...
0.80205274
0
Create an Asana client. Do this per request since it keeps state that shouldn't be shared across requests.
function createClient() { return Asana.Client.create({ clientId: clientId, clientSecret: clientSecret, redirectUri: 'http://dash-adicheo.c9users.io/auth/asana/callback' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createClient() {\n return Asana.Client.create({\n clientId: envVariables.ASANA_CLIENT_ID,\n clientSecret: envVariables.ASANA_CLIENT_SECRET\n });\n}", "function createClient() {\n\treturn Asana.Client.create({\n\t\tclientId: clientId,\n\t\tclientSecret: clientSecret,\n\t\tredirectUri: global.conf...
[ "0.7836637", "0.7554396", "0.68849325", "0.6529957", "0.5882124", "0.5851781", "0.57902807", "0.5765887", "0.57463795", "0.5726599", "0.56658155", "0.56514895", "0.5621288", "0.559531", "0.55883396", "0.5568582", "0.5567014", "0.55496967", "0.5543491", "0.5537884", "0.5525454...
0.781695
1
Inject CSS and bower files (css,js,fonts)
function inject() { const injectStyles = gulp.src([ 'src/assets/css/normalize.css', 'src/assets/css/topcoat/topcoat-desktop-light.css', 'src/assets/**/*.css' ], {read: false}); const injectOptions = { ignorePath: ['src/'], addRootSlash: false, relative: true...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssInject() {\n return src('app/temp/styles/styles.css')\n .pipe(browserSync.stream());\n}", "function injectingassets() {\n\n\n var injectSrc = gulp.src(\n [\n './assets/javascripts/vendor/jquery*.js',\n './assets/javascripts/govuk/selection-buttons.js',\n './assets...
[ "0.6991886", "0.6795809", "0.6775349", "0.65871274", "0.6564459", "0.65147", "0.64799905", "0.6474748", "0.61313045", "0.6050178", "0.6009131", "0.5966179", "0.59328365", "0.5930406", "0.5916782", "0.59061944", "0.58723086", "0.583388", "0.5830265", "0.5827715", "0.58002126",...
0.7121488
0
Open a new tab, and load "about.html" into it.
function openAboutPage() { if(askadmissionsPage === true){ chrome.tabs.create({"url": "/about.html" }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function open_new_tab(url){\n window.open(url, '_blank');\n}", "function opennewwindow() {\n var myWindow = window.open(\"index.html\", \"\", \"\");\n }", "function goToAboutPage () {\n window.location.href = \"about.html\"\n}", "function openPage() {\n browser.tabs.create({\n url: \"options.ht...
[ "0.67752475", "0.6708849", "0.6682112", "0.6673096", "0.6650552", "0.66333735", "0.6615067", "0.6596581", "0.65163404", "0.6508526", "0.64796716", "0.6476279", "0.6433883", "0.6422211", "0.63992846", "0.63532805", "0.6333197", "0.6310865", "0.623816", "0.6231995", "0.6174032"...
0.7034538
0
Simple in memory caching A simple, synchronous in memory cache is used to implement "working memory" of a server. This is intended to be a small, per node.js instance for caching frequently accessed data. It implements a struct LRU based on the ordering of Javascript object map property inserts, and Object.keys() index...
function MemoryCache(maxEntries, trimCount) { this.moduleName = "MemoryCache"; this.maxEntries = maxEntries; this.trimCount = trimCount; this.entryCount = 0; // A Javascript object is a map this.cacheMap = new Object(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MemoryCache() {\n this._entries = [];\n}", "function cacheToMemory(){\n // need to implement\n}", "function MemCache() {\n this.__wrapped__ = {};\n }", "function EntryCache() {}", "getInMemoryCache() {\n this.logger.trace(\"Getting in-memory cache\");\n // convert the cache key value...
[ "0.7263959", "0.7034739", "0.7013452", "0.6648361", "0.66396576", "0.6591745", "0.65734327", "0.65548146", "0.6508104", "0.64573014", "0.64553136", "0.62812805", "0.6272846", "0.6251501", "0.6219962", "0.6192804", "0.61546767", "0.6140779", "0.6125394", "0.61245906", "0.61245...
0.74046963
0
tags: semTypeDetector input: column col output: string semType
detectNucleotides(col) { if (col.type === DG.TYPE.STRING && this.isNucleotideColumn(col)){ col.semType = 'dna_nucleotide'; return col.semType; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "detectFit(col) {\n if (DG.Detector.sampleCategories(col, (s) => {\n return s.includes('series') && s.includes('points') && s.includes('fitFunction');\n }, 1)) {\n col.semType = FIT_SEM_TYPE;\n return col.semType;\n }\n return null;\n }", "detectXMLCurveChart(col) {\n if (DG.Detecto...
[ "0.64832276", "0.55705935", "0.5449503", "0.5355004", "0.51222", "0.5097615", "0.5086296", "0.5013336", "0.49450636", "0.49140733", "0.49055573", "0.48836863", "0.47813693", "0.45793074", "0.4540974", "0.45358485", "0.4531539", "0.45309144", "0.45255274", "0.4522459", "0.4509...
0.64792013
1
input: string nucleotide output: bool result
checkWhetherItIsNucleotide(inputString) { const dnaBases = new Set(['A','C','T','G']); return inputString.split('').every(x => dnaBases.has(x)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gimmiTrue(inputString, letter) {\n var x = false;\n inputString.split('').forEach(function (e) {\n if (e === letter) {\n x = true;\n }\n });\n return x;\n}", "function areSimboluri(sir){\n\tvar simboluri=\"!@#$%^&*()_+=<>?|\";\n\t\n\tfor(var i=0;i<sir.length;i++){\n\t\tfor(var j=0;j<simbo...
[ "0.6520382", "0.6336508", "0.63104814", "0.6248068", "0.62358564", "0.621217", "0.6204915", "0.61330736", "0.60991335", "0.60559946", "0.6041191", "0.6018222", "0.59901685", "0.5977981", "0.59744745", "0.59650934", "0.5937819", "0.59048057", "0.5897996", "0.58879465", "0.5881...
0.72980833
0
Go to next slide by passing current class to next sibling
function nextSlide() { const current = document.querySelector(".current"); current.classList.remove("current"); if (current.nextElementSibling) { current.nextElementSibling.classList.add("current"); } else { slides[0].classList.add("current"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "next() {\n\n if (this.currStep < this.slides[this.currSlide].steps.length - 1) {\n\n this.nextStep();\n\n } else {\n\n this.nextSlide();\n\n }\n\n }", "function next() {\n changeSlide($nextel);\n }", "function nextSlide() {...
[ "0.81008714", "0.794469", "0.7898596", "0.78215086", "0.78093195", "0.77781814", "0.7767924", "0.77398497", "0.77067703", "0.7693712", "0.7688568", "0.7675521", "0.76402086", "0.76139736", "0.76013345", "0.7581189", "0.7575691", "0.7564893", "0.7560672", "0.7560672", "0.75359...
0.818732
0
Go to previous slide by passing current class to previous sibling
function prevSlide() { const current = document.querySelector(".current"); current.classList.remove("current"); if (current.previousElementSibling) { current.previousElementSibling.classList.add("current"); } else { slides[slides.length - 1].classList.add("current"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToPrevSlide() {\r\n // Current slide goes from active to oldActive\r\n $('.active').removeClass('active').addClass('oldActive');\r\n\r\n // Go back to the last slide if you click next on the first slide\r\n if ($('.oldActive').is(':first-child')) {\r\n $('.slide').last().addClass('activ...
[ "0.82456774", "0.81802595", "0.8083734", "0.8065885", "0.7920658", "0.788908", "0.7866923", "0.7827662", "0.7797245", "0.77627945", "0.7761669", "0.7748692", "0.7641854", "0.7634378", "0.7605068", "0.76013005", "0.7600225", "0.75786173", "0.75468695", "0.7518304", "0.75171715...
0.83024395
0
Register customer on Acme system
register() { if (!telephoneDirectory.lists(this)) { throw new Error('Customer ' + this.name + ' is not in directory'); } acmeSystem.register(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async register (email, password, passwordconfirm, customername, nik, phonenumber, dob) {\n await (await this.inputEmail).setValue(email);\n await (await this.inputPassword).setValue(password);\n await (await this.inputPasswordConfirm).setValue(passwordconfirm);\n await (await this.input...
[ "0.69858265", "0.6963708", "0.6767416", "0.6649296", "0.656195", "0.6559386", "0.65013987", "0.64644605", "0.6464344", "0.6381752", "0.63694984", "0.63349074", "0.63021237", "0.62852", "0.6244908", "0.6172314", "0.607591", "0.60746974", "0.6059693", "0.60407215", "0.60134846"...
0.73087674
0
end of tile 'class' puzzle 'class'
function puzzle(inID, inName, inX, inY, inWidth, inHeight, inCWidth, inCHeight, imageroot){ this.id = inID; this.name = inName; this.xpos = inX; this.ypos = inY this.width = inWidth; this.height = inHeight this.cellWidth = inCWidth; this.cellHeight = inCHeight; th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tiles(){\n \n }", "function tile_class(tile) {\n if (tile == 1) {\n return \"red\";\n }\n else if (tile == 2) {\n return \"blue\";\n }\n else {\n return \"number\";\n }\n}", "function Tile() {\n this.x=0;\n this.y=0;\n this.z=0;\n this.type='';\n ...
[ "0.6309528", "0.6276552", "0.62743825", "0.6243055", "0.6218864", "0.6196569", "0.616533", "0.6082522", "0.60733443", "0.60619247", "0.60274315", "0.6004212", "0.5983206", "0.5976864", "0.593846", "0.5904816", "0.58634543", "0.5840896", "0.58404917", "0.5836773", "0.5826482",...
0.67812544
0
Detects if the data structure represents U2F error. And if so, whether the error code is nonzero
function isU2fError(data) { if ((typeof data !== "undefined") && data.errorCode) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ofteU2FError(resp) {\n if (!('errorCode' in resp)) {\n return '';\n }\n if (resp.errorCode === u2f.ErrorCodes['OK']) {\n return '';\n }\n let msg = 'ofte error code ' + resp.errorCode;\n for (name in u2f.ErrorC...
[ "0.59719354", "0.58477753", "0.5620312", "0.55823314", "0.5548123", "0.5517339", "0.550115", "0.5494929", "0.5433774", "0.54022235", "0.5370437", "0.53397655", "0.53397655", "0.53249586", "0.53227556", "0.53227556", "0.5293555", "0.52864647", "0.5262525", "0.5261811", "0.5261...
0.7976733
0
return data associated with selected algorithm
function get_data(id) { var sel = document.querySelector(id) var algo = (sel || {value: undefined}).value return algorithms[algo || 'hi'] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getAlgorithms () {\n try {\n const res = await api().get('/algorithm')\n return Array.isArray(res.data) ? res.data : []\n } catch (e) {\n return []\n }\n }", "get alg() {\n return this.keys[0].alg;\n }", "function getSelectedAlgorithm() {\n\n const menuSelection = do...
[ "0.6272871", "0.61090946", "0.5903732", "0.5895033", "0.5777104", "0.5757443", "0.57446235", "0.57011324", "0.56765586", "0.5581351", "0.5571102", "0.54082894", "0.5288396", "0.5270058", "0.5220531", "0.5216121", "0.5187507", "0.51697046", "0.5169028", "0.51641786", "0.515672...
0.6419687
0
function starts after 65 second page loading, subtract 200 calories every 60 second and render the calories value to response div
makingHungry() { let calories = get('#calories > span'); if (this.calories > 199) this.calories -= 200; else this.calories = 0; calories.innerHTML = this.calories; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePageHtml(){\n\tfunction getClockData(timeData) {\n \t$.get(\"/api/\", timeData, function(data){\n \t\tconsole.log(data);\n \t\t//clear our previous enteries\n \t\tdocument.getElementById('clockInDate').innerHTML = \"\";\n \t\tdocument.getElementById('clockInTime').innerHTML = \"\";\n ...
[ "0.6198598", "0.60866034", "0.60726786", "0.60397905", "0.6022383", "0.6018671", "0.6018408", "0.6005367", "0.5963094", "0.59055275", "0.5869347", "0.585636", "0.58544517", "0.58478564", "0.5846388", "0.58455634", "0.58271843", "0.58168447", "0.5744075", "0.5733367", "0.57280...
0.63365245
0
Iterates through pizza elements on the page and changes their widths
function changePizzaSizes(size) { for (var i = 0; i < document.querySelectorAll(".randomPizzaContainer").length; i++) { var dx = determineDx(document.querySelectorAll(".randomPizzaContainer")[i], size); var newwidth = (document.querySelectorAll(".randomPizzaContainer")[i].offsetWidth + dx) + 'px'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changePizzaSizes(size) {\n var pizzaContainer = document.getElementsByClassName('randomPizzaContainer');\n var dx = determineDx(pizzaContainer[0], size);\n var newWidth = (pizzaContainer[0].offsetWidth + dx) + 'px';\n for (var i = 0, l = pizzaContainer.length; i < l; i++) {\n pizzaConta...
[ "0.7893274", "0.63240284", "0.62254363", "0.6214887", "0.6072105", "0.5994179", "0.59560794", "0.5929446", "0.5925774", "0.5916314", "0.58437437", "0.58333844", "0.57936996", "0.57849824", "0.57836324", "0.57807064", "0.57654005", "0.57396334", "0.5735689", "0.5731251", "0.57...
0.71829945
1
bodies created from SVG paths eslintdisablenextline
function path(x, y, path) { console.log(x, y, path); const vertices = Matter.Vertices.fromPath(path); return Matter.Bodies.fromVertices(x, y, vertices, { isStatic: true, render: { fillStyle: COLOR.OUTER, // add stroke and line width to fill in slight gaps between fragments ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n super.draw();\n\n this.componentBodyShape = this.paper.path('m 58.611201,1.1397665 c 9.55485,0.18892 20.16562,5.82395 ' +\n '24.0335,17.2506995 4.9232,15.87108 -9.03622,29.35593 -20.8054,30.21669 -3.85823,0.45079 ' +\n '-7.74776,0.13486 -11.62055,0.22897 -6.74559,0 -1...
[ "0.6375533", "0.62161076", "0.61636287", "0.61369884", "0.613421", "0.6050831", "0.5855417", "0.5833777", "0.583362", "0.58262706", "0.5793207", "0.579276", "0.5791142", "0.57893926", "0.5787352", "0.5724645", "0.57057625", "0.5697334", "0.566065", "0.56575626", "0.5654441", ...
0.6825477
0
start function add new bar chart
function addNewBarChartFunction(idName, labelName, dataName, ctName, typeName) { document.querySelector('.current-data-chart').classList.remove('current-data-chart'); var newCurrentClass = document.getElementById(idName); newCurrentClass.classList.add('current-data-chart'); myBarChart.destroy(); /* */myBarChart = new C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBar(){\n\t\t\n\t\t/*get the # of values in the clicked dataset*/\n\t\tvalueCount = clickedData.map(d=>d.value).length;\n\n\t\t/*define margins around extra chart area*/\n\t\tvar margin_extraChart = {\n\t\t top: 60 * screenRatio,\n\t\t right: 90 * screenRatio,\n\t\t bottom: 100 * screenRatio,\n\t\...
[ "0.721291", "0.7211267", "0.7187797", "0.7158437", "0.71207386", "0.7057719", "0.7007299", "0.70026153", "0.6962338", "0.68648505", "0.6822156", "0.68024623", "0.6787226", "0.6770234", "0.6766061", "0.67464155", "0.67215985", "0.67141557", "0.6700153", "0.6688935", "0.6686551...
0.7226864
0
start function add new doughnut chart
function addNewDoughnutChartFunction(idName, labelName, dataName, ctName, typeName) { document.querySelector('.current-data-chart').classList.remove('current-data-chart'); var newCurrentClass = document.getElementById(idName); newCurrentClass.classList.add('current-data-chart'); myDoughnutChart.destroy(); /* */myDoughn...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_brew_progress(ctx)\r\n{\r\n // And for a doughnut chart\r\n var data = {\r\n datasets: [{\r\n data: [0, 1], // The donut is two data values, initially shows zero visible.\r\n backgroundColor: [ 'rgba(255,100,100,0.3)', 'rgba(100,255,100,0.1)']\r\n }]\r\n }...
[ "0.70357305", "0.6863705", "0.6850983", "0.68441993", "0.6843271", "0.6842165", "0.6801052", "0.6700661", "0.66180134", "0.6614847", "0.6483514", "0.6480037", "0.64020634", "0.6393755", "0.63907045", "0.6311796", "0.62896854", "0.61725676", "0.61564183", "0.61364716", "0.6135...
0.7519477
0
end function add new doughnut chart hourly function Chart
function hourlyFunction() { addNewLineChartFunction('hourlyId', 'hourly', hourlyData, ctLine, 'line' ); addNewBarChartFunction('hourlyId', 'hourly', hourlyData, ctBar, 'bar' ); addNewDoughnutChartFunction('hourlyId', 'hourly', hourlyDataDoughnut, ctDoughnut, 'doughnut' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNewDoughnutChartFunction(idName, labelName, dataName, ctName, typeName) {\ndocument.querySelector('.current-data-chart').classList.remove('current-data-chart');\nvar newCurrentClass = document.getElementById(idName);\nnewCurrentClass.classList.add('current-data-chart');\nmyDoughnutChart.destroy();\n/* ...
[ "0.73046935", "0.6583442", "0.6556913", "0.65565294", "0.6527098", "0.6526524", "0.6517019", "0.64136976", "0.6376368", "0.637178", "0.6367413", "0.6361341", "0.6355388", "0.63438004", "0.6340014", "0.6329332", "0.6323137", "0.6312049", "0.62799144", "0.62605894", "0.6245276"...
0.79533
0
Starts barcode search process, implemented in WinRTBarcodeReader.winmd library Calls success callback, when barcode found.
function startBarcodeSearch(width, height) { reader = new WinRTBarcodeReader.Reader(); reader.init(capture, width, height); reader.readCode().done(function (result) { destroyPreview(); success({ text: result && result.text, format: result && result.ba...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fnScanBarcode() {\n console.log(\"fnScanBarcode is running\");\n\n //user presses button, turns on camera to scan barcode\n //barcode is scanned and passed to the input field\n //when they save comic, that data in new input\n //is bundled withou our c...
[ "0.66561717", "0.62419385", "0.6098884", "0.60853857", "0.59963876", "0.58349574", "0.581375", "0.572648", "0.5706927", "0.5680067", "0.566644", "0.55143505", "0.5431881", "0.5396173", "0.53865945", "0.5345067", "0.53117704", "0.53046626", "0.5300656", "0.52955055", "0.527495...
0.73095566
0
Stops preview and then call success callback with cancelled=true See
function cancelPreview() { reader && reader.stop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelPreview() {\n CameraUI.captureCancelled = true;\n camera && camera.stop();\n }", "function stopPreview() {\r\n isPreviewing = false;\r\n\r\n // Cleanup the UI\r\n var previewVidTag = document.getElementById(\"cameraPreview\");\r\n previewVid...
[ "0.72110224", "0.69961303", "0.6400201", "0.6272358", "0.6270843", "0.62668324", "0.6237022", "0.61948156", "0.61742127", "0.61651975", "0.61451584", "0.6137859", "0.6128112", "0.609404", "0.60873455", "0.6071474", "0.6067548", "0.6049851", "0.6014236", "0.600331", "0.5979547...
0.77357787
0
Draw a maze in a svg, with the specified cellsize
function drawMaze(maze, svg, cellSize){ var size = { width : maze[0].length, height : maze.length }; // scale svg svg.attr("width", size.width*cellSize).attr("height", size.height*cellSize); for(var i = 0; i < size.height;i++){ for(var j = 0; j < size.width;j++){ // draw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewMazeSVG(graph) {\n d3.select(\"#canvas\").selectAll(\".edge\")\n .data(graph.getAllEdges())\n .enter()\n .append(\"rect\")\n .attr(\"class\", \"edge\")\n .attr(\"width\", edge => edge.getWidth())\n .attr(\"height\", edge => edge.getHeight())\n .attr(...
[ "0.65674144", "0.6168971", "0.6077077", "0.59613806", "0.5838788", "0.5819472", "0.57911265", "0.5774663", "0.5771542", "0.57249147", "0.5692402", "0.5643971", "0.56230474", "0.5591144", "0.5588188", "0.5571581", "0.5569493", "0.55387175", "0.5513834", "0.54555434", "0.544466...
0.8138824
0
Create websocket and request mazes on connect
function initWS() { if (!"WebSocket" in window) { alert("WebSocket NOT supported by your Browser!"); } else { // create websocket ws = new WebSocket("ws://localhost:8081/mazews"); // request available mazes on open ws.onopen = function() { ws.send(JSON.stringify( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createSocket () {\n this.ws = new WebSocket(this.getEndpoint())\n }", "function initWebSocket() {\n\t\t// Create a connection to Server\n\t\tconnect();\n\t}", "function initWebSocket() {\n\t\t// Create a connection to Server\n\t\tconnect();\n\t}", "connect() {\r\n socket = new WebSocket(\"ws://local...
[ "0.72759855", "0.72323436", "0.72323436", "0.7160455", "0.71427405", "0.7134024", "0.7132005", "0.71313065", "0.71147007", "0.71112734", "0.7096474", "0.69955075", "0.69911975", "0.6985457", "0.6970396", "0.6935749", "0.69337034", "0.6904019", "0.6901566", "0.68917596", "0.68...
0.72893244
0
Build the storybook with DSM options
function buildStorybook(options, customArgs) { const runConfiguration = { [environmentKeys.dsmProdEnvironment]: true, [environmentKeys.dsmHost]: options.dsmHost, [environmentKeys.storybookFramework]: options.storybookFramework, [environmentKeys.storybookVersion]: options.storybookVersion, [environ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStory() {\n // In this example you need to initialise these in reverse order, so that\n // when you assign a target it already exists. I.e., start at the end!\n lunarEnd4B = new StorySection(\n \"The Escavator explodes, falling backwards into one of the many craters of the moon. It was a brief...
[ "0.6010753", "0.56951344", "0.5338563", "0.5271711", "0.51660293", "0.508975", "0.50591516", "0.5048972", "0.503244", "0.503244", "0.503244", "0.5021505", "0.50043577", "0.4985535", "0.49770895", "0.4954757", "0.4935807", "0.48970547", "0.48516995", "0.48329884", "0.48269054"...
0.6885466
0
this function creates the connections(lines) between particles which are less than a certain distance apart
joinParticles(connection) { connection.forEach(connect => { // if (dist(this.x, this.y, particles[connect].x, particles[connect].y) > 200) { // stroke('rgba(0,255,0,1)'); // line(this.x, this.y, particles[connect].x, particles[connect].y); // } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect() {\n\tlet opacityValue = 1;\n\t// loop through all article and compare each particle with the rest of the particles\n\tfor (let a = 0; a < particleArray.length; a++) {\n\t\tfor (let b = a; b < particleArray.length; b++) {\n\t\t\tlet dx = particleArray[a].x - particleArray[b].x;\n\t\t\tlet dy = pa...
[ "0.7468371", "0.7255869", "0.70518094", "0.6985328", "0.69026387", "0.681643", "0.67632115", "0.6703344", "0.66491294", "0.64456916", "0.6393202", "0.63821846", "0.60947734", "0.59341455", "0.5768864", "0.5754122", "0.5741618", "0.5683079", "0.56749964", "0.5648315", "0.55999...
0.7387105
1
Patch content of one note
patch_note_content(route, nbid, update) { //#ADJUST TO NOTEBOOKS const url = this.baseUrl + route + "/" + nbid return client.fetch(url, { method: "PATCH", body: json(update) }) .then(response => response.json()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function patchNote(content, id) {\n if(!content) {\n content = ' ';\n }\n\n let data = { content };\n $.ajax({\n url : `/notes/${id}`,\n data : JSON.stringify(data),\n type : 'PATCH',\n contentType : 'application/json',\n processData: false,\n dataType: 'json'\n });\n}", "function updat...
[ "0.77382076", "0.67445904", "0.6583728", "0.63782287", "0.6355253", "0.6346512", "0.633614", "0.6319792", "0.6264505", "0.6249151", "0.614363", "0.6131294", "0.61201537", "0.60727173", "0.6042459", "0.6039027", "0.60371566", "0.6012834", "0.60031897", "0.5977226", "0.5971577"...
0.7622484
1
mayShowFeature function Determines if the client code is allowed to display a given feature. When not running an exercise, all features may be displayed, but in an exercise, features that the student should provide plus features that are marked as don't show may not be displayed. Parameters: oType: The type of the curr...
function mayShowFeature(oType : string, origOtype : string, feat : string, sgiObj : SentenceGrammarItem) : boolean { if (!inQuiz) return true; let qf : ExtendedQuizFeatures = quizdata.quizFeatures; // Function to check if origOtype is a dontShowObject function isDontShowObject() { for ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDontShowObject() {\n for (let dso of qf.dontShowObjects)\n if (dso.content===origOtype)\n return true;\n return false;\n }", "function showType(feature) {\n return feature.properties.name\n .toLowerCase()\n .indexOf(searchString) ...
[ "0.5321517", "0.49878684", "0.4965616", "0.48891276", "0.48791605", "0.48275557", "0.48149458", "0.4767609", "0.4669052", "0.45698285", "0.45457408", "0.449708", "0.44803494", "0.44668534", "0.4456554", "0.44359586", "0.44163677", "0.43905416", "0.43882337", "0.43701658", "0....
0.7853313
0
Function to check if origOtype is a dontShowObject
function isDontShowObject() { for (let dso of qf.dontShowObjects) if (dso.content===origOtype) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function notIgnoredObj(obj) {\n return (obj.type !== \"AmbientLight\" && obj.name !== \"\"\n && !(obj.isMesh && obj.isMaterialGeneratedMesh));\n}", "function notIgnoredObj(obj) {\n return (\n obj.type !== \"AmbientLight\" &&\n obj.name !== \"\" &&\n !(obj.isMesh && obj.isM...
[ "0.64667284", "0.6459568", "0.6279396", "0.6134764", "0.5769289", "0.5688375", "0.5669613", "0.56511545", "0.5648268", "0.5616623", "0.5609794", "0.5592738", "0.5584356", "0.5570238", "0.5535297", "0.5530847", "0.5530485", "0.5512056", "0.5507891", "0.5504623", "0.54661196", ...
0.8940321
0
Test if a message should be submitted
_testSubmitMessage() { if (this.__shouldSubmitMessage) this._submitMessage(); this.__shouldSubmitMessage = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_shouldSubmitMessage() {\n if (this.message) this.__shouldSubmitMessage = true;\n }", "function shouldRespond(message) {\n return message.type === MESSAGE && message.text;\n}", "function submitMessage() {\n \tvar messageBox = document.querySelector('#messageBox'),\n message = messageBox.valu...
[ "0.81699085", "0.68677515", "0.66952115", "0.65902466", "0.65523684", "0.64016104", "0.63707554", "0.63035154", "0.62200594", "0.61159533", "0.61032987", "0.6087744", "0.6049357", "0.6011615", "0.5980832", "0.59570396", "0.59547466", "0.593964", "0.5935403", "0.5933401", "0.5...
0.7411296
1
Function to run query and print response to console
function runQuery(query) { connection.query(query, function (err, res) { if (err) throw err; for (var i = 0; i < res.length; i++) { // console.log response as JSON console.log(JSON.stringify(res[i])); } runSearch(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run(){\n let [q, ...args] = this._getQuery();\n return this.client._query(q, args, {emitter: this}).then(data => {\n this.emit('data', data);\n return data;\n });\n }", "function doQuery(answer) {\n con.query(answer, [], (err, res) => {\n if (err) {\n console.log(err.sqlM...
[ "0.7085559", "0.70179075", "0.6994651", "0.684257", "0.6820955", "0.6702033", "0.65624344", "0.6531005", "0.6465798", "0.6399916", "0.6397412", "0.6357001", "0.6333101", "0.6296232", "0.6260975", "0.6255263", "0.6249224", "0.62275434", "0.6207596", "0.61594164", "0.61571574",...
0.7810862
0
Spends the given (limit) number of iterations continuing a search whose state (remembered) was returned by a previous solveboard or solvenext call. The return value has the same form as solveboard. Notice that depthfirst search ordering is randomized, so calling solvenext on the same initial search state may result in ...
function solvenext(remembered, limit) { var steps = 0; while (remembered.length > 0 && steps < limit) { steps += 1; var r = remembered.pop(); if (r.c >= r.guesses.length) continue; remembered.push({guesses:r.guesses, c:r.c+1, board:r.board}); workspace = r.board.slice(); workspace[r.guesses[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solvefast(original, limit) {\n var turtle = solveboard(original, 100);\n var steps = 100;\n var rabbitsteps = 60;\n while (steps < limit) {\n if (turtle.solution !== null || turtle.track.length == 0) return turtle;\n var rabbit = solveboard(original, rabbitsteps);\n if (rabbit.solution !== nu...
[ "0.65360796", "0.65360796", "0.64102316", "0.64102316", "0.60791224", "0.60407174", "0.5894816", "0.5747597", "0.55719846", "0.55719846", "0.5571563", "0.55256176", "0.54742956", "0.54254967", "0.54006493", "0.53284764", "0.52164644", "0.5203394", "0.5200604", "0.51786053", "...
0.65391564
1
Given an input 81numberornull array (board), returns an array of positions, ordered from leastconstrained to mostconstrained, with positions at the same level of constraint shuffled.
function unconstrained(board) { var bits = figurebits(board); var results = []; for (var freedom = 0; freedom < lib.N + 1; freedom++) { results.push([]); } for (var pos = 0; pos < lib.S; pos++) { if (board[pos] === null) { results[listbits(bits.allowed[pos]).length].push(pos); } } var re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unconstrained(board) {\n var bits = figurebits(board);\n var results = [];\n for (var freedom = 0; freedom < 10; freedom++) {\n results.push([]);\n }\n for (var pos = 0; pos < 81; pos++) {\n if (board[pos] === null) {\n results[listbits(bits.allowed[pos]).length].push(pos);\n }\n }\n ...
[ "0.69927025", "0.59406626", "0.5776661", "0.57371074", "0.56960917", "0.56874615", "0.5587138", "0.55753845", "0.5567935", "0.5547272", "0.5495891", "0.5485684", "0.5469897", "0.5451693", "0.54307467", "0.53871435", "0.5354552", "0.5323194", "0.53014463", "0.529539", "0.52895...
0.6828777
1
Precomputes two arrays: first, an array of all the upperleft corners of all the N BxB blocks of the sudoku board, and second, an array of all the N locations within the 0th block (suitable for shifting to locate locations within any block).
function blockpositions(B) { var posx = 0; var posy = 0; var Px = []; var Py = []; for (var x = 0; x < B; ++x) { for (var y = 0; y < B; ++y) { Px.push(posx); Py.push(posy); posx += B; posy += 1; } posx += (B * B * B) - (B * B) posy += (B * B) - B } return [Px, Py]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRegion(row, column) {\n const result = [];\n const startRow = Math.floor(row / 3) * 3;\n const startColumn = Math.floor(column / 3) * 3;\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n result.push(this.sudokuBoard[startRow + i][startColumn + j]);\n }\n }\n re...
[ "0.6220509", "0.62199074", "0.6089232", "0.60817134", "0.6067193", "0.5985122", "0.5963262", "0.59406364", "0.5912271", "0.5899103", "0.58956486", "0.58610594", "0.58401275", "0.58266425", "0.57958776", "0.5780562", "0.57731336", "0.57360905", "0.570343", "0.5700685", "0.5679...
0.6275635
0
Helper for the bestchoices() implementation: if the given choice array (choices) is betterconstrained than the passed result array (result), then any existing results are cleared and the choice is added. If the given choices are sameconstrained, then the choice is just added on. If the given choices are looserconstrain...
function updatechoices(result, choices) { if (result.length) { if (choices.length > result[0].length) return; if (choices.length < result[0].length) result.length = 0; } result.push(choices); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "correctSelections(oldSelection, newSelection, allChoices) {\n // Default result\n var result = newSelection;\n // User has deactivated 'All' selection => remove also all other selectitons\n if (oldSelection.includes('All') && !newSelection.includes('All')) {\n result = [];\n ...
[ "0.56713414", "0.5366838", "0.5124273", "0.512362", "0.5091055", "0.504281", "0.49749643", "0.49665105", "0.49540433", "0.4923123", "0.4903171", "0.4896869", "0.4826781", "0.48109525", "0.48065925", "0.4792819", "0.47913277", "0.478476", "0.47825715", "0.47798288", "0.4778153...
0.7392281
1
cycles through an array doing function action to each. does same as a for loop, but is reusable.
function forEach(array, action){ for (var i = 0; i < array.length; i++) action(array[i]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i]);\n }\n }", "function forEach(array, action){\n\tfor (var i = 0; i < array.length; i++){\n\t\taction(array[i]);\n\t}\n}", "function each(array, func) {\n for (var i = 0; i < array.length; i++) {\n func(array[i])...
[ "0.80241865", "0.79503906", "0.79344934", "0.78915197", "0.7866871", "0.78389305", "0.78239775", "0.78194803", "0.78157866", "0.7802124", "0.76936483", "0.7684633", "0.7684633", "0.76763284", "0.76761144", "0.7637635", "0.7632387", "0.7529232", "0.74404305", "0.7437167", "0.7...
0.8025561
0
If user types in a search term inside searchEmoji, use a keyup event listener so it runs a function called searchEmojis
function searchEmojis() { // debugger; const getEmoji = emojis .filter(g => g.name.includes(searchEmoji.value)) .map(emoji => `<div class="emoji">${emoji.char}</div>`) .join(""); emojimodalbody.innerHTML = getEmoji }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emojiInputHandler(event) {\n const inputEmoji = event.target.value;\n setEmoji(emoji); //react call to show output\n\n if (inputEmoji in emojiDictionary) {\n setMeaning(emojiDictionary[inputEmoji]);\n } else {\n setMeaning(\"failure to recognise this emoji\");\n }\n }", "functi...
[ "0.6732371", "0.66463464", "0.66344935", "0.6614683", "0.6589763", "0.65633017", "0.6475606", "0.6471926", "0.6469416", "0.6377907", "0.6366076", "0.6350593", "0.632228", "0.6287218", "0.62795126", "0.6261584", "0.6256396", "0.62402296", "0.6237476", "0.62272793", "0.6201756"...
0.71277803
0
clip path generator function
function generateClipPath(){ /* create clip and path node */ var clipPathElm = document.createElementNS(kSvgNS, 'clipPath'); var pathElm = document.createElementNS(kSvgNS, 'path'); /* append path data to clip path */ clipPathElm.appendChild(pathElm); /* return our clip path for further processing */ retu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get clip() {}", "function clip(d) {\n return path(circle.clip(d));\n}", "clipWith(element) {\n // use given clip or create a new one\n let clipper = element instanceof ClipPath_ClipPath ? element : this.parent().clip().add(element); // apply mask\n\n return this.attr('clip-path', 'url(\"#' + cl...
[ "0.6023929", "0.59972715", "0.59904575", "0.5979496", "0.5896938", "0.58377236", "0.5798144", "0.5755609", "0.5695796", "0.5675219", "0.56531775", "0.5580536", "0.555071", "0.5514997", "0.55099773", "0.55099773", "0.55099773", "0.55099773", "0.55043787", "0.5496368", "0.54518...
0.68791735
0
clip path update function
function updateClipPath(clipPathElm, obj){ /* fetch path node */ var pathElm = clipPathElm.querySelector('path'); /* set attributes, transfer path data */ for(var name in obj.pathAttributes){ if (obj.pathAttributes[name]) { pathElm.setAttribute(name, obj.pathAttributes[name]); } } /* assign uniqu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set originalClip(value) {}", "updatePath(){\n \n let move = this.getMinL1(this.snake.pos, this.snake.direction, this.target);\n if(move){\n this.path.push(move);\n }\n \n }", "clipWith(element) {\n // use given clip or create a new one\n let clipper = ...
[ "0.6526471", "0.64693445", "0.6445525", "0.63774383", "0.60310775", "0.5939113", "0.5921684", "0.58941704", "0.5751838", "0.572487", "0.5675723", "0.5635099", "0.56173635", "0.5601485", "0.5601357", "0.55810845", "0.5559591", "0.5557347", "0.5555908", "0.55458975", "0.5526511...
0.69596565
0
determine if dataset.clipPath has changes (return boolean)
function processingClipPathDemandsUpdate(mutation){ /* fetche values */ var newValue = mutation.target.dataset.clipPath; var oldValue = mutation.oldValue; /* if they differ act */ if (newValue != oldValue) { /* is new value set */ if (newValue) { /* apply new clip path */ return true; } els...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasChanged() {\n return this.__changed;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHea...
[ "0.62537134", "0.6135313", "0.6135313", "0.6135313", "0.6135313", "0.6135313", "0.6135313", "0.6019363", "0.59695494", "0.59299076", "0.58977914", "0.5884988", "0.5828287", "0.58187485", "0.5797691", "0.5768964", "0.57640135", "0.57489014", "0.57458186", "0.5739506", "0.57128...
0.6923802
0
parse transforms helper for IDE
function parse_transform(a) { var b = {}; for (var i in a = a.match(/(\w+)\(([^,)]+),?([^)]+)?\)/gi)) { var c = a[i].match(/[\w\.\-]+/g); b[c.shift()] = c; } return b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "transform(program) {\n var options = AsxFormatter.options(this.file.ast);\n //DefaultFormatter.prototype.transform.apply(this, arguments)...
[ "0.6372132", "0.6219084", "0.6219084", "0.6219084", "0.6219084", "0.6219084", "0.6142211", "0.60687566", "0.5987438", "0.59732443", "0.59660876", "0.59660876", "0.59660876", "0.59660876", "0.5888272", "0.5827365", "0.5825694", "0.5802868", "0.5802868", "0.5802868", "0.5802868...
0.6232949
1
Sets that current applicationInfo state to the currently selected application.
selectCurrentApplication(id){ var currentApplication = this.state.applicationInfo; currentApplication.id = this.state.applications[id].id currentApplication.name = this.state.applications[id].name currentApplication.description = this.state.applications[id].description currentApplication.hasSupportC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setApplicationState() {\n const update = {\n applications: this.makeApplicationState()\n };\n this.setState(update);\n }", "set currentProgram(program) {\n let programInfo = this._programs.get(program);\n if (programInfo == null) {\n return;\n }\n this._currentProgramInfo = progr...
[ "0.60996884", "0.57572603", "0.568927", "0.5581398", "0.55740047", "0.55249125", "0.53790057", "0.5308952", "0.5306106", "0.5292213", "0.5215978", "0.5201568", "0.51643836", "0.51291776", "0.5109836", "0.51061195", "0.5097172", "0.5089506", "0.5069177", "0.5055725", "0.499248...
0.6023237
1
Renders the applications state array into a table, with the ability to view applications details in a modal, or create a new application.
renderApplicationTable(){ return( <Card> <CardBody style={{overflow: 'scroll', height: 760}}> <CardTitle style={{width: '100%', textAlign: 'center', fontSize: 25}}>Applications <Button onClick={this.toggleApplicationModal} style={{float: 'right'}} size="sm" color="primary">New</B...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showApps(mApps) {\n\t\tvar oTable = document.getElementById(\"apps\");\n\n\t\tfunction addCell(oRow, sText, sUrl) {\n\t\t\tvar oCell = document.createElement(\"td\"),\n\t\t\t\toTextNode = document.createTextNode(sText),\n\t\t\t\toContent = oTextNode;\n\n\t\t\tif (sUrl) {\n\t\t\t\toContent = document.creat...
[ "0.6311293", "0.6122243", "0.60924625", "0.5939408", "0.58768994", "0.58754426", "0.5842609", "0.5822341", "0.58203226", "0.5776788", "0.5772452", "0.576665", "0.5750754", "0.5746346", "0.57149637", "0.5707288", "0.5700812", "0.5660462", "0.5594712", "0.5591755", "0.5566054",...
0.69490135
0
Renders the Calls table, using Button dropdowns for both filtering and setting a status.
renderCallsTable(){ return( <Card> <CardBody style={{overflow: 'scroll', height: 760}}> <CardTitle style={{width: "100%", textAlign: 'center', fontSize: 25 }}>Calls</CardTitle> <Table hover style={{fontSize: 13}}> <thead> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n clearTable();\n showTable();\n}", "function startTripAvailableBoats(status, type, numseats) {\n let urlCompletion = (status + \"/\" + type + \"/\" + numseats).toString();\n\n startTripAvailableBoatsTable = $(\"#startTripAvailableBoatsTable\").DataTable({\n aj...
[ "0.60696346", "0.58287174", "0.5825534", "0.578927", "0.56725454", "0.5514775", "0.5505832", "0.54722786", "0.54712063", "0.54576534", "0.54532415", "0.5415711", "0.5410562", "0.539456", "0.5386193", "0.5384226", "0.5377973", "0.53655225", "0.5356963", "0.53484327", "0.532860...
0.69339377
0
This doesn't actually toggle visibility, but returns string for toggled visibility
toggleVisibility() { this.visibility = this.visibility === "hidden" ? "visible" : "hidden"; return this.visibility; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static set visible(value) {}", "_computeToggleActionLabel(opened) {\n return opened ? 'Hide' : 'Show';\n }", "toggleVisibility() {\n this.setVisible(!this.visible);\n }", "function toggleVisible() {\n setVisible(false)\n\n }", "toggler() {\n const visibility = this.state.visibility...
[ "0.6978361", "0.69261885", "0.6921493", "0.69056386", "0.6764285", "0.67295706", "0.6681173", "0.6678166", "0.6677145", "0.6664685", "0.6661888", "0.6661888", "0.6648417", "0.6642144", "0.65966463", "0.65942806", "0.6592245", "0.6569044", "0.65555173", "0.64924884", "0.649192...
0.7812557
0
Takes in an array of corner coordinates using screen coordinates Ouputs the leftmost coordinates. Sorts the two corners by height, with the top corner in the first index, and the lower corner in the second index
static sortCornersByTopness(corners_array){ var corners_array_to_be_returned = [] for (var i = 0; i < corners_array.length; i++){ corners_array_to_be_returned[i] = {x:corners_array[i].x,y:corners_array[i].y} } var sorted = false; //The greater value of y gets the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static sortCornersByTopnessPS(corners_array){\n var corners_array_to_be_returned = []\n for (var i = 0; i < corners_array.length; i++){\n corners_array_to_be_returned[i] = {x:corners_array[i].x,y:corners_array[i].y}\n }\n\n var sorted = false;\n //The greater value of ...
[ "0.805302", "0.751773", "0.6701586", "0.66219825", "0.625265", "0.6193172", "0.61787987", "0.59409493", "0.5934811", "0.5831933", "0.58258104", "0.58239996", "0.5769405", "0.5760981", "0.57338613", "0.57175195", "0.56966203", "0.56827605", "0.56714493", "0.56435", "0.56274813...
0.8040596
1
Takes in an array of corner coordinates using ps coordinates Ouputs the leftmost coordinates. Sorts the two corners by height, with the top corner in index 0, and the lower corner in index 1
static sortCornersByTopnessPS(corners_array){ var corners_array_to_be_returned = [] for (var i = 0; i < corners_array.length; i++){ corners_array_to_be_returned[i] = {x:corners_array[i].x,y:corners_array[i].y} } var sorted = false; //The greater value of y gets the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static sortCornersByTopness(corners_array){\n var corners_array_to_be_returned = []\n for (var i = 0; i < corners_array.length; i++){\n corners_array_to_be_returned[i] = {x:corners_array[i].x,y:corners_array[i].y}\n }\n\n var sorted = false;\n //The greater value of y ...
[ "0.7554968", "0.7195532", "0.68227607", "0.62684405", "0.5996193", "0.59830993", "0.5961718", "0.5948444", "0.5948302", "0.5940478", "0.59117216", "0.5892392", "0.5868198", "0.5829588", "0.5753471", "0.57450557", "0.569226", "0.5673606", "0.5625699", "0.56210303", "0.5588461"...
0.7896956
0
Returns the ps coordinates corners of a drawing area Assumes this.position represents the lowerleft corner in the rectangle
getCorners(){ //Order for corners is left top, left bottom, right bottom, right top var lt = {x:this.position.x, y:this.position.y + this.size.y - 1}; var lb = {x:this.position.x, y:this.position.y}; var rb = {x:this.position.x + this.size.x - 1, y:this.position.y}; var rt = {x:t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getScreenCoordinatesTLCorner(){\n var cornersInScreenCoordinates = []\n var cornersInPSCoordinates = this.getCorners();\n for (var i = 0; i < 4; i++){\n cornersInScreenCoordinates[i] = this.parent.getScreenCoordinatesFromPSCoordinates(cornersInPSCoordinates[i]);\n }\n\n ...
[ "0.6318978", "0.6183089", "0.617481", "0.60491776", "0.5945349", "0.5881551", "0.58366495", "0.57982475", "0.5739707", "0.56904054", "0.56723106", "0.5662699", "0.56550324", "0.5581623", "0.55785847", "0.55700094", "0.55588865", "0.55387914", "0.5526234", "0.54923755", "0.548...
0.6292811
1
Given top left corner in screen coordinates, and the size of a rectangular area, returns the 4 corners
static getScreenCorners(position, size){ var lt = {x:position.x, y:position.y}; var lb = {x:position.x, y:position.y + size.y - 1}; var rb = {x:position.x + size.x - 1, y:position.y + size.y - 1}; var rt = {x:position.x + size.x - 1, y:position.y}; return [lt,lb,rb,rt]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getScreenCoordinatesTLCorner(){\n var cornersInScreenCoordinates = []\n var cornersInPSCoordinates = this.getCorners();\n for (var i = 0; i < 4; i++){\n cornersInScreenCoordinates[i] = this.parent.getScreenCoordinatesFromPSCoordinates(cornersInPSCoordinates[i]);\n }\n\n ...
[ "0.6861226", "0.645814", "0.6439311", "0.62984574", "0.62892073", "0.6240576", "0.6224516", "0.615856", "0.6038589", "0.6033212", "0.6010755", "0.59239274", "0.59154856", "0.5872736", "0.58525914", "0.58374304", "0.5837251", "0.5815405", "0.57790464", "0.57784", "0.57470804",...
0.6807523
1
print variables for testing
function printVars(){ console.log("current account:", account); console.log("network id", networkId); console.log("DAI balance: ", daiTokenBalance); console.log("fiji balance: ", fijiTokenBalance); console.log("staking balance: ", stakingBalance); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allVariablesInfo() {\n\t\tconsole.log(\"------ ALL VARIABLE DUMP ------\");\n\t\tconsole.log(\"intervalId: \" + intervalId);\n\t\tconsole.log(\"cardsArray: \" + cardsArray);\n\t\tconsole.log(\"urlArray: \" + urlArray);\n\t\tconsole.log(\"indexArray: \" + indexArray);\n\t\tconsole.log(\"userName: \" + user...
[ "0.6849218", "0.67570055", "0.6756537", "0.6728018", "0.6637621", "0.6617945", "0.64845794", "0.6470429", "0.6464074", "0.64523274", "0.6368145", "0.63474447", "0.6330391", "0.63028866", "0.62437445", "0.62147266", "0.62095875", "0.61954373", "0.6193621", "0.6182282", "0.6181...
0.75485253
0
allow users to stake tokens
async function stakeTokens(amount) { console.log("staking ", amount, "DAI tokens"); console.log(tokenFarm._address); console.log("typeof amount:", typeof(amount)); setLoading(true) // first approve the transaction daiToken.methods.approve(tokenFarm._address, amount) .send({ fro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "token(payload, done) {\n User().setToken(payload, done)\n }", "token(value){ window.localStorage.setItem('token', value)}", "function saveToken(token, type) {\n var tokenKey = type + 'UserToken'\n responseStash[tokenKey] = token\n}", "function guardarLS(user) {\n const token = {\n token: ...
[ "0.63568413", "0.6323151", "0.60532176", "0.5986889", "0.5959129", "0.58951366", "0.58641726", "0.58501315", "0.58388996", "0.581799", "0.5799753", "0.57791597", "0.5775238", "0.57732606", "0.577107", "0.5763296", "0.57523483", "0.5739866", "0.5701908", "0.570104", "0.5689019...
0.6613153
0
method will adjust width of open/closed task heading if displaycontainer not visible
function adjustwidth(){ if(displaycontainer.style.display="none"){ opentaskheading.style.width = "78%"; } else{ opentaskheading.style.width="50%"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeTask(){\n if(document.getElementById(\"details-tab\").offsetWidth == 2){\n document.getElementById(\"details-tab\").style.width = \"0%\";\n document.getElementById(\"main-display\").style.width = \"100%\";\n\n }\n else{\n document.getElementById(\"details-tab\").style.width ...
[ "0.6131761", "0.5903351", "0.5879235", "0.5839147", "0.5833686", "0.5819193", "0.58060765", "0.57834715", "0.57624763", "0.563387", "0.5630824", "0.55920035", "0.5562602", "0.55532235", "0.5545711", "0.55443716", "0.5525378", "0.5524648", "0.55143064", "0.5508614", "0.5505963...
0.7770182
0
GET Teams from ID
function getTeamsFromID(idTeams) { var urlTeam = `${get_teamURL}${idTeams}`; fetchAPI(urlTeam) .then(teamFromID => { showFavTeams(teamFromID); }) .catch(error => { console.log(error) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTeam() {\n // Ambil nilai query parameter (?id=)\n let urlParams = new URLSearchParams(window.location.search);\n let idParam = urlParams.get(\"id\");\n\n fetch(`${base_url}competitions/${idParam}/teams`, {\n headers: {\n 'X-Auth-Token': authToken\n }\n })\n ....
[ "0.7770818", "0.71469456", "0.6896864", "0.68855095", "0.6838112", "0.682013", "0.6819828", "0.68041676", "0.67425567", "0.6740278", "0.66822565", "0.6681422", "0.6588273", "0.6507524", "0.6477834", "0.64432985", "0.642029", "0.63898224", "0.6329041", "0.6323331", "0.6306284"...
0.75667924
1
CLASS stylerXML /CLASS stylerXML
function stylerXML ( xmlDoc, xsltSheet, domElem ) { if (!(this instanceof stylerXML)) { return new stylerXML( xmlDoc, xslSheet, domElem ); } this.setup( xmlDoc, xsltSheet, domElem ); // xmlDoc = (new DOMParser).parseFromString(response, "application/xml"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "styles() { }", "function DocumentComponentStyle(){\r\n this.initByNamespace(\"doc\");\r\n}", "function formatStyle(eleXML, eleHTML) {\n if ($(eleXML).hasAttr(XML_STYLE)) {\n var style = $(eleXML).attr(XML_STYLE);\n\n $(eleHTML).addClass(style);\n $(eleHTML).attr(HTML_STYLE, style);\n...
[ "0.64221495", "0.6267816", "0.6248584", "0.6061249", "0.5910281", "0.59093475", "0.58618325", "0.58348423", "0.5757485", "0.5750387", "0.5665007", "0.56327504", "0.5615367", "0.5615265", "0.5605284", "0.5605284", "0.5604607", "0.5601647", "0.56003386", "0.5598305", "0.5578287...
0.68025124
0
Simple maths for for smart resizing of the background. It gets the height of logo and sizes appropriately the container to scaled proportional to the logo image.
function resizer() { var height = $("#logo img").height(); height = height * .708; $("#main").height(height); $(".container").css("min-height", height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLogoSize()\n{\n return background.width > background.height ? background.height * 0.33 : background.height / 2\n}", "getBackgroundImageHeightUnit(){return this.__background.imageHeightUnit}", "function resize()\n{\n var imgBackground = document.getElementById(\"img-hangman0\");\n var bkgHe...
[ "0.7826247", "0.6650227", "0.64635533", "0.63516384", "0.6264927", "0.62474203", "0.61900663", "0.6172578", "0.6168431", "0.6090315", "0.6044865", "0.5990281", "0.5946118", "0.59030575", "0.58647585", "0.5839879", "0.5839879", "0.5839879", "0.5839879", "0.5835869", "0.5824433...
0.6811918
1
move it to the uploader dir
function moveFile(path) { rename = fs.rename(path, toDir + '/' + thisFile, function(err) { if (err) { console.log('Error: selecting random file failed:', thisFile); console.log(err); } else { done += 1; console.log(done + ' of ' + total + ' complete'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static move(options) {\n FileSystem._wrapException(() => {\n options = Object.assign(Object.assign({}, MOVE_DEFAULT_OPTIONS), options);\n try {\n fsx.moveSync(options.sourcePath, options.destinationPath, { overwrite: options.overwrite });\n }\n catc...
[ "0.5757841", "0.56930315", "0.5655111", "0.55539143", "0.5551344", "0.55128944", "0.54850817", "0.54823786", "0.54806566", "0.5480108", "0.5479302", "0.5452342", "0.5444999", "0.5436878", "0.5430952", "0.5428641", "0.5420547", "0.54157215", "0.5406184", "0.5384205", "0.537394...
0.5751451
1
HELPERS /The "target counterpart" is the element associated with the target, i.e.: if the URL hash targets a footnote reference, its counterpart is the sidenote for that citation; and viceversa, if the hash targets a sidenote, its counterpart is the intext citation. We want a target counterpart to be highlighted along ...
function updateTargetCounterpart() { GWLog("updateTargetCounterpart"); /* Clear existing targeting. */ document.querySelectorAll(".targeted").forEach(element => { element.classList.remove("targeted"); }); /* Identify new target counterpart, if any. */ var counterpart; if (location.hash.match(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightTarget(target) {\n $(target).addClass(\"highlight\");\n}", "function target() {}", "function highlightElement(id)\n{\n var theName = \"isTarget\";\n \n // Remove class\n if (currentTarget)\n {\n var removeMe = currentTarget.className.match(\" \" + theName) ? \" \" : \"\";\n remove...
[ "0.7114834", "0.64024657", "0.635761", "0.6328275", "0.6181119", "0.6035559", "0.59572685", "0.5930097", "0.5889924", "0.5889924", "0.5889924", "0.5875875", "0.5872485", "0.5872045", "0.5872045", "0.5842134", "0.5828075", "0.57582057", "0.5749511", "0.5726911", "0.57244974", ...
0.6600872
1
COLLAPSE BLOCKS /Returns true if the given collapse block is currently collapsed. NOTE: This does not count targeted collapse blocks as expanded unless their disclosure button is also engaged (i.e., in the checked state). This is deliberate! (Because we use the disclosure button state to determine whether we need to re...
function isCollapsed(collapseBlock) { let collapseCheckbox = collapseBlock.querySelector(".disclosure-button"); return (collapseCheckbox.checked == false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isCollapsed(data) {\r\n let parent = data.parent;\r\n\r\n while (parent) {\r\n if (!parent.expanded) {\r\n return true;\r\n }\r\n\r\n parent = parent.parent;\r\n }\r\n\r\n return false;\r\n }", "isCollapsed() {\n return this.o...
[ "0.70975477", "0.7048456", "0.70371705", "0.6958759", "0.68015194", "0.67118406", "0.64867234", "0.6440065", "0.64184356", "0.6385862", "0.6328681", "0.6309852", "0.6260143", "0.60442305", "0.6043494", "0.60302025", "0.5996146", "0.5984905", "0.5961689", "0.5954597", "0.59491...
0.813671
0
Returns true if the given element is within a currentlycollapsed collapse block.
function isWithinCollapsedBlock(element) { /* If the element is not within a collapse block at all, it obviously can't be within a *currently-collapsed* collapse block. */ let collapseParent = element.closest(".collapse"); if (!collapseParent) return false; /* If the element is within a collapse block a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCollapsed(element) {\n return hasClass(element, 'collapse');\n}", "isCollapsed() {\n return this.outerElement.classList.contains('collapsed');\n }", "function isCollapsed(collapseBlock) {\r\n\tlet collapseCheckbox = collapseBlock.querySelector(\".disclosure-button\");\r\n\treturn (colla...
[ "0.76548165", "0.73148274", "0.71017444", "0.6704132", "0.66117173", "0.6235262", "0.60975444", "0.60645545", "0.60645545", "0.60645545", "0.60645545", "0.5998909", "0.5946428", "0.5946428", "0.5946428", "0.5946428", "0.5946428", "0.5946428", "0.5946428", "0.5946428", "0.5946...
0.8478916
0
This function expands all collapse blocks containing the given element, if any (including the element itself, if it is a collapse block). Returns true if any such expansion occurred.
function expandCollapseBlocksToReveal(element) { GWLog("expandCollapseBlocksToReveal"); /* If the given element is not within any collapse block, there is nothing to do. */ if (!isWithinCollapsedBlock(element)) return false; // Expand the nearest collapse block. let collapseParent = element.closest(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isWithinCollapsedBlock(element) {\r\n\t/*\tIf the element is not within a collapse block at all, it obviously can't\r\n\t\tbe within a *currently-collapsed* collapse block.\r\n\t\t*/\r\n\tlet collapseParent = element.closest(\".collapse\");\r\n\tif (!collapseParent) return false;\r\n\r\n\t/*\tIf the eleme...
[ "0.6868704", "0.62051046", "0.62014157", "0.6090775", "0.59829074", "0.59339607", "0.59063566", "0.58660406", "0.5858891", "0.5835907", "0.57617813", "0.57524014", "0.57349205", "0.56669325", "0.56665933", "0.5658811", "0.5647445", "0.5607655", "0.56053895", "0.5598246", "0.5...
0.8019321
0
This function expands all necessary collapse blocks to reveal the element targeted by the URL hash. (This includes expanding collapse blocks to reveal a footnote reference associated with a targeted sidenote). It also scrolls the targeted element into view.
function revealTarget() { GWLog("revealTarget"); if (!location.hash) return; let target = document.querySelector(decodeURIComponent(location.hash)); if (!target) return; /* What needs to be revealed is not necessarily the targeted element itself; if the target is a sidenote, expand collapsed blocks t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expandAccordion() {\n if (location.hash) {\n var section = $(location.hash);\n if (section.hasClass('is-collapsed')) {\n section.removeClass('is-collapsed').addClass('is-expanded');\n section.get(0).scrollIntoView();\n }\n }\n}", "function expandItemOnHashChange() {\n if ('onhash...
[ "0.7411683", "0.6619414", "0.63000494", "0.58737725", "0.58428204", "0.58361375", "0.58123636", "0.57807285", "0.5732306", "0.5718629", "0.5643271", "0.56073517", "0.5598746", "0.55977863", "0.5569571", "0.5554315", "0.55533457", "0.5536671", "0.55338174", "0.5496637", "0.549...
0.6883018
1
Move sidenotes within currentlycollapsed collapse blocks to the hidden sidenote storage container (hiddensidenotestorage). Conversely, move sidenotes within currentlyexpanded collapse blocks from the hidden sidenote storage container to the appropriate sidenote column.
function updateSidenotesInCollapseBlocks() { GWLog("updateSidenotesInCollapseBlocks"); for (var i = 0; i < GW.sidenotes.footnoteRefs.length; i++) { let fnref = GW.sidenotes.footnoteRefs[i]; let sidenote = GW.sidenotes.sidenoteDivs[i]; // If the enclosing collapse block is currently collapsed... if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSidenotePositions() {\r\n\tGWLog(\"updateSidenotePositions\");\r\n\r\n\t/*\tIf we're in footnotes mode (i.e., the viewport is too narrow), then\r\n\t\tdon't do anything.\r\n\t\t*/\r\n\tif (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == true)\r\n\t\treturn;\r\n\r\n\t/*\tPosition left si...
[ "0.6643566", "0.55190164", "0.5403803", "0.52958137", "0.51629895", "0.50766265", "0.5075007", "0.50580746", "0.50495654", "0.50160503", "0.50093114", "0.4970696", "0.49667135", "0.49601614", "0.49435169", "0.4934053", "0.49073815", "0.4904985", "0.48978084", "0.48971483", "0...
0.79029554
0
FOOTNOTES VS. SIDENOTES /In footnote mode (i.e., on viewports too narrow to support sidenotes), footnote reference links (i.e., citations) should point down to footnotes. But in sidenote mode, footnote reference links should point to sidenotes. This function rewrites all footnote reference links appropriately to the cu...
function updateFootnoteReferenceLinks() { GWLog("updateFootnoteReferenceLinks"); for (var i = 0; i < GW.sidenotes.footnoteRefs.length; i++) { let fnref = GW.sidenotes.footnoteRefs[i]; if (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == false) { fnref.href = "#sn" + (i + 1); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFootnoteEventListeners() {\r\n\tGWLog(\"updateFootnoteEventListeners\");\r\n\r\n\t/*\tDetermine whether we are in sidenote mode or footnote mode.\r\n\t\t*/\r\n\tvar sidenotesMode = (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == false);\r\n\r\n\tif (sidenotesMode) {\r\n\t\tif (window.F...
[ "0.6562073", "0.59948826", "0.59073675", "0.59073675", "0.5896483", "0.5896483", "0.5896483", "0.5882435", "0.5882435", "0.5882435", "0.58642083", "0.58642083", "0.58641756", "0.58351153", "0.57877934", "0.5588565", "0.5510307", "0.55034655", "0.54736894", "0.54322374", "0.54...
0.7731096
0
Bind event listeners for the footnote popups or the sidenotes, as appropriate for the current viewport width; unbind the others.
function updateFootnoteEventListeners() { GWLog("updateFootnoteEventListeners"); /* Determine whether we are in sidenote mode or footnote mode. */ var sidenotesMode = (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == false); if (sidenotesMode) { if (window.Footnotes) { // Unbind footno...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unbindEvents() {\n if (this.items.size === 0) {\n OdoWindowEvents.remove(this.resizeId);\n OdoWindowEvents.remove(this.scrollId);\n\n this.hasActiveHandlers = false;\n }\n }", "_removeEventListeners() {\n\n this.el.removeEventListener('click', this._onClickBound);\n window.removeEvent...
[ "0.6112682", "0.5863156", "0.58629674", "0.58629674", "0.58629674", "0.58629674", "0.5805988", "0.5787114", "0.5782809", "0.57826453", "0.57781845", "0.5704819", "0.56851864", "0.56834984", "0.56819683", "0.5676818", "0.56549436", "0.5647697", "0.56463337", "0.5613931", "0.56...
0.69563186
0
In some rare cases, we might switch to sidenote mode while a footnote popup is on the screen. Since we remove footnote popup event listeners during the switch, that popup will remain there forever... unless we clean it up.
function clearFootnotePopups() { GWLog("clearFootnotePopups"); document.querySelectorAll("#footnotediv").forEach(footnotePopup => { footnotePopup.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFootnoteEventListeners() {\r\n\tGWLog(\"updateFootnoteEventListeners\");\r\n\r\n\t/*\tDetermine whether we are in sidenote mode or footnote mode.\r\n\t\t*/\r\n\tvar sidenotesMode = (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == false);\r\n\r\n\tif (sidenotesMode) {\r\n\t\tif (window.F...
[ "0.7254745", "0.6092991", "0.602825", "0.6014878", "0.6007792", "0.597395", "0.59403557", "0.582218", "0.582218", "0.582218", "0.582218", "0.5786958", "0.57825446", "0.57750475", "0.57736033", "0.5743771", "0.5736856", "0.57347256", "0.57347256", "0.57347256", "0.57347256", ...
0.6736775
1
LAYOUT /This function actually calculates and sets the positions of all sidenotes.
function updateSidenotePositions() { GWLog("updateSidenotePositions"); /* If we're in footnotes mode (i.e., the viewport is too narrow), then don't do anything. */ if (GW.sidenotes.mediaQueries.viewportWidthBreakpoint.matches == true) return; /* Position left sidenote column so top is flush with to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructSidenotes() {\r\n\tGWLog(\"constructSidenotes\");\r\n\r\n\t/*\tDo nothing if sidenotes.js somehow gets run extremely early in the page\r\n\t\tload process.\r\n\t\t*/\r\n\tlet markdownBody = document.querySelector(\"#markdownBody\");\r\n\tif (!markdownBody) return;\r\n\r\n\t/*\tAdd the sidenote co...
[ "0.6411551", "0.5727469", "0.5615676", "0.55090773", "0.54510415", "0.51825005", "0.5123177", "0.51144356", "0.509955", "0.50614387", "0.5032594", "0.49926043", "0.49670625", "0.49584427", "0.4952965", "0.49341184", "0.49271706", "0.49095342", "0.49034244", "0.48401904", "0.4...
0.71021736
0
Constructs the HTML structure, and associated listeners and auxiliaries, of the sidenotes.
function constructSidenotes() { GWLog("constructSidenotes"); /* Do nothing if sidenotes.js somehow gets run extremely early in the page load process. */ let markdownBody = document.querySelector("#markdownBody"); if (!markdownBody) return; /* Add the sidenote columns (removing them first if they alr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function siren() {\n\n var d = domHelp(); \n var g = {};\n \n g.url = '';\n g.msg = null;\n g.ctype = \"application/x-www-form-urlencoded\";\n g.atype = \"application/vnd.siren+json\";\n g.title = \"\";\n \n // init library and start\n function init(url, title) {\n\n g.title = title||\"Siren Client\...
[ "0.5534627", "0.54493666", "0.5161603", "0.51144236", "0.5107443", "0.51022106", "0.50898963", "0.5064845", "0.5020744", "0.50190294", "0.501834", "0.5001969", "0.49994576", "0.49574193", "0.49559802", "0.4944336", "0.4940263", "0.491464", "0.49081182", "0.48801205", "0.48568...
0.76010156
0
convenience function to get the country object by name
function getCountry(name){ return countryData[name.toUpperCase()] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findCountry(country) {\r\n if (country.name == \"India\") {\r\n return country;\r\n }\r\n }", "function findCountry(country, data){\n var key = country;\n var object = data[0][key];\n return object;\n }", "function getNationByName(name) {\n\t\t\tvar nation = {};\n...
[ "0.7658997", "0.7330733", "0.73146665", "0.7190092", "0.7059884", "0.70445263", "0.69058335", "0.6822534", "0.6777395", "0.66931623", "0.66629046", "0.6614168", "0.66135424", "0.6554334", "0.6544552", "0.65078896", "0.638601", "0.6368227", "0.6325608", "0.63209075", "0.628787...
0.78220665
0
Hides fields that are empty; requires article input due to multiple instances
function hideEmpty(article){ var id = article.data('id'); var mod = ''; if ($(article).get(0).id == 'recent-1' || $(article).get(0).id == 'recent-2') mod = 'r'; var hidden = ['start', 'time', 'speaker', 'bio', 'prelude', 'content', 'postlude', 'location']; for(var x=0;x<8;x++){ if(document.getElementById(mod+i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideEmpty(){\n\tvar hidden = ['ce-side-event', 'ce-side-time', 'ce-side-title', 'ce-side-speaker', 'ce-side-bio', 'ce-side-prelude', 'ce-side-article', 'ce-side-postlude', 'ce-side-location'];\n\tfor(var x=0;x<9;x++){\n\t\tif(document.getElementById(hidden[x]) == null){\n\t\t\t//Prevents nullpointer excep...
[ "0.7449583", "0.735462", "0.69371945", "0.68891215", "0.6728782", "0.66325593", "0.6584818", "0.6534661", "0.64220774", "0.64220774", "0.6402167", "0.6401821", "0.63871205", "0.63737184", "0.63354236", "0.6334977", "0.6314519", "0.6273352", "0.62732536", "0.62565124", "0.6237...
0.7711792
0
Shows fields that are filled; requires article input due to multiple instances
function showFilled(article){ var id = article.data('id'); var mod = ''; if ($(article).get(0).id == 'recent-1' || $(article).get(0).id == 'recent-2') mod = 'r'; var hidden = ['start', 'time', 'speaker', 'bio', 'prelude', 'content', 'postlude', 'location']; for(var y=0;y<8;y++){ if(document.getElementById(mod+...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static claerFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function cleanArticleFields(){\n $('.title span').text( '' ); \n $('.author span').text( '' );\n ...
[ "0.6501635", "0.6312484", "0.6160869", "0.61386573", "0.59571964", "0.59496677", "0.5910065", "0.58734727", "0.58520573", "0.58038884", "0.577353", "0.5716225", "0.57135475", "0.5677402", "0.5663199", "0.5648347", "0.5640365", "0.55921346", "0.557688", "0.55627006", "0.554644...
0.63636184
1
Write a function that takes an array of numbers and returns true if the sum of all the numbers in the array is greater than 100.
function array100(arrayName) { var arraySum = 0; for(i=0; i < arrayName.length; i++) { arraySum = arraySum + arrayName[i]; } if(arraySum > 100) { return true; }else{ return false;} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPositive(arr) {\n // Add your code below this line\n return arr.every(function(num) {\n return num > 0;\n }); \n //if every element passes the test --> true if all passes, false if not\n // Add your code above this line\n}", "function checkPositive(arr) {\n // return arr.every(val => val...
[ "0.669711", "0.66071534", "0.6600929", "0.659616", "0.6591269", "0.65516746", "0.6514663", "0.6465428", "0.6447942", "0.6446614", "0.64354897", "0.64354897", "0.64354897", "0.64354897", "0.6410659", "0.6403407", "0.6399727", "0.6399727", "0.6377237", "0.6367852", "0.6367852",...
0.78005415
0
LiteGraph defined RenderOptions contains info about how to render the FULL scene (not just a render pass) It is used to store info about which passes should be applied, and what actions performed It could occasionally contain info about the current pass it should not be associated with an scene (the same RenderOptions ...
function RenderOptions(o) { //this.renderer = null; //which renderer is in use //info this.main_camera = null; //this camera is the primary camera, some actions require to know the primary user point of view this.current_camera = null; //this camera is the one being rendered at this moment this.current_pas...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawRenderPasses() {\n // if we got one or multiple scene passes after the render passes, bind the first scene pass here\n if(this.stacks.scenePasses.length && this.stacks.renderPasses.length && this.renderer.planes.length) {\n this.renderer.state.scenePassIndex = 0;\n this.rend...
[ "0.5885717", "0.5866654", "0.5678571", "0.56425637", "0.5631982", "0.5631982", "0.56267494", "0.5614882", "0.5575043", "0.54799736", "0.54270667", "0.5361066", "0.53265166", "0.53118885", "0.53118885", "0.5287033", "0.5277193", "0.524024", "0.5168375", "0.515771", "0.51530206...
0.6943507
0
The SceneTree contains all the info about the Scene and nodes
function SceneTree() { this._uid = LS.generateUId(); this._root = new LS.SceneNode("root"); this._root.removeAllComponents(); this._root._is_root = true; this._root._in_tree = this; this._nodes = [ this._root ]; this._nodes_by_id = {"root":this._root}; LEvent.bind(this,"treeItemAdded", this.onNode...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayScene() {\n if(this.nodeInfo)\n this.displayNode(this.nodeInfo[this.idRoot],this.defaultMaterialID,\"null\",{s:1,t:1},false);\n }", "constructor(scene_){\n\n\t\t//this.enclosingStructure;//this is the story or scene depending on what this node if for\n\t\tthis.isBase=false;\n\t\tthis....
[ "0.6819732", "0.66580755", "0.6649781", "0.6570988", "0.65575045", "0.65460056", "0.649879", "0.6495665", "0.64644855", "0.6337734", "0.629896", "0.62792575", "0.62721395", "0.6208087", "0.61939436", "0.6105929", "0.60944414", "0.6094318", "0.6079247", "0.60438", "0.6027445",...
0.7510806
0
An Animation is a resource that contains samples of properties over time, similar to animation curves Values could be associated to an specific node. Data is contained in tracks
function Animation(o) { this.takes = {}; //packs of tracks if(o) this.configure(o); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Track(o)\r\n{\r\n\tthis.nodename = \"\"; //nodename\r\n\tthis.property = \"\"; //property\r\n\tthis.duration = 0; //length of the animation\r\n\tthis.value_size = 0; //how many numbers contains every sample of this property\r\n\tthis.data = null;\r\n\r\n\tif(o)\r\n\t\tthis.configure(o);\r\n}", "static p...
[ "0.648837", "0.61001766", "0.59836644", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5947639", "0.5934305", "0.59321874", "0.5924388", "0.59010977", "0.5899972", "0.5873566", "0.58623457",...
0.67807204
0
Represents one track with data over time about one property
function Track(o) { this.nodename = ""; //nodename this.property = ""; //property this.duration = 0; //length of the animation this.value_size = 0; //how many numbers contains every sample of this property this.data = null; if(o) this.configure(o); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Track(title, rating, length) {\n this.title = title;\n this.rating = rating;\n this.length = length;\n}", "static get properties() {\n return {\n icon: {\n type: String\n },\n trackIcon: {\n type: String,\n attribute: \"track-icon\"\n },\n title: {\n ...
[ "0.62501025", "0.60332924", "0.60159403", "0.59659195", "0.58218694", "0.57981837", "0.57262367", "0.56604683", "0.5604731", "0.5583532", "0.5573723", "0.5542721", "0.5534879", "0.55061257", "0.54251385", "0.54016256", "0.53932405", "0.5370426", "0.5316641", "0.5300388", "0.5...
0.7002997
0
encodeUtf8 is a string encoding utility for both node and browsers.
function encodeUtf8(input) { var encoder = // tslint:disable-next-line typeof TextEncoder === 'undefined' ? // @ts-ignore new (require('util')).TextEncoder('utf-8') // Node. : new TextEncoder(); // Browser. // @ts-ignore return encoder.encode(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeUtf8$1(input) {\r\n var encoder = \r\n // tslint:disable-next-line\r\n typeof TextEncoder === 'undefined'\r\n ? // @ts-ignore\r\n new (require('util')).TextEncoder('utf-8') // Node.\r\n : new TextEncoder(); // Browser.\r\n // @ts-ignore\r\n return encoder.enco...
[ "0.7907172", "0.75082266", "0.7439555", "0.732438", "0.7309277", "0.72420007", "0.7241518", "0.7206779", "0.717517", "0.7161505", "0.7157172", "0.71560544", "0.71239805", "0.71200734", "0.7111206", "0.710725", "0.7098971", "0.70969903", "0.70896333", "0.70711404", "0.70693666...
0.81378007
0