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
print array in reverse
function printReverse(agg){ var reversed = agg.reverse(); reversed.forEach(function(e,i){ console.log(e + " index #" + i) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printReverse(array){\n\tfor(var i = array.length - 1; i >= 0; i--){\n\t\tconsole.log(array[i])\n\t}\n}", "function printReverse(array) {\n\tfor(let i = array.length - 1; i >= 0; i--) {\n\t\tconsole.log(array[i]);\n\t}\n}", "function printReverse(arr) {\n for (var counter = arr.length - 1; counter >...
[ "0.7881302", "0.78781116", "0.7852424", "0.7766604", "0.7738118", "0.769131", "0.7689463", "0.7644367", "0.75734", "0.7543744", "0.75401235", "0.74971205", "0.74757683", "0.7446935", "0.74240327", "0.7420714", "0.7412086", "0.74051636", "0.73680377", "0.73236656", "0.7306542"...
0.6849523
46
using .forEach to find the max number in the array
function maxTwo(arr){ //need a place to store the largest value/num let largest = 0; //forEach to loop through array arr.forEach(function(element){ //if largest is < element, largest becomes that element, then it loops through the whole arry and as largest changes it will end up being the larges...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function max(arr){\n var highest = 0\n arr.forEach(function(num){\n if (num > highest){\n highest = num\n } \n });\n return highest;\n console.log(highest);\n}", "function max(arr){\n var max_num = 0;\n arr.forEach(num => {\n if (num>max_num){\n max...
[ "0.82830966", "0.8229302", "0.8177472", "0.8159926", "0.8138378", "0.8047114", "0.8041962", "0.7968534", "0.79185724", "0.7875664", "0.78172565", "0.7814468", "0.77954364", "0.7773217", "0.77700394", "0.77647984", "0.77422625", "0.772105", "0.77051514", "0.7668463", "0.766650...
0.8014963
7
third way to find max using for loop, also we will be returning the value instead of console.log()
function maxThree(arr){ let max = arr[0]; for(let i = 1; i < arr.length; i++){ if(arr[i] > max){ max = arr[i]; } } return max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "maximum() {\n // Write your code here\n\tvar max = this.arr[0];\n\tfor(var i=0;i<this.arr.length;i++){\n\t\tif(max>this.arr[i]){\n\t\t max = max;\n\t\t}else{\n\t\t\tmax = this.arr[i];\n\t\t}\n\t}\n\treturn max;\n }", "function findMax(aNums) {\n\n let iMax = aNums[0];\n\n for(var iCount=0; iCount<aN...
[ "0.7964795", "0.79006135", "0.7883848", "0.78602946", "0.7838711", "0.78157896", "0.7803118", "0.7784649", "0.7776413", "0.7731126", "0.7693587", "0.7668202", "0.7657617", "0.7653662", "0.7636739", "0.7628758", "0.7621991", "0.76217157", "0.7617426", "0.76151234", "0.76136553...
0.0
-1
modify this so that it fits the "edit" paradigm
function Edit(props) { let { slug } = useParams(); const classes = useStyles(); const [currentStep, setCurrentStep] = useState(1); const [error, setError] = useState(false); const user = firebase.auth().currentUser; const [jobData, setJobData] = useState(props.jobs.currentPosting); const registeredKeys = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "edit() {\n }", "edit() {\n this._enterEditMode();\n }", "get editable() {}", "doEditMode() {\n\n }", "function editClicked() {\n edit = true;\n}", "edit(todo) {\n this.editTodo = todo.content;\n todo.isEdited = true;\n }", "onEditComplete_() {\n this['ed...
[ "0.70985824", "0.6887541", "0.66792524", "0.62670326", "0.6265421", "0.6193643", "0.61262304", "0.611972", "0.6116647", "0.6095353", "0.6095165", "0.6089608", "0.60785353", "0.60524744", "0.60374165", "0.59883595", "0.5985353", "0.5985353", "0.5985353", "0.5985353", "0.598535...
0.0
-1
Creates an instance of IconRoundPrintElement.
constructor() { super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawIcon()\n\t{\n\t\tlet size = this.size / 2\n\t\tthis.iconHeight = size\n\t\tthis.iconWidth = size\n\t\tconst circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle')\n\t\tcircle.setAttribute('cx', this.x + size / 2)\n\t\tcircle.setAttribute('cy', this.y + size / 2)\n\t\tcircle.setAttribute('r',...
[ "0.6283953", "0.6216445", "0.5930385", "0.5868531", "0.5830304", "0.5746174", "0.5746174", "0.5688483", "0.554698", "0.54403174", "0.53545266", "0.53429985", "0.5304636", "0.5294831", "0.5246504", "0.52448875", "0.5215919", "0.52099186", "0.520872", "0.51868266", "0.5181691",...
0.0
-1
Engine Methods Do at script start Init basic variables
function Awake() { _ce = GetComponent("CombatEngine"); _me = GetComponent("MovementEngine"); _audio = GetComponent("AudioSource"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n initValues();\n initEngine();\n initLevel();\n initTouchHandlers();\n startTurn();\n initEffects();\n setInterval(tick, 10);\n\t}", "function init() {\n\n\n\n\t}", "function init() {\r\n // Set up the items that are needed for the ...
[ "0.73299694", "0.7290233", "0.7214478", "0.7178709", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7161352", "0.7115657", "0.7101944", "0.7101944", "0.7091614", "0.7090693", "0.7070935", "0.70400715", ...
0.0
-1
Do at initial start of script
function Start() { // set animation wrap modes for player avatar charDummy.animation["death"].wrapMode = WrapMode.ClampForever; charDummy.animation["hit"].wrapMode = WrapMode.Once; charDummy.animation["idle"].wrapMode = WrapMode.Loop; charDummy.animation["jump-flight"].wrapMode = WrapMode.ClampForever; charDummy....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeScript()\r\n{\r\n host.diagnostics.debugLog(\"***> initializeScript called \\n\");\r\n}", "function init() {\n\n// reset();\n lastTime = Date.now();\n main();\n }", "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n }...
[ "0.7257915", "0.7242706", "0.72229594", "0.720553", "0.720553", "0.7205285", "0.7194296", "0.7194296", "0.7194296", "0.7194296", "0.7194296", "0.7194296", "0.7194296", "0.7194296", "0.7175818", "0.71743315", "0.71698076", "0.71458876", "0.71458876", "0.71458876", "0.71458876"...
0.0
-1
Animation Methods Play Attack Two attack animation (thrust)
function AnimateThrustRelease():void { // play Attack Two thrust attack animation charDummy.animation.CrossFade("thrust-release", 0.1); SetNewClip(STAB); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animAttack(action) {\n let board = this.board;\n let anim = this.renderAnimation('attack', action.direction);\n let spriteAction = this._sprite.getAction('attack');\n let effectOffset = spriteAction.events.find(e => e[1] === 'react')[0];\n\n anim.addFrame(() => this.stand());\n\n if (this.directi...
[ "0.67248225", "0.66727567", "0.66316587", "0.6617353", "0.6554065", "0.6467994", "0.6370425", "0.6254058", "0.62473285", "0.61700845", "0.6138111", "0.6069563", "0.6064001", "0.60571927", "0.6041031", "0.60386384", "0.6033964", "0.60267913", "0.59797734", "0.5961643", "0.5944...
0.73571455
0
Play Attack Two charge up animation
function AnimateThrustWindup():void { charDummy.animation.CrossFade("thrust-windup", 0.1); SetNewClip(STAB_CHARGE); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AnimateThrustRelease():void {\n\t// play Attack Two thrust attack animation\n\tcharDummy.animation.CrossFade(\"thrust-release\", 0.1);\n\tSetNewClip(STAB);\n}", "function playerAttackAnimation(delta){\n let prevAttackCounter = player.attackCounter;\n player.attackCounter += (delta / 1000);\n let t = ...
[ "0.69820684", "0.64341533", "0.6305373", "0.6159578", "0.6147354", "0.6136515", "0.61201483", "0.61146194", "0.6113339", "0.61048967", "0.6100397", "0.60469", "0.604666", "0.60370284", "0.6000072", "0.5969834", "0.59399045", "0.5936692", "0.593516", "0.59296894", "0.59242857"...
0.5760425
34
Play Hit animation (avatar has taken damage)
function AnimateHit():void { charDummy.animation.CrossFade("hit", 0.1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hit(damage) {\n this.color = this.hitColor\n this.life -= damage\n this.isHit = true\n this.showParticles() // when this enemy is hit, the particles are shown\n\n HelperFunctions.playAudio(this.hitVolume, \"https://raw.githubusercontent.com/JoshMatthew/PeewPeew/master/assets/sfx/enemy-hit.mp3\")\n ...
[ "0.7028578", "0.69794786", "0.6961427", "0.6884872", "0.6693018", "0.6665932", "0.6631181", "0.6583751", "0.6498622", "0.6391535", "0.6365478", "0.63461596", "0.63373935", "0.6308416", "0.6306558", "0.62995535", "0.6286782", "0.62706405", "0.6265349", "0.62247926", "0.6223050...
0.74954855
0
Helper/Getter/Setter Methods Apply modifier to Player attack animation
function ApplyAnimModifier(m:float):void { charDummy.animation["slash1"].speed *= m; charDummy.animation["thrust-release"].speed *= m; charDummy.animation["thrust-windup"].speed *= m; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SetPlayerModifier(modifier){\n this.HUD.SetModifier(modifier);\n }", "attack(player) {\r\n player.applyDamage(this.strength);\r\n }", "animAttack(action) {\n let board = this.board;\n let anim = this.renderAnimation('attack', action.direction);\n let spriteAction = this._sprite.getAction...
[ "0.6854967", "0.6538106", "0.65088755", "0.64036506", "0.62566626", "0.6185382", "0.6163208", "0.61494863", "0.6121513", "0.59487486", "0.59485954", "0.5940265", "0.590732", "0.5905492", "0.5900954", "0.58645105", "0.5859631", "0.58464396", "0.5827343", "0.58242446", "0.58242...
0.6773335
1
Reset modifier to Player attack animation
function ResetAnimModifier():void { charDummy.animation["slash1"].speed = defaultAttackAnimSpeed; charDummy.animation["thrust-release"].speed = defaultAttackAnimSpeed; charDummy.animation["thrust-windup"].speed = defaultAttackAnimSpeed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetJumpingAnimation(player) {\n player.animations.right[JUMPING] = new Animation(dwarfRight, player.spriteSize.x, player.spriteSize.y, player.spriteSize.y * 3, player.spriteSize.x, 3, 0.1, true, null, true);\n player.animations.left[JUMPING] = new Animation(dwarfLeft, player.spriteSize.x, ...
[ "0.65929633", "0.65876204", "0.65465784", "0.6496717", "0.6401761", "0.632221", "0.62840253", "0.62625563", "0.6208652", "0.61905885", "0.61558163", "0.61464137", "0.6143294", "0.6131921", "0.6126089", "0.61260414", "0.61235774", "0.6121641", "0.6120281", "0.61054885", "0.606...
0.76802254
0
Set new Audio clip to be played
function SetNewClip(str:String):void { _currentClip = str; _newClip = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playClip() {\n // console.log('playClip triggered');\n this.state.clip.play(); // play the audio elem currently stored in state.clip\n }", "caidicionar(){\n \tthis.sonidocaida = game.add.audio('FreeFall.mp3');\n\t\tthis.sonidocaida.play();\n }", "set originalClip(value) {}", "function SetSound()...
[ "0.72246754", "0.6545372", "0.6521431", "0.645755", "0.64449525", "0.639923", "0.63164467", "0.6276267", "0.6246029", "0.62079364", "0.61949134", "0.61720467", "0.61665463", "0.61604553", "0.61424005", "0.61176807", "0.61081743", "0.60844445", "0.6081136", "0.60735786", "0.60...
0.6533582
2
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
get formatPrice() { return formatRupiah(this.price) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.7641299", "0.75082797", "0.73139536", "0.73065066", "0.73065066", "0.73065066", "0.72952354", "0.72845256", "0.7278983", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", ...
0.0
-1
Checks if any one of the sourceId's friends is friends with destinationId.
function checkChainedRelationship (sourceId, destinationId, sourceIdFriendsList) { // Loop through sourceId's friends' list for (var i = 0; i < sourceIdFriendsList.length; i++) { // Declare a variable to each ID in sourceId's friends list. var sourceFriendId = sourceIdFriendsList[i], // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFriend(id) {\n for (let friend of this.friends) {\n if (friend.id === id) {\n return true;\n }\n }\n return false;\n }", "addFriend(id, name, device, pfp){\n let possibleIDs = [{id : this.id}, ...this.friends];\n if (possibleIDs.some((e...
[ "0.67854923", "0.54610384", "0.53261274", "0.5313782", "0.5221702", "0.51890934", "0.5160616", "0.51260155", "0.5118633", "0.51089984", "0.5102026", "0.51015955", "0.5096865", "0.50591576", "0.5042136", "0.50285316", "0.50281566", "0.50162995", "0.50137293", "0.49500874", "0....
0.7674584
0
Useful generator and command variables
get projectPath() { return this.findProjectDir(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generate() {\n return {\n instructions: 'instructions here',\n question: 'question here',\n diagram: 'diagram here',\n answer: 'answer here',\n }\n }", "constructor() { super(new GeneratorParser(true)) }", "generate() {\n const cmd = this.command;\n const flags = util.sortBy(\n...
[ "0.60802114", "0.6013679", "0.5941618", "0.5764358", "0.57588553", "0.5698672", "0.5659883", "0.564611", "0.5595698", "0.55841726", "0.5580041", "0.5580041", "0.5580041", "0.5580041", "0.5580041", "0.5580041", "0.5559079", "0.55540395", "0.5503138", "0.5503138", "0.5503138", ...
0.0
-1
Files, directories, and templates
isDir(dir) { try { var stat = fs.statSync(dir); return stat.isDirectory(); } catch (e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "templates() {\n\n this.copy('_package-json', 'package.json');\n this.copy('_bower-json', 'bower.json');\n this.copy('editorconfig', '.editorconfig');\n this.copy('gitignore', '.gitignore');\n this.copy('eslintrc', '.eslintrc');\n this.copy('env-example', '.env.example');\n...
[ "0.6776805", "0.6694181", "0.6576111", "0.65248764", "0.6456953", "0.6428111", "0.64028263", "0.63454986", "0.6342261", "0.6308982", "0.62522954", "0.62381387", "0.622927", "0.622927", "0.6217185", "0.6208221", "0.61948556", "0.61874825", "0.6177869", "0.61367214", "0.6133151...
0.0
-1
XXX: Smarter defaults and checking needed.
writeTemplateWithData(opts, isAddToEndOfExistingFile) { opts = opts || {}; var self = this; var src = opts.src || ''; var dest = opts.dest || ''; var isAddToEndOfExistingFile = isAddToEndOfExistingFile || false; if (_.isArray(src)) { src = this.joinArray(src); } if (_.isArray(des...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n this._super(...arguments);\n this._applyDefaults();\n }", "constructor() {\n super();\n this.setDefaults();\n }", "protected internal function m252() {}", "defaults () {\n }", "private public function m246() {}", "function setupDefault() {\n}", "__previnit(){}", "setDefault(...
[ "0.5999837", "0.5921159", "0.59178925", "0.5870289", "0.57764006", "0.5669482", "0.5610996", "0.5582168", "0.5538553", "0.5524168", "0.5510917", "0.5496706", "0.54859155", "0.54859155", "0.54859155", "0.54859155", "0.54859155", "0.54859155", "0.5478115", "0.5452587", "0.54421...
0.0
-1
For now, we'll just check three levels.
findProjectDir() { try { var base = process.cwd(); var firstLevel = path.join(base, '.io'); var secondBase = path.dirname(base); var secondLevel = path.join(secondBase, '.io'); var thirdBase = path.dirname(secondBase); var thirdLevel = path.join(thirdBase, '.io'); if (this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check(index)\n\t{\n\t\tif(index < levels.length)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function compare_level_one(key){\n \n var com_array = getLevelOne(key);\n\n for(var i = 0; i < 4; i++){\n\tif(level_one[i] != com_array[i]){\n\t \n\t return false;\n\t} \n }\n r...
[ "0.6468818", "0.629964", "0.6177125", "0.61481345", "0.57875794", "0.5744157", "0.57395387", "0.5726929", "0.56753695", "0.567489", "0.5627299", "0.5618709", "0.56058306", "0.55902696", "0.5580278", "0.5507022", "0.54918367", "0.5489877", "0.5437943", "0.5428111", "0.54271024...
0.0
-1
For now, we'll just check three levels.
isProjectDir() { try { var base = process.cwd(); var firstLevel = path.join(base, '.io'); var secondBase = path.dirname(base); var secondLevel = path.join(secondBase, '.io'); var thirdBase = path.dirname(secondBase); var thirdLevel = path.join(thirdBase, '.io'); if (this.i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check(index)\n\t{\n\t\tif(index < levels.length)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function compare_level_one(key){\n \n var com_array = getLevelOne(key);\n\n for(var i = 0; i < 4; i++){\n\tif(level_one[i] != com_array[i]){\n\t \n\t return false;\n\t} \n }\n r...
[ "0.6468818", "0.629964", "0.6177125", "0.61481345", "0.57875794", "0.5744157", "0.57395387", "0.5726929", "0.56753695", "0.567489", "0.5627299", "0.5618709", "0.56058306", "0.55902696", "0.5580278", "0.5507022", "0.54918367", "0.5489877", "0.5437943", "0.5428111", "0.54271024...
0.0
-1
? UPDATE MESSAGE FORM
function handleMessageChange(event) { const name = event.target.name const value = event.target.value const data = { ...userMessage, [name]: value } updateUserMessage(data) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUpdateMessage(msg) {\n document.getElementById('updating').innerHTML = msg;\n }", "function update() {\n sendMessage(document.getElementById(\"input\").value);\n }", "function updateMessage(pageId)\n{\n\tcontainerArea = 'status_msg';\n\tpredefinedMessageFlag = true;\n\tvar posts...
[ "0.71030957", "0.70899165", "0.70717835", "0.6863591", "0.67490774", "0.66979164", "0.66053075", "0.6532559", "0.64996076", "0.6486097", "0.64466083", "0.64056957", "0.6396749", "0.63966465", "0.63400733", "0.6332271", "0.628805", "0.6283535", "0.62721866", "0.6270282", "0.62...
0.5684689
84
try to ways for pick all the checkmarks 1 creating all the selectors tags in a class. 2 creating an array of selectors
constructor(){ this.checkBoxOne = Selector(""); const selectors =[ "", ] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkColors(colorIdList){\n\tthis.obj.querySelectorAll('content pickertag').forEach(tag => tag.classList.remove('checked'))\n\tcolorIdList.forEach(colorid => {\n\t\tthis.obj.querySelector(`content pickertag[data-color-id=\"${colorid}\"]`).classList.add('checked')\n\t})\n}", "function findPseudoElements(el) {\n ...
[ "0.56498307", "0.562725", "0.55447954", "0.5478609", "0.54592794", "0.54592794", "0.54592794", "0.54537714", "0.5450938", "0.5426834", "0.5426664", "0.54167295", "0.5408171", "0.54000753", "0.5388484", "0.5387014", "0.53868294", "0.5365788", "0.53610307", "0.5356072", "0.5335...
0.5943252
0
het bewegen van de voetjes op en neer
loopEend() { this.yLpootOnder -= this.yloopSpeed this.xLpoot -= this.xloopSpeed this.yRpootOnder -= this.yloopSpeed this.xRpoot += this.xloopSpeed this.xLvoetR -= this.xSpeedLvoet this.yLvoetR -= this.ySpeedLvoet this.xRvoetR += this.xSpeedRvoet this.yRvoetR -= this.ySpeedRvoet if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function voltooienObject(){\n\tafspelenGeluid(\"schroeven_compleet\");\n\tobjectenCompleet++;\n\tvolgenInstructies = false;\n}", "function mostraNotas(){}", "bestilt() {\n // Går gjennom varene og setter statusen på bestillingen til \"bestilt\" og varene til \"på lager\"\n for (var i = 0; i < this.varer....
[ "0.6450435", "0.63707894", "0.6156175", "0.61517704", "0.604184", "0.60395336", "0.5998696", "0.59889007", "0.5976873", "0.595889", "0.59517974", "0.5920439", "0.591928", "0.59027344", "0.5886274", "0.58807456", "0.5877859", "0.5872991", "0.58581275", "0.58481365", "0.5846025...
0.0
-1
poging om Eend te laten springen 1 (wordt niet gebruikt)
springEend1() { if (keyIsDown(32)) { this.yLpootOnder = this.yCor + (this.straal * (64 / 20)) this.yRpootOnder = this.yCor + (this.straal * (64 / 20)) this.yPootBoven = this.yCor + (2 * this.straal + (this.straal * (5 / 8))) this.yLvoetR = this.yCor + (this.straal * (64 / 20)); this.yR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watAlsErEenMuisIs(){\n console.log('spring zo snel mogelijk op de tafel');\n}", "legKaart(geselecteerd) {\n //kijken of wel zijn beurt is.\n if (spel.wieAanDeBeurt != 0 || this.heeftBeurtGelegd)\n return;\n\n\n let geselecteerdeKaart = this.kijkWelkeKaartgekozenIs(geselecteerd);\n\n ...
[ "0.6077165", "0.59780616", "0.5936233", "0.58963495", "0.5829561", "0.5816486", "0.5760021", "0.56834453", "0.5667205", "0.5635959", "0.56323636", "0.56219673", "0.55932844", "0.55901265", "0.5578629", "0.5577126", "0.5567851", "0.5562299", "0.55306816", "0.552459", "0.551673...
0.5757083
7
poging om Eend te laten springen 2
springEend2() { if (this.yCor < this.beginyCor) { onGround = false this.springfactor = 3 this.yLpootOnder = this.yCor + (this.straal * (64 / 20)) this.yRpootOnder = this.yCor + (this.straal * (64 / 20)) this.yPootBoven = this.yCor + (2 * this.straal + (this.straal * (5 / 8))) thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "springEend1() {\n if (keyIsDown(32)) {\n this.yLpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yRpootOnder = this.yCor + (this.straal * (64 / 20))\n this.yPootBoven = this.yCor + (2 * this.straal + (this.straal * (5 / 8)))\n this.yLvoetR = this.yCor + (this.straal * (64 / 20));\n ...
[ "0.64003426", "0.60410327", "0.6004707", "0.5528071", "0.5469593", "0.54461443", "0.54118437", "0.5404976", "0.53580767", "0.5350537", "0.53438157", "0.5330859", "0.53059095", "0.52924526", "0.529032", "0.5263668", "0.52303785", "0.522408", "0.5221879", "0.5204179", "0.518599...
0.65080523
0
Edit account PATCH function
editAccount() { let res1 = JSON.stringify({ given_name: this.state.given_name, family_name: this.state.family_name, email: this.state.email, password: this.state.password, }); console.log(res1); return fetch('http://10.0.2.2:3333/api/v0.0.5/user/' + this.state.userID, { m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async editProfile(req, res, next) {\n try {\n req.body.accountId = req.userInfo.id\n const account = await accountService.editProfile(req.body)\n res.send(account)\n } catch (error) {\n next(error)\n }\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({...
[ "0.69706786", "0.69063133", "0.69063133", "0.69063133", "0.69063133", "0.69063133", "0.69063133", "0.69063133", "0.6902265", "0.68140876", "0.67699707", "0.6734691", "0.67221117", "0.6704088", "0.6658562", "0.6629522", "0.6565224", "0.6557353", "0.6536163", "0.6507779", "0.65...
0.7224988
0
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.7641476", "0.7507344", "0.7312871", "0.7306175", "0.7306175", "0.7306175", "0.72937477", "0.7284903", "0.7277787" ]
0.0
-1
Send results from services back to client with http status code 201
function sendResults(results, res) { return res.status(201).json(results); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendResponse(result) {\n if (result != null) {\n response.send(200, result);\n \n }\n else\n response.send(401, \"no records found\");\n return next();\n }", "function sendResponse(result) {\n if (...
[ "0.64230263", "0.6322524", "0.6148023", "0.6146811", "0.6046438", "0.5974659", "0.59655297", "0.5957339", "0.5870166", "0.58365107", "0.58067304", "0.57989454", "0.5790308", "0.57789236", "0.5753307", "0.57037556", "0.5695384", "0.568199", "0.5671429", "0.56672305", "0.565654...
0.7149383
0
A recursive function that plays the queue.
async playSong(msg, bot) { if (this.queue.length === 0) { this.musicChannel.send(`J'ai fini de tout jouer !`); this.changeStatus(Statustype.STOPPED); } else if (this.voiceConnection) { let song = this.queue[0]; console.log(song); try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "PlayQueued() {}", "function play(guild, song) {\nconsole.log(\"here we are\")\n //serverQueue.textChannel.send(`We are here`);\n const serverQueue = queue.get(guild.id);\n //check if queue is empty\n if (!song) {\n serverQueue.connection.destroy();\n queue.delete(guild.id);\n return;\n...
[ "0.7146721", "0.6848096", "0.66667193", "0.6485044", "0.6460494", "0.63474554", "0.63214964", "0.6236415", "0.6139174", "0.611411", "0.6097694", "0.6086438", "0.60785127", "0.6050588", "0.60400647", "0.6039648", "0.60084695", "0.5993271", "0.5918533", "0.58820724", "0.5855480...
0.57656956
27
Skips the current song.
skipSong(msg, bot) { if (this.dispatch && this.status === Statustype.PLAYING) { this.musicChannel.send( new MessageEmbed().setDescription(`⏩ \`${this.queue[0].title}\``) ); this.dispatch.end(); } else { this.musicChannel.send(`Rien à...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "skipNext() {\n let id = this.props.trackId;\n const nodes = this.props.audioNodes;\n\n if ( (id + 1) <= (nodes.length - 1) ) {\n\n nodes[id].item.pause();\n\n id = id + 1;\n setCurrTrack(id);\n\n this.play(id);\n this.props.onItemActive(id);\n }\n\n }", "function skipSong( t...
[ "0.76435274", "0.74910283", "0.74704456", "0.710867", "0.71032465", "0.6955595", "0.6916853", "0.691023", "0.6845241", "0.68205935", "0.67800504", "0.67800504", "0.6739816", "0.67097056", "0.66862845", "0.66568184", "0.65422565", "0.65314484", "0.65234315", "0.64899296", "0.6...
0.70969653
5
Displays the currently playing song and elapsed time.
nowPlaying(msg, bot) { if (this.queue.length > 0) { let elapsedTime = this.formatTime(this.getUnixTime() - this.queue[0].startTime); msg.channel.send( { embed: { type: 'rich', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displaySong() {\n let content = `${songs[currentSong].decade}'s: ${\n songs[currentSong].song\n } // ${songs[currentSong].artist}`;\n nowPlayingText.innerHTML = content;\n }", "function updateTimerDisplay(){\n // Update current time text display.\n $('#current-time').text(fo...
[ "0.751457", "0.71864283", "0.7132756", "0.7112201", "0.7020923", "0.69680804", "0.6967364", "0.6711121", "0.66873026", "0.6686535", "0.66571796", "0.6640965", "0.6544162", "0.6542489", "0.65411526", "0.65054923", "0.64775896", "0.6461112", "0.64477897", "0.6381297", "0.636859...
0.5864408
67
Sets the volume of the dispatcher.
setVolume(msg, msgrep, bot) { let vol = parseInt(msgrep) / 100; if (vol && (vol >= 0 && vol <= 1)) { if (this.dispatch) { this.dispatch.setVolume(vol); this.volume = Math.ceil(vol); msg.channel.send( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setVolume(\r\n volume_)\r\n {\r\n volume = volume_;\r\n }", "set volume(vol)\n {\n this._control.value = Math.max(0,Math.min(100,vol));\n this.volumeUpdated();\n }", "setVolume(volume) {\n this._source.volume = volume;\n }", "setVolume({volume} = {}) {\n ...
[ "0.80060446", "0.7653702", "0.76351285", "0.74431175", "0.74342823", "0.73801017", "0.73413676", "0.7265368", "0.72334653", "0.7229281", "0.7224207", "0.7140154", "0.70951617", "0.70771444", "0.7068915", "0.7034234", "0.700593", "0.69985044", "0.69540846", "0.6893855", "0.679...
0.64099187
33
Current song of the bot
contentVolume(msg, bot, lang){ var vol = this.volume; msg.channel.send( { embed: { type: 'rich', description: `🔈 \`${vol * 100}/100\``, color: 3447003 }}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentSong() {\n\t\treturn this.currentSong;\n\t}", "function gameCurrentSong() {\n let game = 'music probably';\n if (radioJSON !== {}) game = `${radioJSON.artist_name} ${config.separator || '-'} ${radioJSON.song_name}`;\n\n client.user.setGame(game);\n\n return setTimeout(gameCurrentUsersAndGui...
[ "0.8005261", "0.74465245", "0.7084727", "0.7077927", "0.69277906", "0.69124067", "0.68718296", "0.6855184", "0.68090945", "0.6784138", "0.67499655", "0.6722618", "0.6703547", "0.67010206", "0.66972715", "0.6694538", "0.6689817", "0.66664773", "0.66535044", "0.6618744", "0.652...
0.0
-1
Summons the bot to the user's voice channel.
joinVc(msg, bot, lang) { if (msg.member.voiceChannel) { if (this.voiceConnection === null) { this.musicChannel = msg.channel; this.musicChannel.send({ embed: { type: 'rich', description: `À rejoin 🔈**${ms...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function voice() {\n responsiveVoice.speak(getRandomElement(lines), \"UK English Male\");\n}", "function setVoice() {\n msg.voice = voices.find(voice => voice.name === this.value);\n playAudio();\n}", "Play(bot, voiceChannel, textChannel, url){\n\t\tthis.Broadcast = bot.Client.createVoiceBroadcast();\n\t\tt...
[ "0.6566386", "0.6532043", "0.6477283", "0.6417501", "0.63381076", "0.63241446", "0.6270683", "0.62623", "0.62500405", "0.622065", "0.6157813", "0.61428845", "0.5997093", "0.59041876", "0.5867332", "0.58625454", "0.58520055", "0.5837174", "0.57838535", "0.57805216", "0.5775252...
0.54319495
44
Disconnects from the voice channel.
leaveVc(msg, bot, lang) { if (this.voiceConnection) { this.musicChannel.send( { embed: { type: 'rich', description: `⛔ Musique arrétée. Je part du channel : **${this.voiceConnection.channel.name}**.`, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disconnect() {\n this.emit('closing');\n this.sendVoiceStateUpdate({\n channel_id: null,\n });\n this.player.destroy();\n this.cleanup();\n this.status = Constants.VoiceStatus.DISCONNECTED;\n /**\n * Emitted when the voice connection disconnects.\n * @event VoiceConnection#disconn...
[ "0.8034438", "0.7824305", "0.78161794", "0.7500696", "0.7013925", "0.6646797", "0.6365291", "0.6365291", "0.63457173", "0.62249947", "0.6162302", "0.61567724", "0.6122012", "0.61052775", "0.6093304", "0.60899216", "0.6081445", "0.60718966", "0.6037551", "0.60368174", "0.59945...
0.57369244
46
/ PROCESSING PROCESSING PROCESSING PROCESSING PROCESSING PROCESSING /____________________________________________________________________________ Code: BUI MINH NGOC Date: 30/04/2013 Template: /____________________________________________________________________________ Info: Xu ly insert
function Ins_CategoryLevel1() { // ShowLoading("#frmIns_CategoryLevel1"); $.ajax({ url: "/Action/ProcessBackendAction.ashx?ActionObject=CategoryLevel1&action=Ins", type: "POST", dataType: "json", data: $("#frmIns_CategoryLevel1").serialize(), success: function (data) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processInsert(param) {\n\n var args = {\n targetid: \"frmData_상세\"\n };\n gw_com_module.formInsert(args);\n\n}", "function insert_sourceA(){\n\t/*Set the data:*/\n\t//id\n\tvar id=$('#HiddeN_projectfileboxitemid').val();\n\t var id=id.match(/\\d{1,12}/);\n\t var id=parseInt(id,10);\t\...
[ "0.6599243", "0.6091318", "0.6071631", "0.60001874", "0.5967404", "0.59434354", "0.5929309", "0.58486676", "0.58365285", "0.5833765", "0.5828329", "0.5823903", "0.58238363", "0.5808578", "0.5808235", "0.57856363", "0.57611424", "0.5753171", "0.5753171", "0.5738514", "0.573471...
0.0
-1
/ FORM FORM FORM FORM FORM FORM FORM FORM FORM FORM FORM FORM FORM FORM /____________________________________________________________________________ Code: BUI MINH NGOC Date: 30/04/2013 Template: /____________________________________________________________________________ Info: Mo form insert
function OpenDialog_Upd_CategoryLevel1(IDCategoryLevel1) { var title = ""; var width = 1200; var height = 900; if ($("#PositionShowDialog").length <= 0) { $("body").append('<div id="PositionShowDialog" style="display:none; overflow-x:hidden; overflow-y:scroll;" title="' + title + '"></div>'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processInsert(param) {\n\n var args = {\n targetid: \"frmData_상세\"\n };\n gw_com_module.formInsert(args);\n\n}", "insertForm() {\n this.builder = new Builder(this.container, this.options.template, {\n style: this.options.style,\n formContainerClass: this.options.formContaine...
[ "0.743793", "0.6557058", "0.6344865", "0.6326205", "0.63243157", "0.62908036", "0.6245798", "0.62086546", "0.61829805", "0.61605537", "0.6156626", "0.61548775", "0.61544394", "0.61498773", "0.61455595", "0.6142344", "0.6135559", "0.6110405", "0.6109474", "0.6078535", "0.60735...
0.0
-1
====================================================================================== /====================================================================================== /====================================================================================== /========================================================...
function Del_CategoryLevel1(IDCategoryLevel1) { $.ajax({ url: "/Action/ProcessBackendAction.ashx?ActionObject=CategoryLevel1&action=Del&IDCategoryLevel1=" + IDCategoryLevel1, type: "POST", dataType: "json", data: $("#frmUpd_CategoryLevel1").serialize(), success: function (da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient final protected i...
[ "0.6827863", "0.67494917", "0.64868826", "0.62786806", "0.62716925", "0.6270561", "0.60487276", "0.5984092", "0.590728", "0.5798895", "0.5781767", "0.5738042", "0.57297754", "0.57036185", "0.57029057", "0.56998765", "0.56897694", "0.5665101", "0.5634263", "0.5597616", "0.5565...
0.0
-1
add points to user account handler
async function handleAddpoints(amount) { try { await userApi.addPoints(amount); setUser({ ...user, points: user.points + amount }); } catch (err) { throw err; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPoints(state, delta){\n console.log(\"store commit add points delta is \", delta)\n state.points += +delta\n user.setPoints(state.points)\n }", "function giveUserPoint(ID){\n\n}", "async function requestAddPoints(setAddPoints) {\n try {\n const response = await fetch(`${API...
[ "0.67032737", "0.6583442", "0.61595184", "0.6155726", "0.60903794", "0.5958069", "0.590774", "0.5820927", "0.5810934", "0.5771814", "0.57611424", "0.5758466", "0.5736003", "0.5697597", "0.5689567", "0.56754285", "0.56149155", "0.55921954", "0.55677265", "0.5498657", "0.549182...
0.74262094
0
redeem product and update user points
async function handleRedeemProduct(productId, cost) { try { await productApi.redeemProduct(productId); setUser({ ...user, points: user.points - cost }); } catch (err) { throw err; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redeemCode() {\n //Check if the code is in firebase\n rewards\n .where(\"code\", \"==\", code)\n .where(\"codeUsed\", \"==\", false)\n .get()\n .then((querySnapshot) => {\n const rewardsDocs = querySnapshot.docs;\n if (rewardsDocs.length > 0) {\n rewardsDoc...
[ "0.6321576", "0.6166347", "0.612981", "0.6070931", "0.6068711", "0.60117495", "0.6008301", "0.59965646", "0.5981678", "0.5966008", "0.59447503", "0.5907986", "0.58836496", "0.5871997", "0.5871107", "0.5866254", "0.58591187", "0.58581305", "0.58519286", "0.58441055", "0.583355...
0.7525798
0
EDIT THESE FUNCTIONS AT YOUR OWN RISK
function write(str, num) { let out = '<p>'; if (num == 1) { out += '<b>'; } out += str; if (num == 1) { out += '</b>'; } out += '</p>'; document.write(out); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "function miFuncion (){}", "private public function m246() {}", "function FunctionUtils() {}", "private internal function m248() {}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "protected internal function m252() {}", "s...
[ "0.6467666", "0.64605516", "0.64115715", "0.6399132", "0.63882", "0.6310551", "0.6310551", "0.6310551", "0.62697744", "0.6243538", "0.6113304", "0.6065781", "0.60338897", "0.60338897", "0.5977245", "0.5931855", "0.58970565", "0.589335", "0.5886738", "0.5886738", "0.5879612", ...
0.0
-1
Using timestamps to ensure the game runs at an optimal speed for both slow and fast computers
function animate(timestamp) { ctx.clearRect(0, 0, $canvas.width, $canvas.height) collision_ctx.clearRect(0, 0, $canvas.width, $canvas.height) let deltaTime = timestamp - lastTime lastTime = timestamp timeToNextRaven += deltaTime // Every set 500ms (because ravenInterval) a new Raven will be created if (timeToNe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTime() {\n\tlet curTime = Date.now();\n\t//divide by 1,000 to get deltaTime in seconds\n deltaTime = (curTime - prevTime) / 1000;\n //cap deltaTime at ~15 ticks/sec as below this threshhold collisions may not be properly detected\n if (deltaTime > .067) {\n \tdeltaTime = .067;\n }\n ...
[ "0.68129987", "0.66134423", "0.64212364", "0.6374931", "0.63384503", "0.63198394", "0.6319039", "0.6313403", "0.6278505", "0.6273711", "0.6244352", "0.6216573", "0.6213309", "0.6208119", "0.61823857", "0.61690295", "0.6163327", "0.6162885", "0.6159323", "0.61501783", "0.61462...
0.0
-1
so the program will not close instantly
function exitHandler(options, err) { console.log('stopScanning & exit'); noble.stopScanning(); process.exit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "relaunch() {}", "function end () {\n //the page goes white\n $('body').css({\n backgroundColor: 'white',\n });\n $('#canvas').css({\n visibility: 'hidden',\n });\n\n //the final package downloads\n window.open('https://whogotnibs.github.io/dart450/assignment02/downloads/package03.zip', '_blank');\n\...
[ "0.6860197", "0.62875473", "0.6265465", "0.6255335", "0.62380266", "0.6177448", "0.6177448", "0.6167775", "0.61260384", "0.61052173", "0.60775244", "0.60762185", "0.6074367", "0.6041928", "0.602698", "0.5981245", "0.5978416", "0.59764236", "0.5958588", "0.5947416", "0.5944504...
0.0
-1
Validation data input match structure of graph data
separateDataToManagement(data, option, fileName) { if (option === 'SEGMENT_SET') { this.CltRouteDiagram.LoadVertexDefinition(data, fileName); } else if (option === 'MESSAGE_SPEC') { this.CltRouteDiagram.loadGraphData(data, fileName); } else if (option === 'ROUTE_CONFIG') { this.CltRouteDiagram.loadScreen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async validateGraphDataStructure(data) {\n\t\t//Validate data exists\n\t\tif(data===undefined)\n\t\t{\n\t\t\tconsole.log('Data does not exist')\n\t\t\treturn Promise.resolve('error')\n\t\t}\n\n\t\t// Validate struct data\n\t\tif (!data.vertex || !data.boundary || !data.position || !data.vertexTypes ||\n (Obje...
[ "0.7386253", "0.6042347", "0.5796557", "0.5786372", "0.5748043", "0.5714384", "0.5583449", "0.5551114", "0.55318505", "0.5499626", "0.5468752", "0.545076", "0.54255474", "0.54047817", "0.53971195", "0.5379914", "0.5369647", "0.5327639", "0.52978534", "0.5295437", "0.52778107"...
0.0
-1
Set mode graph is enable or disable edit
setGraphMode(modeGraph) { const viewMode = modeGraph === 'S' ? VIEW_MODE.SHOW_ONLY : VIEW_MODE.EDIT; this.CltRouteDiagram.setViewMode(viewMode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClickEditMode() {\n\t\teventEmitter.emit(EVENTS.ToggleEditMode, this.Controls.EDIT_MODE);\n\t}", "function switchGraphButtons(flag) {\n\tif (flag) {\n\t\tenableField($(\"selectAllGraphsButton\"));\n\t\tenableField($(\"selectNoGraphsButton\"));\n\t} else {\n\t\tdisableField($(\"selectAllGraphsButton\"));\n\t\td...
[ "0.6527489", "0.64163333", "0.6380538", "0.6370979", "0.6307563", "0.62986267", "0.6257", "0.6249511", "0.6227534", "0.622447", "0.62178344", "0.62103856", "0.6188383", "0.61561346", "0.6095213", "0.6072883", "0.59934354", "0.59726995", "0.59612733", "0.5957677", "0.5909446",...
0.72827494
0
Visitor for both function expressions and arrow function expressions.
function visitFunctionExpression(node) { // We only want to lint nodes which are reactive hook callbacks. if ( (node.type !== "FunctionExpression" && node.type !== "ArrowFunctionExpression") || node.parent.type !== "CallExpression" ) { return; } if (node....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArrowFunctionExpression(node, print) {\n\t if (node.async) this.push(\"async \");\n\n\t if (node.params.length === 1 && t.isIdentifier(node.params[0])) {\n\t print.plain(node.params[0]);\n\t } else {\n\t this._params(node, print);\n\t }\n\n\t this.push(\" => \");\n\n\t var bodyNeedsParens = t....
[ "0.6331525", "0.6331525", "0.61798507", "0.61519825", "0.61407304", "0.6071491", "0.60605216", "0.60357445", "0.60357445", "0.60357445", "0.595975", "0.5919894", "0.58716047", "0.58716047", "0.58115387", "0.5795144", "0.57905805", "0.57786125", "0.57632756", "0.5713621", "0.5...
0.5323821
38
[ undefined, undefined, undefined, undefined, undefined ]
function courseHandler1(course) { // return lại value trong 1 object để có key và value return { name: `Khóa học: ${course.name}` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayDefined(array) {\n return array.filter(function (item) { return item != null; });\n}", "function Array$empty() {\n return [];\n }", "function Array$empty() {\n return [];\n }", "function getFilledUpArray(array) {\n let lastDefinedElement;\n return array.map(element => {\n ...
[ "0.65857434", "0.6500141", "0.6500141", "0.6464317", "0.63884413", "0.6371865", "0.63537234", "0.6343312", "0.6312782", "0.62756187", "0.6240108", "0.6235042", "0.62316287", "0.6204491", "0.6151284", "0.61214435", "0.6112706", "0.6112706", "0.6108817", "0.6104846", "0.6083792...
0.0
-1
purposeful console log error
function add() { var d = 2; console.log('15' + d); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "static logError(error) {\r\n console.log(`[ERROR] Something did not work - \\n`, error);\r\n }", "static error(...args) {\n if (this.toLog('ERROR')) {\n console.error.apply(console, arguments);\n ...
[ "0.79142857", "0.7770462", "0.7660022", "0.7619771", "0.7560242", "0.74155706", "0.7415194", "0.7408324", "0.7399986", "0.73425967", "0.73235625", "0.7308335", "0.7296003", "0.7295082", "0.72694653", "0.726508", "0.7259441", "0.7250391", "0.7250391", "0.72422886", "0.724031",...
0.0
-1
using getHours and getDate
function getDate() { if(new Date(). getHours() < 19) { document.getElementById("Time").innerHTML = "Good evening"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_hours(date) {\r\n hours = date.getHours();\r\n return hours; \r\n}", "get hours() {\n return this.date.getHours();\n }", "setUpHours() {\n this._.each(this.vendor.hours, (day) => {\n //handle no open or close times\n if(!day || !day.opening_time...
[ "0.77485406", "0.71669483", "0.70577425", "0.6955603", "0.6948306", "0.69014835", "0.6828184", "0.67155284", "0.66826075", "0.6678359", "0.6623227", "0.6597867", "0.6579857", "0.6579857", "0.6579857", "0.6579857", "0.6568588", "0.6561662", "0.6556938", "0.6556938", "0.6555377...
0.6284846
30
if statement using function
function rey() { if (10 > 2) { document.getElementById("Win").innerHTML = "Top of the morning to ya"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function if_function(condition, true_res, false_res) {\n\n\n}", "function IF(){}", "function _if(bool, func1, func2) {\n if (bool)\n return (func1)();\n return (func2)();\n}", "function check() {}", "function shortFunction(arg) {\n if (arg) {\n console.log(true)\n }\n return true\n}", "functio...
[ "0.7485358", "0.7364364", "0.67368877", "0.64680606", "0.6464569", "0.6431797", "0.6423477", "0.63785714", "0.63504493", "0.631042", "0.630323", "0.630323", "0.6302562", "0.62731355", "0.62502486", "0.62194484", "0.6205945", "0.61795527", "0.6170463", "0.61688226", "0.6113189...
0.0
-1
pulls time from the computer
function Time_function() { var Time = new Date().getHours(); var Reply; if (Time < 12 == Time > 0) { Reply = "It is morning time!"; } else if (Time >= 12 == Time < 18) { Reply = "It is the afternoon."; } else { Reply = "It is the evening"; } document.getElem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get time() {}", "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "get time() {\n return (process.hrtime()[0] * 1e9 + process.hrtime()[1]) / 1e6;\n }", "async function lastFed() {\r\n var response = await fetch(\"http://worldtimeapi.org/api/timezone/Asia/Kolkata\"...
[ "0.6625223", "0.65871036", "0.6483367", "0.6433997", "0.6399606", "0.6389729", "0.6244521", "0.6243184", "0.62427825", "0.624188", "0.6207446", "0.6176338", "0.6169841", "0.6169841", "0.61634135", "0.61543995", "0.61134535", "0.61057645", "0.61033225", "0.609296", "0.60775757...
0.0
-1
Check winner between user and computer
function checkWinner() { // Select any random icon const computerChoice = pickRandomChoice(); // Display user and computer choice updateSelection(user_select, userChoice); updateSelection(computer_select, computerChoice); //GAME RULES // Draw game if use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWinner(user, computer) {\n gamePlayed++;\n var verdict;\n\n if (user == computer) {\n gameDraw++;\n verdict = 'draw';\n }\n if (\n user == \"paper\" && computer == \"rock\" ||\n user == \"rock\" && computer == \"scissors\" ||\n user == \"scissors\" && computerPlay == \"paper\"\n ...
[ "0.7952004", "0.77836406", "0.758264", "0.75196224", "0.74878776", "0.7481333", "0.74298435", "0.74119294", "0.73150176", "0.7299069", "0.72689843", "0.72674", "0.72597134", "0.7241561", "0.72301924", "0.7226957", "0.72054654", "0.71836203", "0.71759564", "0.7137714", "0.7114...
0.8183195
0
Randomly pick computer choice
function pickRandomChoice(){ return choices[Math.floor(Math.random() * choices.length)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computerSelection(){\n let rand = random(choices.length);\n return choices[rand];\n}", "function getComputerChoice(){\n const choices = ['r','p','s'];\n const randomSelection = (Math.floor(Math.random() * 3));\n return choices [randomSelection];\n }", "function getComputerChoice() {\...
[ "0.86697745", "0.85802865", "0.8567515", "0.85640186", "0.85636014", "0.855776", "0.85448873", "0.852167", "0.84960306", "0.8462045", "0.8434024", "0.8365677", "0.83336234", "0.83289635", "0.8315286", "0.8290707", "0.8279418", "0.82545066", "0.82412815", "0.8229178", "0.82095...
0.770003
89
Update Selected choices details
function updateSelection(selectionEL, choice) { //Reset class of buttons selectionEL.classList.remove('btn-paper'); selectionEL.classList.remove('btn-rock'); selectionEL.classList.remove('btn-scissors'); //Update the selected images const img = selectionEL.querySelector('img'); selectio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateChoices() {\n let value = this._widgetCall('getValue')\n this._widgetCall('updateChoices')\n if (value != null) {\n this._widgetCall('setValue', value)\n }\n }", "function updateDropdown(item, values){\n item.asListItem().setChoiceValues(values)\n}", "function u...
[ "0.7608246", "0.67744154", "0.66193664", "0.64107716", "0.61925364", "0.61925364", "0.60812396", "0.60757977", "0.6072914", "0.606304", "0.6048901", "0.60400957", "0.6028043", "0.5992104", "0.5979942", "0.59481555", "0.59308946", "0.5928995", "0.59253126", "0.59129417", "0.59...
0.0
-1
Show Results of the game
function showResult() { main.style.display = 'none'; selection.style.display = 'flex'; document.getElementById("reset").hidden = true; document.getElementById("user_select").hidden = false; document.getElementById("computer_select").hidden = false; document.getElementById("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async showResults() {\r\n document.getElementById('scenario').hidden = true;\r\n document.getElementById('results').hidden = false;\r\n\r\n const game = await this.api.getResult(this.answers);\r\n document.getElementById('game-title').innerText = game.title;\r\n document.getEleme...
[ "0.8250343", "0.8115041", "0.78690356", "0.77725863", "0.76810557", "0.7657827", "0.76530904", "0.7617984", "0.7613507", "0.76025856", "0.74802434", "0.742088", "0.7364465", "0.73464245", "0.733682", "0.7318472", "0.7299417", "0.72746676", "0.72568566", "0.7205038", "0.719975...
0.0
-1
Stop Game by setting scores to 0
function stop_game() { //Set scores to 0 score = 0; comscore = 0; // Update score board document.getElementById("score").innerHTML=score; document.getElementById("comscore").innerHTML=comscore; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stopScoreCounter() {\n\tclearInterval(scoreCounterID);\n}", "function endGame(score) { // import score from game\n // bug/feature when player clicks end game from game window; gameover doesn't get the score\n // EITHER REMOVE THE QUIT GAME BUTTON FROM GAME WINDOW OR MAKE IT AN ACTUAL FEATURE\n ...
[ "0.7749893", "0.7422692", "0.7415969", "0.7303156", "0.729356", "0.7233182", "0.7215843", "0.7215786", "0.7215376", "0.7209129", "0.71824473", "0.71728355", "0.7130518", "0.7117802", "0.70899457", "0.7044959", "0.7038698", "0.7028729", "0.70264393", "0.70261323", "0.69973856"...
0.81050515
0
NOTE IMPORTANT !!!!!!!!!!!!!!!!!!!!! This all used to be done when the dahsboard loaded. Now that I'm centralizing this for all pages in this component, i'm not getting all the campaigns up front. I'm waiting for one to be activated, then checking the subscription status and getting all the campaigns. I assume that the...
componentDidMount () { if ( this.props.location && this.props.location.query && this.props.location.query.charge_id ) { this.setState( { cb: function ( active ) { //console.log( 'CampaignList.mounted.getSubscriptionStatus.then', active ); if ( !active ) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCampaign()\n{\n}", "async function getCampaign() {\n try {\n let response = await fetch('http://localhost:4000/campaigns');\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n let result = await response.json();\n if (result.erro...
[ "0.65925753", "0.622169", "0.5976169", "0.5873735", "0.58715045", "0.58637375", "0.57721984", "0.57616186", "0.5759209", "0.5692153", "0.56606", "0.56370455", "0.5630356", "0.5580176", "0.5568881", "0.5501491", "0.5486553", "0.5414422", "0.53911245", "0.53768754", "0.5333718"...
0.5778917
6
functions can accept other functions as arguments
function logResultOf(fx, arg) { console.log(fx.call(null, arg)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takesFunc(f){\n\tvar a = 1;\n\tvar b = 2;\n\tconsole.log(f(a,b));\n}", "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "function morechickens(anyFunction){ console.log(\"Bock bock!\"); anyFunction(); }...
[ "0.6665872", "0.6491145", "0.64516836", "0.6442424", "0.6440696", "0.6374879", "0.637442", "0.6361529", "0.63537955", "0.63492966", "0.630321", "0.62971294", "0.6247763", "0.6239329", "0.6145974", "0.6141482", "0.6131288", "0.6114006", "0.61052006", "0.60865456", "0.60786045"...
0.0
-1
SHUFFLE A GIVEN ARRAY
function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inShuffle(arr) {\n\t\tvar temp = [],\n\t\t\tlength = arr.length;\n\t\tfor (var i = 1; i < length; i += 2) {\n\t\t\ttemp.push(arr[i]);\n\t\t}\n\t\tfor (var i = 0; i < length; i += 2) {\n\t\t\ttemp.push(arr[i]);\n\t\t}\n\t\tarr.splice.apply(arr, [0, length].concat(temp));\n\t\treturn arr;\n\t}", "function...
[ "0.72064483", "0.7051534", "0.69509524", "0.69209146", "0.6906572", "0.6903452", "0.6884483", "0.6854389", "0.6832111", "0.68265784", "0.68216735", "0.68164337", "0.6812841", "0.68103784", "0.67982787", "0.67982787", "0.67982787", "0.67968255", "0.67960656", "0.67960656", "0....
0.0
-1
CHECK FOR RIGHT ANSWER
function check(xID){ xID=parseInt(xID.slice(1,2)); if(xID==ansID){ //right score+=10; }else{ //wrong if(score>0){ score-=10; } document.getElementById("i"+xID).style.backgroundImage="url('images/button3.png')"; } document.getElementById("i"+ansID).style.backgroundImage="url('images/butto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRightAnswer() {\n increment(\"#score\", 1);\n answer = null;\n}", "checkAnswer(answer) {\n let check = false;\n if (answer == this.rightAnswer)\n check = true;\n check ? console.log(`CORRECT`) : console.log(`INCORRECT`);\n return check;\n }", "function...
[ "0.7722787", "0.72940874", "0.72508985", "0.71179116", "0.70538485", "0.7043549", "0.699554", "0.6920073", "0.68700445", "0.6860203", "0.6798397", "0.6775182", "0.67489207", "0.6742781", "0.6721156", "0.66899985", "0.6672309", "0.66682696", "0.6628782", "0.66072756", "0.65932...
0.0
-1
The new function should now take an array of numbers as guesses, and tells the user if any of their guesses were correct.
function int0to20(intArray) { var random = Math.floor(Math.random() * 21); console.log(random); var count = 0; for (var i =0; i < intArray.length; i++) { if (random === intArray[i]) { count += 1; } } if (count > 0) { console.log("Good guess!!"); } else { console.log("Incorrect, try again!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkGuess(){\n\tif (playersGuess === winningNumber) {\n\t\tmoveSection();\n\t\tchangeAnn(\"YOU WIN!\")\n\t\tfaceDance();\n\n\t} else {\n\t\tif (arrayOfGuesses.includes(playersGuess)) {\n\t\t\t$('#announcement').fadeOut('fast');\t\n\t\t\tchangeAnn(\"You already guessed that number\");\n\t\t} else {\n\t\t\...
[ "0.7534614", "0.74735856", "0.71046495", "0.71041644", "0.7042849", "0.6976353", "0.69650847", "0.69351393", "0.6913845", "0.68516153", "0.6841793", "0.6810578", "0.6760049", "0.67590266", "0.6686044", "0.6623238", "0.6609422", "0.65933603", "0.6592414", "0.6586324", "0.65810...
0.0
-1
Observations: An 'equalized' array is one in which all elements are the same. Because there is no way to modify elements other than delete them, it means that the final 'equalized' array will have a length equal to the most populous element in the original array. Identifying that is pretty easy: Create an array to keep...
function equalizeArray(numbers) { const counts = getEntryCounts(numbers); const maxCount = counts.reduce((total, count) => Math.max(total, count)); return numbers.length - maxCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalizeArray(arr) {\n let arrObj = {};\n let maxCount = 0;\n //for each number, create a key: value pair\n for (let num of arr) {\n //if key exists, add 1. Otherwise, set to 1\n arrObj[num] = arrObj[num] + 1 || 1;\n }\n //for each value in the object, if value is higher th...
[ "0.80264753", "0.7978396", "0.75894505", "0.7432472", "0.7415652", "0.7387811", "0.73204875", "0.72989", "0.72525394", "0.71990865", "0.71050495", "0.70925605", "0.689592", "0.6886038", "0.6870227", "0.686838", "0.68514335", "0.6837568", "0.6829492", "0.68268526", "0.67769635...
0.72638273
8
drawSpike(0) drawSpike(0.4) drawSpike(2) drawSpike(2.4) drawSpike(2.8) drawSpike(3.4)
moveL() { this.rotation -= (Math.PI / 180); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSpikes() {\n\n\t// Redrawing the spieks everytime the leave the canvas at x = 0\n if (spikes.desX + spikesImg.width <= 0)\n {\n spikes.desX = canvas.width;\n }\n \n // Making the spikes move smoothly along with the ground and background images\n spikes.desX -= xv;\n\n // A ...
[ "0.6666824", "0.6662618", "0.6508724", "0.6380796", "0.6356526", "0.620169", "0.61430717", "0.608801", "0.6083611", "0.60249346", "0.60039395", "0.60039395", "0.60039395", "0.60039395", "0.5968523", "0.5958192", "0.5940753", "0.59321946", "0.59221727", "0.5920518", "0.5918951...
0.0
-1
le puedo pasar al array un tercer array que guarde las mazmorras seleccionadas.
function seleccionaMazmorras(array,n){ if(n > 0){ panel.append("Selecciona la mazmorra que quieras crear"); panel.append("<form name=fmazmorra>"); for(var i=0; i<array[0].length; i++){ panel.append('<legend><input type="Radio" name="mazmorras" value="' + array[0][i].id +'">Mazmo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selecciona() {\n var seleccion = parseInt(Math.random() * (10));\n palabraJuego = new Array();\n palabraJuego = palabras[seleccion];\n /*Solo debug, muestra la palabra seleccionada del array de palabras*/\n //document.getElementById(\"debug\").innerHTML = \"<p>\" + seleccion + \"</p>\"+\"<p...
[ "0.6049209", "0.5961054", "0.5919522", "0.5886106", "0.58728015", "0.57843846", "0.5756969", "0.57374066", "0.573624", "0.5729199", "0.5719645", "0.56987756", "0.5673521", "0.5644826", "0.5632633", "0.5601686", "0.56003946", "0.55806714", "0.5544368", "0.5542587", "0.5523983"...
0.5639498
14
Crear funcion que haga llamada a AJAX, que cargue las mazmorras seleccionadas con su id nuevo
function guardaInfoNuevaMazmorra(array,n){ $.ajax({ method: "GET", url: "loadCargaMazmorra.php", success: function (msg){ var result= $.parseJSON(msg); var myArray = []; if(result.length !== 0){ /* from result create a string of data and append to the div */ $.each(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ControlGramajeSeleccionadoOnda(id)\n{\n\t //alert('id es '+document.getElementById(\"gramaje_seleccionado\").value);\n\t //carga_ajax(webroot+'produccion/BuscarKilosOnda',id,document.getElementById(\"gramaje_seleccionado\").value,'hola');\t\n carga_ajax15(webroot+'produccion/BuscarKilosOnda',id,d...
[ "0.7401636", "0.73925865", "0.7205756", "0.7187071", "0.7170265", "0.71522784", "0.70999455", "0.70900923", "0.6943275", "0.6902005", "0.6889235", "0.6867347", "0.68665254", "0.6855411", "0.6853881", "0.68525153", "0.68503726", "0.6805464", "0.6794848", "0.67780894", "0.67687...
0.0
-1
Despues de guardar, mostrar para pintar en las mazmorras los consumibles
function guardarSeleccion(mazmorra){ $.ajax({ method: "GET", url: "loadCrearMazmorras.php", data: {nombre:mazmorra.nombre,rutaImagen:mazmorra.rutaImagen,w:mazmorra.w,h:mazmorra.h}, success: function (msg){ var result= $.parseJSON(msg); var res; var myArray = []; if(re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function guardar_ejercicio(){\n\tsalvaEstado()\n\tif(no_identificado)\n\t{\n\t\tif(confirm(\"Los resultados se han guardado temporalmente.\\n\\n\"+\n\t\t\t\"Para guardar definitivamente y poder recuperarlos mas adelante debe registrarse o identificarse.\\n\\n\"+\n\t\t\t\"¿Desea registrarse ahora?\"))\n\t\t\twindow...
[ "0.66006285", "0.63887715", "0.6375997", "0.6232781", "0.618835", "0.6154053", "0.6111498", "0.6111498", "0.61108637", "0.6085163", "0.608293", "0.6075884", "0.60744774", "0.60542524", "0.604363", "0.60344344", "0.603336", "0.6021341", "0.6007166", "0.59766096", "0.59702754",...
0.0
-1
this is an example of a pure function. most components should be written as pure functions (as opposed to the containers which are classes with state). basically, a pure function gets its data passed in via "props" from the container above (including function references). no side effects, given the same props passed in...
function ExampleComponent(props) { return ( <div className="whatever" > <h1>{props.header}</h1> <div className="col-sm-12"> <form onSubmit={props.onSubmitUser}> <div className="form-group"> <input className="form-control" onChange={props.onUpda...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionalComponent() {}", "function PureComponent(props,context,updater){this.props=props;this.context=context;// If a component has string refs, we will assign a different object later.\nthis.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue;}", "function PureComponent(props,context,update...
[ "0.68780136", "0.68585473", "0.68585473", "0.6814058", "0.68097156", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251", "0.6548251",...
0.0
-1
TODO > Create fallback SVG icon for missing src scenario.
render() { return ( <img src={ this.props.src } alt={ this.props.title } className={ styles.image } /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function svgpngfallback(){\n if (!Modernizr.svgasimg) {\n $('img').each(function(){\n var dataSrc = $(this).attr('data-src')\n var include = \"wp-content/uploads\"\n\n if (typeof dataSrc !== typeof undefined && dataSrc !== false) {\n if (dataSrc.includes(include) === false) {\...
[ "0.6863129", "0.6753805", "0.6657891", "0.66300195", "0.66300195", "0.6493518", "0.6427319", "0.62613463", "0.62038106", "0.6185767", "0.6185767", "0.6173825", "0.60978574", "0.6096889", "0.60868376", "0.60737956", "0.6068638", "0.60501766", "0.6024442", "0.6024442", "0.60242...
0.0
-1
! vuerouter v3.0.7 (c) 2019 Evan You
function i(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function version(){ return \"0.13.0\" }", "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&...
[ "0.6056174", "0.59535694", "0.5731381", "0.5666798", "0.5582857", "0.5581933", "0.5507302", "0.550633", "0.54699355", "0.54554594", "0.54340523", "0.54278874", "0.5411815", "0.5404959", "0.5404624", "0.5404624", "0.5404624", "0.5404624", "0.5404624", "0.5404624", "0.5404624",...
0.0
-1
alert('hi'); Firstly, you must be able to get input from the user. The following HTML was taken from the jquery_lab folder. Line 19 is used to create an input box for the user. Line 20 creates a button so that the input can be added to the list. To set up functionality of the button, we start at liine 40. Firstly, we u...
function addToList(list, newThing) { // var input = document.getElementById('my-input').value; var newListItem = newThing; $('#fav-list').append('<li>' + newListItem + '</li>'); // var newList = list.innerHTML + newListItem; // in line 20, the 'list' in list.innerHTML refers to list in line 14, which is /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToList ()\n{\n\t$(\"#js-shopping-list-form\").submit(function (e) \n {\n e.preventDefault();\n var userInput = $(\"input#shopping-list-entry\").val();\n\n $.trim(userInput);\n\n // Verify user input is valid, prompt if not.\n if (!userInput) \n {\n ...
[ "0.7212804", "0.70330524", "0.6940617", "0.6889861", "0.68453497", "0.68042123", "0.67633855", "0.6758174", "0.6742794", "0.6734742", "0.6730106", "0.6682812", "0.65904427", "0.6581879", "0.6581281", "0.655069", "0.65402687", "0.65152526", "0.6472292", "0.64679503", "0.645007...
0.7437995
0
Default configuration Help function
function logHelp() { console.log([ ' ', ' Houston :: A cool static files server', ' ', ' Available options:', '\t --port, -p \t Listening port to Houston, default to 8000 ', '\t --path, -d \t Dir of starting point to Houston, default to actual dir', '\t --browser,-b \t open browser window, (true,f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function help() {\n\n}", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n...
[ "0.70005316", "0.6990945", "0.69463885", "0.68245375", "0.67472726", "0.66420794", "0.66380215", "0.66208756", "0.6614397", "0.65675503", "0.6546568", "0.6531127", "0.6511259", "0.6509276", "0.6507103", "0.65061027", "0.6424939", "0.63956815", "0.6388987", "0.6386981", "0.638...
0.6245299
32
readDir Depending on the mode this function is able to read the dir and return the html with the files for that dir
function readDir(location) { if (cfg.cli) cfg.safe = false; if (cfg.safe) { return '<div style="text-align:center"><h1> 401 - Unauthorized </h1><hr>' + '<p> node-' + process.version + ' running on ' + cfg.port + '</p></div>'; } var dir = location, start = '<ul class=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readDir() {\n recursive(dir, function(err, files) {\n if (err) {\n console.log(err)\n } else {\n for (var i = 0; i < files.length; i++) {\n if (validator(files[i])) {\n compile(files[i].split(__dirname.split(\"bin\").join(\"\") + pro...
[ "0.65744454", "0.6306271", "0.62471604", "0.62394834", "0.6140093", "0.6108094", "0.60978293", "0.6010014", "0.59567285", "0.5910631", "0.5905483", "0.58362895", "0.5762315", "0.57205576", "0.56955886", "0.5693386", "0.5666608", "0.5649426", "0.56016415", "0.55939645", "0.558...
0.6219214
4
mergeObj merge the target object into the origin This overwrite the origin object
function mergeObj(org, target) { var result = org; Object.keys(target).map(function(prop) { result[prop] = target[prop]; return true; }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merge_objs(source,target) {\n\t\tfor (var k in source) { if (source.hasOwnProperty(k)) {\n\t\t\ttarget[k] = source[k]; // TODO: does this need to be recursive for our purposes?\n\t\t}}\n\t\treturn target;\n\t}", "function merge_objs(source, target) {\n for (var k in source) {\n if (sou...
[ "0.77069336", "0.74756074", "0.7409198", "0.7409198", "0.73823863", "0.7316376", "0.7270792", "0.7270792", "0.72501516", "0.72252274", "0.72176754", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231", "0.7217231...
0.7085164
42
Partially borrowed from Connect lib/middleware/static
function checkEtags(req, res, stat) { function getHeader(name) { if (req.headers[name] || req.headers[name.toLowerCase()]) return req.headers[name]; return false; } var etag = '"' + stat.size + '-' + Number(stat.mtime) + '"', last = stat.mtime.toUTCString(); cfg.maxAge = c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function staticMiddleware() {\n return async function staticMiddlewareHandler(ctx, next) {\n try {\n if (ctx.path !== '/') {\n return await (0, _koaSend2.default)(ctx, ctx.path, true ? {\n root: _paths2.default.public,\n immutable: true\n } : {\n root: _paths2.def...
[ "0.6992885", "0.67698014", "0.67392945", "0.65835273", "0.64931184", "0.6479583", "0.64729965", "0.6468198", "0.64487636", "0.64433885", "0.63783", "0.63778776", "0.6345478", "0.6340603", "0.6293391", "0.6259685", "0.6256952", "0.62371004", "0.6229441", "0.6215715", "0.618954...
0.0
-1
server The server handler
function server(req, res) { var self = this; req.startTime = Date.now(); req.query = qs.parse(url.parse(req.url).query); // Hack to make it work with weird paths and encoding types, especial // File names with spaces like "Hi world.pdf" or "niña.pdf" // Hat tip to @mathias req.url = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Server() {}", "function serve() {\n connect.server(serverConfig);\n}", "function serverHandler(request, response) {\n try {\n console.log('request received: ' + request.url);\n\n if(request.url === '/') {\n response.writeHead(200, {'Content-Type': 'text/html'});\n ...
[ "0.74164337", "0.71694595", "0.7139256", "0.705832", "0.702616", "0.69806594", "0.69746476", "0.6908167", "0.6891034", "0.6880224", "0.6868422", "0.68376523", "0.68347734", "0.68175423", "0.6790612", "0.677642", "0.6752363", "0.6742444", "0.6735525", "0.6722176", "0.6642062",...
0.72071755
1
Houston The main function
function createServer(options) { var app; if (!options) throw new Error('Invalid options'); if (typeof options === 'string') cfg.path = options; else if (typeof options === 'object') cfg = mergeObj(cfg, options); else throw new TypeError('Type of ' + options + ' is not an object or a string...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Main()\n {\n \n }", "function main(){\n\t\n}", "function main(){\n\n\n}", "function main(){\r\n}", "function main() {\n\n}", "function main() {\n}", "function main () {\n\tvar prompt = require('prompt');\n prompt.start();\n console.log (\"\\nInput the business's name and address ...
[ "0.7214537", "0.70964617", "0.705079", "0.69634676", "0.6884663", "0.68772334", "0.66927946", "0.6529002", "0.6461714", "0.6452477", "0.642688", "0.64255965", "0.631002", "0.62975013", "0.6279295", "0.6261258", "0.62553364", "0.6247839", "0.62184626", "0.62112147", "0.6180372...
0.0
-1
When the server is already listing on a port log the conf
function listener() { if (logged == 1) return; logged = 1; cfg.port = app.address().port; csl.log('Server running on port := ' + cfg.port); // Log the current configuration for (var key in cfg) { if (key != 'spdy' || key != 'https') csl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListening() {\n _logs('访问地址: ' + _config2.default.secheme + '://ip:' + port + '/');\n _logs('APIDoc: ' + _config2.default.secheme + '://ip:' + apiPort + '/');\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = `${serverConfig.host}:${serverConfig.defaultPort}`;\n\t// co...
[ "0.6604624", "0.6573863", "0.6536319", "0.6521333", "0.64958173", "0.6494934", "0.6439188", "0.63882107", "0.6379738", "0.63791025", "0.6375912", "0.6368103", "0.63433045", "0.63197905", "0.6275829", "0.62460274", "0.6236782", "0.62333167", "0.6230046", "0.62233263", "0.62189...
0.6063367
56
Creates a new symbol group and closes the modal on success and passes the newly created symbol group.
createGroup() { this.errorMsg = null; this.SymbolGroupResource.create(this.project.id, this.group) .then(createdGroup => { this.ToastService.success('Symbol group <strong>' + createdGroup.name + '</strong> created'); this.EventBus.emit(events.GROUP_CREATED, {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function group_add(){\n\t$.get(\n base_url + 'index.php/adm/groups_get_form',\n {nohtml:'nohtml'},\n function(data){\n $(\"#modal-global-body\").html('<div class=\"well\">'+data+'</div>');\n } \n );\n $('#modal-global-label').html('<i class=\"fa fa-group\"></i>&n...
[ "0.65374225", "0.6372367", "0.63532096", "0.62559396", "0.622814", "0.62192965", "0.6201034", "0.6154511", "0.61442995", "0.6130731", "0.60085785", "0.60076517", "0.59666437", "0.58880967", "0.5882353", "0.5846175", "0.5829342", "0.57483274", "0.57275444", "0.5688989", "0.564...
0.71480924
0
From the Origin spec If the request method is safe (as defined by RFC 2616, Section 9.1.1, e.g. either "GET" nor "HEAD"), return "MUST NOT modify state" and abort these steps. If the request does not contain a header named "Origin", return "MAY modify state" abort these steps. For each request header named "Origin", le...
function csrfCheck(req, res, next) { //Only check for non-GET requests, since GETs don't modify state if ('GET' !== req.method && 'HEAD' !== req.method) { if (req.get('Origin')) { for (var i = 0; i < whitelist.length; i++) { //whitelist can also contain regexps ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function originIsAllowed(origin) {\n\t//debido a que no se restringen clientes, no se realiza ningun tratamiento\n\treturn true;\n}", "function isOriginAllowed(requestOrigin) {\r\n var allowed = false;\r\n _.each(allowedOrigins, function (origin) {\r\n return !(allowed = origin.test(requestOrigin));...
[ "0.6850048", "0.65542215", "0.617368", "0.6051966", "0.6030803", "0.5673447", "0.5656146", "0.5551805", "0.5551805", "0.5551805", "0.54732335", "0.5424815", "0.53159064", "0.5273917", "0.5219689", "0.52068424", "0.52068424", "0.52068424", "0.5126897", "0.5102241", "0.5080055"...
0.5327431
12
Preact component that renders a simplified version of the DOM structure of PDF.js pages. This is used to test PDFspecific highlighting behavior.
function PDFPage({ showPlaceholder = false }) { return ( <div className="page"> <div className="canvasWrapper"> {/* Canvas where PDF.js renders the visual PDF output. */} <canvas /> </div> {/* Transparent text layer created by PDF.js to enable text selection */} {!showPlace...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DOMRenderer() {}", "function page() {\n\n return (\n <ReactMarkdown>wip</ReactMarkdown>\n );\n}", "renderPage() {}", "render() {\n//todo add component view\n return (\n <div>\n PageTest\n </div>\n );\n }", "function Page() {\n ret...
[ "0.6044567", "0.58206564", "0.581228", "0.57442945", "0.5709762", "0.5707746", "0.5691862", "0.5651362", "0.56325006", "0.5623067", "0.5510991", "0.5495439", "0.54818404", "0.5461297", "0.5430682", "0.54033256", "0.54033256", "0.5394243", "0.53684837", "0.5363111", "0.5363111...
0.7001537
0
Add some text nodes to `root` and highlight them with `highlightRange`. Returns all the highlight elements.
function createHighlights(root, cssClass = '') { let highlights = []; for (let i = 0; i < 3; i++) { const span = document.createElement('span'); span.textContent = 'Test text'; const range = new Range(); range.setStartBefore(span.childNodes[0]); range.setEndAfter(span.childNodes[0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllTextNodesInRange() {\n const startContainer = this.range.startContainer\n const endContainer = this.range.endContainer\n const rootEl = this.range.commonAncestorContainer\n const textNodes = []\n\n if (startContainer === endContainer) {\n if (startContainer.nodeType === Node.TEXT_NODE) {\...
[ "0.6242743", "0.58639497", "0.5797975", "0.5712698", "0.5652555", "0.5618987", "0.5618987", "0.5613892", "0.5576457", "0.55709934", "0.5535021", "0.5531149", "0.5512737", "0.55048764", "0.55048764", "0.5447463", "0.54418814", "0.5392767", "0.5387639", "0.53692126", "0.5368597...
0.7298424
0
before the test runs...
before(callback) { BoundAsync.series(this, [ super.before, this.setTeamSettings, this.setRepoSignupData ], callback); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeRun() {}", "function setUp() {\n}", "function setUp()/* : void*/\n {\n }", "before (callback) {\n\t\tthis.testBegins = Date.now();\n\t\tthis.init(callback);\n\t}", "function beforeTest()\n{\n\tconsole.log(\"'beforeTest' executed\");\n}", "beforeAll() {}", "function beforeTest() {\n ...
[ "0.77987254", "0.7539732", "0.744086", "0.73429054", "0.73172003", "0.7191919", "0.71533763", "0.7128467", "0.6814452", "0.679829", "0.67541057", "0.67500573", "0.6701781", "0.6678004", "0.6678004", "0.6678004", "0.66575384", "0.6638723", "0.65897566", "0.6563058", "0.6520784...
0.60686255
68
set the team settings to enable the autojoin feature
setTeamSettings(callback) { this.doApiRequest( { method: 'put', path: `/team-settings/${this.team.id}`, token: this.users[0].accessToken, data: { autoJoinRepos: [this.repo.id] } }, callback ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function activate() {\n teamMember.member.lead = (teamMember.member.name === 'Jett');\n }", "updateTeamSettings (teamId, teamSettings) {\n let option = this,\n userSettings = option.getUserSettings();\n \n // Update the team settings\n userSettings[ teamId ] = teamSetti...
[ "0.639171", "0.5621017", "0.55533487", "0.55125254", "0.528968", "0.5273437", "0.5245949", "0.5216925", "0.52010256", "0.51549727", "0.5133472", "0.5086249", "0.5068281", "0.505253", "0.504938", "0.50304824", "0.5009732", "0.5005471", "0.49923745", "0.49877447", "0.4985482", ...
0.6482932
0
set the data to pass with the request indicating repobased signup
setRepoSignupData (callback) { this.data.teamId = this.team.id; this.data.repoId = this.repo.id; this.data.commitHash = this.repo.knownCommitHashes[0]; callback(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}...
[ "0.6650387", "0.6650387", "0.6650387", "0.6650387", "0.6650387", "0.6561377", "0.6561377", "0.65320134", "0.6415303", "0.63212764", "0.6253704", "0.62423784", "0.62021875", "0.61765194", "0.6052007", "0.6039628", "0.6038537", "0.6009411", "0.6009101", "0.6005077", "0.6000355"...
0.0
-1
validate the response to the test request
validateResponse(data) { Assert.deepStrictEqual(data.user.teamIds, [this.team.id], 'user created was not put on the team'); Assert.deepStrictEqual(data.user.companyIds, [this.team.companyId], 'user created was not put in the company'); super.validateResponse(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "validateResponse (data) {\n\t\tAssert.equal(data, '/web/confirm-email-error?error=AUTH-1002', 'improper redirect');\n\t}", "static validateResponse(response) {\n if (!response.ok) {\n throw Error(response.statusText);\n }\n return response;\n }", "validateResponse (data) {\n\t\tthis.validateDisp...
[ "0.73479426", "0.73414063", "0.73079836", "0.7292687", "0.7276471", "0.7157064", "0.7107608", "0.71037376", "0.7098662", "0.70034075", "0.69893605", "0.69790435", "0.6940299", "0.6895911", "0.68661946", "0.68548614", "0.68409497", "0.68075", "0.6782096", "0.67226774", "0.6714...
0.642305
39
This DFT verifies an update in Presenter Name as direct presenter name verification is covered in BVTS
function VerifyPPTPresenterName() { LogMessage("DataCollabTest :: VerifyPPTPresenterName"); var selfDisplayName = GetTestCaseParameters("DisplayName1"); var presenterName1 = GetBuddyDisplayName(0); var presenterName2 = GetBuddyDisplayName(1); //Share PPT from Bot GotoMyInfo(); SetNote("VerifyPP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VerifySharedPPTName()\n{\n LogMessage(\"DataCollabTest :: VerifySharedPPTName\");\n var selfDisplayName = GetTestCaseParameters(\"DisplayName1\");\n var presenterName = GetBuddyDisplayName(0);\n var pptName1 = GetPPTName();\n var pptName2 = GetPPTName();\n \n //Share PPT from Bot\n GotoMyI...
[ "0.5787598", "0.52986115", "0.5272952", "0.52341527", "0.5176286", "0.51377815", "0.5123494", "0.51218414", "0.51112396", "0.5062412", "0.50457096", "0.5019274", "0.49844912", "0.4976148", "0.49552065", "0.49187908", "0.49117655", "0.49050334", "0.48939234", "0.48909885", "0....
0.702825
0
This DFT verifies an update in PPT Name as direct PPT name verification is covered in BVTS
function VerifySharedPPTName() { LogMessage("DataCollabTest :: VerifySharedPPTName"); var selfDisplayName = GetTestCaseParameters("DisplayName1"); var presenterName = GetBuddyDisplayName(0); var pptName1 = GetPPTName(); var pptName2 = GetPPTName(); //Share PPT from Bot GotoMyInfo(); SetNote(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VerifyPPTPresenterName()\n{\n LogMessage(\"DataCollabTest :: VerifyPPTPresenterName\");\n var selfDisplayName = GetTestCaseParameters(\"DisplayName1\");\n var presenterName1 = GetBuddyDisplayName(0);\n var presenterName2 = GetBuddyDisplayName(1);\n \n //Share PPT from Bot\n GotoMyInfo();\n ...
[ "0.6087191", "0.57080376", "0.54170984", "0.5349103", "0.52887416", "0.5271727", "0.5165807", "0.51642966", "0.5092584", "0.50397706", "0.50121117", "0.49734414", "0.4966316", "0.4924048", "0.49226144", "0.49118182", "0.4895933", "0.48910984", "0.48892674", "0.4879827", "0.48...
0.5875711
1
PERF: Attempts to speed this method up get very Heisenbergy. Quickly returning based on typeof works for primitives, but slows down object types. Even === checks on null and undefined (no typeof) will end up basically breaking even. This seems to be as fast as it can go.
function classToString(obj) { return internalToString.call(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol...
[ "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.64010555", "0.63963056", "0.63963056", "0.63963056", "0.63963056"...
0.0
-1
Map and Set may be [object Object] in certain IE environments. In this case we need to perform a check using the constructor instead of Object.prototype.toString. istanbul ignore next
function getConstructorClassCheck(obj) { var ctorStr = String(obj); return function(obj) { return String(obj.constructor) === ctorStr; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsMapAndSet$1() {\n\t if (typeof Symbol === 'undefined' || typeof Map === 'undefined' || typeof Set === 'undefined') {\n\t return false;\n\t }\n\t var prop = Object.getOwnPropertyDescriptor(Map, Symbol.species);\n\t return prop && 'get' in prop && Map[Symbol.species] === Map;\n\t}", "functi...
[ "0.6081172", "0.6055065", "0.60402906", "0.60383224", "0.6036672", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6005776", "0.6002559", "0.5991396", "0.5991396", "0.59754026", "0.59754026", "0.5969107",...
0.0
-1
Wrapping the core's "define" methods to save a few bytes in the minified script.
function wrapNamespace(method) { return function(sugarNamespace, arg1, arg2) { sugarNamespace[method](arg1, arg2); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define(factory){\n\t\tif(arguments.length == 2){ // precompiled version\n\t\t\tdefine.factory[arguments[1]] = factory\n\t\t\treturn\n\t\t}\n\t\tdefine.last_factory = factory // store for the script tag\n\t\t// continue calling\n\t\tif(define.define) define.define(factory)\n\t}", "function monkeyPatch() ...
[ "0.6767815", "0.65763724", "0.6568892", "0.6451899", "0.6238316", "0.62261087", "0.6214535", "0.593051", "0.58938265", "0.5862761", "0.5787577", "0.5754631", "0.5754631", "0.5679593", "0.5633566", "0.5586334", "0.55837196", "0.5546412", "0.55087435", "0.54866946", "0.54866946...
0.0
-1
This song and dance is to fix methods to a different length from what they actually accept in order to stay in line with spec. Additionally passing argument length, as some methods throw assertion errors based on this (undefined check is not enough). Fortunately for now spec is such that passing 3 actual arguments cove...
function fixArgumentLength(fn) { var staticFn = function(a) { var args = arguments; return fn(a, args[1], args[2], args.length - 1); }; staticFn.instance = function(b) { var args = arguments; return fn(this, b, args[1], args.length); }; return staticFn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Mo(t, e, n) {\n if (e.length < n) throw new x(D.INVALID_ARGUMENT, \"Function \" + t + \"() requires at least \" + es(n, \"argument\") + \", but was called with \" + es(e.length, \"argument\") + \".\");\n}", "function $e(t, e, n) {\n if (e.length < n) throw new c(h.INVALID_ARGUMENT, \"Function \" +...
[ "0.5988019", "0.58935905", "0.5871393", "0.5863242", "0.58413815", "0.573563", "0.5724943", "0.5720949", "0.5677496", "0.5563266", "0.5540924", "0.5523296", "0.5493949", "0.54923594", "0.5475672", "0.5454135", "0.5454135", "0.5449864", "0.54415464", "0.54415464", "0.54071945"...
0.69650716
0
For methods defined directly on the prototype like Range
function defineOnPrototype(ctor, methods) { var proto = ctor.prototype; forEachProperty(methods, function(val, key) { proto[key] = val; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function RangePrototype() {}", "function Range() {}", "function RangeProt...
[ "0.7949221", "0.7949221", "0.7949221", "0.7949221", "0.7949221", "0.7949221", "0.7949221", "0.7949221", "0.7764409", "0.76467997", "0.6707749", "0.66168785", "0.63867664", "0.6211918", "0.61679274", "0.6162674", "0.61491454", "0.6050767", "0.6042748", "0.5989968", "0.5928838"...
0.0
-1
Coerces an object to a positive integer. Does not allow Infinity.
function coercePositiveInteger(n) { n = +n || 0; if (n < 0 || !isNumber(n) || !isFinite(n)) { throw new RangeError('Invalid number'); } return trunc(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPositiveInteger (obj) {\n if (isString(obj)) {\n return /^(0|[1-9]\\d*)$/.test(obj);\n } else {\n return (obj >>> 0) === obj;\n }\n}", "function toInt(val){\n\t // we do not use lang/toNumber because of perf and also because it\n\t // doesn't break the functionality\n\t r...
[ "0.65952533", "0.640265", "0.6367268", "0.6322973", "0.62360203", "0.6225715", "0.6099476", "0.60757786", "0.60744345", "0.60744345", "0.60744345", "0.60744345", "0.6070501", "0.6070018", "0.6070018", "0.60691845", "0.6061671", "0.6036409", "0.6036409", "0.6036409", "0.60086"...
0.6353942
3
Get object property with support for 0..1 style range notation.
function handleArrayIndexRange(obj, key, any, val) { var match, start, end, leading, trailing, arr, set; match = key.match(PROPERTY_RANGE_REG); if (!match) { return; } set = isDefined(val); leading = match[1]; if (leading) { arr = handleDeepProperty(obj, leading, any, false, se...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Range() {}", "get range() {\n\t\treturn this.range$.slice(0, 2);\n\t}", "get $from() {\n return this.ranges[0].$from;\n }", "get $to() {\n return this.ranges[0].$to;\n }", "get value(){ \r\n return { \r\n min : this._value[ 0 ], \r\n max : this._value[ 1 ]\r\n ...
[ "0.61659163", "0.60061127", "0.59820807", "0.58762187", "0.57859033", "0.5598088", "0.5559217", "0.5501442", "0.5479442", "0.5477246", "0.5461372", "0.54605436", "0.5452432", "0.5439483", "0.54191214", "0.54104006", "0.53537107", "0.5335272", "0.53334713", "0.53214705", "0.52...
0.59616226
3
TODO: Use Object.assign here going forward.
function simpleMerge(target, source) { forEachProperty(source, function(val, key) { target[key] = val; }); return target; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function r(){return r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}", "function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[...
[ "0.71395624", "0.7057065", "0.7030923", "0.7030559", "0.69503224", "0.6810758", "0.6778592", "0.67673784", "0.67644036", "0.67569786", "0.6754682", "0.6747089", "0.67190194", "0.67049736", "0.67049736", "0.66589725", "0.6651971", "0.6615014", "0.6600618", "0.66004217", "0.659...
0.0
-1
Make primtives types like strings into objects.
function coercePrimitiveToObject(obj) { if (isPrimitive(obj)) { obj = Object(obj); } // istanbul ignore next if (NO_KEYS_IN_STRING_OBJECTS && isString(obj)) { forceStringCoercion(obj); } return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#instantiatePrimitive(type, value) {\n const typeOf = {\n number: new Number(value),\n string: new String(value),\n boolean: new Boolean(value)\n }\n\n return typeOf[type];\n }", "function coercePrimitiveToObject(obj) {\n if(isPrimitiveType(obj)) {\n ...
[ "0.6069322", "0.5782351", "0.57193273", "0.57166237", "0.5705447", "0.5699203", "0.5681672", "0.56416947", "0.56125176", "0.56125176", "0.5592014", "0.5592014", "0.5592014", "0.5580698", "0.55754", "0.5540325", "0.5526681", "0.5501369", "0.5498651", "0.549113", "0.5476646", ...
0.51631063
58
Force strings to have their indexes set in environments that don't do this automatically. istanbul ignore next
function forceStringCoercion(obj) { var i = 0, chr; while (chr = obj.charAt(i)) { obj[i++] = chr; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(index) {\n return this.strings[index] || '';\n }", "function censor(){\n let pairStrings = {};\n return function(str1 , str2){\n if(str2){\n pairStrings[str1] = str2;\n } else {\n let arr1 = str1.split(/([_\\W])/)\n arr1 = arr1.map(index => {\n ...
[ "0.59439075", "0.5609034", "0.5545838", "0.54974973", "0.52799845", "0.5263335", "0.522519", "0.5178262", "0.51631093", "0.5139572", "0.51356405", "0.5120667", "0.5100515", "0.50911635", "0.50601816", "0.5025453", "0.5013236", "0.49866992", "0.49749482", "0.49721506", "0.4957...
0.5284607
4
Serializes an object in a way that will provide a token unique to the type, class, and value of an object. Host objects, class instances etc, are not serializable, and are held in an array of references that will return the index as a unique identifier for the object. This array is passed from outside so that the calli...
function serializeInternal(obj, refs, stack) { var type = typeof obj, sign = '', className, value, ref; // Return up front on if (1 / obj === -Infinity) { sign = '-'; } // Return quickly for primitives to save cycles if (isPrimitive(obj, type) && !isRealNaN(obj)) { return type + si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static writeObject(obj) {\n return [];\n }", "function encodeObject(o) {\n if (_.isNumber(o)) {\n if (_.isNaN(o)) {\n return ['SPECIAL_FLOAT', 'NaN'];\n } else if (o === Infinity) {\n return ['SPECIAL_FLOAT', 'Infinity'];\n } else if (o === -Infinity) {\n return ['SPECIAL_FLOAT...
[ "0.5985731", "0.59822035", "0.5634626", "0.5634626", "0.5632649", "0.5532055", "0.55153924", "0.5465905", "0.5452977", "0.5378514", "0.53660053", "0.5365731", "0.53402936", "0.5194759", "0.5194759", "0.5193543", "0.5191171", "0.5191171", "0.5191171", "0.5191171", "0.5191171",...
0.6111245
0
It's unclear whether or not sparse arrays qualify as "simple enumerables". If they are not, however, the wrapping function will be deoptimized, so isolate here (also to share between es5 and array modules).
function getSparseArrayIndexes(arr, fromIndex, loop, fromRight) { var indexes = [], i; for (i in arr) { // istanbul ignore next if (isArrayIndex(i) && (loop || (fromRight ? i <= fromIndex : i >= fromIndex))) { indexes.push(+i); } } indexes.sort(function(a, b) { var aLoop ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sparse(arr) {\n var i, res = { };\n for (i = 0; i < arr.length; i++) {\n res[arr[i].index] = arr[i];\n }\n return res;\n }", "function Array() {}", "function prepare$Array (seen, o, where) {\n let pa = { arr: []...
[ "0.6210775", "0.56975985", "0.5672167", "0.5505915", "0.540002", "0.5376071", "0.53676605", "0.53621286", "0.5348682", "0.5344525", "0.5251365", "0.5248819", "0.52446705", "0.5212313", "0.5199438", "0.5189272", "0.51777756", "0.5173466", "0.5155451", "0.51474404", "0.51443976...
0.5592284
3
Takes into account fullwidth characters, commas, and decimals.
function stringToNumber(str, base) { var sanitized, isDecimal; sanitized = str.replace(fullWidthNumberReg, function(chr) { var replacement = getOwn(fullWidthNumberMap, chr); if (replacement === HALF_WIDTH_PERIOD) { isDecimal = true; } return replacement; }); return isDeci...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valDbl2(textbox, labelId, errmsg, maxlength) {\n var val = textbox.value;\n\n if (val.indexOf(\".\") >= 0) {\n var vals = val.split('.');\n if (vals[0].trim().length == 0 && vals[1].trim().length == 0)\n textbox.value = '0.00';\n else if (vals[0].trim().length > maxle...
[ "0.5995961", "0.5938346", "0.5927696", "0.5905943", "0.5814726", "0.57517177", "0.56799275", "0.56656677", "0.5598988", "0.55900717", "0.55816746", "0.55337036", "0.5502981", "0.5483122", "0.5477502", "0.54524845", "0.54515785", "0.54403055", "0.54174036", "0.5408774", "0.540...
0.0
-1