query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
ea01a1d8c2bd71d254b5d1a3a4fb5999
Best/average case = O(nlogn) time Worst = O(n^2) time if data was already sorted O(logn) space complexity
[ { "docid": "e77e7feac25613a765a8b82fe5bff9b0", "score": "0.0", "text": "function swap(arr, j, i) {\n let temp = arr[j];\n arr[j] = arr[i];\n arr[i] = temp;\n}", "title": "" } ]
[ { "docid": "8a62f817481470c930a5212c3090789d", "score": "0.67992866", "text": "function test2(input) {\n const pi = 3.14; // O(1)\n let found = false; // O(1)\n let sorted = null; // O(1)\n let testCase = 0; // O(1)\n let secondCase = 1; // O(1)\n // O(n)\n for (let i = 0; i < input.length; i++) ...
40eaaa7cc96c136014010fefd762b958
artifact from original code
[ { "docid": "1848ac8399c70ca7e7b1527dc2e07476", "score": "0.0", "text": "function chapterCompare (aChaps, bChaps) {\n if (aChaps[0] != bChaps[0])\n return bChaps[0] - aChaps[0];\n else if (aChaps[1] != bChaps[0])\n return bChaps[1] - aChaps[1];\n else if (aChaps[2] != bChaps[2])\n ...
[ { "docid": "7a811bb22b90fc04edbded1dc5f30586", "score": "0.54217154", "text": "function part2lib(part){\n\n\n\n\n\n}", "title": "" }, { "docid": "d6aa4852c18130f8ea757f1d1b269dcd", "score": "0.5388762", "text": "function utility() {}", "title": "" }, { "docid": "86830aac3...
26b91769c6ce937a222d88b3d0794aa3
Creates a rectangle object.
[ { "docid": "93766a53a5aeb54dbf5e9bfcb9db84e5", "score": "0.0", "text": "function s(e,t,r,n){return{x:e,y:t,width:r,height:n}}", "title": "" } ]
[ { "docid": "6059e3e310311360a6da1f587406120b", "score": "0.8172097", "text": "function Rectangle(left, top, width, height) {\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n }", "title": "" }, { "docid": "5006656de81d87d6ef3be2b0eeed...
76886627dca1f83b6f542a951e9e32c4
get lat lng form zip code
[ { "docid": "d990577df0216c2bdfce4400f2a22c78", "score": "0.0", "text": "function initialize(callback) {\n var price_ = true; // hide old price\n\n\n var center = new google.maps.LatLng(1.26630900, 103.81401500);\n var radius_circle = 500; // 500m\n var markerPositions = [];\n\n markerPosi...
[ { "docid": "f7bfdd50a0bfab49df57a9a005144001", "score": "0.7608761", "text": "function geofromZIP(zip, callback){\n\trequest('https://maps.googleapis.com/maps/api/geocode/json?address='+zip+'&key=AIzaSyCP9syBFfHu5zfVSavGJLWS3f8bzL5mKMI', function(error, response, body){\n\t\t\tvar data = JSON.parse(body...
0e520b23f53ac5951a2c2a7af62f08ef
Returns true if object o has a key named like every property in the properties array. Will give false if any are missing, or if o is not an object.
[ { "docid": "412e1c4f4b30a8fb2fc2ada4b55bdfb5", "score": "0.66418964", "text": "function hasAllProperties(fieldList, o) {\n\n return (o instanceof Object) \n &&\n all(function (field) { \n return (field in o); \n }, fieldList)...
[ { "docid": "ce648b7e11514e998d64de3c4cf828cf", "score": "0.7478394", "text": "function hasProperties(object) {\n //return Array.prototype.every.call(Array.prototype.slice.call(arguments,1),(function (x) { return x in object}));\n for (var i = 1; i < arguments.length; i++) {\n if...
80199d70394f0ce5e6b355a588850ec6
Get the text of a section based on the type
[ { "docid": "a6ac7a5d16c3cef533275e8ca2a06ad3", "score": "0.7733724", "text": "function getSectionText(section) {\n\tswitch (section.getAttribute(\"type\")) {\n\t\tcase \"document-description\": return getDocumentDescriptionText(section);\n\t\tcase \"title\": return getTitleText(section);\n\t\tcase \"aut...
[ { "docid": "6677a8d121d3cd7c1801a4c91bf97b1d", "score": "0.57682514", "text": "getLinkText(type) {\n var $text = 'View ' + type;\n if (type == 'Collection') {\n $text = 'Learn More';\n }\n ...
0c74189fc897111debdeacc7d2a75783
data = data[0]; console.log(data)
[ { "docid": "f8cae5eb5826c8553c720a2093794a6b", "score": "0.0", "text": "function myIndexOf(voter_id) {\n\t\t\tif (data.polls.length === 0) {\n\t\t\t\treturn -1;\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < data.polls.length; i++) {\n\t\t\t\t\tfor (var j = 0; j < data.polls[i].voters.length; j++) {\n\t\t...
[ { "docid": "89af5720bb16171b2e047f3ce1e40951", "score": "0.7573702", "text": "function first(data) {\n return data[0];\n}", "title": "" }, { "docid": "0a7a525ae432396b00d31ae81f5c385e", "score": "0.6645219", "text": "function tampilkanData(dataRAW) {\n console.log(\"Status: \" + ...
57c565531f2f5feabe6202cce27ae82b
Supporting extension for displaying tooltips. Allows / [`showTooltip`](tooltip.showTooltip) to be used to define / tooltips.
[ { "docid": "75aa251cd5d99dfb90484b5322351ef7", "score": "0.68179584", "text": "function tooltips() {\r\n return view_1.EditorView.extend.fallback(tooltipExt);\r\n}", "title": "" } ]
[ { "docid": "747f396fe7f66045cbeeb50fca3cb2b8", "score": "0.74177265", "text": "function Tooltip(){}", "title": "" }, { "docid": "9b2d99c6083fbf4225ec4bd333f838e9", "score": "0.7300087", "text": "get tooltip() {}", "title": "" }, { "docid": "5c7fb04c2a357e92f61c82a5efaff9a...
b681c29aedaacaa51c704ccff815a844
This function is called when the user clicks on Upload to Parse. It will create the REST API request to upload this image to Parse.
[ { "docid": "c4bfef492958fd5bfe8e91bb4f46cd2f", "score": "0.0", "text": "function signuporiginal() {\n var pw = document.forms['signup']['password'].value;\n var pwc = document.forms['signup']['password-confirm'].value;\n pw = document.forms['signup']['password'].value.trim();\n email = docum...
[ { "docid": "63fcb1b841037cad6a4169d99bee0488", "score": "0.7194403", "text": "upload() {\n var params = $('#submitForm').serialize();\n var image_upload = this;\n\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.open('POST', '/repository/file/upload?encoding=base64&_token=' + ...
72ded401ee95f63d0ac58426c182b0bb
Reads a local Javascript file and returns it in minified form.
[ { "docid": "32a1d0aaffffc9bac0e7058108eae349", "score": "0.740031", "text": "function minifiedJS(filename) {\n var ast = uglify.parser.parse(fs.readFileSync(filename, 'utf-8'));\n ast = uglify.uglify.ast_mangle(ast);\n ast = uglify.uglify.ast_squeeze(ast);\n return uglify.uglify.gen_code(ast...
[ { "docid": "af72bd6a52b83f41f3d00015a252aa03", "score": "0.7184459", "text": "function readjs(path) {\n return read(path) + '\\n';\n}", "title": "" }, { "docid": "455e5e7b85dea7c9440c476b54550ca7", "score": "0.666153", "text": "function js() {\n return src('./themes/uncompiled/js...
0fcaf2c86e2434d3567514c86a344804
Detect if the user is moving towards the currently activated submenu. If the mouse is heading relatively clearly towards the submenu's content, we should wait and give the user more time before activating a new row. If the mouse is heading elsewhere, we can immediately activate a new row. We detect this by calculating ...
[ { "docid": "dc51c6649701dfff956d8aaddf1d360c", "score": "0.0", "text": "function slope(a, b) {\n return (b.y - a.y) / (b.x - a.x);\n }", "title": "" } ]
[ { "docid": "ab20dd29b80f71084de2c88b195db83c", "score": "0.6896019", "text": "function activationDelay() {\n if (!activeRow || !matchesSelector(activeRow, options.submenuSelector)) {\n // If there is no other submenu row already active, then\n // go ahead and activate immedi...
f603fc3f4b39368a40baa99c2b13c228
An algorithm for picking the Best from an array based on fitness
[ { "docid": "825453bad8722b767803e9559c367bad", "score": "0.66225004", "text": "function SelectTheBestOne(EvPac) {\n // // Start at 0\n // let index = 0;\n //\n // // Pick a random number between 0 and 1\n // let r = random(1);\n //\n // // Keep subtracting probabilities until you get less than ze...
[ { "docid": "60f8cad247c971394ce4243cb3702c68", "score": "0.720996", "text": "fittest () {\n let fittestValue = this.tours[0].fitness(),\n fitValue = 0;\n this.bestTourIndex = 0;\n for (let i = 1; i < this.tours.length; i++) {\n fitValue = this.tours[i].fitness(...
db4908fa5347a777b31f9792b49b97fd
const redis = require( "../../main.js" ).redis; const RU = require( "../utils/redis_Utils.js" ); const RC = require( "../CONSTANTS/redis.js" ).YOU_TUBE;
[ { "docid": "8191acbdbef60cd3c298dc82ff24fafd", "score": "0.0", "text": "function wStart( wOptions ) {\n\treturn new Promise( async function( resolve , reject ) {\n\t\ttry {\n\t\t\tif ( !wOptions.playlist_id ) { resolve( \"no playlist given\" ); return; }\n\t\t\tawait require( \"../utils/generic.js\" ).s...
[ { "docid": "7704c02124c3d6d50e0e3152a4251171", "score": "0.5703485", "text": "init() {\n return new Promise(async (resolve, reject) => {\n const redis = require('redis');\n\n let connection = require(\"../redis-connection.json\")\n\n let config = {\n ...
607469208563006e8a65420172f92292
Logs a user into their accoutn with a given username and password
[ { "docid": "2de90f874ef1728abd9dde5966c82153", "score": "0.0", "text": "async function login() {\n let loginData = new FormData(id(\"account\"));\n let loginResponse = await fetch(\"/login\", {method: \"POST\", body: loginData});\n try {\n let loginMessage = await checkStatus(loginResponse...
[ { "docid": "867af2c677080781c3ea61752cb21650", "score": "0.7092323", "text": "function doLogin(accountName, password, authCode, captcha) {\r\n\tuser.logOn({\r\n\t\taccountName: accountName,\r\n\t\tpassword: password,\r\n\t\ttwoFactorCode: authCode,\r\n\t\tcaptcha: captcha\r\n\t})\r\n}", "title": "" ...
3ab212d67275632838c26facaff8cace
Removes all keyvalue entries from the map.
[ { "docid": "a1c16153d9285b507b13d1c4bf2b381b", "score": "0.0", "text": "function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}", "title": "" } ]
[ { "docid": "574d77f7913e6848e941f6545f0cc50c", "score": "0.6668894", "text": "clear() {\n\t\tthis.keys().forEach((key) => {\n\t\t\tkey = this.serializeKey(key);\n\t\t\tthis._delete(key);\n\t\t});\n\t}", "title": "" }, { "docid": "66a250691085b70196d7eb7792bc8f97", "score": "0.66167337", ...
80cae9ad7cb13b53a865b9b8d72f7082
============================================== Mostrar todos los rankings ==============================================
[ { "docid": "101b81a1d525c074772baf38f6591971", "score": "0.65028936", "text": "async function getRankings(req, res) {\n try {\n const rankings = await Ranking.findAll();\n successMsg(res, 200, 'correcto', rankings)\n } catch (error) {\n errorMsg(res, 500, 'Ha ocurrido un error...
[ { "docid": "1dbba026345c68860d7722a33127a75d", "score": "0.7515651", "text": "function getRank(){\r\n let url=\"https://blooming-garden-19866.herokuapp.com\";\r\n fetch(url)\r\n\t\t\t\t.then(checkStatus)\r\n\t\t\t\t.then(function(responseText) {\r\n let json = JSON.parse...
7bc8178c8a37051bcb72ed5df0cab35e
Converts a decimal to a hex value
[ { "docid": "1ffd14ee2f8c4c71c1e80c3d7495cbac", "score": "0.7507011", "text": "function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }", "title": "" } ]
[ { "docid": "0f74c7b04c41a26555442190c3b46e14", "score": "0.77600384", "text": "function convertDecimalToHex(d){return Math.round(parseFloat(d)*255).toString(16);}", "title": "" }, { "docid": "5292e775163b70a4dda95609d8dcbca6", "score": "0.76438844", "text": "function hex (dec) {retur...
4984fc3578294e606e61921f665e92d9
Realiza la carga de informacion en los labels correspondientes.
[ { "docid": "7d65d42788ac769e82754ae786e8e639", "score": "0.0", "text": "function cargarinfo(argument){\r\n\tid=argument[7];\r\n\t$.Lbl_NombreEjercicio.text=argument[0];\r\n\t$.Lbl_DescripcionEjer.value=argument[1];\r\n\t$.Lbl_Serie.text=\"Serie:\"+argument[6];\r\n\t$.Lbl_Repetecion.text=\"Repetición:\"+...
[ { "docid": "9221a5dac9231f6690bbc84074e7b2b0", "score": "0.6522767", "text": "function setLabels(){\n catVal = $('#catChild').val();\n if(!catVal){\n catVal = $('#catMain').val();\n }\n common_labels = {\n 0: 'Частное',\n 1: 'Коммерческое'\n ...
3786b60b9234e14d034a7ce0e5c77685
define function to help d3 find min and max values for a selected field
[ { "docid": "edd4ad20db845600df1822f84fb759d5", "score": "0.0", "text": "function returnValue (d) {\n return d[selectedField];\n }", "title": "" } ]
[ { "docid": "1a2e94c80ad91ad7fdb61979856ea6e1", "score": "0.7703714", "text": "function findMinAndMax(dataColumn) {\n rMin = d3.min(dataset, function (d) { return (d[dataColumn]) });\n rMax = d3.max(dataset, function (d) { return (d[dataColumn]) });\n}", "title": "" }, { "docid": "494fb...
6377727f850e1dbe3f2d13b0ab5decf2
Given two schemas, returns an Array containing descriptions of all the types of potentially dangerous changes covered by the other functions down below.
[ { "docid": "5759ce6282296306ec9a12a9420e9592", "score": "0.69837254", "text": "function findDangerousChanges(oldSchema, newSchema) {\n return findArgChanges(oldSchema, newSchema).dangerousChanges.concat(findValuesAddedToEnums(oldSchema, newSchema), findInterfacesAddedToObjectTypes(oldSchema, newSchema)...
[ { "docid": "8d4cfe8a22cf5625860147ac303bacb6", "score": "0.72050905", "text": "function findDangerousChanges(oldSchema, newSchema) {\n\t return [].concat(findArgChanges(oldSchema, newSchema).dangerousChanges, findValuesAddedToEnums(oldSchema, newSchema), findInterfacesAddedToObjectTypes(oldSchema, newS...
980867e88c09e7da7c76e1224f9e70cb
4 byte signature "PACK" 4 byte version number 4 byte number of objects
[ { "docid": "ac39db2efe10c115c5d6c28e11c63860", "score": "0.50455505", "text": "function $header(chunk, offset) {\n // Wait till we have at least 12 bytes\n if (chunk.length < offset + 12) return;\n // Verify the first 8 bytes to be as expected\n if (!(\n chunk[offset + 0] == 0x50 && chu...
[ { "docid": "860a333953e695526cda8c9694789cdc", "score": "0.61356086", "text": "signatureExport(obj, sig) {\n const sigR = sig.subarray(0, 32);\n const sigS = sig.subarray(32, 64);\n if (new BN(sigR).cmp(ecparams.n) >= 0) return 1;\n if (new BN(sigS).cmp(ecparams.n) >= 0) return 1;\n const...
5c2d2d6f27f382e30ca403a3d72580da
Function to render all our app.
[ { "docid": "2b514140ef4d1b44be7bc49829e9bae5", "score": "0.0", "text": "render() {\n const dataToPassToModal = {\n modalType: this.state.modalType,\n show: this.state.isShowingModal,\n name: this.state.name.value,\n age: this.state.age,\n close: this.closeModalHandler,\n ...
[ { "docid": "165b4fe73f4974658100af1ba6ca2c4c", "score": "0.73751706", "text": "function renderApp() {\n\tconst id = 'app-template';\n\tconst app = Framework.templateToElement(id);\n\n\tconst header = renderHeader();\n\taddHeaderListeners(header);\n\tapp.appendChild(header);\n\n\tconst list = renderList(...
3c786d52da8371ec457205dbcd92d043
Gets the Y position of the cell within the content.
[ { "docid": "eb24bf2bb51799a6af406611bb76154e", "score": "0.0", "text": "get y() {\n return this.i.cd;\n }", "title": "" } ]
[ { "docid": "e9389616fcab522cfe20a619667b2f93", "score": "0.7240178", "text": "function posY(elem) {\n // Get the computed style and get the number out of the value\n return parseInt(getStyle(elem, \"top\"));\n}", "title": "" }, { "docid": "8610bf60a9356b9970e84fb1e561315b", "score": "0...
1094ce1d6bea8940d3a8958d476931dd
Active Threads Over Time
[ { "docid": "af8247978c26437a35c2e2f0cc42cf62", "score": "0.0", "text": "function refreshActiveThreadsOverTime(fixTimestamps) {\r\n var infos = activeThreadsOverTimeInfos;\r\n prepareSeries(infos.data);\r\n if(fixTimestamps) {\r\n fixTimeStamps(infos.data.result.series, -10800000);\r\n ...
[ { "docid": "59e7e5276ca978fa9c260f9ab88f1a58", "score": "0.6380148", "text": "function upThreadCount () {\n\t\tctConcurrentThreads++;\n\t\twatchLog.stats.ctCurrentThreads = ctConcurrentThreads;\n\t\tviewStats ();\n\t\t}", "title": "" }, { "docid": "ca8570f6b3e00e62871e85a9af141327", "sco...
d998b57785e454c92c56197302646731
Get details about video like title, upload date, etc.
[ { "docid": "f8f33cc822cd2a93980bc678f0be915f", "score": "0.7216099", "text": "async function getVideoInfo(videoId) {\n console.log('`getVideoInfo` ran');\n\n // Create parameters for API query\n const queryParameters = {\n key: apiInfo.youtube.key,\n part: 'snippet',\n id: ...
[ { "docid": "90f50cecd43d9de18e193feeef77aa2f", "score": "0.7227954", "text": "onCreateVideoDetailsRequest() {\n const request = gapi.client.youtube.videos.list({\n id: this.id,\n part: \"snippet,contentDetails,statistics\"\n });\n request.execute(response => {\...
5c38eccdadd9eb152468e3343e89c9b1
Function for retrieving data
[ { "docid": "55b82de3e63e9c214417a52125ae899f", "score": "0.0", "text": "function showMovieData() {\n getAjaxData(\n \"https://gist.githubusercontent.com/pankaj28843/08f397fcea7c760a99206bcb0ae8d0a4/raw/02d8bc9ec9a73e463b13c44df77a87255def5ab9/movies.json\"\n )\n .then(data => {\n ...
[ { "docid": "8856f12656a76fed3ecb65aeeac54eca", "score": "0.73744476", "text": "getData(){}", "title": "" }, { "docid": "febd0b84794db16f3a4cd0d1d248e0b0", "score": "0.71096563", "text": "function getAllData() {\n return db.get('data').value();\n}", "title": "" }, { "do...
0bcb50c97fb25badd0d4ec429950d220
returns the number of open sites
[ { "docid": "ba82f5cc630f00f3341661f55ee202ed", "score": "0.7709405", "text": "numberOfOpenSites() {\n return this.grid.openNodes;\n }", "title": "" } ]
[ { "docid": "a434251f3052f4cd92a8b69ed30f8bbb", "score": "0.6692471", "text": "function count_sites() {\n\t$.post('check.php', {\n\t\t\tname: \"none\",\n\t\t\taction: \"count\",\n\t\t\ttype: \"site\"\n\t\t})\n\t\t.done(\n\t\t\tfunction (data, status) {\n\t\t\t\tcount = JSON.parse(data);\n\t\t\t\t$('#site...
d9dde76cb3c64215ece1e5dec804049a
Handles responses to an ajax request: sets all responseXXX fields accordingly finds the right dataType (mediates between contenttype and expected dataType) returns the corresponding response
[ { "docid": "933f8069c866657bdd75ef5c6d1a6a28", "score": "0.7809227", "text": "function ajaxHandleResponses(s, jqXHR, responses) {\n var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes, responseFields = s.responseFields;\n // Fill responseXXX fields\n for (...
[ { "docid": "b4c9e7c928a73858567d20b933cb9f89", "score": "0.8113504", "text": "function ajaxHandleResponses(s,jqXHR,responses){var ct,type,finalDataType,firstDataType,contents=s.contents,dataTypes=s.dataTypes;// Remove auto dataType and get content-type in the process\nwhile(dataTypes[0]===\"*\"){dataTyp...
42bd30235cbc1f376acebf2658ff714c
displays player's final score on the page
[ { "docid": "32eef52ed672564760eb3a4f430b5c3a", "score": "0.0", "text": "function showScore(){\n $('.question-content').empty();\n var newSection = $('div');\n $(\".score-button\").append($('<h2>Correct Answers: ' + correctAnswers + '</h2>'));\n $(\".score-button\").append($('<h2>Wrong Answer...
[ { "docid": "b7d8fd2472f2d93f21e480fb63498582", "score": "0.7994788", "text": "function finishPageScr() {\n let _userScore = document.getElementById(\"finalScore\");\n _userScore.innerHTML = `${userScore} pts`;\n}", "title": "" }, { "docid": "85693bf852fad8590bdccc545f36f419", "score": ...
2233990c8296c8589e9a66054ebf9779
Startup function called from html code to start program.
[ { "docid": "377979d78fa35cc28a3baa3fc15fbc82", "score": "0.0", "text": "function startup() {\n document.getElementById(\"phong-phong\").onclick = setPhongShader;\n //document.getElementById(\"gouraud-phong\").onclick = setGouraudShader;\n canvas = document.getElementById(\"myGLCanvas\");\n gl = crea...
[ { "docid": "bfb3680b426aaa01ff128faa655fd50c", "score": "0.7358331", "text": "function main() {\n createStartPage();\n }", "title": "" }, { "docid": "2045f1c4bb22c2c65c51cdbf6e6a2392", "score": "0.6941749", "text": "function mainAppStartup(){\n //#1 - Create App Skeleton...
c30b6cd494a23f29de692afc8d30d7ff
Sets the icon for the new Alert.
[ { "docid": "7c40149492ff572b741b4a3307fa9e43", "score": "0.68429476", "text": "icon(icon) {\n this.__data['icon'] = icon;\n\n return this;\n }", "title": "" } ]
[ { "docid": "423a32beca2d5b7b8eaa1e19242b2e08", "score": "0.7928046", "text": "iconAlert() {\n var icon = latte.IconItem.standard(4, 8);\n icon.size = 32;\n this.icon = icon;\n return this;\n }", "title": "" }, { "docid": "bb614693a4342d3fb32...
a9243a8fda6da790b4a18472df7c1114
returns the sign of PE cross PF
[ { "docid": "cebb98207cc784ec9fba3b94b08e7eac", "score": "0.64865726", "text": "function cross(p, e, f) {\n\t\tvar c = (e.x-p.x)*(f.y-p.y)-(e.y-p.y)*(f.x-p.x);\n\t\treturn c > 0 ? 1 : c < 0 ? -1 : 0;\n\t}", "title": "" } ]
[ { "docid": "6a3bf3f64d8e18845f33b4df68574a59", "score": "0.6668499", "text": "csign () {\n return this.cneg() * -2 + 1 - this.czero();\n }", "title": "" }, { "docid": "61479a0715aaf417e134935112a1b3e7", "score": "0.58504975", "text": "function signPoly(value){if(value<0)return-1;...
9c53f046f5b7eaa9e350d17c423c025b
low (inclusive) and high (inclusive) ([low, high])
[ { "docid": "8ef15c32e8c6168967ae0427ce25e061", "score": "0.0", "text": "function randomInteger (low, high) {\n return Math.floor(Math.random() * (high - low + 1) + low);\n}", "title": "" } ]
[ { "docid": "a86fabc8f79dd7aeb518c23aab6bd73d", "score": "0.7497791", "text": "function bounds(low, val, high) {\n\t\tif (val === Infinity) return high;\n\t\telse if (val === -Infinity) return low;\n\t\telse return Math.max(low, Math.min(val, high));\n\t}", "title": "" }, { "docid": "6fbb253a...
c1e51dda119bbdafe5b7260b6e8253fd
Window Char, display character image and current stats
[ { "docid": "35ed688abeec440adc761c38624dbce5", "score": "0.6679483", "text": "function Window_Char() {\n this.initialize.apply(this, arguments);\n}", "title": "" } ]
[ { "docid": "c10d811032fdb7334a822e3a19238dc1", "score": "0.6827147", "text": "function displayMyChar () { \n $(\"#myCharImage\").html(`\n <img src=\"${characters[myCharName].source}\" class=\"img-responsive\" id=\"myChar\">\n `)\n}", "title": "" }, { "docid": "b3285af220bc3a6b3e3...
eaa544456ac0e910352191b580e3c8ab
Generate string of CSS variables for colors
[ { "docid": "498b4069083db17e34177724073a02d6", "score": "0.0", "text": "function getThemeColors(theme) {\n\tconst varNames = [ 'main', 'h1', 'footer', 'link' ];\n\tlet colors = '';\n\tfor (let i = 0; i < varNames.length; i++) {\n\t\tconst key = varNames[i];\n\t\tconst value = theme.colors[i];\n\t\tcolor...
[ { "docid": "2198fba439a8ddc27c470f5e30ec3417", "score": "0.73425764", "text": "get rgbString() {\n\t\tvar self = this,\n\t\t\torder = [\"red\", \"green\", \"blue\"];\n\n\t\t// BEAUTIFUL barfscript\n\t\tvar innards = order\n\t\t\t.map(key => {\n\t\t\t\treturn self[key];\n\t\t\t})\n\t\t\t.join(\", \");\n\...
402907a335c9b3c2929e5f372f471909
Helper function for moving the player icon and updating the player position
[ { "docid": "7f2a5c71083d980a4c0fce81896817d8", "score": "0.66588646", "text": "function movePlayerIcon(newRow, newCol) {\r\n Excel.run(function (ctx) {\r\n var sheet = ctx.workbook.worksheets.getActiveWorksheet();\r\n var cellRange = sheet.getRange(\"b2:j10\");\r\n\r\n ...
[ { "docid": "b6ca9dc0751ae45da7325fad77b19ee9", "score": "0.7179755", "text": "function moveIcon()\n{\n\tif( hPlace != preferences.hPlacePref.value || vPlace != preferences.vPlacePref.value )\n\t{\t\n\t\tprint(\"hOffset = \" + preferences.hPlacePref.value);\n\t\tprint(\"vOffset = \" + preferences.vPlaceP...
a7292243ebe3254212b9d9216d881af8
Compiles, minifies, file injection, asset revisioning.
[ { "docid": "43cf14aceb51d7ab0600a77cfae75c41", "score": "0.533329", "text": "function compile(callback) {\n var htmlFilter = filter('*.html');\n var jsFilter = filter('**/*.js');\n var cssFilter = filter('**/*.css');\n var assets;\n\n return gulp.src(path.join(config.paths.dev, '*.html'))\n .pip...
[ { "docid": "729aea5d5fa6972ce31be311cd92458c", "score": "0.63687766", "text": "make () {\n this.clean()\n this.copyAssets()\n this.buildHTML()\n this.buildJavaScript()\n this.buildCSS()\n }", "title": "" }, { "docid": "5a0c95cab269cae640a57529d534075e", "score": "0.605114...
3e7cf5e3b43c9859f3b81812c279497a
Asynchronous Function getDataAsync from a url and return
[ { "docid": "079bf778975292dcda71254713f606ba", "score": "0.7320616", "text": "async function getDataAsync(url) {\r\n\r\n const GET_INIT = { method: 'GET', credentials: 'include', headers: getHeaders(), mode: 'cors', cache: 'default' };\r\n\r\n // Try catch \r\n try {\r\n // Call fetch an...
[ { "docid": "ea9847412612194160af0fbdf49f176f", "score": "0.78846943", "text": "function getDataAsync(url, callback) {\n \n /*global XMLHttpRequest: false */\n var httpRequest = new XMLHttpRequest();\n \n httpRequest.onreadystatechange = function () {\n \n // ...
049975fc4adee5ecf93e3d8e88160deb
Task 4 Store Catalogue
[ { "docid": "5b512dd3b55eaa60126b1ef50d7d828d", "score": "0.0", "text": "function storeCatalogue (input) {\n let store = new Map();\n\n for (let line of input) {\n let tokens = line.split(' : ');\n let product = tokens[0];\n let letter = product[0];\n let price = Number(tokens[1]);\n\n i...
[ { "docid": "3e468f46654da57984350140a8c5873d", "score": "0.5772162", "text": "function cargarArxiuStore(){\n var dataSource = new am4core.DataSource();\n dataSource.url = \"store.json\";\n dataSource.events.on(\"parseended\", function(ev) {\n var data = ev.target.data;\n //console.log(dat...
c8868e225d3ceb5ef96ce16000753ee0
istanbul ignore next: optional argument is not a branch statement
[ { "docid": "0ffb679119b8c6cab4449b2f10bc319a", "score": "0.0", "text": "function MDCTopAppBarBaseFoundation(adapter){var _this=_super.call(this,__WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */]({},MDCTopAppBarBaseFoundation.defaultAdapter,adapter))||this;_this.navClickHandler_=function(){return ...
[ { "docid": "4e0cc5e8cffb6d70c162b9a12d7f51e7", "score": "0.56220806", "text": "enterFunctionArgOptional(ctx) {\n\t}", "title": "" }, { "docid": "1908f8d3fb95dba74226e4b32797420d", "score": "0.5552567", "text": "function bar(param) {\n if (param)\n throw 'bar';\n else\n ...
42f8ccbfaaf26fa94e9d912faf517fea
Language: Processing Description: Processing is a flexible software sketchbook and a language for learning how to code within the context of the visual arts.
[ { "docid": "598e41557d1aa868ea3f7cb6c69f85f8", "score": "0.7512407", "text": "function processing(hljs) {\n return {\n name: 'Processing',\n keywords: {\n keyword: 'BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color ' +\n 'double float int long String Array ...
[ { "docid": "e6b5067fd6c2eb1ad479961c3f21ec74", "score": "0.7237037", "text": "function $5d45610882582725$var$processing(hljs) {\n return {\n name: \"Processing\",\n keywords: {\n keyword: \"BufferedReader PVector PFont PImage PGraphics HashMap boolean byte char color double f...
a9fbbca6b8d6baa36a3bd10891c3948a
Construct a new mimetype widget factory.
[ { "docid": "db47496f06f13a3bef9a16b101577d68", "score": "0.47276723", "text": "constructor(options) {\n super(Private.createRegistryOptions(options));\n this._rendermime = options.rendermime;\n this._renderTimeout = options.renderTimeout || 1000;\n this._dataType = options.da...
[ { "docid": "1580b24cec7ee164c9a4381936359659", "score": "0.75804824", "text": "createNewWidget(context) {\n const ft = this._fileType;\n const mimeType = ft.mimeTypes.length ? ft.mimeTypes[0] : 'text/plain';\n const rendermime = this._rendermime.clone({\n resolver: contex...
32f7043ca891405a9e81acb635c9072f
Fetches the value associated with the given key from the hash table Fetch the bucket associated with the given key using the getIndexBelowMax function Find the key, value pair inside the bucket and return the value
[ { "docid": "c8619623c07fa2e60711dca88878b8ad", "score": "0.6388254", "text": "retrieve(key) {\n const index = getIndexBelowMax(key.toString(), this.limit);\n const bucket = this.storage.get(index);\n let retrieved;\n if (bucket) {\n retrieved = bucket.filter(item => item[0] === key)[0];...
[ { "docid": "d23f124b9ab009d5d153be7ae4c6641e", "score": "0.68492585", "text": "get(key) {\n const keyString = this.checkKey(key);\n const targetBucket = this.hash(keyString);\n let currentBucket = this.buckets[targetBucket];\n\n while (currentBucket) {\n if (currentBucket.key === keyStr...
81ae7f07a0a5ca13dbb403d070c8a550
Function to control paddle with the mouse
[ { "docid": "0707f4f8232b9bf4d7db33f90b9b765d", "score": "0.0", "text": "function mouseEventHandler(event) {\r\n let relativeY = event.clientY - canvas.offsetTop;\r\n if (relativeY > 0 && relativeY < canvas.height) {\r\n player.y = relativeY - player.height/2;\r\n }\r\n}", "title": "" } ]
[ { "docid": "8f5b16f9b24a29429e9107d70f0d8d7c", "score": "0.7291781", "text": "function mouseMove(e)\n{\n var tempX = e.clientX - canvas.offsetLeft;\n if(tempX > 0 && tempX < canvas.width)\n paddleX = tempX - paddleWidth/2;\n}", "title": "" }, { "docid": "953329f35147848fced95778...
b306ba0fea514130acca5d15713cd2b5
NOTE: See S3 Get Signed URL (and Create Presigned Post) accept callback but not promise.
[ { "docid": "1efc51dc557cbb30d65d46af002b9f59", "score": "0.7214194", "text": "async function _createPresignedPostPromise(params) {\n return await createPresignedPost(s3, params);\n}", "title": "" } ]
[ { "docid": "9afb8352b67572255ca1726417963638", "score": "0.70104885", "text": "function getSignedRequest(file) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', `/sign-s3?file-name=${file.name}&file-type=${file.type}`);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === 4)...
e455f65ce2b74d9ca17e75e668625cca
Show History Cleaner Provider
[ { "docid": "4420dddaaf34d7b7730b0d6d83bfbdb3", "score": "0.5423292", "text": "function showHistoryProviders () {\n document.getElementById('ShowtHistoryProvider').style.display = 'block';\n}", "title": "" } ]
[ { "docid": "956c3eac1189179fabf55219b01a4c90", "score": "0.5965881", "text": "function showHistory() {\n\n\n\t// Populate the history list from localstorage.\n\tlet arrCities = getHistory();\n\n\tarrCities.forEach(function (city) {\n\n\t\t// Add a new li to the list.\n\t\t// First create the new li, add...
50bfcdcafa7face7c6e60c883e5a3576
this function converts json to suitable hex buffer
[ { "docid": "7c6c65761fa4b5f1e9d894e7f86463d9", "score": "0.68012315", "text": "function convert_to_buffer(message){\n\tvar buf=Buffer.from(JSON.stringify(message))\n\treturn buf.toString('hex')\n}", "title": "" } ]
[ { "docid": "4ced9b71da29f57fb78a61fc009c7334", "score": "0.66262996", "text": "buf2hex(buffer) { // buffer is an ArrayBuffer\n return Array.prototype.map.call(new Uint8Array(buffer), x => ('00' + x.toString(16)).slice(-2)).join('');\n }", "title": "" }, { "docid": "daecf9a867e28154...
683b427a2bcfb88ea6d82ba4d167b8b5
This function returns a promise, so we need to use .then after we call it
[ { "docid": "541e87b17d9a8a9552c93cc987dcaab1", "score": "0.0", "text": "function readJsonData () {\n return fetch('database/FishEyeData.json')\n .then(response => {\n if (!response.ok) {\n throw new Error(\"HTTP error \" + response.status);\n }\n ...
[ { "docid": "4bc779cce3474279e05182876f51be30", "score": "0.6776335", "text": "function query_promise_then(result) { }", "title": "" }, { "docid": "c831a7d6a26c068429ba9dd798555d6a", "score": "0.6676934", "text": "function query_promise_then(result) {\n\n\n }", "title": "" ...
e67a59ca077a926e67cd7632f7f1ad63
highly specialized: better place? document?
[ { "docid": "3bd67ccc8206f0010c926fc900939a8a", "score": "0.0", "text": "function getOriginValue() {\n //jshint validthis: true\n // thisval is a instance of `Field`\n return this.row.getOriginData(this.name);\n }", "title": "" } ]
[ { "docid": "d7ab55f66f4a5892b50854237878b0d3", "score": "0.59392065", "text": "document() {\n _explanation.get(this).forEach(explanation => {\n const line = explanation.loc.start.line;\n\n this.specificDocumentation(line, explanation);\n });\n }", "title": "" ...
d54af23469dadc760ecf8b1cacc50a38
[GET] /me async await
[ { "docid": "a100c32abd84640498345adb000045bf", "score": "0.0", "text": "async showHomeUser(req, res, next) {\n try {\n const provinces = await Province.find({});\n const destinations = await Destination.find({});\n res.render('home', {\n provinces: ...
[ { "docid": "5032f474c2e6ded9dd647319c2efeb98", "score": "0.7842718", "text": "async function getMe (req, res) {\n res.send(await service.getMe(req.authUser))\n}", "title": "" }, { "docid": "9f539763635c0b1bf7b0c9a891bdd705", "score": "0.7771271", "text": "async function getMe() {\n\...
e867d090d2524a570101fa596b9c7279
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a si...
[ { "docid": "745eeeee6b7763874cc161d0f81376ce", "score": "0.6614106", "text": "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n if(typeof arg==='number'){if(typeof encodingOrOffset===...
[ { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.73532706", "text": "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "title": "" }, { "docid": "f4969cdb9157e6399717ff05cd035df6", "score": "0.73532706", "text": "function BufferToArrayBuffer () {\n ...
14c4cdc6b4a3187913382c96763e27be
(public) this & ~a
[ { "docid": "fc1acf407d2fc309ec9807d7685091ca", "score": "0.54109406", "text": "function op_andnot(x, y) {\n return x & ~y;\n }", "title": "" } ]
[ { "docid": "473612dd7ab784f7e8c91ac958052970", "score": "0.58434314", "text": "function uh(){this.b=null;this.a=[]}", "title": "" }, { "docid": "473612dd7ab784f7e8c91ac958052970", "score": "0.58434314", "text": "function uh(){this.b=null;this.a=[]}", "title": "" }, { "doc...
26aa1f808ed0d8785380a24ed76bbb8e
get the total number of traffic permissions present
[ { "docid": "27a4b145a99bbcb9c2334c2820dceeee", "score": "0.7396314", "text": "fetchTrafficPermissionTotalCount ({ commit }) {\n const params = { size: 1 }\n\n return api.getAllTrafficPermissions(params)\n .then(response => {\n const total = response.total\n\n ...
[ { "docid": "579c87806d46b81c9fe7f274d515cbd2", "score": "0.6630182", "text": "fetchTrafficPermissionTotalCountFromMesh ({ commit }, mesh) {\n const params = { size: 1 }\n\n return api.getAllTrafficPermissionsFromMesh(mesh, params)\n .then(response => {\n const total = r...
76da62aeabc798768a59ca8ebac49058
Define a callback function for later on.
[ { "docid": "74001662f28c7f3b12924b07c0510f2b", "score": "0.0", "text": "function toolbar_event(event) {\n return fig.toolbar_button_onclick(event['data']);\n }", "title": "" } ]
[ { "docid": "4846f7442387d0797edb680641658aba", "score": "0.80615205", "text": "function callback(){}", "title": "" }, { "docid": "bfd3ac15570112d3b8e479acffd1aa8d", "score": "0.785519", "text": "function SimpleCallbackHandler() {}", "title": "" }, { "docid": "baf168493a2c...
a128d75d58b6a8c976c4c16258cc0520
Bonus challenge : this method returns the annualized return of the portfolio between two dates
[ { "docid": "0e1a0164de82e5a15afed2283264958a", "score": "0.8157953", "text": "getAnnualizedReturnBetween (dateT0, dateT1) {\n // To compute the annualized return, we need first to have the cumulative return between the two dates.\n let cumulativeReturn =\n this.getProfitBetween(dateT0, dateT1...
[ { "docid": "8d10b14c5e763ccf631f890791e01ecd", "score": "0.68491244", "text": "function calculateAnnualReturns(){\r\n \r\n //initialize blank values\r\n annualReturns = [];\r\n annualReturnLabels = [];\r\n upYearCount = 0;\r\n downYearCount = 0;\r\n \r\n var firstReturnDate = ne...
bed2fb9f89f2348883a9dcbb7a3567b2
adds new option for the hidden vm select fields from new window
[ { "docid": "173d1af3e7f92aa9433d8987d10e1c0a", "score": "0.0", "text": "function AllocSelRowOptions(rowArray)\n {\n \tif (rowArray !== null)\n \t{\n\t for (var i = 0; rowArray.length > i; i++)\n\t {\n\t document.PVForm.hiddenSelRow[i] = new Option(rowArray[i],rowArray[i]);\n\t documen...
[ { "docid": "ebea48d39b522143316469f7d25557aa", "score": "0.6441688", "text": "function updateNetworkSelect(){\n vnetworks_select=\n makeSelectOptions(dataTable_vNetworks,\n 1,\n 4,\n [],\n []\n ...
bab8216c83713f3df27857ef29a45be7
challenge 11 Write a function to calculate factorial for a given input. If input is below 0 or above 12 throw an exception of type
[ { "docid": "24c4a7a7dded9311caafe0d762359622", "score": "0.7864237", "text": "function factorial(n) {\n\tif (n < 0 || n > 12) {\n\t\tthrow RangeError;\n\t} else {\n\t\tlet answer = 1;\n\t\tif (n == 0 || n == 1) {\n\t\t\treturn answer;\n\t\t} else {\n\t\t\tfor (var i = n; i >= 1; i--) {\n\t\t\t\tanswer =...
[ { "docid": "d0307730c7d80e727a2872874842f5e1", "score": "0.7697478", "text": "function factorial(n) {\n let num = n;\n\n if (num === 0 || num > 10) {\n return \"out of bounds\";\n }\n while (n > 1) {\n n--;\n num = num * n;\n }\n return num;\n}", "title": "" }, { "docid": "128...
fefecbb53de3d58d5cac224057492712
fetch service information of a given cloud project
[ { "docid": "6775bf9cb66b2bdebfe56b7f64a2c917", "score": "0.8139028", "text": "getCloudProjectServiceInformation(serviceName) {\n return this.OvhApiCloudServiceInfos.get({ serviceName }).$promise;\n }", "title": "" } ]
[ { "docid": "fed74f9fec5fc8c889e799253c7f876f", "score": "0.6679495", "text": "getProjectWithFullInfo(query = {}) {\n return this.getOneWithCustumQuery(query).then(async (project = {}) => {\n if (!project) {\n return [];\n }\n const {\n clients = [],\n providers = [...
6af6d220383a33c955b3f903dfebde6e
=========================================================================== For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. (It will be regenerated if this run of deflate switches away from Huffman.)
[ { "docid": "a08189fb75fc5f8926b970c0a2ffb73c", "score": "0.0", "text": "function deflate_huff(s, flush) {\n var bflush; /* set if current block must be flushed */\n\n for (;;) {\n /* Make sure that we have a literal to write. */\n if (s.lookahead === 0) {\n fill_window(s);\n ...
[ { "docid": "37be4fc1b71f206e9d2f05ebf4ce6736", "score": "0.6772932", "text": "function deflate_fast(flush) {\n // short hash_head = 0; // head of the hash chain\n var hash_head = 0; // head of the hash chain\n\n var bflush; // set if current block must be flushed\n // eslint-disable-...
6b28b6f0334d38cffab481c1ffc6b459
function which prompts the user to pick the id of the item he whats to buy and its quantity
[ { "docid": "c71dcd8148f85381aec6b18f2d5da468", "score": "0.0", "text": "function runInquirer() {\r\n inquirer.prompt ([\r\n {\r\n type: \"input\",\r\n name: \"productId\",\r\n message: \"What is the ID of the product they would like to buy?\"\r\n },\r\n ...
[ { "docid": "ca297d7947c48da29b8f3ad956831d71", "score": "0.8294795", "text": "function purchaseItem() {\n \n inquirer.prompt([/* Pass your questions in here */\n {\n type: \"input\",\n name: \"searchbyID\",\n message: \"What is the ID of the product you woul...
e55812f30d2f3f02d01f9d2b778f9bca
Function to update champion this only includes stuff when the champion is fixed
[ { "docid": "3ee0d810ae5425beb0853be0bb4aa793", "score": "0.7140004", "text": "function updateChampion(champ) {\n currChampionName = champ.replace(\"+ \", \"\"); // set champ name\n // Get average\n var avgDataRow = avg_data.filter(function(d) { return d.champ == currChampionName; })[0];\n cu...
[ { "docid": "7914ef68df2a0ad6bd5ffdb7e4aba10b", "score": "0.6363191", "text": "async function afterUpdateNotifications(data) {\n const updatedChampions = champions.map((champion) => {\n if (data.includes(champion.id) && !champion.has_matchups) {\n return {\n ...champion,\n ...
ba784df54dfb9e6dc3a909a020b4656d
maitre: null, ideesEsclaves: [], grappe: null,
[ { "docid": "f7792194a053f641ce76c2a68e86fb22", "score": "0.0", "text": "componentDidMount() {\n this.props.loadGrappeOptions();\n this.props.loadIdeeOptions();\n }", "title": "" } ]
[ { "docid": "0592c035d60a6034d497d460c927e6c0", "score": "0.6647425", "text": "constructor(){\n this.sexo\n this.pais\n this.idioma\n }", "title": "" }, { "docid": "f0bfc48e3991a173bd1dda35f0474e91", "score": "0.6363997", "text": "constructor(){\r\n this...
9546acfda1674f760e5379e1b31d18f2
Encode a string as utf8
[ { "docid": "ae1646918be28a8f6285d8b394aab4b7", "score": "0.703789", "text": "function str2rstr_utf8 (input) {\n return unescape(encodeURIComponent(input))\n }", "title": "" } ]
[ { "docid": "24f8c0f6cdf92fd17ae304af1f2cb419", "score": "0.8202771", "text": "function encode_utf8(s) {\n return encode_latin1(unescape(encodeURIComponent(s)));\n }", "title": "" }, { "docid": "24f8c0f6cdf92fd17ae304af1f2cb419", "score": "0.8202771", "text": "function encode_...
b7d447d61529ff4ec8f1a1b8b317aa42
signed area of a triangle
[ { "docid": "22d8927298ec0dc5b3ba29c6a41d295b", "score": "0.0", "text": "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "title": "" } ]
[ { "docid": "55f0348f4b9403500c5eaa519db4698b", "score": "0.7143444", "text": "function areaTriangle(base, height) {\n return (.5*base*height);\n }", "title": "" }, { "docid": "cab59a5dcae61f356ac151bdca4f1ae4", "score": "0.70964205", "text": "function areaOfTriangle(a, b, c) {\n va...
8b20081cbfbe693b3291ab02913bd8ae
Resolve a list of Providers.
[ { "docid": "4ac44b265e8b63031d10146a2b916586", "score": "0.6350446", "text": "function resolveReflectiveProviders(providers) {\n var normalized = _normalizeProviders(providers, []);\n var resolved = normalized.map(resolveReflectiveProvider);\n var resolvedProviderMap = mergeResolvedReflectivePr...
[ { "docid": "f867bcd19aa7c863cf8b2d1e43ebabfd", "score": "0.70662016", "text": "function resolveProviders(providers) {\n\t var normalized = _normalizeProviders(providers, []);\n\t var resolved = normalized.map(resolveProvider);\n\t return collection_1.MapWrapper.values(mergeResolvedProviders(res...
0e4a8c74da3389efd1a41a9688aea5f9
The error handler function should be the last function added with app.use. The error handler has a next callback it can be used to chain multiple error handlers.
[ { "docid": "9458525b147b8c6948e60ef4ccba44ab", "score": "0.0", "text": "function IsJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return 'not a valid json or invalid request';\n }\n return true;\n }", "title": "" } ]
[ { "docid": "ab777b6b5d5ed52d66775482aa50b38c", "score": "0.8009303", "text": "addErrorHandler() {\n\t\tthis.app.use(this.onError.bind(this));\n\t}", "title": "" }, { "docid": "94a751af008bae12a58320128c9358d0", "score": "0.74226946", "text": "setupExpressErrorHandlers(expressApp) {\n...
dd9d19a9b583375a09d8a18dad655224
Runs password through check and then updates GUI
[ { "docid": "4bfcefbcf91cef638f50eb91f5455092", "score": "0.0", "text": "function runPassword(password, dispatch) {\n console.log('runPassword');\n // Check password\n var nScore = checkPassword(password);\n var passStrengthText = '';\n var passStrengthColor = 'white';\n var passError = '';\n\n if...
[ { "docid": "221ac064ac38ebf7c55743bfabbf512e", "score": "0.757227", "text": "function updateUI(){\n const passwordLength = passwordLengthElem.value;\n const includeLowercase = lowercaseElem.checked;\n const includeUppercase = uppercaseElem.checked;\n const includeNumbers = numbersElem.checke...
fbe9344920461dd3b3cafbd3aabd467f
/ NAME : gfn_printWindow() / DESC : print window / DATE : 2016.03.30 / AUTH : Jeongmin Jin
[ { "docid": "9008b194a5a0d7af54c6c0894df653db", "score": "0.8072657", "text": "function gfn_printWindow(printArea) {\n\tvar win = window.open('','','left=0,top=0,width=552,height=477,toolbar=0,scrollbars=0,status =0');\n var headstr = \"<html><head><title></title></head><body>\";\n var footstr = \"...
[ { "docid": "6ff37e7751dbb23821896fc57004f997", "score": "0.77076304", "text": "function WS_print(theURL,winName,features) \n\t\t{ \n\t\t// alert(theURL+'.........'+winName+'....'+features);\n\t\t\n \t\t\t window.moveTo(0,0); \n\t\t\t \n\t\t\t var window_attributes=(features)?features:'width=700,...
70e4589a3efecc95f0999c203bbb642a
Return the length of a node's textContent, regarding single newline characters as zerolength. This allows us to avoid problems with identifying the correct selection offset for empty blocks in IE, in which we render newlines instead of break tags.
[ { "docid": "1dc5154e1f76c9aab0ce89d4b49bb7fb", "score": "0.74018896", "text": "function getTextContentLength(node) {\n var textContent = node.textContent;\n return textContent === '\\n' ? 0 : textContent.length;\n}", "title": "" } ]
[ { "docid": "566428c9287428e0482aa4880b246780", "score": "0.7682836", "text": "function getTextContentLength(node){var textContent=node.textContent;return textContent==='\\n'?0:textContent.length;}", "title": "" }, { "docid": "3ef2b3606e131bceb25c7efa86dddc9f", "score": "0.7498505", "...
be88344fe91a155f719b3a91204600de
Create a new marker and store it on the data object
[ { "docid": "7de4264978633b7af067fa0f3b990614", "score": "0.69449586", "text": "function addMarker(data) {\n //console.log('creating marker with lat ' + data.lat);\n data.singleLatLng = makeLatLngString(parseFloat(data.lat),\n parseFloat(data.lng));\n dat...
[ { "docid": "bf520105f23a57a8698e98f273ef7f09", "score": "0.7412836", "text": "createNewMarker(latLon, xCoord, yCoord) {\n let marker = new Marker(latLon, [xCoord, yCoord]);\n controllers.timeSeriesMarkers.add(marker);\n this.updateMarker(marker);\n }", "title": "" }, { ...
07b9b6ce5f87a7aca248e3440cb63b5c
Creating the missiles which will come from the top of the screen
[ { "docid": "ec080b6e820a3e1787a347e3c440539a", "score": "0.62012154", "text": "function createMissile() {\r\n missileSphere = new THREE.Mesh(new THREE.SphereGeometry(5), new THREE.MeshPhongMaterial({color: 0xFFFF00}));\r\n missileSphere.position.x = Math.floor(Math.random() * (160 - (-160) + 1)) +...
[ { "docid": "840732d7d2f5891e64e69cef5d515872", "score": "0.67778283", "text": "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles...
108646d8c49fc73bfc74024ec8678660
FOR PC it will be COMX on mac it will be something like "/dev/cu.usbmodemXXXX" Look at P5 Serial to see the available ports
[ { "docid": "a5f3daba0a9633eb60b9ffb9a52f7586", "score": "0.0", "text": "function preload(){\n \n realLife1 = loadImage(\"images/rape.jpg\");\n realLife2 = loadImage(\"images/schoolShooting.jpg\");\n realLife3 = loadImage(\"images/christine-blasey-ford.jpg\");\n realLife4 = loadImage(\"ima...
[ { "docid": "287f31b6f4de49bd7ce885c2c4b617f2", "score": "0.7348899", "text": "function ListSerialPorts(){ \n serialport.list(function (err, ports) {\n console.log(\"\\n\");\n console.log(\"+++++++++++ port info +++++++++++\\n\");\n console.log(\"\\n\");\n ports.forEach(f...
ab182bf05db47e56e12dc270e5921100
Se manda llamar cuando se da click en un apartado del calendario donde, se agrega o se elimina un evento si este ya existe
[ { "docid": "06bc5b08563a05e297ec750d0916e83d", "score": "0.0", "text": "function insertar_eliminar_evento(fecha,id_lampara,tag_ejecucion){\n $.ajax({\n type:\"Get\",\n dataType:\"json\",\n url:\"insertar_eliminar_evento.php\",\n data:{fecha: fecha, id_lampara: id_lampara,tag_ejecucion: tag_...
[ { "docid": "bf69c7a22d76ba34d38ef2860eb8a997", "score": "0.64601266", "text": "function delete_event(event) {\n\n const today = new Date();\n const today_date = today.getDate();\n const x = document.querySelector(\".active-date\").innerText;\n\n if (x <= today_date) {\n $(\"#deldialog...
afe8774154337ec34602066721331056
Invokes the update lifecycles and returns false if it shouldn't rerender.
[ { "docid": "fa6220fb5c263c436f205d3a16ba8203", "score": "0.0", "text": "function updateClassInstance(current, workInProgress, ctor, newProps, renderExpirationTime) {\n var instance = workInProgress.stateNode;\n\n var oldProps = workInProgress.memoizedProps;\n instance.props = workInProgress.type === ...
[ { "docid": "32003e4da6b34aa95b39bb5407e3746b", "score": "0.73004746", "text": "shouldComponentUpdate() {\n return this.shouldUpdate\n }", "title": "" }, { "docid": "0f2f6e821b07d553f3073be1e5b7b89d", "score": "0.7289543", "text": "shouldComponentUpdate (...args) {\n re...
92d61e498020cd3cd8233b28fb4ed57d
Collapse selection at the start of the first selected block. This is used for Firefox versions that attempt to navigate forward/backward instead of moving the cursor. Other browsers are able to move the cursor natively.
[ { "docid": "7dc8fdb6433630594e5e5c53e2b34f69", "score": "0.61110556", "text": "function keyCommandMoveSelectionToStartOfBlock(editorState) {\n var selection = editorState.getSelection();\n var startKey = selection.getStartKey();\n return EditorState.set(editorState, {\n selection: selection.merge(...
[ { "docid": "df9adf6554f5c038a530686b93eaf0c0", "score": "0.6895364", "text": "function collapseSelection(ed, dir) {\n // dir = 'start' || 'end'\n var sel = ed.selection, range = sel.getRange();\n dir && sel.moveCursorToPosition(range[dir]);\n sel.clearSelection();\n }", "title": "" },...
4f68b7c51b097aba9ced9e7b7d20a49b
Create an italicized HTML text node
[ { "docid": "ca5b155015c46786128086c1d71191d7", "score": "0.79177016", "text": "function createItalicized(text) {\n let italics = document.createElement(\"i\");\n italics.appendChild(document.createTextNode(text));\n return italics;\n}", "title": "" } ]
[ { "docid": "3997f33d190ae69367532625d88281d9", "score": "0.6959262", "text": "function italic(value){\r\n return '' + value + '';\r\n }", "title": "" }, { "docid": "ac69b6c31aa18fc3b5e77994d0e4fcb5", "score": "0.6946405", "text": "function italic(value){\n return '' ...
1d9b5c8c2323341442b0440aa0584606
TODO: copy/paste grid code from project 1; draw source, sink, and knight path on it ALGORITHM PART 1
[ { "docid": "3c3d801faa0d30ef49028bd845c09190", "score": "0.0", "text": "function findMaxPossibleFlow(grid) {\n let sourceEdges = findNextPossibleMoves(source, grid);\n let sourceMaxEdge = sourceEdges[0];\n let sourceMaxEdgeCapacity = (grid[source[0], source[1]] + grid[sourceMaxEdge[0], sourceMaxEdge[...
[ { "docid": "8024a88280156e3d28bd09dc227cce74", "score": "0.6788132", "text": "function stepCA(theGrid){\n //Create new grid to be written to\n newGrid = [];\n for(let i = 0; i <= width/reso; i++){\n newGrid[i] = [];\n }\n \n //Write values to grid\n for(let x = 0; x <= width/reso; x++){\n f...
60f9a4274abc440175a43e83a3a4b49f
Randomly place trees, using CSS top & leftproperties for placement and transform: scale() for size
[ { "docid": "ce63d8126e2a8ac8e32d275f9ce2f9a0", "score": "0.7186386", "text": "function generateTree(z) {\r\n generatedItemsWrapper.innerHTML += `<div id='wrap${z}'><div id='triangle1${z}'></div><div id='triangle2${z}'></div><div id='triangle3${z}'></div><div id='rectangle${z}'></div></div>`;\r\n\r\n c...
[ { "docid": "7aabb75dddffaeba1f9319a45be51a42", "score": "0.72227454", "text": "function Tree(){\n\n\tvar loc = vec3 ( 0, 0, 0);\n\n\t// var loc = vec3( Math.random() * 2 - 1, 0, Math.random() * 2 - 1);\n\t// var scale = ( Math.floor( Math.random() * 10 ) + 1 ) / 300;\n\t// var scales = vec3( scale, 0.0,...
29f4b9a7678c83dcd482a00edec25bf0
method: handle removing coins
[ { "docid": "710277933bb3110e55c898416c7ffeda", "score": "0.65570205", "text": "handleCoinsToClear(coin){\n let localCoinData = this.handleGetLocalStorage();\n let coinFound = localCoinData.find(x => x.id === coin);\n\n coinFound.available = 0;\n localStorage.setItem('coins', ...
[ { "docid": "8c2706c796656ead5fb605a94588b28d", "score": "0.7755564", "text": "removeCallback(coin) {\n coin.scene.coinPool.add(coin);\n }", "title": "" }, { "docid": "f8807972e78465fa79bb10b4fa2f2e2b", "score": "0.7503747", "text": "removeCallback(coin) {\n coin.sc...
b2851738758a6aa6a9b684115111cb72
Undefined$prototype$equals :: Undefined ~> Undefined > Boolean
[ { "docid": "6324b51983c9556dd98b5b3237b9b656", "score": "0.8593052", "text": "function Undefined$prototype$equals(other) {\n return true;\n }", "title": "" } ]
[ { "docid": "3ec8cd8180afbe4850275e8e2e8671c9", "score": "0.7543457", "text": "function Null$prototype$equals(other) {\n return true;\n }", "title": "" }, { "docid": "3ec8cd8180afbe4850275e8e2e8671c9", "score": "0.7543457", "text": "function Null$prototype$equals(other) {\n ret...
f1085c9d4731e6ebaad13d446fcd20d6
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
[ { "docid": "cb7e8adb5157b0577b9591cbb6660a05", "score": "0.0", "text": "function makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t}", "title": "" } ]
[ { "docid": "6eedd35e3e2ead4609d1863031ba91da", "score": "0.5623116", "text": "function FacebookHandler() {}", "title": "" }, { "docid": "cefd89a62dfa9c820ffc292b65c35b28", "score": "0.5233977", "text": "function identify() {\n if (UtilityService.Global.isChromeApp) {\n re...
ed24f4449ad0a99ced754a71f4967c48
Return mixins that includes one of the range properties (range, rangeStep, scheme).
[ { "docid": "0e98a65ad2506f19fcbb55ce1b9e1e6b", "score": "0.0", "text": "function parseRangeForChannel(channel, scaleType, type, specifiedScale, config, zero, mark, sizeSpecified, sizeSignal, xyRangeSteps) {\n var noRangeStep = sizeSpecified || specifiedScale.rangeStep === null;\n // Check if any o...
[ { "docid": "d464ff65bf2803b7fb21bc66e62e3ab9", "score": "0.5857279", "text": "function range(from,to){\n\tvar r=inherit(range.methods);\n\n\tr.from=from;\n\tr.to=to;\n\treturn r;\n}", "title": "" }, { "docid": "3b56327bbbc9898c0202e8610d8a950b", "score": "0.57793576", "text": "static...
a0b5af7d53799d80fa11443e6670a818
Show PC total and winLose label
[ { "docid": "26e637787dc468d7e92b6dc0f9ada3a9", "score": "0.0", "text": "function endGame(message){\n let winLose = document.getElementById(\"lblWinLose\");\n let pcLabel = document.getElementById(\"lblPC\");\n\n flipCard();\n\n pcLabel.hidden = false;\n winLose.innerHTML = message;\n w...
[ { "docid": "4388cc6029faa924f6e227abc0f0a03d", "score": "0.66395015", "text": "function drawCopsRemainingText() {\r\n /*document.getElementById(\"Trucks\").innerText = (numCops * numberOfLanes).toString(10);*/\r\n document.getElementById(\"Trucks\").innerText = score + \"\";\r\n ...
a7337065f703779094d08a9383c3a47e
TODO: some confusion throughout about whether '() should be converted into js as [] or as undefined both used in various places
[ { "docid": "683a88fb631dff7a737a67d64ac89a1c", "score": "0.53426725", "text": "function scheme_to_js_style_array(a) {\n var o = [];\n while (a && a.length > 0) {\n\to.push(a[0]);\n\ta = a[1];\n }\n return o;\n}", "title": "" } ]
[ { "docid": "063d311e484360588f2da6d2a4243c6a", "score": "0.6308303", "text": "function arrayify (thing) {\n return Array.isArray(thing) ? thing : typeof thing !== \"undefined\" ? [thing] : [];\n}", "title": "" }, { "docid": "564066e05d2dd59b73b04d8ea40cd1c5", "score": "0.6304809", ...
6db1111227c4dc3a99f7e8bab2b1d50d
Opera <= 12 includes TextEvent in window, but does not fire text input events. Rely on keypress instead.
[ { "docid": "114713a54905a2f999ce65d1f837a12b", "score": "0.0", "text": "function isPresto() {\n\t var opera = window.opera;\n\t return (typeof opera === 'undefined' ? 'undefined' : _typeof(opera)) === 'object' && typeof opera.version === 'function' && parseInt(opera.version(), 10) <= 12;\n\t}", "t...
[ { "docid": "3fc515f049d5561eb227f77c9b58e134", "score": "0.64078885", "text": "function dispatchTextEvent(target, eventType, char) {\n var evt = document.createEvent(\"TextEvent\");\n evt.initTextEvent(eventType, true, true, window, char, 0, \"en-us\");\n target.dispatchEvent(evt);\n}", "title": ...
c7c492c62130040308789bbd5e7d8623
Functions: Sets up and shows the Home Screen
[ { "docid": "a1286326b5f72d2be7f2b06eef3cc11e", "score": "0.7205659", "text": "function setHomeScreen() {\n setScreen(\"homeScreen\");\n setProperty(\"hsDaysLeftCount\", \"text\", monthsLeft + \" Months and \" + daysLeft + \" Days Away\");\n}", "title": "" } ]
[ { "docid": "59ea0399874e07234e7a02945b83a30d", "score": "0.770415", "text": "function goToHomeScreen() {\n inGameInfo.inPlay = false\n resetAllGameInfo()\n\n makeSection2DisplayNone()\n sectionGameMenu.removeClass(cssDisplayNone)\n sectionOpeningScreen.removeClass(cssD...
2d04fdcda142703aa8767fb7f1483c58
Mark a component as needing a rerender, adding an optional callback to a list of functions which will be executed once the rerender occurs.
[ { "docid": "7d131f306f15d73382089f10a9eabfb5", "score": "0.0", "text": "function enqueueUpdate(component) {\n ensureInjected();\n\n // Various parts of our code (such as ReactCompositeComponent's\n // _renderValidatedComponent) assume that calls to render aren't nested;\n // verify that that's the c...
[ { "docid": "7b37c36168cf7e6af365d62c1774c48c", "score": "0.64397836", "text": "function onRenderComplete(callback) {\n renderCompleteCallbacks.push(callback);\n enqueueUpdateIfNot();\n}", "title": "" }, { "docid": "eb4680c9e39a4095f1cbe169366cf2ba", "score": "0.6438433", "text"...
ecab19abc314bf6427afaedd69948d08
Programming from A to Z, Fall 2014
[ { "docid": "0837e22b554fcfd0def83ccf9bda2e6c", "score": "0.0", "text": "function setup() {\n noCanvas();\n // Assign the generate() function to the button\n var button = getElement('generate');\n button.mousePressed(generate);\n}", "title": "" } ]
[ { "docid": "4ba42df549fe9202b5539891c3e199f7", "score": "0.615541", "text": "function alhorithm() {\n\n}", "title": "" }, { "docid": "f6b54de99f6f0f797ceb5c52aa55fb51", "score": "0.6146691", "text": "function step1ab(z) {\n\t if (z.b.charAt(z.k) == 's') {\n\t\tif (ends(z, \"sses\"...
bd479c63c45ecdd9809a08566c38c63d
Create a new watchlist
[ { "docid": "6259d4262831ded8a0f23a1588576bfc", "score": "0.67100275", "text": "function createWatchlist(name, epics) {\n\treturn new Promise((res, rej) => {\n\t\tlet payload = {\n\t\t\t'epics': epics,\n\t\t\t'name': name\n\t\t};\n\t\tpost('/watchlists', payload)\n\t\t\t.then(r => {\n\t\t\t\tif (r.status...
[ { "docid": "19e8a7375bc00d018af360b41df7274c", "score": "0.79655164", "text": "createWatchlist() {\n if (this.get('newWatchlistName')) {\n this.get('accountService').createWatchlist(this.get('newWatchlistName'), this.onEditWatchlist.bind(this));\n this.set('newWatchlistName', null);\n...
a90c25685fbb1eec8224912ca7aba7e5
SHOWING / HIDING MODULES
[ { "docid": "ce9556a82a9fe59abfb4ee68e3dd2a1a", "score": "0.0", "text": "function initModules() {\n\tshowModule(\"TrackStatus\");\n\t$(document.querySelector(\"html\")).keypress(function(event) {\n\t\tif (event.keyCode == 47) {\n\t\t\t$(\"#track-search\").focus();\n\t\t\tevent.preventDefault();\n\t\t}\n\...
[ { "docid": "6775188c9aa3c349aa2d82c2c52215e9", "score": "0.69653493", "text": "function hideAllModules() {\n for (var i = 0; i < document.getElementsByClassName(\"modules\").length; i++) {\n document.getElementsByClassName(\"modules\")[i].style.display = \"none\";\n }\n}", "title": "" ...
1eb0c71cba83932fa4670f4490441169
funcion para mostrar el mapa de una sucursal (con una marca)
[ { "docid": "bbd5f76d751c7789baa9ec8d0c1bf6e9", "score": "0.6659694", "text": "function mostrarMapa(latitud,longitud){\n\n\n\tmap = new GMaps({\n el: '#map',\n lat: latitud,\n lng: longitud,\n width: '700px',\n height: '300px'\n });\n map.addMarker({\n ...
[ { "docid": "ed1df5fb3a5081646cf9310a119c918e", "score": "0.7218878", "text": "function mostrar_mapa() {\n\t//MOSTRAMOS AL USUARIO EL MAPA \n\tdocument.getElementById(\"mapa\").style.visibility = \"visible\";\n\t//LE AÑADIMOS AL MISMO ELEMENTO LA POSICION DISPLAY_BLOCK\n\tdocument.getElementById(\"mapa\"...
9913d3edb3134a6460282e8a97d508d9
When size is submitted by the user,call makeGrid()
[ { "docid": "2c43605b906c28af44df1af4d0b2892d", "score": "0.66561234", "text": "function makeGrid(submitButn) {\n let rows = $(\"#inputHeight\").val();\n let cols = $(\"#inputWeight\").val();\n \n //Prevent submit button from submitting form\n submitButn.preventDefault();\n \n //empty canvas befor...
[ { "docid": "4c4292e12825757cf0dd46e72c18a646", "score": "0.786554", "text": "function sizeSubmit(event) {\n makeGrid();\n // Use preventDefault to stop form from resetting height & width values\n event.preventDefault();\n}", "title": "" }, { "docid": "27a13d7d6c720ca7baa0ce33329a7aed", ...
45ed0a6f709d68d50a3eb79312da2f7d
Provide the validation to the user name is it empty or not
[ { "docid": "d70c51d40761efd3eaff58fd672b53bc", "score": "0.0", "text": "function onValidate() {\n let username = document.getElementById(\"name\").value;\n let usercode = document.getElementById(\"code\").value;\n let usermail = document.getElementById(\"mail\").value;\n let usernumber = document.ge...
[ { "docid": "bd7a865fa01ef89429757c0b382653de", "score": "0.76178145", "text": "function cheacsignUpName() {\n\n\t\tvar pattern = /^[a-z A-Z]*$/;\n\n\t\tvar name = $(\"#userName\").val()\n\t\tvar nameLength = name.length;\n\n\t\tif (pattern.test(name) && name !== '' && nameLength >= 3) {\n\n\t\t\t$(\"#us...
c50e57a2e1717cef2bf6c29deb0cf23a
I will refactor imports into lazy imports after Unit 2 is done with building out their forms tdubs
[ { "docid": "f9d2417584f83d67a142277009b7500c", "score": "0.0", "text": "function App() {\n return (\n <Router>\n <Suspense fallback={<h2>Loading...</h2>}>\n {/* Unit 2 - Your code goes here :) */}\n <Switch>\n {/* Unit 2 - Your code goes here :) */}\n </Switch>\n ...
[ { "docid": "be11f03fa21c26574a24ed0760c0f711", "score": "0.5640754", "text": "function formUtils() {\n\n let formio = new Formio('https://examples.form.io/example');\n formio.loadForm().then((form) => {\n let component = FuGetComponent(form.components, 'survey');\n console.log('surve...
4a864c36fe475ee62fd5808f97d5175c
empty UCC DOM container
[ { "docid": "2fe56e2d092ef18a4cc5e22858b61ac6", "score": "0.0", "text": "function emptyContainer() {\n //remove all\n _.each(regionMap, function (value, key) {\n value.emptyContainer();\n });\n }", "title": "" } ]
[ { "docid": "18afec7bfd13e23e0d88d7f8d7f03680", "score": "0.73289794", "text": "emptyDOM() {\n this.rootEl.innerHTML = '';\n this.rootEl.setAttribute('style', 'background-color: #FFF');\n }", "title": "" }, { "docid": "e904cdbf1c19cb80d70625672a3e43fa", "score": "0.729629...
f78a2a74a4f9d9fb7ed488650b386811
speed is whatever units the user wants to use
[ { "docid": "fa61a07f6c0bb04cb12680275de6fbb1", "score": "0.67813", "text": "function calcSpeed(distance, time){\n return distance/time;\n}", "title": "" } ]
[ { "docid": "3adddfd0a1eaaaa5be432a7fc74b2279", "score": "0.7776892", "text": "function getSpeed()\r\n {\r\n return speed;\r\n }", "title": "" }, { "docid": "3fba5a3e29e6480a3ba1bc9eb6472103", "score": "0.7759597", "text": "updateSpeed (speed) {\n this.speed = spee...
53d78a6171125753dbb4fa6f9bb23643
The function whose prototype chain sequence wrappers inherit from.
[ { "docid": "94d209651535670a08e9df4a9c2e1a53", "score": "0.0", "text": "function baseLodash() {\n\t // No operation performed.\n\t}", "title": "" } ]
[ { "docid": "3cb0cd9559bdfd798ea97f4a4f190033", "score": "0.60924053", "text": "function inherit4() {\n\n}", "title": "" }, { "docid": "a97924215a7036b60f895d63446f54e6", "score": "0.5900003", "text": "function inherit3() {\n\n}", "title": "" }, { "docid": "871212b29952f85...
1f565e3ca35189d449974ea99b94fb71
Sends (via method POST) the values of name and nameID (Nafn og notendanafn) to user_log.php which creates cookies from the values of name and nameID. These cookies are what define the personal scoreboard the user gets.
[ { "docid": "ede039adb718080fa7f96060d5713176", "score": "0.4905937", "text": "function signUp() {\n\tvar name = $(\"#name\").val();\n\tvar nameID = $(\"#nameID\").val();\n\n\tif (name !== \"\" && nameID !== \"\") {\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"user_log.php\",\n\t\t\tdata: {nameID: ...
[ { "docid": "42f2ade6c95a8d2ac15d44bc08ddd007", "score": "0.584814", "text": "function addUserName() {\n if (nameInput.value !== \"\") {\n myCookie = nameInput.value;\n CookieUtil.set('name', myCookie);\n\n $('#myTabs a[href=\"#tab-home\"]').trigger('click');\n\n ...
0d3c65cb93e156893d2805543e73aff2
render a button for the toggle
[ { "docid": "c88b2eaa88142810b86563aa19692c52", "score": "0.0", "text": "render() {\n return (\n <button onClick={this.props.triggerStop}>\n Stop\n </button>\n );\n }", "title": "" } ]
[ { "docid": "b735e79adbfc46825a94dc08da3ee4d1", "score": "0.7399494", "text": "toggleButton(){\n if (this.state.showText === true ) return (<div></div>)\n else\n return(<div><Button variant=\"outline-secondary\" onClick={this.handleToggleButton}>About this app</Button></div>)\n }...
706fa814ba3c2daa9b2023481e43ea5d
Returns the current timestamp in the UTC format
[ { "docid": "75e51b18708fcd875cf053ae3edd8cf3", "score": "0.76674086", "text": "static getTimeUTC() {\n return new Date().getTime().toString().slice(0, -3);\n }", "title": "" } ]
[ { "docid": "9e8d2e0a9294506d2e7916c5341e616b", "score": "0.76848286", "text": "function getTimestamp() {\n 'use strict';\n return new Date().toUTCString();\n}", "title": "" }, { "docid": "fa4e6a025ee67633251ccd1d92f34490", "score": "0.7603453", "text": "function utcNow() {\n ...