Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
start the connection upon user request
function connect() { if (!started && localStream && channelReady) { createPeerConnection(); started = true; peerConn.createOffer(setLocalAndSendMessage, createOfferFailed, mediaConstraints); } else { alert("Local stream not running yet - try again."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start(){\n// will start the connection\n}", "function request(){\n\n var remoteID = getPrevious();\n\n if ( !remoteID ) return; // entry\n\n CONNECTIONS[ remoteID ].send( 'start', { request: true }, true );\n}", "start () {\n\t\tthis._logger.info(`Connecting to ${this.host}...`)\n\t\tthis._params.h...
[ "0.79686856", "0.71102446", "0.7109942", "0.69947", "0.6920068", "0.69143033", "0.68051887", "0.67278415", "0.66584265", "0.6641017", "0.66116303", "0.65882415", "0.6569769", "0.6543838", "0.6473037", "0.64697015", "0.6452939", "0.6449579", "0.6441955", "0.64326453", "0.64134...
0.0
-1
stop the connection upon user request
function hangUp() { console.log("Hang up."); socket.json.send({type: "bye"}); stop(); remotevid.src = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stop() {\n server.logoutConnection(this.connection, this.user);\n }", "stop() {\n this.running = false;\n // Tell the server we are done in order to save resources. We cannot wait for the result.\n // This may fail when socket connection is not open, thus ignore errors in queueRequest\n ...
[ "0.7940573", "0.7448863", "0.7312155", "0.7301949", "0.7251331", "0.72394884", "0.722738", "0.705372", "0.699964", "0.6974156", "0.6958791", "0.6933088", "0.6919518", "0.68943864", "0.6891379", "0.6889366", "0.6874092", "0.68654966", "0.6751655", "0.67380124", "0.6729951", ...
0.0
-1
socket: accept connection request
function onMessage(evt) { if (evt.type === 'offer') { console.log("Received offer..."); if (!started) { createPeerConnection(); started = true; } console.log('Creating remote session description...'); peerConn.setRemoteDescription(new RTCSessionDescrip...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function acceptConnection(socket) {\n}", "function ClientAccept(socket) {\n\tsocket.onmessage = function (buffer) {\n\t\tPacketEvent(socket, buffer);\n\t};\n\n\tsocket.onclose = function () {\n\t\tClientDisconnected(socket);\n\t};\n}", "accept() {\n }", "function accept(fd, buf) {\n // debug('accept', ...
[ "0.820381", "0.6604747", "0.6451677", "0.6422324", "0.62199634", "0.6188093", "0.6171265", "0.61257875", "0.60572785", "0.59892756", "0.59892756", "0.59892756", "0.5974384", "0.5953916", "0.59364444", "0.5855864", "0.5853533", "0.5838352", "0.58083576", "0.5765278", "0.576444...
0.0
-1
when remote adds a stream, hand it on to the local video element
function onRemoteStreamAdded(event) { console.log("Added remote stream"); remotevid.src = window.URL.createObjectURL(event.stream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRemoteStreamAdded(event) {\n\tconsole.log(\"Added remote stream\");\n\tremotevid.src = window.URL.createObjectURL(event.stream);\n }", "function handleRemoteStreamAdded (event) {\n console.log('Remote stream added.');\n remoteStream = event.stream;\n\n remoteVideo.srcObject = remoteStream;\n}", ...
[ "0.82877797", "0.8208906", "0.81466246", "0.8111912", "0.81109285", "0.80496776", "0.79093903", "0.7907109", "0.7903851", "0.7784091", "0.77282804", "0.7524071", "0.74645525", "0.74642134", "0.74344146", "0.7429578", "0.73959774", "0.73343873", "0.73294663", "0.72895217", "0....
0.82620394
1
when remote removes a stream, remove it from the local video element
function onRemoteStreamRemoved(event) { console.log("Remove remote stream"); remotevid.src = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRemoteStreamRemoved(event) {\n\tconsole.log(\"Remove remote stream\");\n\tremotevid.src = \"\";\n }", "removeRemoteStream(elem) {\n this._addOrRemoveRemoteStream(false\n /* remove */\n , elem);\n }", "removeRemoteStreamElement(stream) {\n if (!this.container) {\n retur...
[ "0.8625307", "0.8032976", "0.7993415", "0.7863886", "0.7603052", "0.74146545", "0.73618644", "0.713868", "0.6992781", "0.694294", "0.6931831", "0.6743154", "0.6690711", "0.66612947", "0.6599533", "0.6599533", "0.6571087", "0.6529124", "0.6479011", "0.64579296", "0.64099836", ...
0.86614007
0
Create the Model Class
function ExternalAccounts(defaultValues){ var privateState = {}; privateState.Id = defaultValues?(defaultValues["Id"]?defaultValues["Id"]:null):null; privateState.accountNumber = defaultValues?(defaultValues["accountNumber"]?defaultValues["accountNumber"]:null):null; privateState.accountType = defaultValues?...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Model() {}", "function Model() {\n\n }", "function Model() {\n}", "function createModel() {\n var model = new Model();\n\n // give model the default values provided by the service\n model.color = DEFAULT_COLOR;\n model.shape = DEFAULT_SHAPE;\n model.texture = DEFAULT_TEXTURE;\n\n ...
[ "0.7571185", "0.7502446", "0.7362998", "0.7231747", "0.7013781", "0.7013781", "0.68957925", "0.68461996", "0.67336154", "0.663488", "0.662471", "0.65511125", "0.65296316", "0.6501116", "0.64499426", "0.6444946", "0.64107853", "0.6399771", "0.6394952", "0.6393367", "0.6385768"...
0.0
-1
the basename is used when your project is published in a subdirectory and not in the root of the domain you can set the basename on the .env file located at the root of this project, E.g: BASENAME=/reacthellowebapp
render() { const basename = process.env.BASENAME || ""; return ( <div className="d-flex flex-column h-100"> <BrowserRouter basename={basename}> <ScrollToTop> <Navbar /> <Switch> <Route exact path="/" component={Home} /> <Route exact path="/home" component={Home} /> <Rout...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAppName() {\n return process.env.APP_NAME;\n }", "function find_base_name () {\n var base_name = process.env.REACT_APP_BASENAME;\n\n // (OPTIONAL) Check package.json for 'homepage'\n if (!base_name.length > 0) {\n return null;\n }\n\n // react-router will be pissed if the basenam...
[ "0.6600693", "0.65205824", "0.62798065", "0.62481165", "0.5983799", "0.5966565", "0.5907527", "0.5856954", "0.58452135", "0.58222216", "0.5816443", "0.577919", "0.5699944", "0.56874233", "0.5681483", "0.5606132", "0.5562609", "0.5551416", "0.54980165", "0.54588664", "0.543382...
0.5231121
32
var contentDiv = $("content");
function remove(id) { if(localStorage[id]) { delete localStorage[id]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function div(content){ return elem(\"div\", content); }", "function div(content){ return elem(\"div\", content); }", "function createContentDiv() {\n var contentDiv = document.createElement('div');\n contentDiv.id = 'content';\n return contentDiv;\n}", "function $$(divID)\n{\n return document.getElemen...
[ "0.711699", "0.711699", "0.6533975", "0.6462202", "0.62545824", "0.61450887", "0.613938", "0.61046946", "0.60866916", "0.6056582", "0.6053821", "0.6049783", "0.6029417", "0.6029417", "0.6029417", "0.601338", "0.5999552", "0.5946603", "0.59451234", "0.5938434", "0.5935726", ...
0.0
-1
caches the comic title
function createPageTitle(config) { if(!config.type) { console.error("You have to specify a background image."); return 0; } var pageTitle = config.title || "The Age of the Jaguar." $("#"+ config.id).text(pageTitle); ComicCache.update("pageTitle", config); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateTitle() {\n if (this._changeGuard || !this.content) {\n return;\n }\n this._changeGuard = true;\n const content = this.content;\n this.title.label = content.title.label;\n this.title.mnemonic = content.title.mnemonic;\n this.title.icon = content.ti...
[ "0.6987125", "0.67469805", "0.64662033", "0.6273152", "0.6207421", "0.6201854", "0.61965543", "0.61735314", "0.6129456", "0.61264014", "0.609416", "0.60690624", "0.6057", "0.60465497", "0.604467", "0.60161114", "0.60110825", "0.60093576", "0.60058874", "0.6003324", "0.5981623...
0.0
-1
uploads comic frame images and stores it in cache
function createBackgrounds(config) { if(!config.type) { console.error("You have to specify a background image."); return 0; } var bgProps = { "type": config.type, "id": config.id, "blob": config.blob }; $("#"+ bgProps.id).css({ "background-image": "url("+ bgProps....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadFiles() {\n var done = false;\n var formData = new FormData();\n formData.append('projectName', project.getProjectName());\n formData.append('projectID', project.getProjectID());\n formData.append('email', project.email);\n\n var canvasRender = document.getElementById('canvas');\n ...
[ "0.63248307", "0.6155481", "0.6022388", "0.5954526", "0.5948548", "0.591896", "0.5868717", "0.5859012", "0.5796284", "0.57685494", "0.57602495", "0.5756799", "0.5717897", "0.57028884", "0.5692514", "0.5653935", "0.5653564", "0.563847", "0.56314707", "0.56229097", "0.5611209",...
0.0
-1
given a set of properties, returns an array of jquery elems
function createAssets(config) { if(!config.type) { console.error("You have to specify a type of element to create."); return 0; } // merge config with assetProps var assetProps = { "type": config["type"], "asset-type": config["asset-type"], "editable": config.editable, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _gatherElements() {\n return jQuery('*[id]')\n .toArray()\n // use jQuery instances\n .map(function(oElement) {\n return jQuery(oElement);\n })\n .filter(function($element) {\n // is at least part of a control\n ...
[ "0.6414982", "0.6344859", "0.6329732", "0.6201074", "0.61635643", "0.60555696", "0.60163593", "0.58704394", "0.586914", "0.58071876", "0.5736573", "0.57282484", "0.57094824", "0.55374634", "0.5527195", "0.55018663", "0.54809994", "0.5452768", "0.5450839", "0.5444358", "0.5413...
0.0
-1
genre de films isnt working
function clickValidateButton(textBoxesId, differentGenresIds, differentGenres, userD) { console.log("Vous avez clique sur VALIDER : "); var userName = document.getElementById(textBoxesId[0]).value; var age = document.getElementById(textBoxesId[1]).value; console.log("Username : " + userName); consol...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowGenre(cache2)\n{\n\tlet id,\n\t\trows = $(\"div.filmo-category-section\").not(\"div[style='display:none;']\").find(\"div.filmo-row b > a\");\n\n\tfor (let i = 0; i < rows.length; i++)\n\t{\n\t\tid = $(rows[i]).attr(\"href\").match(/\\/(tt\\d+)\\//)[1];\n\n\t\tif (typeof cache2[id] === \"undefined\")\n...
[ "0.67473644", "0.66692716", "0.66554683", "0.65964156", "0.64924777", "0.6463356", "0.64132476", "0.63857836", "0.63758117", "0.6209094", "0.61970437", "0.6192278", "0.616227", "0.6134234", "0.61330855", "0.6121627", "0.61149", "0.60914624", "0.6067667", "0.6056063", "0.60359...
0.0
-1
Helper function for creating and appending elements
function el(innerHtml) { var el_ = document.createElement("SPAN"); el_.innerHTML = innerHtml || el_.innerHTML; parent.appendChild(el_); return el_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "appendElements() {\n this.appendChild(this.container)\n }", "appendCeleb(element) {\n element.append(this.createElement())\n }", "_createElements(text) {\n\t\tthis._elements.forEach((el) =>\n\t\t\tel.insertAdjacentHTML(\n\t\t\t\t'afterbegin',\n\t\t\t\t`<button class=\"glow-btn\">${text}</bu...
[ "0.70779186", "0.7067193", "0.7038303", "0.70105666", "0.69833076", "0.6945922", "0.68770707", "0.67985934", "0.6759302", "0.6740143", "0.66697115", "0.66685295", "0.66414607", "0.6630263", "0.66284144", "0.66281676", "0.66044194", "0.65938354", "0.6570871", "0.65683174", "0....
0.0
-1
Appends the graph or hides it on checkbox click
function toggleGraphOnClick() { var graphName = $(this).attr("name"); var graph = $('#' + graphName); if(graph.length == 1) { graph.toggle('slow'); } else { var dataName = data_names[graphName]; if ($.inArray(dataName, interventionVariables) == -1) drawChart(dataName, dataName, data[dataName...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeGraph()\n{\n\n d3.selectAll(`.item-analysis svg`).remove();\n\n const value = event.target.value;\n\n if(value == \"all\")\n {\n chart = new BarChart(chartConfig);\n \n next.classList.add('hidden');\n \n prev.classList.add('hidden');\n }\n ...
[ "0.68551946", "0.6600655", "0.64662045", "0.6294462", "0.62773794", "0.62693805", "0.6248915", "0.6246893", "0.62437594", "0.6233469", "0.6199054", "0.61463064", "0.61272156", "0.6119792", "0.6095356", "0.60814476", "0.60671484", "0.60589755", "0.6049865", "0.60152584", "0.60...
0.6512058
2
Returns the earliest and latest date for patient information
function getTotalTimeOfStay(data) { // Parse the time values into date objects var timeFormat = d3.time.format("%Y-%m-%dT%H:%M:%SZ"); var times = []; for(var variable in data) { for(var row in variable) { if (data[variable][row]) { times.push(timeFormat.parse(data[variable][row].time))...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "FindDate() {\n var dates = [];\n\n dates.push(new Date(\"2019/06/25\"));\n dates.push(new Date(\"2019/06/26\"));\n dates.push(new Date(\"2019/06/27\"));\n dates.push(new Date(\"2019/06/28\"));\n\n var getDate = new Date(Math.max.apply(null, dates));\n var maximumDate = new Date(Math.max.apply(...
[ "0.58089733", "0.5571926", "0.5391764", "0.5380079", "0.5308206", "0.5298426", "0.5298426", "0.52149826", "0.52149826", "0.52078366", "0.5145354", "0.5139917", "0.5137207", "0.51315063", "0.5106773", "0.5081184", "0.50595903", "0.50423837", "0.5029215", "0.50273335", "0.50015...
0.0
-1
Remove nonHTML parsing characters
function removeNonParsingChars(str) { return str.replace(/[() "/]/g, ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clean(html) {\n\t\treturn html\n\t\t\t.replace(/(&#xA0;)+/g, ' ')\n\t\t\t.replace(' ', ' ')\n\t\t\t.replace(/\\s*([<>])\\s*/g, '$1');\n\t}", "function _clearHtml(txt){\n txt = txt.replace(new RegExp('<','g'),'&#8249;');\n txt = txt.replace(new RegExp('>','g'),'&#8250;');\n return txt;\n ...
[ "0.73124814", "0.72334844", "0.7162835", "0.710315", "0.69927907", "0.69693583", "0.6966668", "0.69619", "0.6857765", "0.6848169", "0.6846956", "0.68462044", "0.6839372", "0.6811691", "0.68116367", "0.67575896", "0.674862", "0.67474645", "0.67468315", "0.6739111", "0.6718987"...
0.66846853
22
Append a check box for each variable in data
function addVariableCheckBoxes(data) { var variableList = $(".variable-selection"); for(var variable in data) { if(isFinite(data[variable][0].value) && $.inArray(variable, calculatedValues) == -1 && $.inArray(variable, interventionVariables) == -1) addCheckBox(variableList, variable); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCheckboxes() {\n $('#checkbox').text('');\n\n for (let i = 0; i < ingredientsArray.length; i++) {\n let pContainer = $(\"<p class=label>\");\n let labelContainer = $(\"<label class=option>\");\n let inputContainer = $(\"<input type=checkbox>\");\n let spanContainer...
[ "0.72648567", "0.7177184", "0.69769263", "0.68068224", "0.674375", "0.6684203", "0.66628057", "0.66340554", "0.6618728", "0.6607103", "0.6584317", "0.6489488", "0.646945", "0.63993025", "0.63579655", "0.6340982", "0.6332173", "0.62962013", "0.6275413", "0.6269284", "0.6268421...
0.72082907
1
Append a check box for each variable in data
function addInterventionCheckBoxes(data) { var variableList = $(".intervention-variables"); for(var variable in data) { if(isFinite(data[variable][0].value) && $.inArray(variable, calculatedValues) == -1 && $.inArray(variable, interventionVariables) != -1) addCheckBox(variableList, variable)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCheckboxes() {\n $('#checkbox').text('');\n\n for (let i = 0; i < ingredientsArray.length; i++) {\n let pContainer = $(\"<p class=label>\");\n let labelContainer = $(\"<label class=option>\");\n let inputContainer = $(\"<input type=checkbox>\");\n let spanContainer...
[ "0.7265557", "0.72090447", "0.71775377", "0.6974865", "0.6743665", "0.6684513", "0.6662786", "0.6633868", "0.6618395", "0.6607883", "0.65834814", "0.6490032", "0.64707625", "0.6398221", "0.6356194", "0.63414115", "0.6332303", "0.6295645", "0.62744033", "0.62690175", "0.626816...
0.6806796
4
Appends a check box to the variable list for the specified variable
function addCheckBox(variableList, variable) { var variableID = removeNonParsingChars(variable); data_names[variableID] = variable; var element = '<li>'; element += '<input type="checkbox" name="' + variableID + '" id="variable" >'; element += '<span>' + variable + '</span>'; element += '</li>'; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addVariableCheckBoxes(data) {\n var variableList = $(\".variable-selection\");\n\n for(var variable in data) {\n if(isFinite(data[variable][0].value) && \n $.inArray(variable, calculatedValues) == -1 &&\n $.inArray(variable, interventionVariables) == -1)\n addCheckBox(variableList, var...
[ "0.68014336", "0.6494276", "0.64654094", "0.63807523", "0.634892", "0.634588", "0.6160577", "0.6084128", "0.6009674", "0.59784657", "0.5953285", "0.59355456", "0.5912297", "0.5888508", "0.58817774", "0.5879305", "0.5875333", "0.5864462", "0.58430153", "0.5838562", "0.5815991"...
0.81766504
0
components/Feed.html generated by Svelte v2.6.1
function add_css() { var style = Object(svelte_shared_js__WEBPACK_IMPORTED_MODULE_0__["createElement"])("style"); style.id = 'svelte-1tosv1m-style'; style.textContent = "li.svelte-1tosv1m{clear:both;margin-bottom:30px}ul.svelte-1tosv1m{margin:0;padding:0;list-style-type:none}h3.svelte-1tosv1m{font-weight:normal;font...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderFeed() {\n\tlet feed = document.getElementById(\"feed\");\n\tfor (let i = 0; i < friendImgs.length; i++) {\n\tfeed.appendChild(article(friendImgs[i], friendNames[i], contentImgs[i], likecount[i], description[i]));\n\t}\n\taddXemThemButton();\n}", "function parseFeed(feed) {\r\n var content = docu...
[ "0.652877", "0.6437817", "0.64029163", "0.63641596", "0.60672826", "0.598136", "0.5972622", "0.59383726", "0.5930524", "0.59261507", "0.5907704", "0.5815097", "0.57693434", "0.5762925", "0.5751127", "0.57498723", "0.57492745", "0.57492745", "0.5740197", "0.572665", "0.5723917...
0.0
-1
components/FeedItem.html generated by Svelte v2.6.1
function pubDate({item}) { return moment__WEBPACK_IMPORTED_MODULE_1___default()(item.pubDate).fromNow(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(item) {\n let html = ` \n <div class=\"item\">\n <div class=\"item--content\">\n <div class=\"content__avatar\">\n <img\n src=${item.imageUrl}\n alt=\"\"\n />\n </div>\n <div class=\"content__description\">\n <h3>messi</h3>\n ...
[ "0.64066136", "0.6377839", "0.6361845", "0.6091626", "0.60416514", "0.6029899", "0.59789336", "0.59479296", "0.5868804", "0.5852822", "0.5849448", "0.584885", "0.58449733", "0.5798471", "0.5779567", "0.57559097", "0.57501566", "0.57439464", "0.5736004", "0.5663473", "0.565349...
0.0
-1
routes/feeds/[slug].html generated by Svelte v2.6.1
function preload({ params, query }) { // the `slug` parameter is available because this file // is called [slug].html const { slug } = params; return this.fetch(`feeds/${slug}.json`) .then(r => r.json()) .then(data => { return { data }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "feed() {\n const key = this.io.getSessionKey();\n\n this.whenAuthenticated('/', (key, user) =>\n this.render(Feed, {\n user: user,\n edit: () => this.io.navigate('/a/edit/'),\n newTab: () => this.io.navigate('/tabs/new/'),\n getPage: (page, done) =>\n this.logs.front...
[ "0.57985955", "0.5780063", "0.5724687", "0.5670037", "0.5658866", "0.5627825", "0.5579078", "0.54195005", "0.5398974", "0.5374603", "0.5322865", "0.5274955", "0.5271499", "0.52276313", "0.51976293", "0.518568", "0.51813394", "0.5147789", "0.51264036", "0.5121337", "0.50860703...
0.50427634
22
The purpose of the function is to get the canvas set up wit directions
function initializeCanvas() { var canvas = document.getElementById("screen"); var context = canvas.getContext("2d"); var clicked = false; // Draw the directions on the screen function animate(){ console.log("Initializing"); context.save(); context.clearRect(0, 0, 800, 50...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getParams(){\n\t\tconst allCorners = this.layers.map(layer => {\n\t\t\treturn layer.getCorners().map(corner=>{\n\t\t\t\treturn Canvas.absolutePoint(corner.x, corner.y, layer.x, layer.y, layer.rotation);\n\t\t\t});\n\t\t});\n\t\t\n\t\tconst allBounds = [];\n\t\tallCorners.forEach(corners=>{\n\t\t\tallBounds.p...
[ "0.6367899", "0.6213613", "0.6176852", "0.60009", "0.5951583", "0.5913927", "0.58938354", "0.5831611", "0.5813275", "0.58116853", "0.58047265", "0.5771133", "0.57470316", "0.57456034", "0.5741782", "0.5741644", "0.5741347", "0.5714119", "0.57088804", "0.57081544", "0.5694507"...
0.55743915
40
Draw the directions on the screen
function animate(){ console.log("Initializing"); context.save(); context.clearRect(0, 0, 800, 500); context.font = "60px Arial"; context.textAlign = "center"; context.strokeStyle = "white"; context.strokeText("Click to Start or Hit Enter", canvas.width/2, canvas....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawDirections(direction, ctx, x, y) {\n switch (direction) {\n case \"vBar\":\n this.drawVBar(ctx, x, y);\n break;\n case \"hBar\":\n this.drawHBar(ctx, x, y);\n break;\n case \"fSlash\":\n this.drawFSlash(ctx, x, y);\n break;\n case \"bSlash\":\n ...
[ "0.6755652", "0.6642499", "0.6565141", "0.63373303", "0.6325964", "0.6309115", "0.62894815", "0.62790036", "0.6243779", "0.6207058", "0.6178496", "0.61583227", "0.6149078", "0.6141901", "0.61399126", "0.6109145", "0.6086594", "0.60795045", "0.6049223", "0.6040038", "0.6034295...
0.0
-1
This function takes in three inputs: direction, dir, and object. The purpose of this function is to tell where the pong ball should go. It takes in a direction to tell it whether to move left, straight, or right. Th input dir tells it to either move up (true) or down(false)
function handleDirection(direction, dir, object){ switch (direction){ case "left": if (dir) object.y -= 5; else object.y += 5; object.x -=3; break; case "right": if (dir) object.y -= 5; else object.y += 5; object.x +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setDir(direction) {\n // If direction is up, move up (y-)\n // Can't move down\n if (direction == \"up\") {\n if (this.direction == \"down\") {\n return false;\n }\n }\n // If direction is left, move left (x-)\n // Can't move right\n ...
[ "0.6554366", "0.6546528", "0.6473604", "0.64244246", "0.6388175", "0.6370568", "0.6369686", "0.6306072", "0.6297845", "0.6284429", "0.6276457", "0.6219483", "0.61347735", "0.61253744", "0.61067307", "0.6090958", "0.60401165", "0.60378003", "0.60353595", "0.60252506", "0.60211...
0.7519766
0
This is an object so that we can initialize multiple sound objects. It takes in an input for the directory of the sound file
function Sound(src) { this.sound = document.createElement("audio"); this.sound.src = src; this.sound.setAttribute("preload", "auto"); this.sound.setAttribute("controls", "none"); this.sound.style.display = "none"; this.playedOnce = false; document.body.appendChild(this.sound); this.play ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initSound() {\n this.enemyDyingSound = this.level.game.add.audio('enemy_dying');\n this.playerHitSound = this.level.game.add.audio('player_hit');\n this.itemCollectSound = this.level.game.add.audio('item_collect');\n this.itemDropoffSound = this.level.game.add.audio('item_dropoff');\n ...
[ "0.7091973", "0.70782703", "0.68671566", "0.6823576", "0.67957246", "0.67603385", "0.66792595", "0.6594391", "0.6569048", "0.6530369", "0.65240437", "0.6518556", "0.6514806", "0.65006036", "0.64764506", "0.6457799", "0.63736975", "0.63680893", "0.6351954", "0.63417137", "0.63...
0.0
-1
This is the bread and butter for the canvas animation
function draw() { var canvas = document.getElementById("screen"); var context = canvas.getContext("2d"); // how much space the player can move per click const dist = 100; // up or down var dir = false; // x direction var direction = "middle"; var middleCounter = 0; // where ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\n ctx.drawImage(bg,0,0);\n for(var i = 0; i < pipe.length; i++){\n // gambar pipeSouth pada kanvas dengan dimulai dari titik ordinat (x, y)\n // e.g\n ctx.drawImage(pipeNorth,pipe[i].x,pipe[i].y);\n // gunakan variable constant untuk mengambil tinggi pipeNorth dit...
[ "0.6558787", "0.65346193", "0.6484876", "0.64848465", "0.64830714", "0.646729", "0.6447575", "0.6392349", "0.6293059", "0.62876034", "0.6286942", "0.62800735", "0.62800735", "0.6231792", "0.6218058", "0.61949605", "0.6175328", "0.6162158", "0.6140599", "0.61070275", "0.610042...
0.0
-1
draw a moving image in the background
function Background() { this.x = 0; this.y = 0; this.w = bg.width; this.h = bg.height; this.render = function () { context.drawImage(bg, this.x--, 0); if(this.x <= -499){ this.x = 0; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\r\n if (x < background.w)x += 1;\r\n else x=0;\r\n if(theme==\"basic\"){\r\n bgImg=background.img;\r\n }else bgImg=backgroundSnow.img; \r\n context.drawImage(bgImg, x, 0, background.w, background.h, 0, 0, background.w ,background.h); \r\n con...
[ "0.74075645", "0.73728395", "0.7201862", "0.7123422", "0.71144575", "0.7072642", "0.7025944", "0.7012889", "0.70069534", "0.69500595", "0.6949901", "0.6949611", "0.68192464", "0.6807035", "0.6785179", "0.67720115", "0.6751792", "0.6751743", "0.67400324", "0.67395544", "0.6735...
0.65929234
39
Holds the score and directional instruction
function Score(){ this.score = 0; this.end = "Game Over!"; this.increaseScore = function(){ this.score++; } this.render = function() { context.font = "30px Arial"; context.strokeStyle = "yellow"; context.strokeText("Score: " + this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function correct() {\n score += 20;\n next();\n \n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n }", ...
[ "0.62306535", "0.6117834", "0.6117834", "0.6117834", "0.6087884", "0.60705", "0.60091287", "0.5982234", "0.5974559", "0.59583175", "0.5913003", "0.5861871", "0.5851229", "0.5842935", "0.5796463", "0.5795418", "0.57799244", "0.57729757", "0.57647544", "0.57611257", "0.57492465...
0.0
-1
Render the pong ball
function Pong(){ // initialize the pong ball at a random this.x = parseFloat((Math.random() * 750).toFixed(0)); this.y = parseFloat((Math.random() * 100).toFixed(0)); this.render = function() { //console.log(this.y); context.fillStyle = "orange"; conte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n pong.draw();\n\n if (pong.isStarted) {\n ball.move();\n leftPaddle.move();\n rightPaddle.move();\n } else {\n // Show paddles at startup and redraw paddles once a player won/lost actual round.\n leftPaddle.draw();\n rightPaddle.draw();\n }\n}", "function pong() {\n\tOutp...
[ "0.7091156", "0.7043201", "0.70251286", "0.70198256", "0.70137644", "0.70034933", "0.6968953", "0.696106", "0.69119745", "0.6879094", "0.68755156", "0.6866434", "0.6858168", "0.68496364", "0.68340075", "0.68210936", "0.68189603", "0.6816266", "0.680884", "0.68029296", "0.6776...
0.72504216
0
Render the bottom rectangle that the user controls
function Player(){ this.x = 400; this.y = 490; this.render = function() { context.fillStyle = "white"; context.fillRect(this.x - 50, this.y, 100, 10); //console.log("Player: " + this.x + " " + this.y); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRenderedBottom(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.bottom}", "drawBottomPipe() {\n\n // Draw the bottom pipe\n paint.fillStyle = this.color;\n paint.fillRect(this.x, this.y, this.width, this.height);\n\n }", "function bottomButton(...
[ "0.7223294", "0.671942", "0.65221274", "0.6368927", "0.6258829", "0.6104085", "0.6087544", "0.6046928", "0.60245305", "0.5993051", "0.5986518", "0.5982365", "0.5979123", "0.5945562", "0.5896768", "0.58818835", "0.58789766", "0.58548534", "0.5853143", "0.5850178", "0.5827493",...
0.0
-1
this function will allow us to set interval on the animation
function animate() { // set up the screen for rendering context.save() context.clearRect(0, 0, 800, 500); background.render(); pong.render(); player.render(); score.render(); context.restore(); // collision on left edge if ((pong.x >= playe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set interval(interval) {\n this.interval_ = interval < 17 ? 17 : interval; // 17 ~ 60fps\n }", "function startAnimation() {\n timerId = setInterval(updateAnimation, 16);\n }", "function anim() {\r\n Loop();\r\n requestAnimFrame(anim);\r\n }", "function start () {\n...
[ "0.72769886", "0.72142935", "0.72106725", "0.7032754", "0.6985592", "0.69812965", "0.6952283", "0.6919452", "0.687983", "0.68636763", "0.68632156", "0.67967105", "0.6791805", "0.6780049", "0.6776079", "0.67341787", "0.67053086", "0.6681383", "0.66811675", "0.6638153", "0.6624...
0.0
-1
save a new execution at axecution index
async save(recipe, hits, firedAction, result) { console.log(`Butler => Saving process result for recipe [${recipe.application}] [${recipe.name}]`); let execution = { recipe: recipe, hits: hits, firedAction: firedAction, result: result, created...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async saveCurentIndex(newStep, filename) {\n\n this.check()\n await this.storage.saveIndex(newStep, filename)\n }", "async function addExecution({ blockNumber = 91, txIndex = 0, execution } = {}) {\n const tx = await txsDAL.create({\n blockNumber: blockNumber,\n version: 0,\n index: txIndex,\n ...
[ "0.6442253", "0.6162446", "0.6114582", "0.6109461", "0.6092189", "0.57308364", "0.55515015", "0.551028", "0.54392534", "0.5423584", "0.532058", "0.53192616", "0.5299559", "0.5264732", "0.51786804", "0.5175693", "0.504849", "0.5037991", "0.50179255", "0.5006879", "0.49936825",...
0.6835359
0
Data for first view
function first_view(){ //Set date to all date = 'All_dates'; //Set truck to all truck_id = 'All'; var arr_distance = []; var arr_duration = []; var arr_speed = []; var arr_emissions = []; //Prepare SQL for insights var sql_boxplot = new cartodb.SQL({ user: 'manifar92' }); sql_boxplot.e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ViewData() {}", "function ViewData() {}", "function ViewData() {}", "function ViewData() { }", "function ViewData() { }", "function ViewData(){}", "function initViewData() {\n loadDataChart();\n displayLogIn();\n}", "showFirstData() {\n let result = []\n if (!this.head) {\n retu...
[ "0.71131253", "0.71131253", "0.71131253", "0.6992202", "0.6992202", "0.6813482", "0.63237345", "0.6287634", "0.61572796", "0.6128154", "0.6030411", "0.60164577", "0.5949967", "0.59004515", "0.5891559", "0.5855222", "0.5791021", "0.57788515", "0.57707244", "0.5760409", "0.5753...
0.0
-1
Insights > One truck
function insights_one(query){ var arr_distance = []; var arr_duration = []; var arr_speed = []; var arr_emissions = []; //Prepare SQL var sql_boxplot = new cartodb.SQL({user: 'manifar92'}); // sql_boxplot.execute(query) .done(function (data) { console.log("Insights ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function infoTurnover() {\n var title = 'Turnover Rate';\n var msg = 'This measure refers to the average quantity sold per day over the last 30 days. ' +\n 'This helps to show the number of days worth of inventory is on hand.';\n app.showMessage(msg, title, ['Ok']);\...
[ "0.57741475", "0.5646564", "0.53633726", "0.53496414", "0.53151596", "0.52547044", "0.51734054", "0.51675916", "0.5127441", "0.5043464", "0.5036146", "0.5019956", "0.4997773", "0.49825516", "0.497995", "0.49237493", "0.49134868", "0.49021307", "0.48863354", "0.48858798", "0.4...
0.0
-1
Insights > Many trucks
function insights_many(query, ids){ var arr_distance = []; var arr_duration = []; var arr_speed = []; var arr_emissions = []; //Prepare SQL var sql_boxplot = new cartodb.SQL({user: 'manifar92'}); sql_boxplot.execute(query) .done(function (data) { console.log("Trucks sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Truck() {\n this.doors = 0;\n \n this.addParts = function() {\n this.doors = 2;\n };\n \n this.say = function() {\n log.add(\"I am a \" + this.doors + \"-door truck\");\n };\n}", "function truckRatings(truckId){\n return db('visited_trucks')\n .select('rating')\n ...
[ "0.5359661", "0.502522", "0.4910169", "0.49072757", "0.48860806", "0.48609158", "0.4844717", "0.48213783", "0.48205695", "0.4806887", "0.48063847", "0.47691447", "0.47657955", "0.47637045", "0.47487372", "0.47463354", "0.47269645", "0.47131044", "0.46735692", "0.4651046", "0....
0.0
-1
Creacion del nombre en HTML
function myFunction (){ var user = document.getElementById("name").value; var p = document.getElementById("welcomeMsje"); p.innerHTML = user + " cuando tú respuesta esté correcta, se verá en color verde, y cuando sea incorrecta se verá en color naranjo"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placename(id, length1) {\n document.getElementById(id).innerHTML = namegen(length1);\n output_namegen = \"\";\n}", "get photographerNameInForm() {\n\t\treturn `\n\t\t\t<h1 class=\"modal__head\" id=\"contact\">Contactez-moi </br> ${this.name}</h1>\n\t\t` \n\t}", "function writeNameNE() {\n\t\tv...
[ "0.6728052", "0.67261446", "0.67086816", "0.67072505", "0.6642793", "0.6601838", "0.6588766", "0.6587611", "0.64754987", "0.64254916", "0.63985395", "0.63945615", "0.63808143", "0.633578", "0.6300897", "0.6297273", "0.629003", "0.62817514", "0.6221802", "0.6218599", "0.621577...
0.0
-1
Respuesta pregunta 1 Alternativa si
function changeColor(newColor) { var elem = document.getElementById('para'); elem.style.color = newColor ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Jugar(){\n /* PRIMERA PREGUNTA */\n if (answ1 == 2) { //Ejemplo de opción con NÚMERO\n respuestasCorrectas.innerHTML += \"1.¿Cuál es la bebida preferida de Gonzalo? <br> <strong>Respuesta correcta:</strong> 🍺 La cerveza 🍺\";\n } else {\n respuestasIncorrectas.innerHTML += \"1.¿Cuál es...
[ "0.63956475", "0.6375171", "0.61099994", "0.6066993", "0.606348", "0.6031675", "0.60105264", "0.60069096", "0.58554214", "0.58388454", "0.5807333", "0.5804907", "0.57900476", "0.5777377", "0.5727552", "0.5727123", "0.57181793", "0.5711033", "0.5668782", "0.5666577", "0.566393...
0.0
-1
Phone validations() Individual Element Validation is completed / submit button Validation
function validateForm(regForm) { var username = document.getElementById('inputname'); var password = document.getElementById('inputPassword'); var fname = document.getElementById('inputfname'); var lname = document.getElementById('inputlname'); var propic = document.getElementById('inputpropic'); var gender...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantValidation(field) {\n var webForm = document.getElementById(\"form\");\n var bForm = isHidden(webForm) ? document.getElementById(\"mc-embedded-subscribe\") : document.getElementById(\"mc-embedded-subscribe-mob\");\n var phoneField = document.getElementById(\"mce-PHONE\");\n var phoneConfirm = d...
[ "0.72090775", "0.7073709", "0.68782496", "0.6862131", "0.68355316", "0.6821892", "0.6734275", "0.6709149", "0.6705822", "0.6692637", "0.66827554", "0.6674901", "0.66174024", "0.65962213", "0.6528716", "0.650596", "0.6478856", "0.6472807", "0.64623064", "0.64524084", "0.644779...
0.0
-1
to set the route config of this Component
function config($locationProvider, $stateProvider, $urlRouterProvider) { 'ngInject'; //$locationProvider.html5Mode(true); //$urlRouterProvider.otherwise('/'); //to set a default route in general used in a global context not in a component $stateProvider .state('graduationedit', { url...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function routehelperConfig() {\n /* jshint validthis:true */\n this.config = {\n // These are the properties we need to set\n // $stateProvider: undefined\n // $urlRouteProvider: undefined\n // docTitle: ''\n // resolveAlways: {ready: function(){...
[ "0.69146556", "0.69098264", "0.6849873", "0.6785623", "0.6735526", "0.6703628", "0.6685133", "0.654207", "0.6488871", "0.63816607", "0.63771194", "0.6361679", "0.63536775", "0.63536775", "0.63536775", "0.63536775", "0.63536775", "0.63240206", "0.6311112", "0.6298726", "0.6291...
0.0
-1
homebrewn buttons with 2 kinds of images for active/passive, replace at some point
function PicPar(data) { this.data = data; // store object in container PicPar.pars[data.name] = this; // store type in global container Par.all[data.name] = "picture"; // store name in list PicPar.names.push(data.name); //cl("initializing glob."+data.name+" to "+data.value); glob[dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateButtons() {\n\t//Reprints the button list, with the active button highlighted\n\tvar button_list = '';\n\tfor (var i = 0; i <= last; i++) {\n\t\tif (current==i)\n\t\t\tbutton_list += ' <img src=\"img/buttons/selected_image.png\" onclick=\"goto(' + i + ')\"> ';\n\t\telse\n\t\t\tbutton_list += ' <img ...
[ "0.6782082", "0.6769409", "0.6507018", "0.647112", "0.64417624", "0.6344564", "0.633881", "0.6316932", "0.6278328", "0.62740886", "0.6256797", "0.62372196", "0.6219231", "0.6159607", "0.6149859", "0.61151844", "0.6080239", "0.60591894", "0.6030978", "0.6006622", "0.5992967", ...
0.0
-1
if name = XXX, we build the following: Label with id="XXXlab" input with id="XXX" slider with id="XXXSlider"
function NumPar(data) { // name // min // max // step // value this.data = data; this.data.rem = this.data.rem || ""; NumPar.pars[data.name] = this; NumPar.names.push(data.name); Par.all[data.name] = "numeric"; //console.log("setting ",data.name, " to ", +data.value); win...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSlider(name, label) {\n\t$( name ).slider({\n // orientation: \"vertical\",\n range: \"min\",\n min: 0,\n max: 360,\n value: 0,\n slide: function() {\n \t$( label ).text( $( name ).slider( \"value\" ) );\n renderCanvas();\n }\n });\n}", "function c...
[ "0.71029335", "0.66815656", "0.6568692", "0.6202972", "0.61672086", "0.61580825", "0.61098415", "0.61060625", "0.60664725", "0.59779745", "0.5974876", "0.59472275", "0.59345585", "0.59295654", "0.59075415", "0.5885252", "0.58541113", "0.58482903", "0.58365464", "0.5803735", "...
0.0
-1
Function makeTrays() initializes all of the tray objects. It calls the TileSheet constructor for each tile sheet. It calls the TokenSheet constructor for each token sheet. It also adds the trayNumb to each new tray object. Finally it initializes BD18.curTrayNumb to 0 and BD18.trayCount to the number of tray objects.
function makeTrays() { var sheets = BD18.bx.tray; var i=0; var images = BD18.tsImages; for (var ix=0;ix<sheets.length;ix++) { if(sheets[ix].type === 'tile') { BD18.trays[i] = new TileSheet(images[ix],sheets[ix]); BD18.trays[i].trayNumb = i; i++; } else if(sheets[i].type === 'btok') { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTrays() {\n var sheets = BD18.bx.tray;\n var i=0;\n var images = BD18.tsImages;\n for (var ix=0;ix<sheets.length;ix++) {\n if(sheets[ix].type === 'mtok') {\n BD18.trays[i] = new TokenSheet(images[ix],sheets[ix]);\n BD18.trays[i].trayNumb = i;\n i++;\n }\n }\n BD18.curTrayNum...
[ "0.8390875", "0.6364943", "0.63647014", "0.6167402", "0.60227937", "0.57286763", "0.55662584", "0.55652547", "0.5521998", "0.5521347", "0.5462438", "0.53478104", "0.5323004", "0.53124785", "0.52687615", "0.5254972", "0.5250988", "0.51944774", "0.51944774", "0.51795274", "0.51...
0.87267226
0
This function initializes the BD18.boardTiles array. It calls the BoardTile constructor for each tile in BD18.gm.brdTls array and adds the new object to the BD18.boardTiles array.
function makeBdTileList(){ BD18.boardTiles = []; if (BD18.gm.brdTls.length === 0) return; var tile,sn,ix,rot,bx,by; for(var i=0;i<BD18.gm.brdTls.length;i++) { sn = BD18.gm.brdTls[i].sheetNumber; ix = BD18.gm.brdTls[i].tileNumber; rot = BD18.gm.brdTls[i].rotate; bx = BD18.gm.brdTls[i].xCoord; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createBoard() {\n\t\tfor (let i = 0; i < 6; i++) {\n\t\t\tfor (let j = 0; j < 6; j++) {\n\t\t\t\tlet tile = new MyTile(this.scene, this);\n\t\t\t\tlet pieceSize = 0.395 + 0.005;\n\t\t\t\ttile.addTransformation(['translation', -3 * pieceSize + pieceSize * j, -3 * pieceSize + pieceSize * i, 0]);\n\t\t\t\tthis.tiles....
[ "0.7170571", "0.71519136", "0.71322393", "0.70988643", "0.70986104", "0.69822586", "0.6879601", "0.6848621", "0.680423", "0.67679965", "0.66948545", "0.65686613", "0.6543368", "0.64749426", "0.6452885", "0.64211", "0.6412679", "0.63903266", "0.63444227", "0.63409185", "0.6269...
0.8119695
0
This function initializes the BD18.boardTokens array. It calls the BoardToken constructor for each token in BD18.gm.brdTks array and adds the new object to the BD18.boardTokens array.
function makeBdTokenList(){ BD18.boardTokens = []; if (BD18.gm.brdTks.length === 0) return; var token,sn,ix,flip,bx,by; for(var i=0;i<BD18.gm.brdTks.length;i++) { sn = BD18.gm.brdTks[i].sheetNumber; ix = BD18.gm.brdTks[i].tokenNumber; flip = BD18.gm.brdTks[i].flip; bx = BD18.gm.brdTks[i].xCoord;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBdTileList(){\n BD18.boardTiles = [];\n if (BD18.gm.brdTls.length === 0) return;\n var tile,sn,ix,rot,bx,by;\n for(var i=0;i<BD18.gm.brdTls.length;i++) {\n sn = BD18.gm.brdTls[i].sheetNumber;\n ix = BD18.gm.brdTls[i].tileNumber;\n rot = BD18.gm.brdTls[i].rotate;\n bx = BD18.gm.brdTls[i...
[ "0.6129388", "0.60673374", "0.6062905", "0.57676643", "0.5757769", "0.5641749", "0.5569456", "0.5466356", "0.5430375", "0.53800225", "0.53472185", "0.534375", "0.53281385", "0.53228676", "0.531455", "0.5306132", "0.5301017", "0.5300412", "0.53002214", "0.5278884", "0.52747214...
0.7531236
0
Function trayCanvasApp calls the trays.place() method for the current tile/token sheet object. This sets up the tray Canvas.
function trayCanvasApp() { BD18.trays[BD18.curTrayNumb].place(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initTray()\n {\n // Hook clock tick with tray label\n this.clock.onTick((clock) => {\n this.tray.setLabel(clock.toString());\n });\n\n // Show calendar when clicking on tray icon\n this.tray.onClick(() => {\n const bounds = this.tray.getBounds();\n ...
[ "0.67446756", "0.6436054", "0.6407734", "0.6394625", "0.630666", "0.62820333", "0.62044483", "0.57894695", "0.5731708", "0.57155377", "0.5715349", "0.5697288", "0.567104", "0.5635942", "0.5627175", "0.5598958", "0.55930215", "0.5564372", "0.5536513", "0.55042964", "0.547548",...
0.8300502
1
Function mainCanvasApp calls the gameBoard.place() method. This sets up the main Canvas. It then places all existing tiles on the game board using the BD18.boardTiles array.
function mainCanvasApp(){ BD18.hideMapItems = false; BD18.gameBoard.place(); if (BD18.boardTiles.length === 0) { return; } var tile; for(var i=0;i<BD18.boardTiles.length;i++) { if (!(i in BD18.boardTiles)) { continue; } tile = BD18.boardTiles[i]; tile.place(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initGame() {\n\tdebugAlert(\"initGame\", false);\n\tif(gGameActive === true) return;\n\t\n\tgBoardRowCount = 8;//document.getElementById(\"row\").value;\n\tgBoardColumnCount = 6;//document.getElementById(\"column\").value;\n\t\n\t//Create the play area canvas and listeners\n\tgPlayAreaCanvas = createCanv...
[ "0.68245333", "0.6723668", "0.6653353", "0.6472319", "0.6448213", "0.643738", "0.6410227", "0.6373322", "0.6295801", "0.6218284", "0.62101865", "0.6203007", "0.6167175", "0.6165529", "0.61612076", "0.6151174", "0.61297494", "0.6128664", "0.6089479", "0.60879105", "0.60872406"...
0.87114084
0
Function toknCanvasApp places all existing tokens on the game board using the BD18.boardTokens array.
function toknCanvasApp(keepHexSelect){ BD18.gameBoard.clear2(keepHexSelect); if (BD18.boardTokens.length === 0) { return; } var token; for(var i=0;i<BD18.boardTokens.length;i++) { if (!(i in BD18.boardTokens)) { continue; } token = BD18.boardTokens[i]; token.place(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeBdTokenList(){\n BD18.boardTokens = [];\n if (BD18.gm.brdTks.length === 0) return;\n var token,sn,ix,flip,bx,by;\n for(var i=0;i<BD18.gm.brdTks.length;i++) {\n sn = BD18.gm.brdTks[i].sheetNumber;\n ix = BD18.gm.brdTks[i].tokenNumber;\n flip = BD18.gm.brdTks[i].flip;\n bx = BD18.gm.brdT...
[ "0.68353736", "0.6338595", "0.5974676", "0.551968", "0.54746246", "0.5454768", "0.5398215", "0.5324752", "0.530591", "0.5301554", "0.5262812", "0.5218287", "0.52089995", "0.51660526", "0.5102761", "0.505095", "0.502526", "0.5022322", "0.5002366", "0.49925613", "0.49791616", ...
0.7455299
0
Function CanvasApp initializes all canvases. It then calls trayCanvasApp, tokenCanvasApp and mainCanvasApp.
function canvasApp() { var hh = parseInt(BD18.gameBoard.height, 10); var ww = parseInt(BD18.gameBoard.width, 10); $('#content').css('height', hh); $('#content').css('width', ww); $('#canvas1').prop('height', hh); $('#canvas1').prop('width', ww); $('#canvas2').prop('height', hh); $('#canvas2').p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eventWindowLoaded() {\n canvasApp();\n}", "function start_app() {\n\n // size canvas to window\n sizeCanvas();\n\n //set up a ticker to refresh page automatically.\n let speed = 300; // how often screen refreshes, in milliseconds.\n let ticker = NOOPBOT_TICK_SETUP(draw, speed);\n\n //fire a dra...
[ "0.662103", "0.6590861", "0.65753853", "0.6571598", "0.65290123", "0.641338", "0.63444597", "0.62989044", "0.62523043", "0.6227132", "0.616727", "0.60884833", "0.60550845", "0.60291773", "0.59836024", "0.5937944", "0.59244174", "0.5884839", "0.5797936", "0.57795966", "0.57729...
0.6401474
6
Startup Event Handler and Callback Functions. / This function is an event handler for the game box images. It calls makeTrays, makeBdTileList, canvasApp and delayCheckForUpdate after all itemLoaded events have occured.
function itemLoaded(event) { BD18.loadCount--; if (BD18.doneWithLoad === true && BD18.loadCount <= 0) { BD18.gameBoard = new GameBoard(BD18.bdImage,BD18.bx.board); makeTrays(); makeBdTileList(); makeBdTokenList(); canvasApp(); delayCheckForUpdate(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actualRun() {\n\n\t\t//set preloader mode\n\t\tif (g_objPreloader) {\n\t\t\tg_objPreloader.fadeTo(0, 1);\n\t\t\tg_objWrapper.height(g_options.theme_preloading_height);\n\t\t\tg_functions.placeElement(g_objPreloader, \"center\", g_options.theme_preloader_vertpos);\n\t\t}\n\n\t\tinitEvents();\n\n\t\tg_tiles...
[ "0.6417779", "0.6240307", "0.61647516", "0.60585743", "0.60478604", "0.6030658", "0.6022879", "0.60188633", "0.59966296", "0.5982863", "0.5961638", "0.5955499", "0.5955219", "0.5903512", "0.5875553", "0.5872767", "0.58624214", "0.5840522", "0.582065", "0.58143944", "0.5808792...
0.6552179
0
The loadLinks function is called by the statements which are created by the loadLinks function below.
function doLink(linkURL) { $('#mainmenu').hide(); window.open(linkURL); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadLinks() {\n // Get links and sort them by title\n LinksService.getLinks().then(function(links) {\n if (angular.isArray(links)) {\n $scope.links = links.sort(function compare(a, b) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.titl...
[ "0.7555157", "0.685258", "0.6499809", "0.6499809", "0.6499809", "0.64751166", "0.6353042", "0.63347626", "0.62915814", "0.62755454", "0.6239097", "0.61694753", "0.6124335", "0.6108903", "0.6082642", "0.6056887", "0.6020022", "0.6018722", "0.6017382", "0.59853643", "0.5965511"...
0.0
-1
The loadBox function is a callback function for the gameBox.php getJSON function. It loads all the game and game box links. It loads all the game box images. It also initializes the BD18.gm.trayCounts array if it is undefined or empty.
function loadBox(box) { BD18.bx = null; BD18.bx = box; if (typeof(box.links) !== 'undefined' && box.links.length > 0) { loadLinks(box.links); } $.getJSON("php/linkGet.php", 'gameid='+BD18.gameID,function(data) { if (data.stat === "success" && typeof(data.links) !== 'undefined' && data.links.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadBox(box) {\n BD18.bx = null;\n BD18.bx = box;\n if (typeof(box.links) !== 'undefined' && box.links.length > 0) {\n loadLinks(box.links);\n }\n $.getJSON(\"php/linkGet.php\", 'gameid='+BD18.gameID,function(data) {\n if (data.stat === \"success\" && typeof(data.links) !== 'undefined' \n ...
[ "0.8286711", "0.6254459", "0.6183809", "0.6151389", "0.6107147", "0.58563054", "0.58470404", "0.584124", "0.5837803", "0.57455343", "0.572277", "0.5707167", "0.5649813", "0.5557837", "0.55568516", "0.5556563", "0.5550416", "0.5542304", "0.55330586", "0.55310035", "0.5528146",...
0.8263456
1
The loadSession function is a callback function for the gameSession.php getJSON function. It finds and loads the game box file.
function loadSession(session) { BD18.gm = null; BD18.gm = session; if( !BD18.doneWithLoad ){ BD18.history = [JSON.stringify(BD18.gm)]; BD18.historyPosition = 0; var boxstring = 'box='; boxstring = boxstring + BD18.gm.boxID; $.getJSON("php/gameBox.php", boxstring, loadBox) .fail(function() { var ms...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSession(session) {\n BD18.gm = null;\n BD18.gm = session;\n if( !BD18.doneWithLoad ){\n\tBD18.history = [JSON.stringify(BD18.gm)];\n\tBD18.historyPosition = 0;\n\tvar boxstring = 'box=';\n\tboxstring = boxstring + BD18.gm.boxID;\n\t$.getJSON(\"php/gameBox.php\", boxstring, loadBox)\n\t .fail(fun...
[ "0.84295845", "0.6528944", "0.65119857", "0.6462389", "0.6441815", "0.64055884", "0.63706553", "0.6366838", "0.6357757", "0.62925863", "0.62846065", "0.62764364", "0.6162464", "0.61339134", "0.608469", "0.5979618", "0.5952426", "0.5924603", "0.58981663", "0.58048695", "0.5773...
0.8448747
0
startTimer rus a timer in the background, that is displayed in the div named "timer"
function startTimer() { var minutesLabel = document.getElementById("minutes"); var secondsLabel = document.getElementById("seconds"); timeID = setInterval(setTime, 1000); function setTime() { //totalSeconds will return the total # of seconds every second ++totalSeconds; secondsLabel.innerHTML = pad...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTimer() {\n $timer.show().text(\"Timer: \" + timer.toFixed(1));\n interval = setInterval(updateTimer, 100);\n }", "function startTimer(_timer){\n _timer.start({\n countdown: true,\n startValues: {\n seconds: 30\n }\n });\n }", ...
[ "0.79590625", "0.7850033", "0.7844577", "0.78074396", "0.7765255", "0.76891994", "0.7664951", "0.7641534", "0.76112527", "0.76088554", "0.7598205", "0.75832057", "0.757812", "0.75620985", "0.75609213", "0.75549763", "0.7532883", "0.7526213", "0.74770725", "0.747649", "0.74532...
0.0
-1
Logs a message in the console if available.
function log(msg) { if (window.console && console.log) { console.log(msg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log (message) {\n this.getConsole().showMessage(message);\n }", "function log(message) {\n if (logToConsole) {\n console.log(message);\n }\n }", "function log(message) {\n if (logToConsole) {\n console.log(message);\n }\n }", "function log(messa...
[ "0.7970379", "0.7717661", "0.7717661", "0.7645867", "0.76119715", "0.75812364", "0.7569756", "0.7533215", "0.73862076", "0.7339864", "0.7334318", "0.7226801", "0.71434444", "0.7120208", "0.7109251", "0.70898664", "0.70898664", "0.70823693", "0.7053951", "0.70514834", "0.70435...
0.70442563
20
Add all the rows for a unit, including average, coverage and indivual results for its activities.
function addUnitToTable(unit) { rows.push({ title : "<a href='#view=unit&amp;id=" + unit.id + "'>" + unit.name + "</a>", exportTitle : safe_export_replace(unit.name), css : 'unit main', unit : unit, type : UNIT }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processData(unit) {\n\n if (!unit) {\n\n log(\"Warning processData: Parameter unit required\");\n\n return;\n }\n\n log(\"Processing unit: \" + unit.id);\n\n var ud = unitsData[unit.id];\n\n if (!ud) {\n return; ...
[ "0.5544122", "0.5407866", "0.52826583", "0.5176815", "0.5153879", "0.502144", "0.49956483", "0.49860778", "0.49830553", "0.49443635", "0.49348253", "0.49301678", "0.49266627", "0.49266627", "0.48943505", "0.48401526", "0.48284256", "0.4819412", "0.48169133", "0.4789702", "0.4...
0.7124276
0
addUnitToTable Callback para cada celda de la tabla.
function displayCell(row, col, i, j, exportCell) { var activityUserData = gradeManager.activityUserData; var unitUserData = gradeManager.unitUserData; // checkObject(row); // checkObject(col); // checkObject(col.student); // by now var student =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addUnitToTable(unit) {\n\n rows.push({\n title : \"<a href='#view=unit&amp;id=\" + unit.id + \"'>\" + unit.name + \"</a>\",\n exportTitle : safe_export_replace(unit.name),\n css : 'unit main',\n unit : unit,\n type : UNIT\n ...
[ "0.72789013", "0.57422346", "0.573005", "0.5691815", "0.5680878", "0.5641096", "0.54685986", "0.5465776", "0.5461185", "0.5457375", "0.5456036", "0.54555315", "0.54465604", "0.5420167", "0.5363856", "0.53559834", "0.53480947", "0.53205055", "0.52960414", "0.5263865", "0.52553...
0.0
-1
Process attempt based on current useractivity status. Grading data must be given order by attempt number (asc).
function processAttempt(grade, data) { if (!data) { die("Data cannot be empty at this point"); } data.attempts.push(grade); var n = data.attempts.length; var score = grade.grade; var attempt = grade.attempt; // Unknown...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activateAttemptRow() {\n\t\t\tvar queryResult = $document[0].getElementById(\"attempt\" + currentAttempt);\n\t\t\tvar currentRow = angular.element(queryResult);\n\t\t\tvar children = currentRow.children();\n\t\t\tfor (var i = 0; i < children.length; i++) {\n\t\t\t\tif (children[i].nodeType !== 8) {\n\t\t\...
[ "0.5445236", "0.53572464", "0.53051573", "0.5289914", "0.5264447", "0.51217824", "0.5104373", "0.50660527", "0.50073695", "0.4976232", "0.49296218", "0.491253", "0.48920614", "0.48919374", "0.48815286", "0.48557648", "0.48331454", "0.4831184", "0.4830529", "0.48274648", "0.48...
0.61529297
0
processAttempt Rellena las tablas intermedias y agrega los datos de las unidades.
function processData(unit) { if (!unit) { log("Warning processData: Parameter unit required"); return; } log("Processing unit: " + unit.id); var ud = unitsData[unit.id]; if (!ud) { return; // No data to process ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formata_dados_v2( resposta_HANA ){\n const reducer = (r, row) => {\n \n const key_caminhao = `${row.ID} - ${row.Unidade} - ${row.Nome} - ${row.Placa} - ${row.Transportadora} - ${row.Modal} - ${row.Dia} - ${row.Transportadora} - ${row.Modal} -${row.Nome}`;\n const key_entrega...
[ "0.5006139", "0.48764807", "0.48567873", "0.47685066", "0.473849", "0.4685452", "0.46270645", "0.45912486", "0.45747316", "0.45669258", "0.4562554", "0.45393646", "0.45052844", "0.44789064", "0.44420722", "0.44372773", "0.4432565", "0.4420728", "0.44004378", "0.43960932", "0....
0.54623127
0
REDUX REDUCER UPDATE STATE
function reduxReducer( state = initState, action ) { switch ( action.type ) { case NEXT_COUNTER: return { ...state, display: true, counter: state.counter + 1 } case RESET_COUNTER: return { ...state, display: true, counter: 0 } case PREV_COUNTER: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refreshUpdateStatus() {}", "updated() {}", "enableUpdating(_requestedUpdate) {\n }", "[REFRESH_BEGIN](state) {\n state.error = false\n state.error_msg = null\n state.refreshing = true\n }", "stateChange(state){\n\t\tLogger.info(`Ably realtime state changed to: ${state.current}`);\n\t}", "first...
[ "0.6805816", "0.6168247", "0.6092945", "0.6081906", "0.6078568", "0.60492814", "0.60468584", "0.60244614", "0.60120887", "0.59476966", "0.5944984", "0.59357756", "0.59255415", "0.59253895", "0.59233606", "0.59233606", "0.59233606", "0.59233606", "0.59233606", "0.59233606", "0...
0.0
-1
Dump icon meta & links to a Twig template.
beforeEmit(compilation) { HtmlWebpackPlugin.getHooks(compilation) .beforeEmit.tapAsync('CanelaApp', (data, cb) => { const dom = new jsdom(data.html); const window = dom.window; const nodeList = window.document.querySelectorAll('meta, link'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printIcons(icons, contenitoreIcone) {\r\n icons.forEach((icon)=>{\r\n const {family, prefix, name, color} = icon;\r\n const html =//parte di html\r\n `<div class=\"icon\">\r\n <i class=\"${family} ${prefix}${name}\"\r\n style=\"color: ${color}\"></i>\r\...
[ "0.54543227", "0.5439422", "0.5328025", "0.52895325", "0.5226268", "0.51349616", "0.5128724", "0.50461113", "0.50380284", "0.50334287", "0.50133246", "0.50044465", "0.49836555", "0.49395087", "0.4926294", "0.49044162", "0.48870218", "0.4869319", "0.48454377", "0.48268813", "0...
0.50310814
10
Write out a fresh critical CSS file.
afterEmit(compilation) { HtmlWebpackPlugin.getHooks(compilation) .afterEmit.tapAsync('CanelaApp', (data, cb) => { fs.writeFileSync(__dirname + '/../public/assets/critical.css', "\/* critical *\/\n"); console.log(''); cb(null, data); }, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveStylesheet() {\n console.info( 'Creating stylesheet...' );\n var stylePath = rootPath + styleDirectory + '/style.css';\n fs.unlink( stylePath, function() {} );\n loadUrlSync( webUrl, function( html ) {\n\tvar doc = domino.createDocument( html );\n\tvar links = doc.getElementsByTagName( 'li...
[ "0.6692853", "0.6212091", "0.6124139", "0.611938", "0.5845684", "0.5844624", "0.57792825", "0.5767188", "0.57380235", "0.57201695", "0.56908894", "0.5686763", "0.5650174", "0.56227416", "0.56204987", "0.557047", "0.5547667", "0.553877", "0.5525347", "0.5505568", "0.5501138", ...
0.5224358
61
Here is a shorter solution, which uses the Node.js Buffer class. 1) We create a Buffer object from our hex string, by passing in the string as the first argument, and the form of encoding it's encased in as the second argument. For the Buffer.from() method, the second encoding parameter is optional. 2) We use the toStr...
function hexToBase64(hex) { return Buffer.from(hex, 'hex').toString('base64'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hexToBase64(str) {\n return btoa(String.fromCharCode.apply(null, str.replace(/\\r|\\n/g, \"\").replace(/([\\da-fA-F]{2}) ?/g, \"0x$1 \").replace(/ +$/, \"\").split(\" \")));\n}", "function hexToBase64(hexStr) {\n const hexStrLen = hexStr.length;\n let hexAsciiCharsStr = '';\n for (let i = 0;...
[ "0.760047", "0.72024417", "0.711312", "0.71097064", "0.70995665", "0.70878357", "0.69512457", "0.68600905", "0.6852461", "0.6807979", "0.6780236", "0.6765596", "0.6732694", "0.6732562", "0.6619318", "0.65898454", "0.65255576", "0.65255576", "0.65255576", "0.65255576", "0.6525...
0.76819783
0
Set the width of the side navigation to 0
function closeNav() { document.getElementById("mySidenav").style.width = "0"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"0\";\r\n }", "closeNav() {\n document.getElementById(\"mySidebar\").style.width = \"0\";\n }", "function closeNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"0\";\r\n}", "function closeNav() {...
[ "0.70861566", "0.7049859", "0.7012826", "0.69670886", "0.6955028", "0.6944995", "0.6901262", "0.6897775", "0.6896408", "0.68802017", "0.6876053", "0.6862062", "0.6856591", "0.6856591", "0.6856591", "0.6856591", "0.6856591", "0.6849448", "0.6849448", "0.68392557", "0.6833784",...
0.67424506
68
if you have add options use...
function foo({first=10, second=true} = {}) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExtraOptions(){}", "function ExtraOptions() {}", "function ExtraOptions() {}", "function ExtraOptions() { }", "function ExtraOptions() { }", "get options() {}", "set options(value) {}", "setOptions() {\n let defaultObj = {numChar: 1, limitNum: 3, orderBlock: [\"suggest\",\"collection\...
[ "0.7539808", "0.7404153", "0.7404153", "0.73128444", "0.73128444", "0.7025374", "0.68818724", "0.67700255", "0.67360634", "0.6610176", "0.65881246", "0.6532286", "0.64986706", "0.63931453", "0.63892585", "0.6257206", "0.6201417", "0.6178373", "0.6156559", "0.6155793", "0.6122...
0.0
-1
if you have add options use...
function boo({first="10", second="true"}) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExtraOptions(){}", "function ExtraOptions() {}", "function ExtraOptions() {}", "function ExtraOptions() { }", "function ExtraOptions() { }", "get options() {}", "set options(value) {}", "setOptions() {\n let defaultObj = {numChar: 1, limitNum: 3, orderBlock: [\"suggest\",\"collection\...
[ "0.7540256", "0.74041724", "0.74041724", "0.7312769", "0.7312769", "0.7023645", "0.688161", "0.6769889", "0.6736983", "0.66103274", "0.6586665", "0.6531758", "0.6497744", "0.63920474", "0.6390324", "0.625709", "0.620176", "0.617664", "0.6156994", "0.61553836", "0.6122334", ...
0.0
-1
Returns if a value is really a number
function isNumber(value) { return typeof value === 'number' && isFinite(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function number(value) {\r\n return typeof value === 'number' && !isNaN(value);\r\n }", "__is_number(value) {\n return typeof value === 'number' && isFinite(value);\n }", "function isNumber(value) { return typeof value === \"number\" || value instanceof Number; }", "function IsANumber(value) ...
[ "0.8541772", "0.8474744", "0.8321925", "0.8152208", "0.8102142", "0.810138", "0.80654454", "0.80563766", "0.80538684", "0.80538684", "0.80538684", "0.7961366", "0.7941406", "0.79229546", "0.79135656", "0.79135656", "0.79046243", "0.79016894", "0.7891392", "0.788276", "0.78598...
0.7912306
18
Returns if a value is an array
function isArray(value) { return value && typeof value === 'object' && value.constructor === Array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "is_array(val) {\n return Array.isArray(val);\n }", "function isArray(value) {\n return \"[object Array]\" === Object.prototype.toString.call(value);\n }", "function array$1(value) {\r\n return Array.isArray(value);\r\n }", "isArray(value) {\n return value && typeof value === ...
[ "0.8113176", "0.80553544", "0.80127597", "0.79783845", "0.7966586", "0.7922019", "0.7896964", "0.7883242", "0.7827885", "0.7765991", "0.76819813", "0.7680644", "0.7657303", "0.7606509", "0.76051486", "0.74885064", "0.74571025", "0.7415158", "0.7408967", "0.73971117", "0.73623...
0.7746367
11
Returns if a value is a function
function isFunction(fun) { return fun && {}.toString.call(fun) === '[object Function]'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFunction(value) { return typeof value === \"function\" || value instanceof Function; }", "is_function(value) {\n return typeof(value) === 'function';\n }", "function isFunction (value) {\n return typeof value == 'function';\n }", "function isFunction(value) {\n return typeof value...
[ "0.84933066", "0.84757364", "0.8392715", "0.83643425", "0.83643425", "0.83643425", "0.83568764", "0.8323193", "0.83151305", "0.8311336", "0.8280306", "0.8267837", "0.8267837", "0.82587457", "0.81782097", "0.81590664", "0.8125532", "0.8125532", "0.8125532", "0.8125532", "0.799...
0.7157171
86
Returns if a value is an object
function isObject(value) { return value && typeof value === 'object' && value.constructor === Object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "__is_object(value) {\n return value && typeof value === 'object' && value.constructor === Object;\n }", "function isObject(value) {\n\n\t if (typeof value === 'object' && value !== null &&\n\t !(value instanceof Boolean) &&\n\t !(value instanceof Date) ...
[ "0.84575516", "0.8143963", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.813873", "0.81265956", "0.8116576", "0.81073284", "0.80967337", "0.8052753", "0.7987878", "0.7956878", "0.792610...
0.79625416
20
TODO: Rename Renderer(WebGL|2D).setViewport() to setResolution()
setViewport(width, height) { this.gl.uniform2f(this.resolutionUniform, width, height); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setResolution(width, height) {\n\t\tthis.gl.canvas.width = width;\n\t\tthis.gl.canvas.height = height;\n\t}", "function resizeViewport() {\n\tvar width = window.innerWidth;\n\tvar height = window.innerHeight;\n\trenderer.setSize(width, height);\n\tcamera.aspect = width / height;\n\tcamera.updateProjectionMatrix(...
[ "0.7686386", "0.76066405", "0.7603112", "0.7399996", "0.731307", "0.7279197", "0.7279197", "0.7263052", "0.7263052", "0.72395915", "0.72395915", "0.72395915", "0.72395915", "0.7230719", "0.7193608", "0.7107126", "0.70852166", "0.70553714", "0.7016668", "0.6998213", "0.6997966...
0.8179028
0
TODO(2): burst particle in a particular direction;
function particleBurst(particles, center, color) { const N = randomBetween(...PARTICLES_COUNT_RANGE); for (let i = 0; i < N; ++i) { particles.push(new Particle( center, V2.polar(randomBetween(...PARTICLE_MAG_RANGE), randomAngle()), randomBetween(...PARTICLE_LIFETIME_R...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Burst () {\n\tbursting = true;\n\tfor(var bur : int = 0; bur < 3; bur++){\n\t\tFire ();\n\t\tyield WaitForSeconds (srate);\n\t}\n\tyield WaitForSeconds (.1);\n\tbursting = false;\n}", "moveParticle() {\n if(this.x < 0 || this.x > width)\n this.xSpeed*=-1;\n if(this.y < 0 || this.y > height)...
[ "0.62619126", "0.6206703", "0.5940085", "0.59243244", "0.5917505", "0.5914191", "0.5870162", "0.5868566", "0.57994545", "0.5791479", "0.579013", "0.57725656", "0.57725656", "0.57672125", "0.57629645", "0.5761708", "0.5757607", "0.5740125", "0.5736238", "0.57355183", "0.573212...
0.6153657
2
blocco funzioni funzione che chiede nome utente
function nomeUser(nome){ nome = prompt("Qual è il tuo nome?") return nome }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_my_name(name){\n return name + \" Ubanell\";\n}", "function getUserNameById(id) {\n // codigo\n return \"Regulus\";\n}", "function nombreFuncion(parametro){\n return \"regresan algo\"\n}", "function imprimirNombreMayuscula({ nombre }) { //entre las llaves colocamos el nombre de la prop...
[ "0.71363235", "0.7112581", "0.706951", "0.70364547", "0.70303184", "0.6950047", "0.68647563", "0.68462384", "0.6793971", "0.6732885", "0.67297477", "0.66663843", "0.66438895", "0.6579628", "0.6561211", "0.6551422", "0.653623", "0.653063", "0.65215373", "0.64713603", "0.646289...
0.6586646
13
funzione che chiede sesso utente
function sessoUser(genere){ genere = prompt("Sei uomo o donna?") if(genere != "uomo" && genere != "donna"){ alert("Non fare lo scemo!"); } return genere }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guardarSesion(nombre,contraseña,id){\n sessionStorage.setItem('nombre',nombre);\n sessionStorage.setItem('contraseña',contraseña);\n sessionStorage.setItem('id',id);\n\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id'...
[ "0.67218673", "0.6594907", "0.6594907", "0.6588055", "0.6572396", "0.6569255", "0.6463944", "0.6437649", "0.63669854", "0.630407", "0.62961644", "0.6287128", "0.6285456", "0.6284823", "0.627327", "0.62405705", "0.623709", "0.6230394", "0.62266403", "0.6220836", "0.6184903", ...
0.58875144
50
adds mock values for all the properties on a given model
function mockProperties(db, config = { relationshipBehavior: "ignore" }, exceptions) { return async (record) => { const meta = ModelMeta_1.getModelMeta(record); const props = meta.properties; const recProps = {}; // set properties on the record with mocks const mh = await (aw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initPropertyValues() {\n var propertyNames = Object.keys(model.values);\n propertyNames.forEach(function (propertyName) {\n properties[propertyName] = 'unknown';\n });\n myself.addValue(properties);\n sendCommand(initialCommands);\n}", "_mutateModel() {\n let model = this.get('m...
[ "0.5735605", "0.56056386", "0.5330987", "0.53071994", "0.53066915", "0.5290158", "0.52312714", "0.5156073", "0.51307285", "0.50789505", "0.49778402", "0.49704453", "0.49374133", "0.49311063", "0.49196595", "0.490907", "0.48643187", "0.485927", "0.48461112", "0.4825547", "0.48...
0.6319232
0
! vuex v3.6.2 (c) 2021 Evan You
function i(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:i});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[i].concat(e.init):i,n.call(this,e)}}function i(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.pare...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.6759831", "0.67032593", "0.6644306", "0.62890977", "0.6276258", "0.6252346", "0.6231344", "0.6231344", "0.6231344", "0.6225691", "0.6143966", "0.6115739", "0.6100471", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6060739", "0.6055024", "0.60186625", ...
0.0
-1
! ZRender, a high performance 2d drawing library. Copyright (c) 2013, Baidu Inc. All rights reserved. LICENSE
function qr(e){delete Gr[e]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSurface() {\n wgl.takeBufferData(positionLocation, positionBuffer, 3, gl.FLOAT, false, 0, 0);\n wgl.takeBufferData(normalLocation, normalBuffer, 3, gl.FLOAT, false, 0, 0);\n gl.drawArrays(gl.TRIANGLES, 0, 6 * (map.points.length - 1) * (map.points.length - 1));\n }", "render(r...
[ "0.6583044", "0.65467244", "0.65232277", "0.65232277", "0.65232277", "0.64956135", "0.6454542", "0.6427558", "0.6423321", "0.6347734", "0.6334223", "0.63125217", "0.63120025", "0.6301799", "0.6300941", "0.628176", "0.62767726", "0.62767726", "0.6268511", "0.6268511", "0.62685...
0.0
-1
! vuerouter v3.5.1 (c) 2021 Evan You
function i(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "...
[ "0.5827362", "0.57881236", "0.5779447", "0.5718348", "0.56940615", "0.5667806", "0.56446993", "0.5596583", "0.5562166", "0.5545932", "0.553526", "0.5513425", "0.5509242", "0.5460678", "0.54419667", "0.5400543", "0.5376622", "0.53701186", "0.53701186", "0.53701186", "0.5370118...
0.0
-1
TODO: remove when new collection.
async getAllAcls () { return this._acls.get() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Collection () {}", "function Collection () {}", "function Collection () {}", "function Collection() {}", "function Collection() {}", "function Collection() {}", "get collection() {\n return this._collection;\n }", "constructor(collection) {\n this.collection = collection;\n }",...
[ "0.7186214", "0.7186214", "0.7186214", "0.70812714", "0.70812714", "0.70812714", "0.68737644", "0.67552483", "0.67427075", "0.6564905", "0.6519774", "0.6414939", "0.6402756", "0.6241822", "0.6231285", "0.61722314", "0.6122508", "0.6097402", "0.59954154", "0.59954154", "0.5979...
0.0
-1
TODO: delete when merged with the new collection.
async getRoles () { return [ { id: 'viewer', name: 'Viewer', permissions: [ 'view', ], }, { id: 'operator', name: 'Operator', permissions: [ 'view', 'operate', ], }, { id: 'admin', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear () {\n this._collections = {}\n this._collectionsIndex = {}\n }", "removeAll(collection) {\n this.db.get(collection).remove().value();\n }", "clear(){\n this.collection = {}\n }", "async clear() {\n this.mem.clear();\n try \n {\n //@TODO\n await this.collect.dele...
[ "0.69047797", "0.68425", "0.68420386", "0.6732841", "0.6651612", "0.6286169", "0.6224191", "0.62192786", "0.6197302", "0.6122711", "0.6028088", "0.5995154", "0.5967288", "0.59596014", "0.59594476", "0.59392124", "0.5937135", "0.5930955", "0.5928552", "0.5919175", "0.5892525",...
0.0
-1
Returns an array of roles which have a given permission.
async getRolesForPermission (permission) { const roles = [] forEach(await this.getRoles(), role => { if (includes(role.permissions, permission)) { roles.push(role.id) } }) return roles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getRoles () {\n return [\n {\n id: 'viewer',\n name: 'Viewer',\n permissions: [\n 'view',\n ],\n },\n {\n id: 'operator',\n name: 'Operator',\n permissions: [\n 'view',\n 'operate',\n ],\n },\n {\n ...
[ "0.68681145", "0.65497446", "0.62608415", "0.6101339", "0.6087766", "0.60451174", "0.6029088", "0.59005827", "0.58048767", "0.57877153", "0.5760201", "0.57298195", "0.57294744", "0.562934", "0.56143355", "0.55905646", "0.55541724", "0.5534413", "0.5475769", "0.5456785", "0.54...
0.82094514
0
Defines high level functionality to interact with the OpenSocial API.
function SocialWrapper() { /* * Retrieves the current viewer. */ this.getViewer = function(callback) { osapi.people.getViewer().execute(callback); } /* * Retrieves the current owner. */ this.getOwner = function(callback) { osapi.people.getOwner().execute(callback); } // ------------...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function API(){}", "function API(){}", "function STXSocial(){\n\t\t}", "function ApiClient() {\n\n}", "function Api(){\n}", "function ContentApiClient() {\n\t// use OpenSocial UserPref properties specified in the gadget specification file\n\t// User must include UserPref name=\"contentApiKey\" datatype=\...
[ "0.619487", "0.619487", "0.6116464", "0.5917955", "0.5668311", "0.5577582", "0.54866284", "0.54740435", "0.54156446", "0.54131407", "0.5406292", "0.5395107", "0.53851914", "0.5344232", "0.52833223", "0.52672815", "0.52672815", "0.52672815", "0.5265662", "0.52558416", "0.52526...
0.7145574
0
this is just a regular component class and we can do anything we can do in any stateful component
render(props) { return ( <div className={className}> <WrappedComponent {...this.props}/> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n //Call the constrictor of Super class i.e The Component\n super(props);\n //maintain the state required for this component\n this.state = {}\n }", "constructor() {\n super(); // Gives context for \"this\" within component.\n this.state = { txt:...
[ "0.7305302", "0.7293128", "0.72520375", "0.7249871", "0.7249871", "0.7172561", "0.71206814", "0.7111613", "0.7079586", "0.7065243", "0.7000485", "0.6986053", "0.6986053", "0.69651276", "0.6956097", "0.69353074", "0.6934232", "0.689893", "0.6895897", "0.6878919", "0.6866985", ...
0.0
-1
Set up clock and begin timer
function initializeClock(id, endtime) { var clock = document.getElementById(id); var minutesSpan = clock.querySelector('.minutes'); var secondsSpan = clock.querySelector('.seconds'); function updateClock() { var t = getTimeRemaining(endtime); minutesSpan.innerHTML = ('0' + t.minutes).slice(-2); se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startClock(){\n\tt = getTime();\n\tsetNum(\"sec2\" ,t[\"s2\"]);\n\tsetNum(\"sec1\" ,t[\"s1\"]);\n\tsetNum(\"min2\" ,t[\"m2\"]);\n\tsetNum(\"min1\" ,t[\"m1\"]);\n\tsetNum(\"hours2\" ,t[\"h2\"]);\n\tsetNum(\"hours1\" ,t[\"h1\"]);\n\tupdateTimer = setTimeout(\"updateClock()\",5000)\n\t //console.debug(\"call...
[ "0.815756", "0.75847155", "0.7478653", "0.7453023", "0.7323545", "0.73127854", "0.7284686", "0.726527", "0.72609484", "0.72483367", "0.71963596", "0.71689785", "0.7168745", "0.7166735", "0.71661246", "0.7145254", "0.7128679", "0.7117845", "0.70721817", "0.7067164", "0.7061705...
0.0
-1
HOURGLASS NAVBRAND Animation to fill the hourglass
function hourglassFill() { let hourglass = document.getElementById('hourglass'); hourglass.innerHTML = "&#xf251"; // half setTimeout(function () { hourglass.innerHTML = "&#xf252"; }, 1000); // end setTimeout(function () { hourglass.innerHTML = "&#xf253"; }, 2000); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function homeAnim() { //homepage animation on load \n qsCl(\"home__logo-fill\").left = '-177px';\n qsCl(\"home__logo-dolya\").color = 'black';\n qsCl(\"home__logo-consulting\").color = 'black';\n qsCl(\"home__logo-frame\").opacity = '1';\n q...
[ "0.7071276", "0.6356108", "0.6270192", "0.62678266", "0.62135303", "0.62122375", "0.6208566", "0.62080795", "0.6053805", "0.6037372", "0.5994041", "0.5973064", "0.59435505", "0.5935418", "0.5926579", "0.5914026", "0.5882113", "0.5873405", "0.5864898", "0.58519953", "0.5851683...
0.6848785
1
Validate network parameter is a `mainnet` or `testnet` string.
function validateNetwork (network) { if (network === undefined || network === null) { return false } else if (network !== 'mainnet' && network !== 'testnet') { return false } else { return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ValidateNetwork (network) {\n if (network === undefined || network === null) {\n return false\n } else if (network !== 'mainnet' && network !== 'testnet') {\n return false\n } else {\n return true\n }\n}", "validateNetwork (addr) {\n try {\n const network = process.env.NETWORK\n\n ...
[ "0.8052447", "0.7080785", "0.70694757", "0.6679675", "0.66286516", "0.6613834", "0.5829507", "0.57188237", "0.5633181", "0.56043285", "0.5542613", "0.5542613", "0.54902816", "0.54722834", "0.54165494", "0.54165494", "0.53988343", "0.53988343", "0.5396442", "0.53918546", "0.53...
0.80131143
1
Validates the given WIF.
function validateWIF (wif) { if (wif === undefined || wif === null) { return false } else { return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isWIF(wif) {\r\n try {\r\n if (wif.length !== 52) {\r\n return false;\r\n }\r\n const hexStr = u_1.ab2hexstring(bs58_1.default.decode(wif));\r\n const shaChecksum = u_1.hash256(hexStr.substr(0, hexStr.length - 8)).substr(0, 8);\r\n return shaChecksum === he...
[ "0.63890404", "0.59706813", "0.52118075", "0.51397705", "0.5045145", "0.5033053", "0.50282395", "0.5016013", "0.5006235", "0.500359", "0.49929506", "0.49508405", "0.49105787", "0.48706943", "0.48420683", "0.4830022", "0.4811846", "0.48012662", "0.47833633", "0.47808275", "0.4...
0.78081703
0
Generates a new WIF.
function createWIF (network, compressed) { if (!validateNetwork(network)) { throw new Error('Invalid network choice') } var data = { bn: zcash.PrivateKey._getRandomBN(), compressed: typeof compressed !== 'boolean' ? true : compressed, network } return new zcash.PrivateKey(data).toWIF() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_op_wfi()\n{\n gen_opc_ptr.push({func:op_wfi});\n}", "function gen_op_neon_bif()\n{\n gen_opc_ptr.push({func:op_neon_bif});\n}", "function generateItinerary() {\n\tpopulateItinerary();\n\topenInfoWindows();\n}", "function gen_op_swi()\n{\n gen_opc_ptr.push({func:op_swi});\n}", "functio...
[ "0.66222906", "0.56624824", "0.55799216", "0.5444983", "0.54080987", "0.5396815", "0.53414994", "0.53231007", "0.53023994", "0.5292649", "0.5279261", "0.5278707", "0.5238319", "0.5232339", "0.51933616", "0.5175591", "0.5169369", "0.5160166", "0.5141509", "0.511652", "0.511399...
0.5704328
1
Converts a provided WIF string to a public key string.
function convertWIFToPublicKey (wif, network) { if (!validateNetwork(network)) { throw new Error('Invalid network choice') } if (!validateWIF(wif)) { throw new Error('Invalid WIF key') } return new zcash.PrivateKey(wif, network).toPublicKey() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "marshalPubKey () {\n if (this.pubKey) {\n return crypto.keys.marshalPublicKey(this.pubKey)\n }\n }", "marshalPubKey () {\n if (this.pubKey) {\n return crypto.keys.marshalPublicKey(this.pubKey)\n }\n }", "marshalPubKey () {\n if (this.pubKey) {\n return crypto.keys.marshalPublicK...
[ "0.59582675", "0.59582675", "0.59582675", "0.5954521", "0.5941088", "0.59258753", "0.58962953", "0.5892147", "0.5809225", "0.57796204", "0.5692396", "0.56697327", "0.55999225", "0.5583808", "0.5567629", "0.5564273", "0.55324966", "0.55324966", "0.55324966", "0.55324966", "0.5...
0.7218251
0
Converts a provided WIF string to an address string.
function convertWIFToAddress (wif, network) { if (!validateNetwork(network)) { throw new Error('Invalid network choice') } if (!validateWIF(wif)) { throw new Error('Invalid WIF key') } return new zcash.PrivateKey(wif, network).toAddress() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertAddress(s) {\n var chars = [];\n for (var i = 0; i < s.length; i += 1) {\n var code = s.charCodeAt(i);\n if (code >= 0x2400) {\n code -= 0x2400;\n }\n chars.push(String.fromCharCode(code));\n }\n return chars.join('');\n}", "function evmWordToAdd...
[ "0.6010064", "0.559896", "0.5370263", "0.53583217", "0.5216323", "0.5154826", "0.51471627", "0.51261777", "0.5052774", "0.50337636", "0.5026498", "0.5023944", "0.5017978", "0.49554285", "0.49235746", "0.49104515", "0.48902005", "0.48764288", "0.4863135", "0.4822425", "0.48040...
0.69953054
0
Generates a new transaction from a WIF, list of UTXOs, receiver, & amount.
function createTransaction (wif, utxos, receiver, amount, network) { if (!validateNetwork(network)) { throw new Error('Invalid network choice') } if (!validateWIF(wif)) { throw new Error('Invalid WIF key') } var key = new zcash.PrivateKey(wif, network) var transaction = new zcash.Transaction() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static constructTransaction (params, files) {\n // return an array of UTXOs for this user\n networkManager.findUTXOsByAddress(window.config.userAddress).then((allUTXOs) => {\n var transaction = new bch.Transaction()\n // pay the parent address the amount provided\n transaction.to(bchaddr.toLeg...
[ "0.6575279", "0.6540724", "0.6484156", "0.63074005", "0.6157999", "0.60246867", "0.59470403", "0.5934711", "0.5898977", "0.5842532", "0.58405274", "0.5725894", "0.5713582", "0.56535476", "0.5631843", "0.5629554", "0.56087136", "0.5601808", "0.5575501", "0.5556853", "0.5537214...
0.78024983
0
Needs to be made more solid for types
function parseInfo (type, name, back) { var arr = name.split('.'); var ext = arr[arr.length -1]; var container = mime.extension(type); var id = uuid(); var newName = id + '.' + ext; back(null, container, id, newName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Type() {}", "function Type() {\r\n}", "function StructType() {}", "getType() {}", "private public function m246() {}", "function UnderreactType() {}", "getType(){return this.__type}", "function Type() {\n}", "get type() {}", "type() { }", "type(_obj) {\n return this.typeChr(_obj);\n...
[ "0.6239472", "0.59607106", "0.5886827", "0.5855317", "0.5842725", "0.5786043", "0.57730764", "0.5752277", "0.5733487", "0.5722067", "0.570658", "0.5678705", "0.55994874", "0.5553595", "0.5553595", "0.5553595", "0.55492276", "0.55109113", "0.5457769", "0.5444623", "0.5425831",...
0.0
-1
function removes escape characters from lyrics and counts word occurence
function wordFreq(songLyrics) { //set all lyrics to lowerCase to Capital letters do not create duplicates let words = songLyrics.toLowerCase().replace(/[.]/g, '').split(/\s/); words.forEach(function (lyric) { //check for two character or less and 'the if (lyric.length <=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preprocessLyrics (lyrics) {\n var wordCountMap = {}\n\n for (var song of lyrics) {\n var songLyric = song['lyrics']\n var language = song['language']['language']\n // musixmatch remove free version tags in lyrics\n // songLyric = songLyric.split('...')[0]\n\n // re...
[ "0.6482251", "0.6465687", "0.63769966", "0.6286604", "0.62207425", "0.61846894", "0.6156857", "0.61513036", "0.6150932", "0.61411965", "0.60401297", "0.60262585", "0.6007617", "0.6007617", "0.5956853", "0.593896", "0.593896", "0.5930022", "0.59291583", "0.5929045", "0.5925155...
0.5842872
29
function to make an array of objects that are ordered by word occurence
function sortedArray(freqLyric) { let lyricsArray = Object.keys(freqLyric).map(function (lyric) { //returns object return { word: lyric, total: freqLyric[lyric] }; }).sort(function (a, b) { return b.total - a.total; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordCountSortByOccurance(text) {\n var storage = new Dictionary();\n for (var word of text.toLowerCase().split(' ')) {\n if (!storage.find(word)) {\n storage.add(word,1);\n } \n else {\n storage.dataStore[word] += 1;\n }\n }\n // sort\n var ...
[ "0.68459386", "0.6575052", "0.6503305", "0.64809674", "0.64809674", "0.6357286", "0.6320948", "0.6311043", "0.6264186", "0.62206036", "0.6218883", "0.61739", "0.60908145", "0.6089685", "0.60385144", "0.6008425", "0.59957", "0.5978081", "0.5930686", "0.5930577", "0.5907451", ...
0.5598932
55
This file is automatically included by javascript_include_tag :defaults Function to load url in active tab.
function loadUrlInActiveTabInSet(tabs, url) { var selected = tabs.tabs('option', 'selected'); tabs.tabs('url', selected, url); tabs.tabs('load', selected); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadOneTab() { }", "function activateTab(contentPath){\n if(contentPath == 'view/HomeView.php'){\n $('#home').load('view/header_img.html');\n $('#myNavbar').removeClass('white');\n $('#home').show();\n }else{\n $('#home').hide();\n $('#myNavbar').addClass('white');\n }...
[ "0.6510794", "0.6472169", "0.64292914", "0.6173614", "0.61544347", "0.614721", "0.6069381", "0.6003223", "0.5968839", "0.5913539", "0.59012437", "0.5876092", "0.5845046", "0.58219475", "0.58155686", "0.580106", "0.5765498", "0.5750069", "0.57433486", "0.5740446", "0.5688754",...
0.6137295
6
Buttons that load in active tab.
function createLoadInActiveTabButton(element, url) { element .button() .bind('click', function() { loadUrlInActiveTab(url); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupTabs(){\n const content = document.getElementById('content');\n buttons = Array.from(content.getElementsByTagName('button'));\n\n buttons.forEach(button => {\n button.addEventListener(\"click\", changeTab);\n });\n\n loadHome();\n buttons[0].classList.add('button-active');\n}...
[ "0.6956045", "0.6937151", "0.6649178", "0.661526", "0.64952624", "0.6480539", "0.6473551", "0.64399683", "0.6429949", "0.64273673", "0.64216423", "0.6414491", "0.6357364", "0.63388664", "0.633014", "0.6325014", "0.6320139", "0.63120866", "0.6302412", "0.62569225", "0.6249268"...
0.69879514
0
var parent = parent; var element = element;
function addClasses(){ var scroll = $(window).scrollTop(); var parentPos = parent.offset().top; //console.log(parentPos,'parentPos',parent,element); if(!element.is('.noSticky')){ //console.log((parentPos + parent.outerHeight() - element.outerHeight()-(num*2)), scroll,parentPo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParent(elem) {\n return elem.parent || null;\n}", "function getParent(elem) {\n return elem.parent || null;\n}", "function getParent(elem) {\n return elem.parent || null;\n}", "function getParent(elem) {\n return elem.parent || null;\n}", "function getParent(elem) {\n return elem...
[ "0.6793868", "0.6793868", "0.6793868", "0.6793868", "0.6793868", "0.6793868", "0.6783954", "0.6744389", "0.6643215", "0.66325223", "0.66112787", "0.65677613", "0.6555846", "0.6433812", "0.63733745", "0.632846", "0.63162076", "0.6294795", "0.6289177", "0.62862754", "0.6274742"...
0.0
-1
Add the sticky class to the header when you reach its scroll position. Remove "sticky" when you leave the scroll position
function HeaderStickyD() { var scroll = $(window).scrollTop(); var validScroll = true; if(window.outerWidth <= 640){ if($('.main-menu__list').is('.is-opened')){ validScroll = false; } } if(validScroll){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function headerScroll() {\n // if the user scrolls (pageYOffset) past the header's position, add the sticky class\n if (window.pageYOffset > sticky) {\n header.classList.add(\"sticky\");\n } else {\n header.classList.remove(\"sticky\");\n }\n}", "function onScrollFuntion(position, header) {\n if...
[ "0.8742538", "0.86129445", "0.8571516", "0.8528133", "0.8518923", "0.84799224", "0.84613436", "0.8451264", "0.8441938", "0.84160185", "0.8277843", "0.8131547", "0.8079652", "0.80740786", "0.80502003", "0.80338526", "0.80338526", "0.80338526", "0.80338526", "0.80338526", "0.80...
0.7605642
50
check obj type with .constructor
function joinDogFraternity(candidate) { return candidate.constructor === Dog ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}", "function isInstance(obj,type){return obj instanceof type||obj!=null&&obj.constructor!=null&&obj.constructor.name!=null&&obj.constructor.name===type.name;}"...
[ "0.7149329", "0.7149329", "0.7149329", "0.69906205", "0.6985904", "0.6954965", "0.6926437", "0.69238573", "0.6919862", "0.6831397", "0.68277836", "0.66807723", "0.66652143", "0.66395384", "0.66395384", "0.66395384", "0.66395384", "0.66395384", "0.66395384", "0.66395384", "0.6...
0.0
-1
Change the Prototype to a New Object note: must set the constructor again!
function Dog(name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NewObj(){}", "function Prototype() {\n }", "function NewObj() {}", "function PrototypeBasedClass () {\n}", "function createObject(proto) {\n var f = function () { };\n f.prototype = proto;\n return new f();\n }", "function createObject(proto) {\n\t\tvar f = functio...
[ "0.70734644", "0.703109", "0.6921854", "0.67579746", "0.64270973", "0.640163", "0.6378718", "0.6339647", "0.6339647", "0.6339647", "0.6339647", "0.6339647", "0.6339647", "0.6339647", "0.6339647", "0.6332859", "0.62698936", "0.616717", "0.60916317", "0.60916317", "0.60916317",...
0.0
-1