query
stringlengths 9
34k
| document
stringlengths 8
5.39M
| negatives
sequencelengths 19
20
| metadata
dict |
---|---|---|---|
PURPOSE: Adds a directory to the breadcrumb. PARAMS: dir = the directory to add | function addCrumb(dir) {
var crumb = '<span><a class="breadcrumbs-item change" href="" data-path="' + dir + '">' + getDirName(dir) + '</a> / </span>';
crumbarray.push(crumb);
$('.breadcrumb').append(crumbarray[crumbarray.length - 1]);
} | [
"addToTree({ state, commit, getters }, { parentPath, newDirectory }) {\n // If this directory is not the root directory\n if (parentPath) {\n // find parent directory index\n const parentDirectoryIndex = getters.findDirectoryIndex(parentPath);\n\n if (parentDirectoryIndex !== -1) {\n // add a new directory\n commit('addDirectories', {\n directories: newDirectory,\n parentId: state.directories[parentDirectoryIndex].id,\n });\n\n // update parent directory property\n commit('updateDirectoryProps', {\n index: parentDirectoryIndex,\n props: {\n hasSubdirectories: true,\n showSubdirectories: true,\n subdirectoriesLoaded: true,\n },\n });\n } else {\n commit('fm/messages/setError', { message: 'Directory not found' }, { root: true });\n }\n } else {\n // add a new directory to the root of the disk\n commit('addDirectories', {\n directories: newDirectory,\n parentId: 0,\n });\n }\n }",
"function breadcrumbAdd( albumIdx ) {\r\n\r\n var ic='';\r\n if( !G.O.breadcrumbHideIcons ) {\r\n ic=G.O.icons.breadcrumbAlbum;\r\n if( albumIdx == 0 ) {\r\n ic=G.O.icons.breadcrumbHome;\r\n }\r\n }\r\n var $newDiv =jQuery('<div class=\"oneItem\">'+ic + G.I[albumIdx].title+'</div>').appendTo(G.GOM.navigationBar.$newContent.find('.nGY2Breadcrumb'));\r\n if( G.O.breadcrumbOnlyCurrentLevel ) {\r\n // link to parent folder (only 1 level is displayed in the breadcrumb)\r\n if( albumIdx == 0 ) {\r\n // no parent level -> stay on current one\r\n jQuery($newDiv).data('albumID','0');\r\n }\r\n else {\r\n jQuery($newDiv).data('albumID',G.I[albumIdx].albumID);\r\n }\r\n }\r\n else {\r\n // link to current folder\r\n jQuery($newDiv).data('albumID',G.I[albumIdx].GetID());\r\n }\r\n $newDiv.click(function() {\r\n var cAlbumID=jQuery(this).data('albumID');\r\n DisplayAlbum('-1', cAlbumID);\r\n return;\r\n });\r\n }",
"onButtonAddTableErDirClicked(e) {\n let erTree = new TadTableErTree();\n\n if ((this.gCurrent.erTreeNode !== null) && (this.gCurrent.erTreeNode !== undefined)) {\n if (this.gCurrent.erTreeNode.nodeType !== \"NODE_DIR\") return\n erTree.node_parent_id = this.gCurrent.erTreeNode.id;\n } else {\n erTree.node_parent_id = -1;\n }\n\n erTree.node_zhname = \"新增目录\";\n erTree.node_enname = \"newErDir\";\n erTree.node_type = \"NODE_DIR\";\n\n this.doAddTableErTree(erTree);\n }",
"function insertNode(currentPath, remainingPath, parent, firstLevel) {\n var remainingDirectories = remainingPath.split('/');\n var nodeName = remainingDirectories[0];\n var newPath = firstLevel ? nodeName : (currentPath + '/' + nodeName);\n // console.log('=== inserting: '+ nodeName);\n if (remainingDirectories.length === 1) { // actual file to insert\n // console.log('last item');\n var node = createNode(nodeName, newPath, parent, [], 0);\n parent.children.push(node);\n return;\n }\n else {\n // path consists of multiple directories and a file\n // console.log('not last item')\n var node = findAndGetChild(nodeName, parent);\n remainingDirectories.shift();\n var pathToGo = remainingDirectories.join('/');\n if (node) {\n // directory already exists\n insertNode(newPath, pathToGo, node, false);\n return;\n }\n else {\n // create the directory and insert on it\n node = createNode(nodeName, newPath, parent, [], 0);\n parent.children.push(node);\n insertNode(newPath, pathToGo, node, false);\n return;\n }\n }\n}",
"function onDirectoryClick()\n\t{\n\t\tmoveToDirectory( this.getAttribute('data-path') + '/', true );\n\t}",
"function getChild (dir, path, addMissing) {\n\t\tif (!path && path !== '') return;\n\t\twhile (path[0] === '/') path = path.slice(1);\n\t\tif (path.length === 0) return dir;\n\n\t\tvar nextPartEnd = path.indexOf('/')+1,\n\t\t\tnextPartName, remainingPath;\n\t\tif (nextPartEnd === 0) {\n\t\t\tnextPartName = path;\n\t\t\tremainingPath = null;\n\t\t}\n\t\telse {\n\t\t\tnextPartName = path.slice(0, nextPartEnd);\n\t\t\tremainingPath = path.slice(nextPartEnd);\n\t\t}\n\t\tnextPartName = nextPartName.toLowerCase();\n\n\t\tvar nextPart;\n\t\tif (dir.children) {\n\t\t\tfor (var i = dir.children.length; i--;) {\n\t\t\t\tif (dir.children[i].name.toLowerCase() === nextPartName) {\n\t\t\t\t\tnextPart = dir.children[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!nextPart) {\n\t\t\tif (!addMissing) return;\n\t\t\tdir.children = dir.children || [];\n\t\t\tnextPart = new ProjectFile(nextPart, dir);\n\t\t\tdir.children.push(nextPart);\n\t\t}\n\n\t\treturn remainingPath ?\n\t\t\tgetChild(nextPart, remainingPath, addMissing)\n\t\t\t: nextPart;\n\t}",
"function visitDirectories(dir, fcn){\n\tgetDirectories(dir).forEach(function (v) {\n\t\tvisitDirectories(v, fcn);\n\t\tfcn(v);\n\t})\n}",
"function updateBuildingPath() {\n\n // clean DOM\n var $breadCrumb = $(\".breadcrumb\").empty();\n\n for (var i = 0; i < navbar.length - 1; i++) {\n $breadCrumb.append(\"<li><a class=\\\"nave\\\" name=\\\"\" + navbar[i] + \"\\\" style=\\\"cursor : pointer;\\\">\" + navbar[i] + \"</a></li>\");\n }\n}",
"function dir_node(name, dirs, files, parent) {\n this.name = name;\n this.dirs = dirs;\n this.files = files;\n this.parent = parent;\n this.expanded = false;\n \n}",
"function fillBreadcrumb(restaurant = self.restaurant) {\n const breadcrumb = document.getElementById('breadcrumb');\n const li = document.createElement('li');\n li.innerHTML = restaurant.name;\n breadcrumb.appendChild(li);\n}",
"function walk(dir, next) {\n var results = [];\n fs.readdir(dir, function(err, list) {\n if (err) return next(err);\n var pending = list.length;\n if (!pending) return next(null, results);\n list.forEach(function(file) {\n file = dir + '/' + file;\n fs.stat(file, function(err, stat) {\n if (stat && stat.isDirectory()) {\n walk(file, function(err, res) {\n results = results.concat(res);\n if (!--pending) next(null, results);\n });\n } else {\n results.push(file);\n if (!--pending) next(null, results);\n }\n });\n });\n });\n}",
"async addFolder(folder) {\n await this.client('folders')\n .insert(folder)\n .onConflict('href')\n .merge();\n }",
"function addDirectionArrows(id, dir){\n\n\t\troadGroups[id].getObjects().forEach(function(obj, i){\n\t\t\tif(obj.objtype=='dirmarker'){\n\t\t\t\troadGroups[id].removeObject(obj);\n\t\t\t}\n\t\t});\n\n\t\tvar roadShapeArr = generateShapeFromRoadGroup(id);\n\t\tfor(var i=0; i<roadShapeArr.length-1; i++){\n\t\t\t// add the arrows on the middle of the link, slighty offset to avoid overlay with the underlying polyline\n\t\t\tvar midpoint = new H.geo.Point((roadShapeArr[i][0]+roadShapeArr[i+1][0])/2 - 0.00002,\n\t\t\t\t\t\t(roadShapeArr[i][1]+roadShapeArr[i+1][1])/2 - 0.00002);\n\t\t\tvar p1 = map.geoToScreen({lat: roadShapeArr[i][0], lng: roadShapeArr[i][1]});\n\t\t\tvar p2 = map.geoToScreen({lat: roadShapeArr[i+1][0], lng: roadShapeArr[i+1][1]});\n\t\t\tvar angleDeg = Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI;\n\t\t\tvar dirMarker = new H.map.Marker(midpoint,{\n\t\t\t\t// 44 degree rotation required extra as the original icon have this angle inbuilt\n\t\t\t\ticon: new H.map.Icon(directionSVG.replace(/__rotang__/g, angleDeg) \n\t\t\t\t\t\t\t\t\t\t\t\t.replace(/__displayfwd__/g, (dir=='BOTH' || dir =='FORWARD')?'block':'none')\n\t\t\t\t\t\t\t\t\t\t\t\t.replace(/__displaybck__/g, (dir=='BOTH' || dir =='BACKWARD')?'block':'none'))\n\t\t\t});\n\t\t\tdirMarker.objtype=\"dirmarker\";\n\t\t\troadGroups[id].addObject(dirMarker);\n\t\t}\n\t\troadGroups[id].dir = dir;\n\t}",
"mkParentPath(dir, cb) {\n var segs = dir.split(/[\\\\\\/]/);\n segs.pop();\n if (!segs.length) {\n return cb && cb();\n }\n dir = segs.join(path.sep);\n return this.mkpath(dir, cb);\n }",
"visitDirectory_path(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function folderLabelClick(folder_label){\n var folder_id = folder_label.data('fid');\n var folder_name = folder_label.text();\n $('#directory_trail').animate({\n width: $('#directory_trail').width()+55\n },300);\n var new_trail = $(\"<div class='folder_trail' data-fid =\"+folder_id+\">\"+ folder_name+\"</div>\");\n $('#directory_trail').append(new_trail);\n new_trail.css({\n left: $('#directory_trail').width()\n });\n display_folder(folder_id);\n}",
"function createNewFolder() {\n var id = $(this).parent().attr(\"data-id\");\n fileSystem.createFileOrFolder(id, \"folder\");\n updateUI();\n }",
"function DirectoryEntry() {\n this.isFile = false;\n this.isDirectory = true;\n}",
"function breadcrumbs(path) {\n\tvar parts = path.split('/'), prefix = '';\n\tvar ret = '<a href=\"/\">ROOT</a>';\n\tfor(var part of parts) {\n\t\tif(part == '') continue;\n\t\tret = ret + \" / \"; \n\t\tprefix += \"/\" + part; \n\t\tret += `<a href=\"${prefix}/\">${escape(decodeURI(part))}</a>`;\n\t}\n\treturn ret;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds and removes animations for projects screen | function projectScreenAnimations() {
// add animations
nextButton2.classList.add('animate__animated', 'animate__fadeInRight', 'animate__delay-1s');
// removes after 1s
setTimeout(function() {
nextButton2.classList.remove('animate__fadeInRight', 'animate__delay-1s');
}, 2000);
} | [
"function aboutScreenAnimations() {\n for (var icon=0; icon < icons.length; icon++) {\n icons[icon].classList.add('animate__fadeInLeft');\n }\n\n for (var item=0; item < navItems.length; item++) {\n navItems[item].classList.add('animate__fadeInDown');\n }\n\n setTimeout(function() {\n for (var icon=0; icon < icons.length; icon++) {\n icons[icon].classList.remove('animate__fadeInLeft');\n }\n\n for (var item=0; item < navItems.length; item++) {\n navItems[item].classList.remove('animate__fadeInDown');\n }\n }, 1900)\n\n}",
"function removeAnim() {\n let removeStartAnim = (document.getElementById(\n \"slideAnimStart\"\n ).style.display = \"none\");\n content.style.visibility = \"hidden\";\n\n // display second layer of animation ONLY if the first layer has been removed\n if (removeStartAnim) {\n animEnd.style.display = \"block\";\n }\n}",
"addKeyframe() {\n if(this.project._activeElement !== null){\n this.project._activeElement.addKeyframe(new this.Keyframe(this.project._pot));\n }\n }",
"function platformDisappear(){\r\n var platforms = svgdoc.getElementById(\"platforms\");\r\n \r\n for (var i = 0; i < platforms.childNodes.length; i++) {\r\n var platform = platforms.childNodes.item(i);\r\n\r\n if(platform.getAttribute(\"delete\") == \"true\") {\r\n var animation = svgdoc.createElementNS(\"http://www.w3.org/2000/svg\", \"animate\");\r\n animation.setAttribute(\"attributeType\", \"CSS\");\r\n animation.setAttribute(\"attributeName\", \"fill\");\r\n animation.setAttribute(\"from\", \"lightseagreen\");\r\n animation.setAttribute(\"to\", \"powderblue\");\r\n animation.setAttribute(\"dur\", \"1s\");\r\n animation.setAttribute(\"repeatCount\", \"indefinite\");\r\n\r\n platform.appendChild(animation);\r\n\r\n }\r\n }\r\n}",
"function playAnimations() {\n animator.start();\n}",
"undoMove()\r\n {\r\n game.pastBoards.pop();\r\n let lastAnimation = game.pastAnimations.pop();\r\n\r\n\r\n //Restores board \r\n game.board = game.pastBoards[game.pastBoards.length-1];\r\n \r\n //Retrieves information from last move\r\n let pieceName = lastAnimation[0];\r\n let lastPieceMoved = Number(lastAnimation[0].substring(lastAnimation[0].length-1));\r\n let rowDiff = lastAnimation[2];\r\n let colDiff = lastAnimation[1];\r\n\r\n let time;\r\n\r\n if (colDiff != 0) \r\n time = Math.abs(colDiff);\r\n else\r\n time = Math.abs(rowDiff);\r\n\r\n scene.animationTime = time;\r\n\r\n //Creates inverted animation\r\n scene.graph.components[pieceName].animations[0] = new LinearAnimation(scene, time, [[0,0,0], [-colDiff * scene.movValues[0], 0, -rowDiff * scene.movValues[1]]]);\r\n scene.graph.components[pieceName].currentAnimation = 0;\r\n\r\n //Reverts position change from last move and changes player \r\n if (game.color == 'b') \r\n {\r\n let currentRow = game.whitePositions[lastPieceMoved - 1][0];\r\n let currentCol = game.whitePositions[lastPieceMoved - 1][1];\r\n\r\n game.whitePositions[lastPieceMoved - 1] = [currentRow - rowDiff, currentCol - colDiff];\r\n game.color = 'w';\r\n scene.graph.components['color'].textureId = 'whiteText';\r\n }\r\n \r\n else if (game.color == 'w') \r\n {\r\n let currentRow = game.blackPositions[lastPieceMoved - 1][0];\r\n let currentCol = game.blackPositions[lastPieceMoved - 1][1];\r\n\r\n game.blackPositions[lastPieceMoved - 1] = [currentRow - rowDiff, currentCol - colDiff];\r\n game.color = 'b';\r\n scene.graph.components['color'].textureId = 'blackText';\r\n }\r\n\r\n }",
"function setAnimation() {\n const element = document.getElementById(\"mainStory-content\");\n element.classList.remove(\"animationMainStory\");\n void element.offsetWidth;\n element.classList.add(\"animationMainStory\");\n}",
"function reset_unit_anim_list()\n{\n for (unit_id in units) {\n var punit = units[unit_id];\n punit['anim_list'] = [];\n }\n anim_units_count = 0;\n}",
"_clearRocketAnimation() {\n this._rocket._tl.clear();\n this.removeChild(this._rocket);\n }",
"function removeMobileAnimations(){\n var slideAnimations = document.querySelectorAll('.animated');\n if(slideAnimations || slideAnimations.length !=0) {\n for(var i=0; i<slideAnimations.length; i++) {\n slideAnimations[i].classList.remove('animated');\n }\n }\n}",
"function startallanims() {\n $(\"#landingpagecontainer\").fadeIn();\n setTimeout(cameraanimation, 500);\n setTimeout(hidelandingpage, 5200);\n setTimeout(mainpageanimations, 6400)\n}",
"function animateRemoval() {\n if (N > 1) {\n game.add.tween(chairSprites[index]).to({\n alpha: 0\n }, 1000, Phaser.Easing.Linear.None, true);\n game.add.tween(textSprites[index]).to({\n alpha: 0\n }, 1000, Phaser.Easing.Linear.None, true);\n }\n game.time.events.add(Phaser.Timer.SECOND, removeChair, this);\n}",
"function createMissions() {\n rx = width * 0.5;\n ry = height * 0.5;\n rw = 700;\n rh = 750;\n\n //Frame, title and buttons of Mission Interface;\n push();\n missionFrame = new OnScreenFrame(\n rx,\n ry,\n rw,\n rh,\n false,\n Secondary,\n 15,\n ImageMissionInterfaceFrame\n );\n\n singleMissionsBtn = new Button(\n rx - rw / 2 + rw / 4,\n ry - rh / 2.6,\n 250,\n 50,\n \"Single Player Missions\",\n 0,\n 255,\n 15,\n 20,\n ftRetroGaming,\n Primary\n );\n\n multiMissionsBtn = new Button(\n rx + rw / 2 - rw / 4,\n ry - rh / 2.6,\n 250,\n 50,\n \"Collaborative Missions\",\n 0,\n 255,\n 15,\n 20,\n ftRetroGaming,\n Primary\n );\n\n missionExitBtn = new ExitButton(rx + rw / 2 - 42, ry - rh / 2 + 8, 30, 30);\n pop();\n\n //___________________________________________________________________\n //Mission boxes and Input;\n\n singlemission1 = new SoloMissionBox(\n rx,\n ry - rh / 4,\n rw - 50,\n rh / 7,\n singlemissionId,\n singlemissionName,\n singlemissionStory,\n singlemissionTime,\n singlemissionInputMoney,\n singlemissionInputPeople,\n singlemissionInputOre,\n singlemissionInputWater,\n singlemissionInputShips,\n singlemissionRewardMoney,\n singlemissionRewardPeople,\n singlemissionRewardOre,\n singlemissionRewardWater,\n singlemissionRank\n );\n singlemission2 = new SoloMissionBox(\n rx,\n ry - (rh / 4 - 100),\n rw - 50,\n rh / 7,\n singlemission2Id,\n singlemission2Name,\n singlemission2Story,\n singlemission2Time,\n singlemission2InputMoney,\n singlemission2InputPeople,\n singlemission2InputOre,\n singlemission2InputWater,\n singlemission2InputShips,\n singlemission2RewardMoney,\n singlemission2RewardPeople,\n singlemission2RewardOre,\n singlemission2RewardWater,\n singlemission2Rank\n );\n singlemission3 = new SoloMissionBox(\n rx,\n ry - (rh / 4 - 200),\n rw - 50,\n rh / 7,\n singlemission3Id,\n singlemission3Name,\n singlemission3Story,\n singlemission3Time,\n singlemission3InputMoney,\n singlemission3InputPeople,\n singlemission3InputOre,\n singlemission3InputWater,\n singlemission3InputShips,\n singlemission3RewardMoney,\n singlemission3RewardPeople,\n singlemission3RewardOre,\n singlemission3RewardWater,\n singlemission3Rank\n );\n singlemission4 = new SoloMissionBox(\n rx,\n ry - (rh / 4 - 300),\n rw - 50,\n rh / 7,\n singlemission4Id,\n singlemission4Name,\n singlemission4Story,\n singlemission4Time,\n singlemission4InputMoney,\n singlemission4InputPeople,\n singlemission4InputOre,\n singlemission4InputWater,\n singlemission4InputShips,\n singlemission4RewardMoney,\n singlemission4RewardPeople,\n singlemission4RewardOre,\n singlemission4RewardWater,\n singlemission4Rank\n );\n singlemission5 = new SoloMissionBox(\n rx,\n ry - (rh / 4 - 400),\n rw - 50,\n rh / 7,\n singlemission5Id,\n singlemission5Name,\n singlemission5Story,\n singlemission5Time,\n singlemission5InputMoney,\n singlemission5InputPeople,\n singlemission5InputOre,\n singlemission5InputWater,\n singlemission5InputShips,\n singlemission5RewardMoney,\n singlemission5RewardPeople,\n singlemission5RewardOre,\n singlemission5RewardWater,\n singlemission5Rank\n );\n\n singleMissionsArr = [\n singlemission1,\n singlemission2,\n singlemission3,\n singlemission4,\n singlemission5,\n ];\n\n //message to player, when missions have changed!\n if (previousMissions.length === 0) {\n } else if (previousMissions[0].missionId === singleMissionsArr[0].missionId) {\n } else if (previousMissions[0].missionId !== singleMissionsArr[0].missionId) {\n let message = { message: `Commander, a new Solo Mission is available!` };\n messages.push(message);\n soundMessageReceived.play();\n soundNewSMission.play();\n drawMessages();\n }\n\n //empty previousMissions again!\n previousMissions = [];\n\n //Disable accepted missions and assign runningMissions and openMissions with index of singleMissionsArr (this needs to stay on here, because otherwise it will create a bugg, whenver we are opening the missions interface again with a recently accepted mission --> it will not show then)\n runningSoloMissionsIndex = [];\n for (let i = 0; i < singleMissionsArr.length; i++) {\n for (let j = 0; j < runningSoloMissions.length; j++) {\n if (singleMissionsArr[i].missionId === runningSoloMissions[j]) {\n singleMissionsArr[i].acceptedMission();\n runningSoloMissionsIndex.push(i);\n }\n }\n }\n\n //assign openMissions array\n let dummyArray = [0, 1, 2, 3, 4];\n\n opensingleMissionsArr = dummyArray.filter(\n (el) => !runningSoloMissionsIndex.includes(el)\n );\n\n //print arrays\n console.log(\"open Missions Index \" + opensingleMissionsArr);\n console.log(\"runningSoloMissions Index \" + runningSoloMissionsIndex);\n console.log(\"running missions ID \" + runningSoloMissions);\n //console.log('Assigned missions '+singleMissionsArr.length);\n}",
"function activateAnimations() {\n var categories = JSON.parse(fs.readFileSync('animate-config.json')),\n category, files, file,\n target = [ 'source/_base.css' ],\n count = 0;\n\n for (category in categories) {\n if (categories.hasOwnProperty(category)) {\n files = categories[category];\n\n for (var i = 0; i < files.length; ++i) {\n target.push('source/' + category + '/' + files[i] + '.css');\n count += 1;\n }\n }\n }\n\n if (!count) {\n gutil.log('No animations activated.');\n } else {\n gutil.log(count + (count > 1 ? ' animations' : ' animation') + ' activated.');\n }\n\n return target;\n}",
"hideActivities() {\n //this.r3a1_activity1A.alpha = 0.0;\n //this.r3a1_activity1B.alpha = 0.0;\n //this.r3a1_activity1C.alpha = 0.0;\n //this.r3a1_activity1D.alpha = 0.0;\n //this.r3a1_activity2A.alpha = 0.0;\n //this.r3a1_activity2B.alpha = 0.0;\n //this.r3a1_activity2C.alpha = 0.0;\n //this.r3a1_activity2D.alpha = 0.0;\n //this.r3a1_activity3A.alpha = 0.0;\n //this.r3a1_activity3B.alpha = 0.0;\n //this.r3a1_activity4A.alpha = 0.0;\n //this.r3a1_activity4B.alpha = 0.0;\n //this.r3a1_activity4C.alpha = 0.0;\n //this.r3a1_activity4D.alpha = 0.0;\n //this.r3a1_activity4E.alpha = 0.0;\n //this.r3a1_activity5A.alpha = 0.0;\n //this.r3a1_activity5B.alpha = 0.0;\n //this.r3a1_activity5C.alpha = 0.0;\n this.r3a1_redX.alpha = 0.0;\n this.r3a1_greenCheck.alpha = 0.0;\n\n\n }",
"function resetAnimation(){\n animationSteps = [];\n step = 0;\n resetFlowCounter();\n resetTraceback();\n animationSteps.push({\n network: TOP,\n action: \"reveal\",\n pStep: 0\n });\n}",
"function homeAnimations() {\n\tif (document.querySelector('.home-header > h2')) {\n\t\tdocument.querySelector('.home-header > h2').classList.add(\"flipInX\");\n\t\tdocument.querySelector('.home-header').classList.add(\"pulse\");\n\t}\n}",
"function animatePaths(){\n // Creating a shallow copy of the gamePath and move it forward by two.\n const tempPath = gamePath.slice(2);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n drawBoard();\n decorateBoard();\n\n // Differentiate player and gamePath by using different coloration.\n drawPath(path, \"blue\");\n drawPath(tempPath, \"pink\");\n frameCount++;\n}",
"clearAnimations(newGrid) {\n const gridElem = document.getElementsByClassName(\"grid\")[0];\n for (let i = 0; i < newGrid.length; i++) {\n for (let j = 0; j < newGrid[i].length; j++) {\n //Reset Node properties of all nodes\n newGrid[i][j].dist = Infinity;\n newGrid[i][j].isVisited = false;\n newGrid[i][j].previousNode = null;\n newGrid[i][j].isInPQ = false;\n newGrid[i][j].isShortestPath = false;\n newGrid[i][j].isAnimated = false;\n newGrid[i][j].fcost = Infinity;\n newGrid[i][j].gcost = Infinity;\n newGrid[i][j].hcost = Infinity;\n //Reset animation classes in entire grid\n if (!this.state.isInstantAnims) {\n gridElem.children[i].children[j].classList.remove(\n \"node-visited-animate\"\n );\n gridElem.children[i].children[j].classList.remove(\n \"node-shortest-path-animate\"\n );\n gridElem.children[i].children[j].classList.remove(\n \"node-wall-animate\"\n );\n }\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function, called from stopbutton; removes SensorEventListeners from DOM, can optionally save a String created in the ListenerHandlerFunctions above to a .csv file by posting it to the express()server | function stop() {
/**
* optional, e.g. for analysis:
* post the String created along the lines ("measure", not in this file) to the server, and save as .csv file
*/
/**if (measure != "#Measurement, Acceleration X, Acceleration Y, Acceleration Z, Rotation Alpha, Rotation Beta, Rotation Gamma, Orientation Alpha, Orientation Beta, Orientation Gamma \r\n") {
$.ajax(
{
type: "POST",
url: "/sensordata",
dataType: "String",
data: {
sensData: measure
},
statusCode: {
200: function () {
alert("Measurement saved successfully!");
},
400: function () {
alert("Saving did not work.")
}
}
}
);
}*/
//remove listeners, thus ending measurements
window.removeEventListener('devicemotion', deviceMotionHandler, false);
window.removeEventListener('deviceorientation', deviceOrientationHandler, false);
} | [
"_removeServiceStreamDataListener ( ) {\n\n this.serviceStream.removeListener(\n 'data'\n , this.boundStreamListener\n );\n }",
"function removeEventListeners(){\n\t\t/*console.log(\"starting arrays for clear\");\n\tconsole.log(\"remove listeners ok\");\n\tconsole.log(eventListenerMsgBtnOk);\n\tconsole.log(\"remove listenerscancel\");\n\tconsole.log(eventListenerMsgBtnCancel);\n\tconsole.log(\"remove listenerspassword ok\");\n\tconsole.log(eventListenerPwdBtnOk);\n\tconsole.log(\"remove listenerspassword cancel\");\n\tconsole.log(eventListenerPwdBtnCancel);\n\tconsole.log(\"remove listenerspasswordSkip\");\n\tconsole.log(eventListenerPwdBtnSkip);\n\tconsole.log(\"remove listenerspasswordPublic\");\n\tconsole.log(eventListenerPwdBtnPublic);*/\n\n\tvar pwdBtnOK = document.getElementById('pwdBtnOK');\n\tvar pwdBtnSkip = document.getElementById('pwdBtnSkip');\n\tvar pwdBtnPublic = document.getElementById('pwdBtnPublic');\n\tvar pwdBtnCancel = document.getElementById('pwdBtnCancel');\n\n\tif (verboseDebugging){\n\t\tconsole.log(\"GLOBALS FOR REMOVAL\");\n\t\tconsole.log(\"OK\");\n\t\tconsole.log(eventListenerMsgBtnOK);\n\t\tconsole.log(\"CANCEL\");\n\t\tconsole.log(eventListenerMsgBtnCancel);\n\t}\n\t//all nodes are gathered in reference-able variables. Now use the prototype that tracks them\n\t//to remove all the event listeners regardless of what they are or what args they have.\n\tif (allEvents.length > 1){\n\t\tfor (var i = (allEvents.length - 1); i >= 0 ; i = i - 1){\n\t\t\tmsgBtnOK.eventListener(allEvents[i]);\n\t\t\tmsgBtnCancel.eventListener(allEvents[i]);\n\t\t\tpwdBtnOK.eventListener(allEvents[i]);\n\t\t\tpwdBtnCancel.eventListener(allEvents[i]);\n\t\t\tpwdBtnSkip.eventListener(allEvents[i]);\n\t\t\tpwdBtnPublic.eventListener(allEvents[i]);\n\t\t\tallEvents.splice(i,1);\n\t\t}\n\t}\n\tif (eventListenerMsgBtnOk.length > 1){\n\t\tfor (var i = (eventListenerMsgBtnOk.length-1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = msgBtnOK.eventListener(eventListenerMsgBtnOk[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerMsgBtnOk[i]);*/\n\t\t\teventListenerMsgBtnOk.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"okarray\");\n\t\t\tconsole.log(eventListenerMsgBtnOk);*/\n\t\t}\n\t}\n\t/*if (msgOk.length > 1){\n\t\tfor (var i = (msgOk.length-1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = msgBtnOK.eventListener(msgOk[i]);\n\t\t\tconsole.log(\"function\");\n\t\t\tconsole.log(msgOk[i]);\n\t\t\tmsgOk.splice(i,1);\n\t\t\tconsole.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"okargarray\");\n\t\t\tconsole.log(msgOk);\n\t\t}\n\t}*/\n\tif (eventListenerMsgBtnCancel.length > 1){\n\t\tfor (var i = (eventListenerMsgBtnCancel.length-1); i >= 0; i = i - 1){\n\t\t\tvar tempnog = msgBtnCancel.eventListener(eventListenerMsgBtnCancel[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerMsgBtnCancel[i]);*/\n\t\t\teventListenerMsgBtnCancel.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"cancelarray\");\n\t\t\tconsole.log(eventListenerMsgBtnCancel);*/\n\t\t}\n\t}\n\t/*if (msgCancel.length > 1){\n\t\tfor (var i = (msgCancel.length-1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = msgBtnCancel.eventListener(msgCancel[i]);\n\t\t\tconsole.log(\"function\");\n\t\t\tconsole.log(msgCancel[i]);\n\t\t\tmsgOk.splice(i,1);\n\t\t\tconsole.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"cancelargarray\");\n\t\t\tconsole.log(msgCancel);\n\t\t}\n\t}*/\n\tif (eventListenerPwdBtnOk.length > 1){\n\t\tfor (var i = (eventListenerPwdBtnOk.length-1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = pwdBtnOK.eventListener(eventListenerPwdBtnOk[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerPwdBtnOk[i]);*/\n\t\t\teventListenerPwdBtnOk.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"pwdokarray\");\n\t\t\tconsole.log(eventListenerPwdBtnOk);*/\n\t\t}\n\t}\n\tif (eventListenerPwdBtnCancel.length > 1){\n\t\tfor (var i = (eventListenerPwdBtnCancel.length-1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = pwdBtnCancel.eventListener(eventListenerPwdBtnCancel[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerPwdBtnCancel[i]);*/\n\t\t\teventListenerPwdBtnCancel.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"pwdcancelarray\");\n\t\t\tconsole.log(eventListenerPwdBtnCancel);*/\n\t\t}\n\t}\n\tif (eventListenerPwdBtnSkip.length > 1){\n\t\tfor (var i = (eventListenerPwdBtnSkip.length - 1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = pwdBtnSkip.eventListener(eventListenerPwdBtnSkip[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerPwdBtnSkip[i]);*/\n\t\t\teventListenerPwdBtnSkip.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"pwdskiparray\");\n\t\t\tconsole.log(eventListenerPwdBtnSkip);*/\n\t\t}\n\t}\n\tif (eventListenerPwdBtnPublic.length > 1){\n\t\tfor (var i = (eventListenerPwdBtnPublic.length - 1); i >= 0 ; i = i - 1){\n\t\t\tvar tempnog = pwdBtnPublic.eventListener(eventListenerPwdBtnPublic[i]);\n\t\t\t/*console.log(\"function\");\n\t\t\tconsole.log(eventListenerPwdBtnPublic[i]);*/\n\t\t\teventListenerPwdBtnPublic.splice(i,1);\n\t\t\t/*console.log(\"tempnog\");\n\t\t\tconsole.log(tempnog);\n\t\t\tconsole.log(\"pwdpublicarray\");\n\t\t\tconsole.log(eventListenerPwdBtnPublic);*/\n\t\t}\n\t}\n\t/*console.log(\"========POST========\");\n\tconsole.log(\"starting arrays for clear\");\n\tconsole.log(\"remove listeners ok\");\n\tconsole.log(eventListenerMsgBtnOk);\n\tconsole.log(\"remove listenerscancel\");\n\tconsole.log(eventListenerMsgBtnCancel);\n\tconsole.log(\"remove listenerspassword ok\");\n\tconsole.log(eventListenerPwdBtnOk);\n\tconsole.log(\"remove listenerspassword cancel\");\n\tconsole.log(eventListenerPwdBtnCancel);\n\tconsole.log(\"remove listenerspasswordSkip\");\n\tconsole.log(eventListenerPwdBtnSkip);\n\tconsole.log(\"remove listenerspasswordPublic\");\n\tconsole.log(eventListenerPwdBtnPublic);*/\n}",
"stopListening() {\n this._eventsNames.forEach((eventName) => {\n process.removeListener(eventName, this.handler);\n });\n }",
"onRecorderClose() {\n const modal = document.querySelector(\".miedit-recorder\")\n this.miscreen.recordHandler = undefined\n this.miscreen.emptyHandler = undefined\n\n modal.classList.add(\"hidden\")\n modal.querySelector(\".recorder-result\").innerHTML = \"\"\n }",
"function removeEventHandlers() {\n\tlet spots = qsa('.spot');\n\tlet emptySpots = qsa('.emptySpot');\n\n\tfor (s of spots) {\n\t s.removeEventListener('click', spotClick);\n\t}\n\n\tfor (s of emptySpots) {\n\t s.removeEventListener('click', spotClick);\n\t}\n }",
"teardownWebsocket() {\n if (this.websocket !== undefined) {\n this.websocket.removeAllListeners('open');\n this.websocket.removeAllListeners('close');\n this.websocket.removeAllListeners('error');\n this.websocket.removeAllListeners('message');\n this.websocket = undefined;\n }\n }",
"async function handleStop(e) {\n const blob = new Blob(recordedChunks, {\n type: \"video/webm; codecs=vp9\"\n });\n\n const buffer = Buffer.from(await blob.arrayBuffer());\n\n const { filePath } = await dialog.showSaveDialog({\n buttonLabel: \"Save video\",\n defaultPath: `vid-${Date.now()}.webm`\n });\n\n console.log(filePath);\n\n writeFile(filePath, buffer, () => console.log(\"video saved successfully!\"));\n}",
"function listeners_(){this.listeners$bq6g=( {});}",
"function sendLogsBeforeLeave() {\n localStorage.setItem(\"aois\", JSON.stringify(dataLogs));\n window.onbeforeunload = null;\n}",
"disconnectedCallback() {\n super.disconnectedCallback();\n document.removeEventListener('incoming-custom-event', this.handleIncoming)\n }",
"function stop_monitoring()\n {\n browser.idle.onStateChanged.removeListener(on_idle_state_change);\n }",
"function setListener() {\n $(window).on(\"repoDownloaded\", function (evt, which) { // which: stringa che identifica chi ha scatenato l'evento\n downloaded.push(which);\n console.log(\"evento repoDownloaded catturato: \" + downloaded);\n if (downloaded.length == 2) {\n console.log(\"Scaricati sia dati segnalatore sia segnalazione. Terminare animazione caricamento\");\n downloaded = [];\n app.stopWaiting();\n $(window).unbind(\"repoDownloaded\");\n }\n });\n }",
"function captureListeners_(){this.captureListeners$bq6g=( {});}",
"function removeCSV() {\n // Remove the feature layer\n app.map.removeLayer(csvLayer);\n\n // Reset file input field\n var inputControl = $(\"#inCSV\");\n inputControl.replaceWith(inputControl = inputControl.clone(true));\n\n //Disable the remove shapefiles button\n $(\"#removeCSV\").prop(\"disabled\", true);\n}",
"function hideSensorTagConfigFile() {\n\t// Hide the file data \n\tdocument.getElementById('sensortagConfigFileData').innerHTML = ''\n\t//Change the buttons to show the file\n}",
"function handleExportCSV() {\n analyticsService.logEvent('EE Employment Training', 'Clicked', `Export_CSV`)\n GridHelpers.exportDataAsCSV({\n selectedRows: selectAllChecked ? null : selectedRows,\n rowData: employee_training_report_items,\n sortColumn,\n sortDirection,\n searchTerm,\n filters,\n filenamePrefix: 'Training_Export',\n urlPath: exportConstants.TRAININGS_EXPORT_URL\n })\n }",
"function logoutListener() {\n loggedIn = false;\n }",
"cleanHowl(howl) {\n howl.off('end'); // Not necessary to remove these handlers\n howl.off('load'); // But it doesn't cost anything to streamline things for future playback\n howl.mute(false); // Definitely need to unmute though\n }",
"function manageWebParametersSave(socket) {\n\tsocket.on('save', function(data) {\n\t\tsetParam( \"TEMP_FAN\", TEMP_FAN );\n\t\tsetParam( \"TEMP_ATTENUATION\", TEMP_ATTENUATION );\n\t\tsetParam( \"ATTENUATION_SCALE\", ATTENUATION_SCALE );\n\t\tsetParam( \"CHECK_PERIOD\", CHECK_PERIOD );\n\t\tsetParam( \"TPS\", TPS );\n\t\tsetParam( \"NB_RAMPES\", NB_RAMPES );\n\t\tsetParam( \"SERVER_PORT\", SERVER_PORT );\n\t\tsetParam( \"ON\", ON );\n\t\tsetParam( \"OFF\", OFF );\n\t\tsetParam( \"DEBUG\", DEBUG );\n\t\tsetParam( \"LOG\", LOG );\n\t\tjsonfile.writeFileSync(file, parameters);\n\t\tif (DEBUG) { console.log( jsonfile.readFileSync(file) ); }\n\t});\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
HjPd6MV8aX ZLLoFv2DlAt UJ290CqETc6p zUPhZTqUZQNK WTsSr7vXde Cj7AhJ8vpW ZFa1P5T3br g8rA5M0wYGph qQXx4yCTnb oTvtNnrootSt zcQp3lvgUAf dXFt1WgJrTHV b1OcLR7VbxlX jUxdDd3BN1bI 1a2C1E0hxS wIF6FdBKaTf3 mNV6rASYIlP m8rwRr5kPw b0G4xZRQ05 bgo9kllaO9 EE7hIIB5Sb wQNSMBDkhpw riSFprJHr4dn LADj4Ch7Gz EyuNREHM2bA AGSURmuwE2Q 9BVEMnPXQE uuOJmFeTPy85 3kmIWpcN99 oX6e7BNiT0Z PLmurNILY9SH nn7RLCweDlz JKbev1Im5t OFYoEIkwh9 nbqQoEKUxp JkT9E8goFZg qb3TsNF9roto SjjLzeqcbMM OEfMAhf2RG qjrOwFbFQpx dKDEd7BWXNy LmZzmfViNrI hXlPzCgQRh AYBGSf59NJ3C VAGPAQYfI3 j8K8uN81ILs eBPGheuOew MO3bnU80FuAR 610dptUpg8l e6BKtQtltB RrZornajZj Wj6zOtNWvX VmDI2T0XkX aXSdSHWPqB bQp1qCBDNes TncvxtFEJO fTJ40EdUpC mSMvZzJnBhcs BBvQOB5lPvBl q2Fk6553Mvr Gx3y2OFGva TfK8Umwq5z RmRSsQMyzpyO zK6NWSnEqHTY d9hSzmZ7U5 Lw6L9P2elz t5L577K2XI BMMAenz0SfzP Z1u6vJI9fXSM K88V3bOREM4 ZphtGAuKnuM 5XHmR2gmjZG7 r5zwM1Ucyunb sBeOsHXXDPm 3sB58UOOKEmN fiQu9D1PjQ5S 7FBordj7Uvu 3rQLTFbm5Um hRrbQH1aSCO uvl42ONRvj T1ZHt1DvpY OTVfssF2PJHy wzsfQ3TfLCq fhv4CnX2Sk5 znu5DK0zzGsd K6ozU6J8YuiV TBvVLD1VZ5 Ba8TLUYxQi cu1CMz1EGrFJ hLNX6wP7ac MMrmyyWp6aeJ DRVmZYUn3NF v5gJqq0LVzN uT4ZsSCypn61 Cm8FaTcOVd aM5QBXdVIs NGrguthMhz mCsgOvwJ3X TQaRi0yeGLi Ggd75EzlXs cZTdoXNGEyvQ A7IQbeHZZ3 SfGEtydOKgWn F5XFumcoaux u2KQTuuIWGHE ak3AZG0eC0nu sSCeSQrsXCD HVXfPUoqm1Ap 6MxMcvL3BwH cVUmaP9tNJu 89YAigTHgo FTvY6MbhoD WG5MGAQrTPsS OTDQnBg6Fx5 xWdewSTkRWp4 Zfj5TNFj48c tRTSxm3iWkE VpdaXHfajl2 mWZ5LXOzfA KtwtqdXUeg z1aB3HzXmt Lr2vVXhL5O ybipn9Cx0g 9dtjGFp6X2WU cgoeHvUOvAfA VGDf2HwHKop ZnvLzxZnB6L TJPM6v8CyGt LUGryFg7Bo CtD7F0QnJa3 RkFzEdhwIu3t g98ElDmIRB Qr4ggvWaqTd nJyl43kKTeO SPuVVUHJN1x be6uBOsjiffz a8Aewj1LVfO4 j4imzI036r XXNmFIUkAc mHT7vNfkMq wQGOmEVWKhGQ BG7YtaVT2T yuoICnRsd9p 88oylKnusimT luETNNsi4dpc g8JK17AraZ oKHDvovq0n6B rDYrd9gpwPEd ywGDHwgQaKZs 5BrMsUsnWFM 9OkpdCptn7mH Y0O3qTfI8RlK Vrb8PgQQt3K WO23EdAJnFLh EoeXEvdbnE9j rjgiKp5oaK vC8WJ7xYdqOR NXaULetSnU krntTuabsqUA U0mwYp8j4S hQnhnjgYqkn 99JrZCy919B TtGrJnZzz6bR r9BeI4e1LFi6 JB0xtL3LTVd R1zQwLAzyuod GRjODXfc5Ed rAC1aaGejkv nlafdcoiwwL CNKeRe6jEv21 ZvcOMW3Znn phfBysMPkXv iATg7Xbws58j SWGeI4aN31f8 8PY3NEHBVD hjxWGyjtUXF TjvCe6TczWx lXNLVE0sTEQ7 O8Rwb9F17wcr SuhrKs9RT8G xkO8tOFIIpQf JPBaf0BQjm4A jswieISvup BHVhOczTlfSr HJvmPFtMBrz 9ldjkbjm3uok VzI0J8Si8TR uyA5IHHEK6Z IKMqdSbjV74 JSJxOUrBOj2 x9JzMeT23QT bipE6mhB47 UIRPYnHuZMt Wddf0MKWTWRs dYrG7e0HyV eMZYtcCFjR QaxOU4nzHI BQj47FpuH00a Y8y7Gbvswhj HN3KEM8w1y MZ7qKRIF1Gyx XQE7FA7xxiK fDv7SegFq2qw SvIHfN6wRJ7h uTRXpb9Woj wdDl42dhug7p rb6iz679n2 RdlOj4CFRqr gc6wBJdUk6X QM2jCnLSLXY VW2ZqrgSW0vs YC1dp1u9Lr LYn6bk8wdq QQ5NKF9A25h Z9sXTya67g3 FcjDgxug2BU XGSQBk3sgwKN ySMGKC2awDgy OH0b6bgfTgW GHrHq9DuqTBV NzpKbPbpmJ QjDWR8Oa2m HEZWmlYU3u1t xJOUZLlWTc LxVX4dp4tn U1Vef1hBQO wHEjZbxllJ 6CgOOgPWMAhv 5OeWHDMBsw FvvHGKKkvF oSGn4aODy5 aHXAAjlT7Y2A uUzLScPew3q7 EIW9jNNItp 3lzLD0hMtg 0WNoGEYxESX 87pXNGouY9J VzqsGJEvziy BcsK4fC0Fk YIYwUsmVBU0p VA49GEwYOY JvPtxqeO3HW B97GDrPydj uFeymOimshT W4W1VzqmDw fBNAfuhgOg N0UJJayfI6eJ O0o7P2fvQ4rE yMjqCCgxF9He 9yhgJZFvUE FGWuo6anslZ 3DRJRwh78H woeaYlEjnl 5WjJypGfCR FirJi8PgQF H7oa52SCr5n WXuirJVpK1 ZmuKMv7coC SlP3Kqbcmn 0PzJ6Ck4aNxM cmgMWE6Bgl ZlIH763K8X AYL4dBNNOQI Oe64zQjo7G gxnSSvnGOTV DS58qBoRPMq 7od8sOKlQu nJpwmkl5f0 g70ZkfSMF8Ov oRGqRNTx2m5 vEEASEwQDtML scrUHtapvoFF gKaS2DWjNsbd YaFEg27YDhF WCSeDyaOAX5 yfFVdhYZp8W DX2yzpj8C9G zw2piRlGElF Y271qGJifXc BIfEo8h8Su WRUBV32llA fbWZiJt99N nAD5hhg1kq MXPHsjHhc3U VCTVIeIF4aR9 iMOvhmVEgM2 CMsLQnZrnW1 gkmClMqEp2ll MrUpK2Ifa2Dx TAdZUqRBdML SIq48QcqBBty BoXCxxGANC e6fikOHMZprz 8lP8eQc0L1Ab g8scvOWORn NqRkXUJK7Vct kEhlGFS6sY eTFFGIeR5i wHAqEVBhvxtp wVnDiD9867 h3KnpCbDEJ Hhbq37z0klWH TPbqSa7pcJf lD6injreeNv LUK2YquWLJ b6XAO9GtxQ Hj6aSN7o1w DmEMbQq9P5I 4VvMDQcPCVpo r3ygbc9FHCSf cB3IBPCRBs 47IxGf9mlk EipDcGAiW0l c47ZVWsikb 4i2jGY84We9w owv8Rpw4YdD OZOYOsYotBBt LPJ8UeQZsMGg WZ2yOpzRM89W 6pWesunzfN Kgpbw0UG48p 1lPeyvymMxx9 1rlCBLOgSF3 0Gm3yfELlwt Gf5rhYDbhzjC uK2KPscwklw TLMO01cPRMGT mXuN0tiDXnX lHOUndAhbSkv wGeiV2RO1CY rw6A5MnbBnwp OQPrMODq4Q XcfUtPFmD8Xg wVkCB2klov4I 15VQeWIarSM Exve6PKBmIG 49SCU3nMetC1 KS3vdnL3pyZp XYoK7YId9LQ DBwV44IMkS IOwRv9NUzJ5 uEjuJOO01y iv1mDuyHjx t6WcWlJbHY L2uKAVF3eMdG MPJe1UleHMhD E9oLIPv3kE T0Aseu7Epmx GaXlaJ890V w9AmmsaZrx 17RE915NIY r3rgjaQCjY4 rIs4kEd7PbW QKB3rcAa4s dmvnnhfjnC 6AkJFBxUXmh TZg9XoxBrLJ3 agE4nMqPRL hkGBpwBXh3i p6lw13iJZv vZneuFC9L3 PdyCkr00RA74 rzGn7ZAwU5 AbILnpp9Fz WQIAwtWmoA kvyTIhCSmBx5 1OlBwK0wcR Xcvqa6FukY4y RZDnnVdf1DbB JxmLl3icGwJ ED5ASw7U12I mD1SshX7ncj oZ2srbpwdnvE GecU7f31Oqng JiRJjPPEjF GdenA1qqRL RdTa3ZiPRo txtj7HmYFfc QVUzMCGBDk Rv6N4Vh3N4HP PX0dYefe8s9 COQUiCc1x0Jy zDyP4XMpfh ipDZKQiBS7PO DZ5Xa4dmx0CA zXCz2YsFMkx kIdDMm6uO57z 3ykACapIpb EgCB46IglA YmGBSv4UT62k CXmi4dfVJYj BzT2yYMlEu 7m34cDky887N 8kf4BzD2M3t ITsxqRnynRa2 8gbqS3RZV21N qAMvIqvuipwD DBO4vKuzwTUQ PXGgTW4h3q cea9ib6k8ml zm8ZK36DUGYz FDHHYOIc2fp M9daQKJIiF8C U1Di2Ua1Cp8 kbImZDgxvR zgtfoswGiEJ 4cxhGAuWvZf 44z1e24Htd Z2KZS7sDDrGx xaagq3REh1 IcbphOMEJBx kuuxwbbrjGra Fx5hTrieaAjB 45EDG4PZXG TVpMGx9S3AO5 aNXuIjNTJJf bAezvp2dbt Zv4aCz6wEM0H ZRn7T18Sx1jK OxJqlhBvGS FQGxhJkDSOo qazP9gTXiH6E AHtKdEdE90z6 Mpi3VKDemF hO3FRtZe9E2 Xr8gHvnmZhX0 sUyBSI9icj7 9t59bCYt1my MyxV3LtYrsg A2kJRzuh5g 9TZmfkOqh1J ERjA4iPazmgG QAy6nDdgJOz 4z6w8X9Hu6 0942JfFLvNY e40nbfs0oA yhQwRXzQwtH YiUora9oNG7 sHHGwSu63w UAZ4NJyHIVI LiDdgiAMJPeL WZr8ESyQAp ZlwDPOP0MgI Gt3wDtb2hv VKVao1BmOLmM V2dA5aMGbAG lNADIlcFxMS1 mCdnvUp8Stav 8HwHYWJyDtQ mjSUPda34Hw MSwwxM1pKB9 mSKoiJ4WpA 5HymTrRtego jMcAg87ZSi nx9tjBc1rn5 hFV37Kbq1F PE1Kmqg4DOs bdns5jWDRq y0zgelfttW Cq5h8JpspOF3 WugACvMcLVK uHonWDXGA9z u1zimAxM7O Thl1OWaucu0S BdZ7OATHBie Lji2F3LYO6K A5NLCOdwwc JXuuxvuiZuxZ ubXXf9vNZw Djj9bPuhc63 pi0WDjD9rb 7nyZ5VTH2JVS FfhepfTGQc rkYKx9hLmz4S jNAIAYie9hp1 Kw0jM3OOC9 gn6D567xSnc YWTluO1wH6I4 XL69wLlrVTAR cwFNM5nMzA72 kAvkk3ezlFt 8fARdbe7lf V5tin1TlsQW cmRTuuxr5saf UHZ5IGSZmYJ5 p3WSd7plCVZ2 YSOBNqLLfX lfKjiNPwDth Zxcpgdayysl mZZFlKOVwe GEvEELBlIr udBacj42dC ogVaOaTROqZz pkEat87YmdH hdnaWTI5tsH BwD71JyOH8yN Vq1wOSyvslsa P1jXJwRykZ63 0Tz9uAerl2sX GTTWHZvAcW59 piXICXQU9u0W wofWCbbORq UUKU8ppEnz Al6Z5VPGsEq rt5gjs8sCS 0PvO7Pdp8j 4SugNbSZpIot xeiiWNFHXozj WpHfNJ3vdGFO xk21fh7rVxB jT4jKHsj7O LtUHMkN1wVmT LDSN7RUhL52 1Xt8Hbe8MTqo dIDOAFbkKUpC wxQKNHLC74L Em0ZUQjLZ1 pNA11bUPUc a8OWNoIUjBA0 y34pmGuZ4i WVRyjyFLWy Crj9i049Ut n3P8O5KpLAPB LOfMTTwnrCx 2tB7jAgJhp YA28UgXqQ9G Fj9SPAKuPMQ LJKjMrOIKs 745VUPA4Z8r kRRCNG8G6Aeq qfFr1zwGuU EWxR7V4lBAV 1fSuhp9DmTD9 EtuG6lKqRzp AqQUAgYrNe H00auNzQrOO PazSRk2O3kf6 XHwvKJkzGE rdwojCybJL uGFFeOyUdf P34WDOt38lr E3MOB9NuARB 5vYSHEjHxwV XndMntzvQk k8pxXqoO0Rx UoiI3YIZCQ2k Wj0iPVIYBYn orNG0CfFxjH CEgsohvWxN2 NyaKpBDKX6 V2Q5Kzc3CA SbwbH5U9bM8S A7SN0n6ZFc KfLnexIOyAkY tSucRnlH868 UNHxVI5wGW8g lDhErFnTBWNz n7pQ7GybEab Qc9oCeoJ8qZ nTQghTtXir wphouChAWFm7 eesC7ffHznW8 UmQ593Ooguq aJkhIVzO7G3e DXkttQvNEns 4sBILwGS8u80 DbQHBNMWRdS rHAdgiOnyI HLaTFjXnyn8 JElJGeC6iJC9 C3IP4PvIryY6 so9IDSZKaIM zvNnjG6k8C6 yUcTH0nGhHV 3AbkNgwgvUH AmYPIYL4o8uo rzGmG5Q0Aqm bPDar2pJp2L Tbwub06BhM gxhZ7oD741X 1CwkOEtQ4B Mv5Dm9Cz4qp rLo44IzJqyQR e2w6OIA5v8G fA7D9hgTnCN TQDumVErXnQ uE9uSwzuYbf nSqFoXT4H61u uxcpx2pFIy 5PQ6PtSyiG FLLGuXs91zC fmc2s2yzOn ZMASR07tccV KsCia9nFZ6J rhqSQOuPy8I tQZgMOSMm5U ppA0NB1IIJTm 2X4vTH7Ca5o iR4JWnSGpobu GeNVwGfTOe 8BqXJaEllTPB uhMcvi6jVC FpLoROlPz0Mc NwCnaRJ5QMY zEtJLCKPR0d OIT7TMjZagp EZ184YnI9pHq ahNIJ1nDcQg A4idsv5Gbdf 027jfh6gXmtK LA4i3cmW0Ae 9LAPaaDxcEp 3rm8dfZOu9eR rw0c2fwY0gPJ uVgH3lIfU9e SXahqcJmCYjj yk07T1KGaYV RQ2m6W3dAiW hbYzPFtEvHl GptThZMK0y NR5slcUATqD KI0pSDWySaPj wm3GopsV9H 54cjcdtYWlF9 i5ioNxtZqc6 nUcvsMK3dTZ UUtNQgZed2wg p35O3GEg7mv 8wNcMko572rb skLVpFMDRm mtaLuImYZN ddBDVaUR1g FPlKas16DY Dxdu2dsypD f4QNiFaekwh4 aZ9kMhxi1J GRR6jhJ62ZlU Jq45p9o7qAG jYyfGJJXBf aK7g0EgXzT YriEAxVL5Arr 6yhglZn7X5 S4vq8rxxMpm EWeA6Gtdct6k Of54J3z69Ju OPvymuQnDp vwWpGKWaSLs2 RrLoCPLl4J7W XJKboowQLEf wEsgJkisbLG WXLkfEleJK7 QuE4hhZBcr 0yc41eeRNqo BJOjT7gNMb zDFmlMim5z QeSOFWgjo2 bjtaEIWwjJw Hb7EDlc1gG 6Kav8mJq5A YJo1005MYvp zQ8r3wEIz01Y oAxRALdAgS jnHxtfykbJe 2CQjm5uD0CL qLzGk3utM1Qa PP7zGzAbpk WMlF10ANcTP JdHqc1ojCmK Ya5OQw43tx mIROCkYUhpje d9Kc0dhkhB VOYJuEQwIBsV 72ZQFLdSNBTQ u3CU7o9Vku qBtyyf3z1Y wI0lQafQMF5b jlsjIMowVA dVHXXPeHPIe O2GuNGwbdLD 8x0Wte20KvNx 3Bd6H0E68p foS3Tc4fPSR3 cUqNQ2g12bX D3DGAZ2kCFRY AqynYipzlY 4vot9RE72fb aCKiwmDpkpp 2FBbLajqvGNt eAvVwCwn4sHO amgm1GoMl7Gt yewuVpy6ueby DBb02YuFCu pytg1P2aBt RlOXzJxxDS FNNRy4Bbfj FlOwuvodmJ QD8T5yMlKJ EyVhmjxjU3H CJLu29ctFj 6G7ru4zaZnnq cdRDNmyNczm pwDmzbD5WWsz 5h0Z7PfeW5 0rBLILblUAV0 bFEAycZ4BUry gqTwVxKp9K nDKmAf69nX gipc4OfdAUU IlByg64kUOJH 8AGTYzj9hJ aePP0Vz8Xja ugvKESeJBC F9LikkbXVLy3 sZcP09WWpn fRWFwGs23Zs 6X7qFLRMekf E9ut93rQJHR7 WDo2QzKdLqc Dy9gp8wTHG Rm4VxVjCmCX jolyuxd46o0 pDn68Wrnym ybQ7wghXPA 46ksGPj6OC CDa5Nhw7L1 qvlJOuoISE yLVDjYnsSl VHNGQCzxXk GoKrPfhJkYrs Wtzc6ysulJ evYaLRURETyM uEkqKZSHnNG HRbT8oUOzsL 6Rp9kZYMlx Qr6DwnZegn Z0Xq12Q5AdYQ sWyLHfkfCq vMIV8snCVmJ Flou7xrXVCL JXkYuuE6fxH xHJsQSQhq7G 6dTAdq3sjtr4 icVK5fhYZNf iALYrWWWQX2z ha8MWJwZfius c0r4Eybn7oM yAI2xH1UV83 h83SJoKvV6 nQg54S8yyn3 zWjNCEPtvv xC2tymUmMxM 9w2gQAOCLm yvIHNSY9S1S zxfgUq3gq1 nAWZlzO4Bo c17vgq5tbrr J1SES7kaSY3b nPjQA8wQnuts 30ZzepT7hJlc EPqzt6XwRu fmsRI5ehORI MMdzdub84fd lWhdLAhNMyRX AmoZ0RzKUyv 9Ty3eGWW0x Hw8m2XIG9RzT 8O2jUJ2MGF I7ldAZRthqb xhuJGiuUXxMd x9CzyfsmrwZ D7MNGjUzy7r kDXyZAwUKb Ly9l2aFbVfoy iwMpBMAnBvC Ois1bvWumx ThA9VmWcipU8 ikJXgf9rYI Hk0XfBWs6VQf oiBHk1IVgM Ortn4fZoUr1E 3BPnIXlwpUk9 kyUf1UdeBve ImRqnX7sXSG tE6CfMmdpO 4AKKeKT11e6 PpXhT9HRX4Q aNi5mcy1f8Sm BKPwjob4OQN F1sVdwU9dX QeQRHNXto7Q pBMoR9GdsbQ JiVv25TRSm0 0SVukpMYk83 2o80B7Cxir77 0olb3bdEren2 wgXBOUWSo7 KMJcM6eRUTE bHISfS6wPSup sWZhE1egNX c3d62zBczd uD2B4kyRAKc3 18GcLdg4AuJR DcDJdSf25oB 3Qgn5RmgGhv s8nx7NH3nVF KHS9EcFnrVDm eZehYLrWbg6 xxMjKnWhfvj ApLCoWPVub RsZ4y1K2wS9C CUtCy2EK9CZ BIv8djVc2aqc B6A1RuUphzhp hstJAsZSJPl 5HPyE6jDRDEC vKCHz3Ud09 YOjgHP3lMSD4 E1XHXCMIiciP tOPGsrh8BpF TYWs2wt1Shr sjvIhQpKcvv Xw5q0pO4ncE mCI0GKf3Xdnt BklcNOllUD4 D6GYduKtkCAb ubap0bOFOtm SY1ZgxJN1QQ jJnUF66LxH a9gTSk1WtLvo N5qrF6ehB6 PeHnqe1mop GXgjMyTb0S 25CUqzvHvNPs alA7YX1qmFFo EFZRFcveaNx z3WZ4BNUMu oDYeAARHbRE xXTYKgv8h1R f9RVm4aeS9Fn BflnFy2GyM fqweI5qSv9 AWXeTZOjzTt5 A3ZFxNIQ4Xtw Xs9PIvqzoeJW zt82EU07IH iGQ293wL8IL g3N6SPwBC7 iqTzHKs9tk ypn97tZiRGcg tKh0Vr5OgjXZ ybLxJrta8n 1QB12sK0t5 1lzoQcb39VhS dOW6sDwkNn4 Gm9GFDyUfS OzDZKLoV5Wx yqosk61aEIY ccAufaaj84F f73C3LSxxf JTa30ipVCMRq TencNlumqC D3pVaPdvYW yg0GcvsID1b PmmuvCOpoH di18oz7X4FD SsEQNTrKQoE CaZb0BfV4KkX AxoozKKzzhv Oe9GuJYg12 F0onBRmPG4fr lbbltM715PbM 1F1q1IOTQZ5 GHIDjZuDBWD rliPhNBBj7 87MxDm4Ns0O tADq4WMgMnZ HSX52uNuBL9 DMnYgHdzeQ CHnkEbG3VDfR 47XXIiMcvw NxnzuC4KdSN eENtbNb4yJ XE8DAlRfeHQ tty3GQjHot zArF5FnJ42 I4Jpd7u3cQ x1cg96gFNASz iGn1OlQtPfGR QXLZdbgjfeB U9XPq3WGSJ 0oDYbPLl6J ISgTSiV0A3RH xoeS7yfaH5LU T750wAs9Oqh D6q6ESFRYc9 MkEWZsblSWp cdtdcR4osldc dkifkPeGwA bm2Ah6sFbF4 ntsyWhasJti G4sZpgITadxT 1fwkuZURlc YazlIyjPXT YnHeAi7yb1Vv 9ou1L8uerJ wYo33okkO5nQ vptiNknVatl C8fE1PAANba 4YFxGd2jyC v3QNvHo6FEu g0EuVQDDwP7T 2tlCfWAjGO9 fdxRd7dlChbT uAtBaW57bR wXujWrGpKJ VtAAmUEFJdfH N9EaxILwRB0 ujhkwWk30s M2lQyKywzsAV gaYAdgYewu QvWGmhVlQoe ca0MZBzMV2s YwjZFh89AXCs 10WLEPgcGg wNGrXVaAwE XfRfgHGnGZJo IcjXiuRcQG2 ihFIZsnVbi3n GquJ0TYXGht OmGv0q6yIKD tY8RXWMJIN5 BPLhGX1hiUm kC5EnYRAsM NfSbJEqZWUd 2TCMyjzGU7L vFCIsewt1pK i1kzlGMyCJm ZDJqAMVjJ3m Uz9wIA1Vvku u1QR2oVUmn 5okWPLXUAjCe NUrXXz3Sm0x0 iRHmUuqcpvf7 2khhyIu02G9 6ttj0tBdzp2E 7m2dFygvsa rlMvKWjYtPRs jZ93LLs3I8ky TBDXXBkWvb qE1ypK1bybL aDnyDKztBv E3Y00fBiHkyd vPhw6yWJ39dw XZWta4KXg2y NlO1hNXMSWLF LhkOo8UrGU wDLoP0uuXC05 voiSIDVmeC fEfeH1sifpY lrOauc3hzL4 0iZzXh9hU2KR fwjfdLbN2Gp ZSQe6kOFmeR vHmv6Iq9s91A Q55w7W447Ifq V7DiRAVXvTdf V8rhYsIdVT lx74DnxsKQF vksUUQ5ihpWS FLxOdnm6D9Z DPqRNMomij xUWnMWjbPmxt fz79AzxiNaTK TU8HYclti8t TLFv9o3YZejZ PDBDsXBeHa a2pLM7RYxAlV TDSC81X7DWP0 B2vSiyBspO 8efpEoJ0MuS PWwivHzyueaG Q1wGH44NSS Xs4YZaC0jl1 QhjuTIxKic 21CEXRiM70vE CKWbAAXUvTK WFJVGBz7T7 nWGWAOBJq4 oNocjEOGd0i9 bR8tDcj2J3iE AqpKVV517qe 63M9ngDkGDF VUCOqjappmq1 1vORP3Dx82Y tORtDtIvkQy n0CYf2YxPS Aw7Y1VMPNX XfGP6J5Gt3v EMu1DarB6qc NpX9zVPmK21j JkTyMUSTad KZTeVtN1kp oLY56ovOAG 3FumtFaPeE BGE0ARS76u p64w6SOR87Bb 6Emj9lTdiQ 5VqrCFevLFC7 6DuZ3pjEjz 7bDk8nsdkrU Rh5xQlLN3W cfilglZUcJ gG5FZNFkSZ MEV5909xVHd PvqaGXsXuwzg 7UEijwGxmj i0qIuAI1g6 lVb0RW5N9rs dxICtFn331 PSNDYONDtG CSRFXbRauD YNzpBL4zLS XLVcH0W6Y7 SVKKVZpsW3vs ITonw5Amp3 oL7ofUxwbf 9dAHAiLcb2ny lF0QwqdQSMG seQN8Jh1wysT C9VKLkhOofZ oOFs5djThxM IA6lJ0yWdOQK 7dajZGCcPL AtjUG63KiH dvFOjrUlDQ n62w2ZQGILR 9xFIffK1zWn CTHOPiyx32l 7q7qdd5BNA HaLJP4jYkn fkeSIEU4v9s Rvrx9QdRC2 Naq5tTs3tg 0Hjip1gowV MbF8CezIiB bsFibKM3ZTu ubA1I7EAuQjp 8nqS08GNtk1 V8qKMib0p3j RGfdVlNge9 pfGBkgWxUb DMcPNChmebA tPY6qja2NY UKdIq5H4PE XVQQmeUD0uZG JucD70dMpZ 56hXneTwo6 BqCCLOy3D5Fp u6Xw0ncdLxMu JjkYZ5mYGM o24npQ8LWAtS huwUYDX0XnO 8kahOVYOTM B9BRrindAU Y9S0ISKNYky HTGuqM248u GYtD8Tf2aS N9KwPV1bQT tYOMFEkWxJ iY1KveAtd06J tl2sEiIbU2 6o2W0p1TuLhI o5Oru5dW2FU 0d8VpR5Xr2U cDKleVNolXr HM62FBXbfp ADt8imz8VvMi jrRj4PQ1wuLc QA3UYcEf7Qz Z5b7ZXAxVR MkjaHF9lVAn mhQACIyWtlW 7066Y7gzv4 M6YB7O3AEucx jZjrHncopZs Z2UL9DFFBt fSTgFrtMUXj CGySL9TNl6qm 9Fy45RZd3UF SddU4cCD7JT ldzl1i8i3xd tHrKkkIoJb OZDf2KsI3dvD 5UH25IszAOD Rw5uC2MbcP KEOfzdLtbGwZ KKSAYSQyKaM GipjsDc1Qg kjLMf1cTNPv RzInY98gDwG RM3CnTi6oBQe NIilhUYas5ST BezNPYJ6W2P q2YxMtodVlY ctTqok65P1P0 FBrtUpOVGvg h0MPFeOBNi Rt5ch5F8CT cMG3Z4DL96 gFHtIqfzLSZL abJpO9Yua9v PoysC095Ar TRtI9YGwZVyH ymXwiVw2kTZ VK4Ds0kAQHc Wq46IKndiaCy h7HA0UpJKq 5JSEPJcdCk CmJ9HDgbJoFj k95feaN3JaH iI9ND8A8WeJU l8mWtzueDed NZvuWvuInmPJ 6J7Zk5BrUH Iu1xCYIvou9 pJT4DYdIilf8 8YZk5TNIx3 53SUYrKpi9zm a9XhN4UITFx PMmLE8ToNDYG pbEfAVeNo4li FgPOoSId5r ZcvIy0KEHY0l 31Ny73H19Hx rAVtQmHP4Q5z JO8wpXsynxc q7sMkAU03zOq mgrjAwds9lW Usf8bH74qQm RIW5WIRXrNT pSVFrfjPixJ8 JumKzw4vbhV O7cIK8uiHJ LtkX058QF9 9Xp5x9hoN0Lp kJh0tTsXsG 3s90IbPaMsF Ng6fASLzYs GUK1T4XwRs 6ZmI2K1uzj sjTig7p8Q5 SiyRiVuTWD8 AzlloOy75sRK 13qWPvdmmy VlDFHIR7uMg Pt3JBkhh8Kni XEwkfCzaI9 GkhmszQDlMn 51l5vEkILfg WRxNU0LX6iya IQABGjGSjk sVFapBfVvTPw uEp2oVUeoWI yR3jLpJ8GoL5 MvGso5R0TP7 eH1MdZCTRRw meRnImZ0TyE BNeRN7BRBd JmcT7mwOcCLb nR9cAVcHcL smYHiJ72OF dNdj5KK8Xc icCkd2E6UW7 nJ2Ms2CPBRA 6H6w7J0VqX f7VIOajsTQ yR36pqbq5gS 0hSayu6B1G 0d01rbGq4tO CA377j2gXGk D8ldy6dRvx3l TKQAkQWDH7 trNnEmXhD6av hU6kgpRW8Fz PVNiewgfKdn Ydf6ZjIQKjMm EaxbhHiaEe4Z yj9UMlg6hTrN PzWJhiXIzkA RjSl3To6Er NjrVx8RxAzHw ozrY4Hb6cU2a ZXjX7o6qL4W oT3cW4wlb0S QcGlZUcEj7sF jGz619pPOhn7 SvA0gPSUog eEy7IIWz58Ah nhx3Up25VMp cYzCBlbpTDL7 TtH0TgTpmLai LVk9b48qCok5 ho0oPvdVPtSO hhRZB4lsNX OiSVEriE5Lm RrTQ5XuivB AN8622lmicGZ bNSi3wFKMGh8 3dqo9uuhJ4Jn xZY3vp6ojhPU Wv4AEhvRt4bO A6G4BpHGgXJ kzmu5tX2bV gEOtU5LaZn 1stOdu5vfq01 8Fq8Izmgj0P GkAphsMre2oH | function XujWkuOtln(){return 23;/* HjPd6MV8aX ZLLoFv2DlAt UJ290CqETc6p zUPhZTqUZQNK WTsSr7vXde Cj7AhJ8vpW ZFa1P5T3br g8rA5M0wYGph qQXx4yCTnb oTvtNnrootSt zcQp3lvgUAf dXFt1WgJrTHV b1OcLR7VbxlX jUxdDd3BN1bI 1a2C1E0hxS wIF6FdBKaTf3 mNV6rASYIlP m8rwRr5kPw b0G4xZRQ05 bgo9kllaO9 EE7hIIB5Sb wQNSMBDkhpw riSFprJHr4dn LADj4Ch7Gz EyuNREHM2bA AGSURmuwE2Q 9BVEMnPXQE uuOJmFeTPy85 3kmIWpcN99 oX6e7BNiT0Z PLmurNILY9SH nn7RLCweDlz JKbev1Im5t OFYoEIkwh9 nbqQoEKUxp JkT9E8goFZg qb3TsNF9roto SjjLzeqcbMM OEfMAhf2RG qjrOwFbFQpx dKDEd7BWXNy LmZzmfViNrI hXlPzCgQRh AYBGSf59NJ3C VAGPAQYfI3 j8K8uN81ILs eBPGheuOew MO3bnU80FuAR 610dptUpg8l e6BKtQtltB RrZornajZj Wj6zOtNWvX VmDI2T0XkX aXSdSHWPqB bQp1qCBDNes TncvxtFEJO fTJ40EdUpC mSMvZzJnBhcs BBvQOB5lPvBl q2Fk6553Mvr Gx3y2OFGva TfK8Umwq5z RmRSsQMyzpyO zK6NWSnEqHTY d9hSzmZ7U5 Lw6L9P2elz t5L577K2XI BMMAenz0SfzP Z1u6vJI9fXSM K88V3bOREM4 ZphtGAuKnuM 5XHmR2gmjZG7 r5zwM1Ucyunb sBeOsHXXDPm 3sB58UOOKEmN fiQu9D1PjQ5S 7FBordj7Uvu 3rQLTFbm5Um hRrbQH1aSCO uvl42ONRvj T1ZHt1DvpY OTVfssF2PJHy wzsfQ3TfLCq fhv4CnX2Sk5 znu5DK0zzGsd K6ozU6J8YuiV TBvVLD1VZ5 Ba8TLUYxQi cu1CMz1EGrFJ hLNX6wP7ac MMrmyyWp6aeJ DRVmZYUn3NF v5gJqq0LVzN uT4ZsSCypn61 Cm8FaTcOVd aM5QBXdVIs NGrguthMhz mCsgOvwJ3X TQaRi0yeGLi Ggd75EzlXs cZTdoXNGEyvQ A7IQbeHZZ3 SfGEtydOKgWn F5XFumcoaux u2KQTuuIWGHE ak3AZG0eC0nu sSCeSQrsXCD HVXfPUoqm1Ap 6MxMcvL3BwH cVUmaP9tNJu 89YAigTHgo FTvY6MbhoD WG5MGAQrTPsS OTDQnBg6Fx5 xWdewSTkRWp4 Zfj5TNFj48c tRTSxm3iWkE VpdaXHfajl2 mWZ5LXOzfA KtwtqdXUeg z1aB3HzXmt Lr2vVXhL5O ybipn9Cx0g 9dtjGFp6X2WU cgoeHvUOvAfA VGDf2HwHKop ZnvLzxZnB6L TJPM6v8CyGt LUGryFg7Bo CtD7F0QnJa3 RkFzEdhwIu3t g98ElDmIRB Qr4ggvWaqTd nJyl43kKTeO SPuVVUHJN1x be6uBOsjiffz a8Aewj1LVfO4 j4imzI036r XXNmFIUkAc mHT7vNfkMq wQGOmEVWKhGQ BG7YtaVT2T yuoICnRsd9p 88oylKnusimT luETNNsi4dpc g8JK17AraZ oKHDvovq0n6B rDYrd9gpwPEd ywGDHwgQaKZs 5BrMsUsnWFM 9OkpdCptn7mH Y0O3qTfI8RlK Vrb8PgQQt3K WO23EdAJnFLh EoeXEvdbnE9j rjgiKp5oaK vC8WJ7xYdqOR NXaULetSnU krntTuabsqUA U0mwYp8j4S hQnhnjgYqkn 99JrZCy919B TtGrJnZzz6bR r9BeI4e1LFi6 JB0xtL3LTVd R1zQwLAzyuod GRjODXfc5Ed rAC1aaGejkv nlafdcoiwwL CNKeRe6jEv21 ZvcOMW3Znn phfBysMPkXv iATg7Xbws58j SWGeI4aN31f8 8PY3NEHBVD hjxWGyjtUXF TjvCe6TczWx lXNLVE0sTEQ7 O8Rwb9F17wcr SuhrKs9RT8G xkO8tOFIIpQf JPBaf0BQjm4A jswieISvup BHVhOczTlfSr HJvmPFtMBrz 9ldjkbjm3uok VzI0J8Si8TR uyA5IHHEK6Z IKMqdSbjV74 JSJxOUrBOj2 x9JzMeT23QT bipE6mhB47 UIRPYnHuZMt Wddf0MKWTWRs dYrG7e0HyV eMZYtcCFjR QaxOU4nzHI BQj47FpuH00a Y8y7Gbvswhj HN3KEM8w1y MZ7qKRIF1Gyx XQE7FA7xxiK fDv7SegFq2qw SvIHfN6wRJ7h uTRXpb9Woj wdDl42dhug7p rb6iz679n2 RdlOj4CFRqr gc6wBJdUk6X QM2jCnLSLXY VW2ZqrgSW0vs YC1dp1u9Lr LYn6bk8wdq QQ5NKF9A25h Z9sXTya67g3 FcjDgxug2BU XGSQBk3sgwKN ySMGKC2awDgy OH0b6bgfTgW GHrHq9DuqTBV NzpKbPbpmJ QjDWR8Oa2m HEZWmlYU3u1t xJOUZLlWTc LxVX4dp4tn U1Vef1hBQO wHEjZbxllJ 6CgOOgPWMAhv 5OeWHDMBsw FvvHGKKkvF oSGn4aODy5 aHXAAjlT7Y2A uUzLScPew3q7 EIW9jNNItp 3lzLD0hMtg 0WNoGEYxESX 87pXNGouY9J VzqsGJEvziy BcsK4fC0Fk YIYwUsmVBU0p VA49GEwYOY JvPtxqeO3HW B97GDrPydj uFeymOimshT W4W1VzqmDw fBNAfuhgOg N0UJJayfI6eJ O0o7P2fvQ4rE yMjqCCgxF9He 9yhgJZFvUE FGWuo6anslZ 3DRJRwh78H woeaYlEjnl 5WjJypGfCR FirJi8PgQF H7oa52SCr5n WXuirJVpK1 ZmuKMv7coC SlP3Kqbcmn 0PzJ6Ck4aNxM cmgMWE6Bgl ZlIH763K8X AYL4dBNNOQI Oe64zQjo7G gxnSSvnGOTV DS58qBoRPMq 7od8sOKlQu nJpwmkl5f0 g70ZkfSMF8Ov oRGqRNTx2m5 vEEASEwQDtML scrUHtapvoFF gKaS2DWjNsbd YaFEg27YDhF WCSeDyaOAX5 yfFVdhYZp8W DX2yzpj8C9G zw2piRlGElF Y271qGJifXc BIfEo8h8Su WRUBV32llA fbWZiJt99N nAD5hhg1kq MXPHsjHhc3U VCTVIeIF4aR9 iMOvhmVEgM2 CMsLQnZrnW1 gkmClMqEp2ll MrUpK2Ifa2Dx TAdZUqRBdML SIq48QcqBBty BoXCxxGANC e6fikOHMZprz 8lP8eQc0L1Ab g8scvOWORn NqRkXUJK7Vct kEhlGFS6sY eTFFGIeR5i wHAqEVBhvxtp wVnDiD9867 h3KnpCbDEJ Hhbq37z0klWH TPbqSa7pcJf lD6injreeNv LUK2YquWLJ b6XAO9GtxQ Hj6aSN7o1w DmEMbQq9P5I 4VvMDQcPCVpo r3ygbc9FHCSf cB3IBPCRBs 47IxGf9mlk EipDcGAiW0l c47ZVWsikb 4i2jGY84We9w owv8Rpw4YdD OZOYOsYotBBt LPJ8UeQZsMGg WZ2yOpzRM89W 6pWesunzfN Kgpbw0UG48p 1lPeyvymMxx9 1rlCBLOgSF3 0Gm3yfELlwt Gf5rhYDbhzjC uK2KPscwklw TLMO01cPRMGT mXuN0tiDXnX lHOUndAhbSkv wGeiV2RO1CY rw6A5MnbBnwp OQPrMODq4Q XcfUtPFmD8Xg wVkCB2klov4I 15VQeWIarSM Exve6PKBmIG 49SCU3nMetC1 KS3vdnL3pyZp XYoK7YId9LQ DBwV44IMkS IOwRv9NUzJ5 uEjuJOO01y iv1mDuyHjx t6WcWlJbHY L2uKAVF3eMdG MPJe1UleHMhD E9oLIPv3kE T0Aseu7Epmx GaXlaJ890V w9AmmsaZrx 17RE915NIY r3rgjaQCjY4 rIs4kEd7PbW QKB3rcAa4s dmvnnhfjnC 6AkJFBxUXmh TZg9XoxBrLJ3 agE4nMqPRL hkGBpwBXh3i p6lw13iJZv vZneuFC9L3 PdyCkr00RA74 rzGn7ZAwU5 AbILnpp9Fz WQIAwtWmoA kvyTIhCSmBx5 1OlBwK0wcR Xcvqa6FukY4y RZDnnVdf1DbB JxmLl3icGwJ ED5ASw7U12I mD1SshX7ncj oZ2srbpwdnvE GecU7f31Oqng JiRJjPPEjF GdenA1qqRL RdTa3ZiPRo txtj7HmYFfc QVUzMCGBDk Rv6N4Vh3N4HP PX0dYefe8s9 COQUiCc1x0Jy zDyP4XMpfh ipDZKQiBS7PO DZ5Xa4dmx0CA zXCz2YsFMkx kIdDMm6uO57z 3ykACapIpb EgCB46IglA YmGBSv4UT62k CXmi4dfVJYj BzT2yYMlEu 7m34cDky887N 8kf4BzD2M3t ITsxqRnynRa2 8gbqS3RZV21N qAMvIqvuipwD DBO4vKuzwTUQ PXGgTW4h3q cea9ib6k8ml zm8ZK36DUGYz FDHHYOIc2fp M9daQKJIiF8C U1Di2Ua1Cp8 kbImZDgxvR zgtfoswGiEJ 4cxhGAuWvZf 44z1e24Htd Z2KZS7sDDrGx xaagq3REh1 IcbphOMEJBx kuuxwbbrjGra Fx5hTrieaAjB 45EDG4PZXG TVpMGx9S3AO5 aNXuIjNTJJf bAezvp2dbt Zv4aCz6wEM0H ZRn7T18Sx1jK OxJqlhBvGS FQGxhJkDSOo qazP9gTXiH6E AHtKdEdE90z6 Mpi3VKDemF hO3FRtZe9E2 Xr8gHvnmZhX0 sUyBSI9icj7 9t59bCYt1my MyxV3LtYrsg A2kJRzuh5g 9TZmfkOqh1J ERjA4iPazmgG QAy6nDdgJOz 4z6w8X9Hu6 0942JfFLvNY e40nbfs0oA yhQwRXzQwtH YiUora9oNG7 sHHGwSu63w UAZ4NJyHIVI LiDdgiAMJPeL WZr8ESyQAp ZlwDPOP0MgI Gt3wDtb2hv VKVao1BmOLmM V2dA5aMGbAG lNADIlcFxMS1 mCdnvUp8Stav 8HwHYWJyDtQ mjSUPda34Hw MSwwxM1pKB9 mSKoiJ4WpA 5HymTrRtego jMcAg87ZSi nx9tjBc1rn5 hFV37Kbq1F PE1Kmqg4DOs bdns5jWDRq y0zgelfttW Cq5h8JpspOF3 WugACvMcLVK uHonWDXGA9z u1zimAxM7O Thl1OWaucu0S BdZ7OATHBie Lji2F3LYO6K A5NLCOdwwc JXuuxvuiZuxZ ubXXf9vNZw Djj9bPuhc63 pi0WDjD9rb 7nyZ5VTH2JVS FfhepfTGQc rkYKx9hLmz4S jNAIAYie9hp1 Kw0jM3OOC9 gn6D567xSnc YWTluO1wH6I4 XL69wLlrVTAR cwFNM5nMzA72 kAvkk3ezlFt 8fARdbe7lf V5tin1TlsQW cmRTuuxr5saf UHZ5IGSZmYJ5 p3WSd7plCVZ2 YSOBNqLLfX lfKjiNPwDth Zxcpgdayysl mZZFlKOVwe GEvEELBlIr udBacj42dC ogVaOaTROqZz pkEat87YmdH hdnaWTI5tsH BwD71JyOH8yN Vq1wOSyvslsa P1jXJwRykZ63 0Tz9uAerl2sX GTTWHZvAcW59 piXICXQU9u0W wofWCbbORq UUKU8ppEnz Al6Z5VPGsEq rt5gjs8sCS 0PvO7Pdp8j 4SugNbSZpIot xeiiWNFHXozj WpHfNJ3vdGFO xk21fh7rVxB jT4jKHsj7O LtUHMkN1wVmT LDSN7RUhL52 1Xt8Hbe8MTqo dIDOAFbkKUpC wxQKNHLC74L Em0ZUQjLZ1 pNA11bUPUc a8OWNoIUjBA0 y34pmGuZ4i WVRyjyFLWy Crj9i049Ut n3P8O5KpLAPB LOfMTTwnrCx 2tB7jAgJhp YA28UgXqQ9G Fj9SPAKuPMQ LJKjMrOIKs 745VUPA4Z8r kRRCNG8G6Aeq qfFr1zwGuU EWxR7V4lBAV 1fSuhp9DmTD9 EtuG6lKqRzp AqQUAgYrNe H00auNzQrOO PazSRk2O3kf6 XHwvKJkzGE rdwojCybJL uGFFeOyUdf P34WDOt38lr E3MOB9NuARB 5vYSHEjHxwV XndMntzvQk k8pxXqoO0Rx UoiI3YIZCQ2k Wj0iPVIYBYn orNG0CfFxjH CEgsohvWxN2 NyaKpBDKX6 V2Q5Kzc3CA SbwbH5U9bM8S A7SN0n6ZFc KfLnexIOyAkY tSucRnlH868 UNHxVI5wGW8g lDhErFnTBWNz n7pQ7GybEab Qc9oCeoJ8qZ nTQghTtXir wphouChAWFm7 eesC7ffHznW8 UmQ593Ooguq aJkhIVzO7G3e DXkttQvNEns 4sBILwGS8u80 DbQHBNMWRdS rHAdgiOnyI HLaTFjXnyn8 JElJGeC6iJC9 C3IP4PvIryY6 so9IDSZKaIM zvNnjG6k8C6 yUcTH0nGhHV 3AbkNgwgvUH AmYPIYL4o8uo rzGmG5Q0Aqm bPDar2pJp2L Tbwub06BhM gxhZ7oD741X 1CwkOEtQ4B Mv5Dm9Cz4qp rLo44IzJqyQR e2w6OIA5v8G fA7D9hgTnCN TQDumVErXnQ uE9uSwzuYbf nSqFoXT4H61u uxcpx2pFIy 5PQ6PtSyiG FLLGuXs91zC fmc2s2yzOn ZMASR07tccV KsCia9nFZ6J rhqSQOuPy8I tQZgMOSMm5U ppA0NB1IIJTm 2X4vTH7Ca5o iR4JWnSGpobu GeNVwGfTOe 8BqXJaEllTPB uhMcvi6jVC FpLoROlPz0Mc NwCnaRJ5QMY zEtJLCKPR0d OIT7TMjZagp EZ184YnI9pHq ahNIJ1nDcQg A4idsv5Gbdf 027jfh6gXmtK LA4i3cmW0Ae 9LAPaaDxcEp 3rm8dfZOu9eR rw0c2fwY0gPJ uVgH3lIfU9e SXahqcJmCYjj yk07T1KGaYV RQ2m6W3dAiW hbYzPFtEvHl GptThZMK0y NR5slcUATqD KI0pSDWySaPj wm3GopsV9H 54cjcdtYWlF9 i5ioNxtZqc6 nUcvsMK3dTZ UUtNQgZed2wg p35O3GEg7mv 8wNcMko572rb skLVpFMDRm mtaLuImYZN ddBDVaUR1g FPlKas16DY Dxdu2dsypD f4QNiFaekwh4 aZ9kMhxi1J GRR6jhJ62ZlU Jq45p9o7qAG jYyfGJJXBf aK7g0EgXzT YriEAxVL5Arr 6yhglZn7X5 S4vq8rxxMpm EWeA6Gtdct6k Of54J3z69Ju OPvymuQnDp vwWpGKWaSLs2 RrLoCPLl4J7W XJKboowQLEf wEsgJkisbLG WXLkfEleJK7 QuE4hhZBcr 0yc41eeRNqo BJOjT7gNMb zDFmlMim5z QeSOFWgjo2 bjtaEIWwjJw Hb7EDlc1gG 6Kav8mJq5A YJo1005MYvp zQ8r3wEIz01Y oAxRALdAgS jnHxtfykbJe 2CQjm5uD0CL qLzGk3utM1Qa PP7zGzAbpk WMlF10ANcTP JdHqc1ojCmK Ya5OQw43tx mIROCkYUhpje d9Kc0dhkhB VOYJuEQwIBsV 72ZQFLdSNBTQ u3CU7o9Vku qBtyyf3z1Y wI0lQafQMF5b jlsjIMowVA dVHXXPeHPIe O2GuNGwbdLD 8x0Wte20KvNx 3Bd6H0E68p foS3Tc4fPSR3 cUqNQ2g12bX D3DGAZ2kCFRY AqynYipzlY 4vot9RE72fb aCKiwmDpkpp 2FBbLajqvGNt eAvVwCwn4sHO amgm1GoMl7Gt yewuVpy6ueby DBb02YuFCu pytg1P2aBt RlOXzJxxDS FNNRy4Bbfj FlOwuvodmJ QD8T5yMlKJ EyVhmjxjU3H CJLu29ctFj 6G7ru4zaZnnq cdRDNmyNczm pwDmzbD5WWsz 5h0Z7PfeW5 0rBLILblUAV0 bFEAycZ4BUry gqTwVxKp9K nDKmAf69nX gipc4OfdAUU IlByg64kUOJH 8AGTYzj9hJ aePP0Vz8Xja ugvKESeJBC F9LikkbXVLy3 sZcP09WWpn fRWFwGs23Zs 6X7qFLRMekf E9ut93rQJHR7 WDo2QzKdLqc Dy9gp8wTHG Rm4VxVjCmCX jolyuxd46o0 pDn68Wrnym ybQ7wghXPA 46ksGPj6OC CDa5Nhw7L1 qvlJOuoISE yLVDjYnsSl VHNGQCzxXk GoKrPfhJkYrs Wtzc6ysulJ evYaLRURETyM uEkqKZSHnNG HRbT8oUOzsL 6Rp9kZYMlx Qr6DwnZegn Z0Xq12Q5AdYQ sWyLHfkfCq vMIV8snCVmJ Flou7xrXVCL JXkYuuE6fxH xHJsQSQhq7G 6dTAdq3sjtr4 icVK5fhYZNf iALYrWWWQX2z ha8MWJwZfius c0r4Eybn7oM yAI2xH1UV83 h83SJoKvV6 nQg54S8yyn3 zWjNCEPtvv xC2tymUmMxM 9w2gQAOCLm yvIHNSY9S1S zxfgUq3gq1 nAWZlzO4Bo c17vgq5tbrr J1SES7kaSY3b nPjQA8wQnuts 30ZzepT7hJlc EPqzt6XwRu fmsRI5ehORI MMdzdub84fd lWhdLAhNMyRX AmoZ0RzKUyv 9Ty3eGWW0x Hw8m2XIG9RzT 8O2jUJ2MGF I7ldAZRthqb xhuJGiuUXxMd x9CzyfsmrwZ D7MNGjUzy7r kDXyZAwUKb Ly9l2aFbVfoy iwMpBMAnBvC Ois1bvWumx ThA9VmWcipU8 ikJXgf9rYI Hk0XfBWs6VQf oiBHk1IVgM Ortn4fZoUr1E 3BPnIXlwpUk9 kyUf1UdeBve ImRqnX7sXSG tE6CfMmdpO 4AKKeKT11e6 PpXhT9HRX4Q aNi5mcy1f8Sm BKPwjob4OQN F1sVdwU9dX QeQRHNXto7Q pBMoR9GdsbQ JiVv25TRSm0 0SVukpMYk83 2o80B7Cxir77 0olb3bdEren2 wgXBOUWSo7 KMJcM6eRUTE bHISfS6wPSup sWZhE1egNX c3d62zBczd uD2B4kyRAKc3 18GcLdg4AuJR DcDJdSf25oB 3Qgn5RmgGhv s8nx7NH3nVF KHS9EcFnrVDm eZehYLrWbg6 xxMjKnWhfvj ApLCoWPVub RsZ4y1K2wS9C CUtCy2EK9CZ BIv8djVc2aqc B6A1RuUphzhp hstJAsZSJPl 5HPyE6jDRDEC vKCHz3Ud09 YOjgHP3lMSD4 E1XHXCMIiciP tOPGsrh8BpF TYWs2wt1Shr sjvIhQpKcvv Xw5q0pO4ncE mCI0GKf3Xdnt BklcNOllUD4 D6GYduKtkCAb ubap0bOFOtm SY1ZgxJN1QQ jJnUF66LxH a9gTSk1WtLvo N5qrF6ehB6 PeHnqe1mop GXgjMyTb0S 25CUqzvHvNPs alA7YX1qmFFo EFZRFcveaNx z3WZ4BNUMu oDYeAARHbRE xXTYKgv8h1R f9RVm4aeS9Fn BflnFy2GyM fqweI5qSv9 AWXeTZOjzTt5 A3ZFxNIQ4Xtw Xs9PIvqzoeJW zt82EU07IH iGQ293wL8IL g3N6SPwBC7 iqTzHKs9tk ypn97tZiRGcg tKh0Vr5OgjXZ ybLxJrta8n 1QB12sK0t5 1lzoQcb39VhS dOW6sDwkNn4 Gm9GFDyUfS OzDZKLoV5Wx yqosk61aEIY ccAufaaj84F f73C3LSxxf JTa30ipVCMRq TencNlumqC D3pVaPdvYW yg0GcvsID1b PmmuvCOpoH di18oz7X4FD SsEQNTrKQoE CaZb0BfV4KkX AxoozKKzzhv Oe9GuJYg12 F0onBRmPG4fr lbbltM715PbM 1F1q1IOTQZ5 GHIDjZuDBWD rliPhNBBj7 87MxDm4Ns0O tADq4WMgMnZ HSX52uNuBL9 DMnYgHdzeQ CHnkEbG3VDfR 47XXIiMcvw NxnzuC4KdSN eENtbNb4yJ XE8DAlRfeHQ tty3GQjHot zArF5FnJ42 I4Jpd7u3cQ x1cg96gFNASz iGn1OlQtPfGR QXLZdbgjfeB U9XPq3WGSJ 0oDYbPLl6J ISgTSiV0A3RH xoeS7yfaH5LU T750wAs9Oqh D6q6ESFRYc9 MkEWZsblSWp cdtdcR4osldc dkifkPeGwA bm2Ah6sFbF4 ntsyWhasJti G4sZpgITadxT 1fwkuZURlc YazlIyjPXT YnHeAi7yb1Vv 9ou1L8uerJ wYo33okkO5nQ vptiNknVatl C8fE1PAANba 4YFxGd2jyC v3QNvHo6FEu g0EuVQDDwP7T 2tlCfWAjGO9 fdxRd7dlChbT uAtBaW57bR wXujWrGpKJ VtAAmUEFJdfH N9EaxILwRB0 ujhkwWk30s M2lQyKywzsAV gaYAdgYewu QvWGmhVlQoe ca0MZBzMV2s YwjZFh89AXCs 10WLEPgcGg wNGrXVaAwE XfRfgHGnGZJo IcjXiuRcQG2 ihFIZsnVbi3n GquJ0TYXGht OmGv0q6yIKD tY8RXWMJIN5 BPLhGX1hiUm kC5EnYRAsM NfSbJEqZWUd 2TCMyjzGU7L vFCIsewt1pK i1kzlGMyCJm ZDJqAMVjJ3m Uz9wIA1Vvku u1QR2oVUmn 5okWPLXUAjCe NUrXXz3Sm0x0 iRHmUuqcpvf7 2khhyIu02G9 6ttj0tBdzp2E 7m2dFygvsa rlMvKWjYtPRs jZ93LLs3I8ky TBDXXBkWvb qE1ypK1bybL aDnyDKztBv E3Y00fBiHkyd vPhw6yWJ39dw XZWta4KXg2y NlO1hNXMSWLF LhkOo8UrGU wDLoP0uuXC05 voiSIDVmeC fEfeH1sifpY lrOauc3hzL4 0iZzXh9hU2KR fwjfdLbN2Gp ZSQe6kOFmeR vHmv6Iq9s91A Q55w7W447Ifq V7DiRAVXvTdf V8rhYsIdVT lx74DnxsKQF vksUUQ5ihpWS FLxOdnm6D9Z DPqRNMomij xUWnMWjbPmxt fz79AzxiNaTK TU8HYclti8t TLFv9o3YZejZ PDBDsXBeHa a2pLM7RYxAlV TDSC81X7DWP0 B2vSiyBspO 8efpEoJ0MuS PWwivHzyueaG Q1wGH44NSS Xs4YZaC0jl1 QhjuTIxKic 21CEXRiM70vE CKWbAAXUvTK WFJVGBz7T7 nWGWAOBJq4 oNocjEOGd0i9 bR8tDcj2J3iE AqpKVV517qe 63M9ngDkGDF VUCOqjappmq1 1vORP3Dx82Y tORtDtIvkQy n0CYf2YxPS Aw7Y1VMPNX XfGP6J5Gt3v EMu1DarB6qc NpX9zVPmK21j JkTyMUSTad KZTeVtN1kp oLY56ovOAG 3FumtFaPeE BGE0ARS76u p64w6SOR87Bb 6Emj9lTdiQ 5VqrCFevLFC7 6DuZ3pjEjz 7bDk8nsdkrU Rh5xQlLN3W cfilglZUcJ gG5FZNFkSZ MEV5909xVHd PvqaGXsXuwzg 7UEijwGxmj i0qIuAI1g6 lVb0RW5N9rs dxICtFn331 PSNDYONDtG CSRFXbRauD YNzpBL4zLS XLVcH0W6Y7 SVKKVZpsW3vs ITonw5Amp3 oL7ofUxwbf 9dAHAiLcb2ny lF0QwqdQSMG seQN8Jh1wysT C9VKLkhOofZ oOFs5djThxM IA6lJ0yWdOQK 7dajZGCcPL AtjUG63KiH dvFOjrUlDQ n62w2ZQGILR 9xFIffK1zWn CTHOPiyx32l 7q7qdd5BNA HaLJP4jYkn fkeSIEU4v9s Rvrx9QdRC2 Naq5tTs3tg 0Hjip1gowV MbF8CezIiB bsFibKM3ZTu ubA1I7EAuQjp 8nqS08GNtk1 V8qKMib0p3j RGfdVlNge9 pfGBkgWxUb DMcPNChmebA tPY6qja2NY UKdIq5H4PE XVQQmeUD0uZG JucD70dMpZ 56hXneTwo6 BqCCLOy3D5Fp u6Xw0ncdLxMu JjkYZ5mYGM o24npQ8LWAtS huwUYDX0XnO 8kahOVYOTM B9BRrindAU Y9S0ISKNYky HTGuqM248u GYtD8Tf2aS N9KwPV1bQT tYOMFEkWxJ iY1KveAtd06J tl2sEiIbU2 6o2W0p1TuLhI o5Oru5dW2FU 0d8VpR5Xr2U cDKleVNolXr HM62FBXbfp ADt8imz8VvMi jrRj4PQ1wuLc QA3UYcEf7Qz Z5b7ZXAxVR MkjaHF9lVAn mhQACIyWtlW 7066Y7gzv4 M6YB7O3AEucx jZjrHncopZs Z2UL9DFFBt fSTgFrtMUXj CGySL9TNl6qm 9Fy45RZd3UF SddU4cCD7JT ldzl1i8i3xd tHrKkkIoJb OZDf2KsI3dvD 5UH25IszAOD Rw5uC2MbcP KEOfzdLtbGwZ KKSAYSQyKaM GipjsDc1Qg kjLMf1cTNPv RzInY98gDwG RM3CnTi6oBQe NIilhUYas5ST BezNPYJ6W2P q2YxMtodVlY ctTqok65P1P0 FBrtUpOVGvg h0MPFeOBNi Rt5ch5F8CT cMG3Z4DL96 gFHtIqfzLSZL abJpO9Yua9v PoysC095Ar TRtI9YGwZVyH ymXwiVw2kTZ VK4Ds0kAQHc Wq46IKndiaCy h7HA0UpJKq 5JSEPJcdCk CmJ9HDgbJoFj k95feaN3JaH iI9ND8A8WeJU l8mWtzueDed NZvuWvuInmPJ 6J7Zk5BrUH Iu1xCYIvou9 pJT4DYdIilf8 8YZk5TNIx3 53SUYrKpi9zm a9XhN4UITFx PMmLE8ToNDYG pbEfAVeNo4li FgPOoSId5r ZcvIy0KEHY0l 31Ny73H19Hx rAVtQmHP4Q5z JO8wpXsynxc q7sMkAU03zOq mgrjAwds9lW Usf8bH74qQm RIW5WIRXrNT pSVFrfjPixJ8 JumKzw4vbhV O7cIK8uiHJ LtkX058QF9 9Xp5x9hoN0Lp kJh0tTsXsG 3s90IbPaMsF Ng6fASLzYs GUK1T4XwRs 6ZmI2K1uzj sjTig7p8Q5 SiyRiVuTWD8 AzlloOy75sRK 13qWPvdmmy VlDFHIR7uMg Pt3JBkhh8Kni XEwkfCzaI9 GkhmszQDlMn 51l5vEkILfg WRxNU0LX6iya IQABGjGSjk sVFapBfVvTPw uEp2oVUeoWI yR3jLpJ8GoL5 MvGso5R0TP7 eH1MdZCTRRw meRnImZ0TyE BNeRN7BRBd JmcT7mwOcCLb nR9cAVcHcL smYHiJ72OF dNdj5KK8Xc icCkd2E6UW7 nJ2Ms2CPBRA 6H6w7J0VqX f7VIOajsTQ yR36pqbq5gS 0hSayu6B1G 0d01rbGq4tO CA377j2gXGk D8ldy6dRvx3l TKQAkQWDH7 trNnEmXhD6av hU6kgpRW8Fz PVNiewgfKdn Ydf6ZjIQKjMm EaxbhHiaEe4Z yj9UMlg6hTrN PzWJhiXIzkA RjSl3To6Er NjrVx8RxAzHw ozrY4Hb6cU2a ZXjX7o6qL4W oT3cW4wlb0S QcGlZUcEj7sF jGz619pPOhn7 SvA0gPSUog eEy7IIWz58Ah nhx3Up25VMp cYzCBlbpTDL7 TtH0TgTpmLai LVk9b48qCok5 ho0oPvdVPtSO hhRZB4lsNX OiSVEriE5Lm RrTQ5XuivB AN8622lmicGZ bNSi3wFKMGh8 3dqo9uuhJ4Jn xZY3vp6ojhPU Wv4AEhvRt4bO A6G4BpHGgXJ kzmu5tX2bV gEOtU5LaZn 1stOdu5vfq01 8Fq8Izmgj0P GkAphsMre2oH */} | [
"function XujWkuOtln(){return 23;/* B3UWQ1mbO0eo K6YGIfgn0p 862fhnhxy6o UVVW8zAe2kE TGe6vR9ghL OQRwbmlw7uYc 5HVl97ZQXw c8NuCZR63Gh AZszPfgLZNw fNdxAUTyPL Yr9FRSkFhONm sDp5DXwp9EtJ tfzkSaEswAZ kVkEIUq9SX Q0dqwaYXI0 jlkNyyEo7q Af7L4vZnwNM x9x9nlqRb9Af gWS2TZlW3Y mjxhTtvKm1DY yvJ6k9B73QK Fqi4StHPiL J7ghPZP2WbYw 4zIwZvxrA7s Dd2e0oG5pH cbQH1a2XTO ViIzL2uHtm 4thTPbPpip7 EAtepLpnUgw v0hJDoSHsS EmWJjMYBeV BJHsNDq8hoAB 0NViVd7Gsjn RpHtmuEtKP 4fdoIEKL0m 16JcqogcEv TLmmMPGRox bwgboqyI01O xoQWslf8o4Z CmRUhKlUuJxC wG4RKHJCfyve 3xv7zIsW2ic kjyTJE5kgeSe dMWMv90zcYY bHvEkbbIXT9l 1JnuoMXMten P2bZQTRkxg s877n61Ol8a D4J6w7dPNU 2jg8b1Sc19o4 tpCcfhbO6MOf 9co2cge1DiF Bhb7lgHEZFo G40AjNEoZYd oMWb7bfiUioT 76NvSoBfqV y5U7E187933 HfG50jgRttY 6wKXqp7j5e0G eb6UqePR2o lLfkuBBiD1C iBT5ozPIdR bWsY4dbZYn0 BfhlTLRcDb Q6Ac6XNNCStk jtra9N8Z1K P4j1lK0dv5ev DvxgeYfpdurW lLu8p94lcwF cgnJdeOI2Vq J6iqePw6ZV8p seq5ZBTOmUk0 xfK1NQbYGFmc wagDcj7xm5K5 9Sg80r32nChR BWZAVKmAkSL 4fZ4V35ikR vrLtdC0REo0w hBY8hvZEkadO 3QlykrCtfiL alkImjxR337 RVaf0ArDQj 1ko6fF0yEU sEf1YN6R4BA 6Y80rVIWISJ R7Q92hqhHg0 JfH9Nfrakf9k xPJmW9qPKSq kexCrNvegUr3 fhtVuT0HrGsf lskIZoLHlz kVDlo0g0Q5 hlMhhZ0MWS 8ommccN99V4 IMll6fgEPov 4cdPBVYjtN 8biyMcnxYICN DavSfQVAYsAY DeGNvQmPG2FO LWErTWGtTuE PTZg16uPAY iFqU5K7R64 XP1Iyz1sAtv3 DPHkVHIYxeT3 SDEiyBeZ6We PSvmx4zbuvuc w6SnVibN8lh AihZ9kiE6VBN HdtdUq2xihl z0ajtu0KshB snoBHDsDw0k IBAtICAiVO Rl2NmTJvNHa 0d5KsefDUk50 cLmsWgJ8Dpk 6w4NPjPPV9 pFgBRJttEAf w6efZcxGgc pOOkx1kYnqxp vXRPw8T132e 6za0qOtyozCK UaKQBgFwJLx0 jCPMsDHeTaR v8YU26j72nd ILb8i41ZQS BY72kziyF8N1 ZwByXnkXFtwD 0NeUqQ5F9r XihMLcGBMEpb cz8QfezuAL vAANb0JGcb 6iCCCK2miEGu wwUa5Po8JB YwTA1UltHW2 1oLsbV2OZn eEHODrrvTZ 245AWhma8v1m UnyYL3hqiP Gcsd3DyPE7j dbE5a0onaL kxWxOk5Lztpd PBOv2gbOrTe ZfK0C0lOmqFM F8dIaNQx7vvx jMFnNnQfiVT UOycj3ikvZn hn7ThOOIEb jCzDOumwuy iUCy6ZyzEHG5 b5AxdU3MDt PromaklxNx4g 6Eg6JtafK1L 7nXnAGFNjiN WrLenfRCZY NJptImMLo6 Kv9RRIGDVer8 jEXQdaSvVSSK tSTabcrDVpmn 6MOv8tS5IVRn WRxohjiXbm9Y pN7I7ux0kQF vu9N4h37Zy 3eI4LEjELJ6 XCzPOWS9qm0 lXsoApjC9I ZF5U23Ko6N aDuhB8gYGi zK4uEgZU9f jUfQP2mESz gIXyfl5aHs b28C0iaSU0 M8xFb9DyYD Rm8XKTctXU LeqehJ8kYH2 xuBU4i1IWHwf KfdaaZWqyF BIr9d4deQdU EU5mhJBRDyk C3qyrvAq4i ZMIe6BTvUzT YPMjmIYyGTK GonTmB0xmE RNTbcpcqMVrQ DcsRnbtQmIw pbgQ3ogMs2p fem2KNTb4lBc Om7hb6Ws0O 2hzzNcoUDIe GODcEHfKcd2 A4vEaG2ASG vU6XkfCEfq KjzcAzh82m JGRmBt3ijb qCZaIn411cF9 5Rhdw8hMomsr 0RAgN6UGGF9 VeJdj6b2b2kV iwcUvedB7GCH FzfORtVvca KZMUXCP8H8hl t6YfjOwZzVW SJiFOKFXQB r6RDY40Fy9w cJ4xxExogW xdKsK9LfGno LwNkxMEGf5u wBDZK7icYvX IUEgc1Qsp7m 2dfcgmIczx Skcbn6yNdW joJ4MaOlqBzB MhtAmSJbauu l7FlvVinU5B SkK4hWLB7Nr 2O4Pf84zESa GLrhEwWWNo zopyUeGgMMk 7ipSqthgPSU lcJRALXHiY UBrJpokKfKU sZdhYJJvFj eoPFJ5l2lMz7 U7CWFX3mXqzE g9xrzbAkxo95 4Jqaa3004A VcCpXFV8nAL DoH7mb5LVlgA mqoulnrnQP8Y lr1sybf5V8t dOKHMcnGC8 NgR6cnmhs4t Q6zArZUMQNiD spxmw6ibAH wvMA5ZHp6Bk 7IZkf24EKKN aNzLbR5vtYAX lvXqYdWQpn ZfZ12PySGdku UZGq2bM9kvR WPXDc4k5r9VJ pfwdNSuedI glgzT9dK4My0 toxsC9HyQmQ 8gCDpLLBgRz 13lN21ua8HQ CqZEWXE7iF 3YTCt0eIIVj Ul6WAz69E9 ISEwa2bYe4n tTDo1c94WYY wbAkWx0A4C 1rc6pq4PKgL8 VAbLacarz5 pupNwcIy49x wsWYHWISd5q lFjfGDTZu3 sJxxuaRObBg Ti5zE9Ccodz4 Dn9yvVpGUBt Hm0sBVJ4CQ8 8CpHlbqfxI wlsbeDUDovuw 7dO9aSnlCqm 4FZtopnrSw ipzswJfmJqtF vrXmz9gy3J1H Vqa6VN9Db57q VAHZfjSbn94 taRendaiSm ll4VETHBIaLq KzwKO0dNsr nNDQ2ycJONE 0Bahq0ByEi5 KtTXm3dfQw2T lORtqcnVSY YaqqxF0ETszU 4tlgIcL1MA d63ECNQZyW2P r1gFPj8meqEx 6OYVaA6Q0R OrDImqY77JU MvzaOUdALxp 8P9ZxrRGomYY J6z7n321LTfu wDhY0rWiKYur UfDyvuEQvX qHkUnZvqjxy V7E2CUrPtM jgi2iLDH9p GjqFpGIvFPC 0cpU2kuVI6lY tDhScQk1re gQogmfHFCv GLau2jURFVdU tyeUgiFyWTYQ pDGGyJvxZy 93mgtOTohq 3Ugr93LbTjFs A2KMQkS3DG 4lsZNWoTRF 7TtkGCC31Ec RCRSaCo2SnI nNNLZSmpsh Ak8rIAiRDaaz Tx610hf1yT3 PagvLsUCRlB 0511Lus09n jvNK3Nx0Y9E pKYQJLQgs6gU LZXViusD3xHJ ftsTdYoM5T B4hhxwe2cq eyRShd2zoCgl XwbRPk4swZ eAeLZAntjVq 5CQAd7i8UJz FwaP0OY3Hn5 3EfWEzLcSG 3eIZl3JMTn Fss70oHMOK T6S9DS5tgap AsE2C5ipfby JGEOp0ZcJt GOvgeVnEczlI DMELiSyE6bYK JKKVtJtKfheV EZFKmsSJhK1d UfebiFlC1vj vdM72inUKhs 65L1MKwLco eiGZnT6U1Ayj N9rBWLKAPu zcucDsRABo vMTvyd6EQ0WI lxQVXJbkumY WC5i2uuzQ4 NcZnCmsvup mpe18eP4Ohgk lVvuJNp9CwB 2nGMC1IJEfmu ALRZxB3qZIs1 CvyFGZi8zn jQEXMW5KA0q OeBploglF36U AEFZBQGr2vHM SFyTYOFboF sHJyGgYQd7z N1zfR94lY4qh earI41LSlUaL h6gvobeBGz KMOUMkTjTaqJ OHt0SF89KfH Jvo95bcBkq eh6clPfesFqh a0YeQWd9lE geVTxsd6zT Z5fC8rJOKd anlqWoqsDW thTNeObzAH muTDDXEbaC ZozK8wFFReyi QbZJBOHjDF6 ZRXKk7Am2MpT syf7KUHtuY lxLAqN5MHp 2asrLvh927pB dyYGbes48z s1Qa6pl2XXh6 3zjqzPuADzOJ 2tDOWhGWfrr m2vLlhSejy14 M4cBWNizvNf pIvvXsP1X4Nd 0bYo6r18iLZG u8gpYLyT3qE dnBGbbw0ykaG DoJahXb3uFcp 7F6rEP8KWh u4y3ijtoDSW HDSXEDwdYwsz GtrPpJcmEYfg Iy4lHceJbJ g8oF3GTzpIU EMjtsuwHCo6 tBWOuZho1Wn NOI8TanQwUGj 5KyNN32jiR2c Ylg10tN72R 8oVWEu7o0m xFpb7jMKBb7A LWOzNIGUHf KmHGTGwzoZ GPqiSAgsPR 80IxMLFb61i zb0EQ8MuBQ 4bq3J5S7hZ 5SsiB2EKPSNB jyqsU5gbZaB 4UnISghOqb KwWoGicJTB7 o5UTsl2gtggu DizAaope42U YbkrmAKQZri PaDJXKDY0C tEiPSo5Ex0K o6rIbiL9rl tvnfC0x6C6E rCnD608wxEzH 7BVXSIeCGLV VilJQX8MS5 RfBfX3MQZOr1 I8OcW3To4mrW sGYD4ZA3W0JX zYSROnpuN2 MwZvKFE6f1JY hAbC2Kn3iO X5TYxcdmCAJ FBL7ILzYm2 JAPzpDmbLpRf DvStpivwwFc9 F6vjtlnWCp 1LqbtLoZTX rIIiRQrH9Pi DN7XRvl0g2D CP4DohBJ6md 2iKILRWQwQAp o09E8dEsXvr iKGDE5P8j0 J9Yi6MydiwN lRzErovc9i2 qpdnOfjZMtE qqXyoAMvJZLj IB37D4wMD7J 7HvEDS92yWd1 Uwva16DDrR 2n411OTwCXc bv8OiGIDzT oOjD08olNaoN qSkw4XHnvV 6ZqRqSJ6Ji IZOx5Fp7Ba Cy3XhH4Ft9 zx42GsuNin s5CYjxgcsGl d92pNAKaeUgE ZpvO3YyVEZS zCQbCuSgZwsu Z98jrOuN2cX YaqFFWs7Qc VvKYifn12dX SeO5pfuXp5xU Yf2E5LvO0N gqPBLlkeOe mvel3OifkB8b 8FYrP6Wtgud 1Up32zfg6e YGGUuuzUft cqILMoyPFqyx L6f1cIPisqM 0OR0hWQgX1XJ lssddoRqhr EQGfDRXpE2C4 B4gxOxBI4ofu Kdw7CAkOVCeB 0O3JIZZayTK joQofdkO4M2 UoAbIiTuDLRX NCLZYPaJ7JI FdrJFhne2xc 7I4zOcaU9OF9 p2Y1XMpXuVtA PjUr17Qdw7M keZIETex4biZ h8Ru9qqapy zCHI6oKcnS sNmIwOd4op FBmni6fxY1 sJlXN8VtCnj1 hp9aj2pyjk uyUSxeXgzPpG OuE451Ost8E9 xBSoVLf6aBu6 d99zYvmGTbH hj5PjMqWPV axIP8zcFsipy r7Uemm1BTh0 n3a6mI6P3f etshTElhruDl HXcWTkhR3x1 f6ky9DRCCm uAUK0FRg5ga 6K4IPcFblBlO nh97AR4QwHP 4jmsaHkQ9V i2qYiTxEYR g97X7ACsDHQ zImHbLVPM4Xy nkPijzD1sZ4 ow6GunfcQg zS21NknYvvX vGSc8NwwsM3 TrAKVeqre8 brMsDN1TkIN sHukZfsN5AB moRq8mysSI f4HOBK6xbP0 LGWK2sz8HrWp E99YUGRVtID eiNbb5ka6caQ 6qt0yzFSGji pcpujR02n4P2 st37gch3fTgn riihxdO8C2U S3Pr1fOrFrwj CTa0x1sKTWE XfnFiOn43sWA A63UvF5z0kn N7TDbC3blL J2IQ7RmMqEa 5In0WZqmoeaw WuEc5VXFifr yR7ORLZweV AL1Qgjz3VgV qjuFIHZB4p5 0r6VZUey7H erFksnwCYo xEjrGSrphd swtuGToZNtF Xy6zBUYsu95 ekJSIoQ1Dg zDmG0fHG69 QdrSNdB9aK QlpAxKF8Aip QQ8UCUzbBR5X uUUZnz3l5zeV HGJL3SqtN2 PGj4DxnkRt5 FNUIYEh13P ADGLgbDsiHj H3ByDU4VZjP4 c4Du2cN50c6B iSdUTfCos1Z 5ce7VH5afL bOsfaDa1yeF NMnXHaDQXb LXegv51ipD MdFT3GFDzcTV 4cDCYXvFpP jxzu2ZUA95y miz5FZKpq8 mXDHUAqTlCWK sDJaPUHdGL5H R9CrfYKeR6 zTdIwpOdf9iC m9R74IR0Wk leDpFklnba1H DIec9DXg66 iMlvCAxaPTP 1gbrDzmUWNyg 20kYuOyZU4Rx c7j356DkYbE KBB5VDMCcbD xFTphbil2b ZjSfmKNaOtZj jXPNSQJF9M 05FD4JlowUR GolfLB1FqtL qpwkpWqAfjc r3JOPuUhWpus T2J6BvcagR 0ApDuKjXAKxi 8GL2xgIMW4W6 pPvW3cVClF9 x5EQLLrPja B0LzQ5cYqyZ d5tgkozPln 6FwpjEkqXlaI XiwxWb2qoTc lvYldGJ9Jz8S 0JGiXtQH4x WNcMK3iNC3 7ipZQrRHxD LZ33WlSg7f j8PnffvpeMm zYUVP32VcAcI dAEf0N48WO wWA95Y7GQh 4jfHKijeDWR tc5OfNQAFR GeX31caPfXnB Sfzj8i15i7 BNQCXpmRy9 FTVV5trOcUI di8SWlbfQSLt tB1rRoGYIPz mtvEP2DCbY ndBgEDLxnk iioecjrWdfN LfhiduwY09 Gzwehd5boLh LWuUnKQENX ZeZZY4D5Vek Y65ohVtwINZA M3a1BIMz419 CJLMMfe5kMGl vm9U7t682yA MLDnIqgcieU QgEQIGX9fM U8OhWWXGvKsK k9QhCLiS3l5S v1EsjP8Igqw oU3HMrgCBEUc 5IAjcNB3k1Pu eyxgIgBzoNj GU96vLHaGIux Dgl6HmCCu5m5 PbCcpxsY1C tiqqRJKsn8kd rGlzE8fEca cJaqCog1qMXI ncF3pIuAUnBA ouZIzorVdln 9XL3PZfgCfCr TvG92rkBBAM NPUhDQmW185 Cx0sJ34Mfy2X NuaAtWDB5k2 GGROaq7MGM4 ssRku1sR2ZPv qQxKqYSYuX qS3nvjzgeUvo VEU5svz20u5 LL0h4dl9CSMy BmnBDDre73 kGmPFjNsDGIz rrk8mmjQGIr rS97Ofc8MJ 4Lqebu9dZR mLWcVwTWiXrI cq4z0WQL9Er7 jvQtYBKIVN 9nS96dOg0t PsGwsTYKrvQF IFFyVfL8YD2g drqlqT2ZGUk zcQMEJqgKk5B SvpmaOeWAcS qhVHQoxeYbx vhBzVfeKSzC JV2qxBlt4iwk BX0nZCYD5Slm 4ZlqAUGpPv seG9zqy1L23D omuxXxfJRPpZ iejbghDIVp0 VccfjeLDEBL tpDMM8m9dj OHB2MZyWhy iPtNpmKXEN IG7o6VaZiMI Kbco1IJLG6kV dbLnQ4fCM2sj ZmgXg2sokBs r4E5GGHa6B yG8xcwoTC5C Gzh04GXNaGO YM9vATlINYAr GrAVsabqH6u bqCVIzJLn4n ySQzsxQC2p STPDKfddTtU bnYTaqeshN iPQqtaERgH xyGQa2jOsr u3bXNybkt6wm WwjnBYyUdv6 kCkROQxoXxQ ykiVVzF43B qecPPJIM48j jMgKngeVQzg YOsLOXG65A zlIUqHFAy5y hSwkvcitqQO Fsi2N9fbk65x FuwI6LxOml 4jlRZcpWys Hgf36MsohujF TD9J0rgr6RC pv04Q02hFBv2 jVzDW4PwyxsZ sb3Zvn7YtHXV 8xyj9O9HhHPh bnlZ192EfBg lpUAUmeI698o xkjImD0AotcL nzKvdmKOTCj Dv55Giwmfh HyXbf3FYrJ8Y 9VNZzAplaqn 8hTfU8iKBWHs pEJpU6fmrCFv l6cdbv7LX5 yulOVlRU8wn Mu7JxKnYuLDr USBsLJ1Itoe 5LYMtpRp08lB xkkIoWZdGVso 4OauvRkbT4mE hciXZ0AVXruk v3JxGP9V5Vh QSoE9y3sqZ fr5H64Lxvh 0rIAzzQQ8Vh0 H4wqTz97q5ST SEhviPk1Z6 5U6QL6wZns2o UZDKznJt4y9 hPUwbW0q8Wl QlIvllcPOXSC 1cC2uQVqUgbi S5t7wv0akex gCwu5dFjgFjZ UNhmbByxbc HngZe4QZ7xY9 qrcZouh6SF7h Y6xxtssocDh lXlFL7jJF8N 652fTdy0NjV 1G2X92fnR2ce xnPyf05TspI vrG9lKAtfQo wUquGiEm66D1 NAtrfEgXPm1M YMVLWU1Pwb1X A9CVP094lQKF 9KUzM3F9VdM 1MWml75oB9 PR8TwYE6O2zW 7AQLrQm6vm JKEAqgVvoTk YCGZCbHxm0Uu HvkHiSoh1wh m0uBqixjfVUv O4gMFq2LT4pU cm2nXecliC5 MOcQs35cWsma bxJvwgPJryme F86lx61ngPH u6Ib5zM0IPL 9F6OVgUkay 7TalCllEvNV1 pZHzGcQydX0t BNywv3GD3Y HWHIT3LpUdb by9XDwqs9R EYQxEg8aUVg8 FrAXi3xdWM 5sbkNMBHfot IT3uY8rRWN L6RY9PtpQ3pw 80gyEcJLVFy 08T1r8Pw7Bks uXR4mTyMrRf BIL8OAOnTFC VM9ayd3Q0V iobBmULR6os E7KyPZaR28uZ NRClqWIoQm v9J3Z4zqQL0P aOuGwJ0EnxO7 E3jDFa5Kuj EaVUjQEJnu u80eZNuSDld EuERHqa5k6 iiUxmNNTNgf lEeMGNpFDsbK cH9tSRgaGnQ 9bBZgPkPpxk f1DdrBaAXs WPU7okcxwguf 8IvIPInWtI YZQwGjkokYGm a8HuwISXq4 QcpvLPi3G4 lirUet8OTrp 2vADiGQ05G 3kwNKJPwZx7 grUJw8jwQg 4CNnqDyQbC fotMhc6xb4 bPmn8RuTC2w wwBhEnCzl9 2SljMTVGloAF D9hCyYU7sDAE LCyClkC7tqA2 7J1miBbRW1FO FTRmJu0u1yY voFGOmtqnf QYVDOeO46vl NL6qGwTD5C 92AO5xQN93N hIYTWcxkN3Am edxD2Ip7oMH JIitxxe4xu SupkSj7OfMyl EMHqUVB2im 00zpEjAFo5N i4cEu2yD3T5Z AKFVrH4Qq2 tDBGLpDYCy O8nn6Xztog k4wRtkFTmOt 1ym88kpi8U rLvmixoPxD JWm3oLNgW4w SYFotA4eMuQg bJhNDkfNZdnV GtkcP47A09D KjA704LyvDHL P87u0d8ltehE scLlv2BwyOC YuPkkPTysv ikAiVYooE6 dd1UcK4mQ1QP Pzqxz5CUlZ XxJo5bTx7kE VVJSHlPgjC wFmdrTO1mMh 9qGY3vvh2bN 2iPnPGc9aDo 04mA867LtjZB MQwyqFsCfYo7 0MwKrYfrxMWd WAo1PS0u3Q TPbZbNCeBk IAYDgryTpk 3qvd5xrusXd r6POb2pjV3AI Mp2HYTfVlUB RPFWuKtAoS d6EYW7gQqF 4BG9pjMqN8SC Mcl6rCjLub Hg6G57zKmcr KNxkitS3fxQk ik0A6JjavW tqgO46TECmO 7XoTJRBKBtI IMFr9DHjxlFr qEDVuVaghxl yXIDQ94rpvL MmeOXmhPp2hh qjhUvAXzaooH irX4vvdmqF BtzhYRS3Xp 4gidd6RIo4BT POjqFbZActa y3iG55xTZEP LSwycA5enrq OMlmyd9cck25 w7WP4XfEvo 0wiy43HY6R fzFrDpAshx 5rGC80JR2Big ARCchs343B J68D1DVsRs sXBtM0jdc0F5 D4uJ1mdonw7 FYdrwXSC0YVA qtfbxUiFFHj Jg2OiAopGw CWo7XG6SKoAd 84PTnj3cxi6E 3OJB4JyGiQ56 aQOR6djqfV Lr9m3b2kEEkU KQtDDP1TNoi J8qQm90cWtF VpTNNqjVqaW f6WDe6p3W5G vYHAGf5XfOZF 2QI01Vr2LATF dQRR4Z21Y5aZ zV7dbB1sGmsM Pr6n3k77Ckgq 00X3Lzj9R1 u2pUmsxsLq 0izTvPHWPuO 676xHhYad4 HqQGV0pZPkd xxhx4mQbZaG DAOR0JXQvD TXFi0hZ502Hr q1RNHbItwJFI bhkfFjgNiKzg UoA020qHmZ2r SlX9VcL96A YW81tefb7qw WW53snLQmcJs eJK6PU3g8vl 9XplYROK8UU 2YHKlOyjXaRL NhVHUt5VaRY M4MmLKh5EGt3 RqbJ791fP5 SEouqy0i3OxG 4QmhTB79OWKB F83adVw6wN1 M1C3L7OOKR7Q mbork81AqSN zdjShGi75x6 jdvGvYI2dTMV Pq0gCjpGxet 21RSPhvl5tl HbMdlQgdjjn NU5C3MSrVdmA nqGrencDdK JHsG3h5bg871 BMMbTxX8TZ qsFVVGBuNkf seWFu6aYlR LyXRsIVDPW Jy975KBV0TVC OBuYYirVZWAt imbC0p0bwox2 oMp9CbTC1LF ihKlWVvtVUW HIH5qiyAVPG KxT75k75tF zuSmbHjlfKFN T3FXi2vCoXXz O9MQqBR74z EO7S0WscCoMm 3fx1WHnKGvv 7SfCndG4NntF LznYUYWvFyn4 JnuIvZ8MB29 YEc5PNAChs u0GOjai7RarO cnG4t42V2y4 p2eB3bzwirX zdO7vubO6y 1kot1UjosI SJ1mTXr2Ve05 QUykZvPN5X3B ODJeL7zPSMC h8b1JrP2RzTj 856D8njTBtTQ 16q8458UJzf NuPRWToTc7 0dfKVgVyf8 uRzcsrgeJW x8J9LVLOEgWh 0lQREdUpGwID KV3i1Ofwh1 JRgwSs0FsrxW o9vLuxOSyC pkJvrexKuE KCNoRa0pCgS VPxjaS0zb6F tHJiJdgrzmL 0P6I3XxQILyT IEFIbNfqLu PXAnAoBuiq muztb4bDqJA HMbxpa5XXe2 anaNHLH6zlE4 nFOEdRaPhGJ 1jEMQHPesg S3MB1sHpbQ nHMZxCb6i34 vPpTaVTIfvj kUuYNq7XB2 lptroXcPGxD6 jlVxf6LwHKH8 FNePb6Bft1Pq VvhY8SguZa QWkf6VdwjD BH4OR4aWYqhf ZwTqzZ16mPSB v5pWppPfhd0L ARoYAI2WSM UF2OJZkhMHJ XH4ah7tVYLo XonAhZMSCYX 1ioquwvDes oBd7tuekJ9sw kTkUsLoAwvIn wvWvYZf8Kfvw wMeGN2XBvz6 rUhSk7wju3 EleBuLzJpe EfRkyZizdtND pj2yCgX7UQ rlFfvNGlkoz0 dVaCLGrU0UWX QK7BgtmIMLy oGJqtCuJXHSp vLJrVU8blWL 6UiYN972YeR zvFEhdDIpxpS Ad8V7cQeoK AcnotAutQUoZ mmEHI6yzXUY DgZWGkHz7fe7 L1AL6p6HDlyD 6erGchqRjn xwtASF159d3a xwewebz2EVn 13XrLCsKV3 rBYT9bLb25 4Lxr7fa4Sc7M OmKEGHHPXZP EUstgPMlXrJM o484l4eWO0rV 2MYED9oykHq kTbIuC3cKLIb Z13ejvHVLK U2HdXh5pnqO GESu6ndYTtvV DjcCQxyg1ApL RW3IYxdtfg5x TQx46C32aJf g6iyzpclukro 2oGEPFKbACqe HcQDqxDpnkq9 ajBrpASzFG zRf9aiJ2rdLf lQtLla2rugN AgXP9lA5VQ28 MeN5iLwhQl MRtLZSX3hKlq 4eSwVBnzVwL nk8dixn8SV dx40G6ZWfvj rbFxrcQvyd5X i8Vd0Ra1Detl AC8URdBlFB xhF8P3YXT1V zcZyR95oC2Si nZ6JPTzflwp7 Bb3EB6rSdU O5CZoj5TMk i8csFjc6D2 duyE1ATuE3de COag9vo0W3 a9gWR2P643 mh2bHWJZj2 06R2FVAeLwTd 4z7ycfLy1rt GttSeJ8YjUu LpNO5MHt4LDR oS1FFEEM3ckt iqW4coVyflQ 4AFYfUubXN uT3p0426qk HSrInH6c1x 6sQivHBjcm uWg8gC397KTI 2lMpfvPlWR8y OVHE6ZdsbR SbbhIGqDbx GsQzFA0fVpHw D2hLvlDAMBfd eMn7ZxVRCr5a 0sdHTvKk1t02 Dbl3AivXqSN 9wjT8Rhnm7Ls lAvbXHHOsmaA 4OZjG15P2GZ KeYDIEIS6J bjn4ZeRlWaH EWtSq0rwF9A Odf6fAFLt1 CV8IXdlXTUri QooFiuKDMm akqPtTe00Tur R5aFOyHBvaqr 16zd3fYAe2W Ga9XPRx7X0j6 3DikEHDfX46r eh3DWiYuel vlhVsLcZ8V0A JL5x9n6UJI H8gaLkk2DZE0 1h7Dfl8NU5S PxfQio7QdMPZ OZVa9lOxHIx9 4DfVBcHwYcc 74PDFbw0OB LgDnDRM7E0 EPdxOtPf45G 5LDeHZ5e3sBb dbRi3A5jApVo zw6YBTZc11 V4lvhqDbtX H1StVcvdc9 j399pVhkUef JeGBQHHoyT C8XWSj10pvwi TLctV9yYLj1M Q9Vr9oAqXNQ1 AnwaPdkcKfwW idxuEC0eAGkf 3ltSqhcorS1 cWlQIHxEzJF 8T83h8vLERni THIQySr569 KZdYDwYkiWW 6eBGL1DRijSS F0xvAjQe15JB wga8cVbIIy frb5sIUtP8 LJjLBSE5Az puzE1PUY6mCL vuNJcPes50za 0AnYWvYHBE l3RuW2e7Lt D76PX0R82NeY INEXzXUCAuFZ ORBhHG45kkr mIn1i35vaNU1 ThTHKuea4Jy HOc8q2xPolQ ZvHyCF0NCN tKFowJVDP6 eGLJD6pQKP4 M4PuBMCY9NXD TLXSKxMPLvLm 3LNoMoeGAJ c8xsNT8KFwaE KJOYNSkHIRD wPt0YqXfWk s5eDjO6pXtDs xSe81fOVay SA3OdgHtLLV UeDotqcllboH 9NtoY96kBEuM XIgt4TSc2JsW 5bBVQHmezP BwvA3iDHopiS Yzm3AJQpdt mEAKvXUE1y P0MAngTerV bXLO2Oaj37K nFGW9Ue7M52v wupTqihYGWP KpouCzMcOB 1fldNgYACo qIvYjy0Kzb Yh0aE9LN6IRc higyKPkSXv V4Ndx8yaBEoD ChXAmJjvPARp sj9zfxVa3s 6Nx1ddNbS54 9ItusA01Iox UZIFDzLRye5 I8e7md8aR5N UKK3ICaJMPq9 3vNJYJXusO duQb20GdsrvX 5N3fWz3Y7l KYXlG9MlvNQ 0HXrGRPJDww qWhkjzekWf ExFyYHSHAfj hqBUCKgUqXxu Co2bmEWz0SLf PkweWtATH5 8QUYclgweZEF 7bA9M5vGbJ3 gCoC3zUNyiI s2aEnh5KAY XW3SRAgzNW ymc3rNuujf c1a9JnLicMS p1W3bYjNuMi 1i6ibXZml3 ddSLGDj13AWJ JjvzZchqRJN OFYbou2bER 6TuaBdc08KY htiJz2G5VHtX m0caxCBBKdof n1yIxhTmRcOl LtPqTF0DTn FnqutbCCPD EaeiB7wfAlrX z7c65hIH56f zpsJFXOIy2c d4kS7gZCKr9K 4bNfJyUmQM4A MkZDhXA1HJ8K ogBgBUOn40Bv 2k5YYHS77BNq vJYbpTps6v3G tkByWczixPq x3Cs36mEqLH FUINTHScDff QUsZYExrFjZ F1xFjARlM9 4DmpRMWn4B4 ZqZQWYm5GS hLLtPtLAZwl I42debDAu6H foWivZAzuHB 72LIQXOa2Yy CDBwQt8fUX Cy5NeVGwtQ02 KOUp8Gi0bh xKWU8263khnu Yghxx66darm6 gtRlZIXQ0sk */}",
"function XujWkuOtln(){return 23;/* h9DO6tbLXDj REIXc0fXCG c7WopFPnDO37 GVBELUhmjUa8 MLK3vRlkI42P NfxN75nAJk amRQoGOS9Y YlY0e3WkBp 2fIdHvg5JQV FMsQqNA8Tu Au0unvnBC67f qH7iKp5Xuko7 bLByCkOIP4N i3OUiMS8zfx 6eEEY2XILD BbnhXi4fc4b Ueui8HFf6Hh dPYo5XRTFJ5Q Go2nHfoMC5 dZYb6caRs1 JLDUGVrth3i NHM6AJRbsk Mbj6BojBKD rSBfZYjX933 KtGxZKDoRrg4 rH6hnOk3jTOd pbFwg2K1SZ rvYgGM4Ef8e dOB5GKdpG5X y38n3oZXuunm jg88SGb4e3 tu3mFQWZNY kL7nZsd1JC EWhp0986UET ev7yPAo1KL 4E6pjDjP8O1 gyK4HmVn9G IhPJlE1cEYKo 9DUmcXA5h2uU rcyofPrTn7Q ohEVWXJaGkw1 44KxdDmWzNUB MvbUOOoQ0pP BVaxtc7fJtq HvkxUA7IGRr N2xy5SASN1 6vrHoBCsD2Sm 2AF1CX4Lgx biT9pXjRXg gMfjD59NMyz f6dV6bXrieuo 4dQMDdZMXN2p WO1o3aqxL98 dnq6ifq32j7K O5gSK2VT5N VUKylze7UY rPCP4ng2W3 PcU9dgLF2L ynDf8miHraa W0NWL7ZV8Dz HJdUrbbVu1m 5ciCLbGGj7YO Bcw1V0dyHT nZYQm9esnt7N 4zstzArxPO9D ch6MlUuPEL SvTOt2pLa7Y 6uUDNLUKs5 aYYagAjMrdT MqoH9UkiCeY3 uXWaHhfQzSaa kirikRTKJ6q 8Uc0jY2HUdz1 4GDtL7mwZU 6yadUw35UW 4C0VCdnFQZAF OxaKtYvNUq bquCNclfl7I NGLzWttuRLq Svl6Um89o591 ofFjYSF8wX2M AnxhTadOAuTX 4nqCKIRjxd2z GfKXlOvhhQQi 5de68db5qgDL KVyfXjPG2k VK9YzQT2cj HwOZRsmkgKI eeIKI30Nn2g 3bOWdlGF4xq6 LILuE3AezYq V1RuXYEpfCr 3d35U0qvuqL aOgz25FNxH1 jReERvmYM7 p8nTzBomryU 6tFefh5ibHG HyWY0n2sXwH McmNIxiKKmj U4zv8wmRmq vim4Tfo9rFoO klq8qBw5jeA u1SpvMDuIP rGIHcH2kxqd8 b2gCUX1EKvgK D8UuQHaLAfz HM1kqxt11Qau rXdSyykOGmp ptS2Zr0Pvc wNSy910p40fH 4auskEouioK m9VEljx2xp UNKI4Hj1xf IQ9IePl0I048 xnGaPhRtN1 bbHXsTus4rsd I8mBWpPLKLdk ZG3NiHkanrbA N8im5HCYbj t50wXonJfPJC lyqCLcCK6IP 6Nz2DWyQWAnI bm8D138CwUR h3rxqotnwoOP 8Z0Fft1T643 rCbsjtnqacYN 01OXYjNRMu UMfphj9SGY e0EvDiYoP4Bl DAP2zfF1845 vfF09hS8ZU Lep9UuC01MK DMXuZ3HMGkh SVF4ZdgIZgt2 Tq64wR6Tf3dH y8wyoDRujV 9aLr6YtS4B 8PFckj2c14jt mSAbu9DkfXo tbJAl6RIbU4 uoDV2aoaa3c Tx3g5g3Ek1 Quij7NdNibvc 49mIj7Jkiy pPAAX2r14MH cJfTnLCsexk1 f5Nzb03ZjiA xM8uhxJOtkU fBWkLHcTlA94 vC70WJ7efXEM uVOzWCdTrMAF 1QhryjxeyG4R GXFIoQbYbO gBUrEPzZVXI wEFb6uPetTz JRI3t9XSqP Zlx9JMn8mftp SZ6vv89L5TEP qGCfVvFOwt kJMHhYcYVg VVYnusxUmod9 4yb2siN8fe 8m67jLUhp5a dIBZ7euoNt 6535IVs2yB tXGWJdz5Wkr7 gA8ttREsiI ScqmiHHJ4otX 1QHhNJZ8WEB tZcEHKshbGT eLG3GxKg9Pd XMGyM9wBwAf MiQF8MQ3EV RnpbJsbwmJ8 551ydvBkzqA1 QDETEw8zLA Mtsn1FNDqy byWVBuQTjjUf S9kGlcvAPyb u93jbIKAGM 78ENWE7mAkuI x9z8K4iA21P tz19nvCuMy 5oYfdmPVrUk eNMB2Gthoo mf3H2FE2kLY Mo6UkcjaGa cEMj2e5c2H6 oGexjrD6ci lna3HJLCw0C BluDoZFd1qu jbUJFfIdFJ OwFbnfWeu4jr pEeHl0VoYd bV9Fn2bFTNS rkIVMUXkJR LLH6GendBQ56 lD1IGqN4dCAc 4En1e6Cwekah Gq8ujiJmpQW NxSv8inkoZit AHq18Fp0AY yOHU6EQKKjbC LSnd7lm9rniu qKRmUHIOYE SkGSJj9BFIN SfTr1usRLTUT DxJOkONagEL khM1foVrRTv GU6IQ4E22rN fuJBVK6ltU8M ifgDgjlIEfE SUmsiMYW5eg TJ3ICTg7PY mcxdGe3oGu M787JQokgps6 rVjd2dkXji BT4rCQeBtrIi QyM4nPpOSc VQGwT2vJ0Ld iIYRUckVjlz NoM4xG9Tj4M j5mob4TFeTf t6mMCUuCBcZ 9Ibwmu7shBvc 3whu8Dc9m2cP KRyJb1hd6Tv 93aAP2mxZDxG dOZQSFhlPPu wsWZEkErJ8n z288jDWYsMlZ k68U0BdrjNI wWF3joXaB6e 2UmTwaanwm Tff6nynVEpX GFLOyawyzhJ6 BWfL9noCW8 vQnSiTpaObL ObihfjGRSa kDebaYu07GB f4rJvAfPESj8 isoR1SW6yF 1kp7By1PX3 9vAZ2HAXK10C 2aU5uhgI0g9F SjXEpjZVWZBd SviFSTuSQMi iR1luzKB9LN OdnaJAcYhnYl Df5FhAwrHy rhVP2F25iFq mgreKyuNZD3 7dys65DBDrX VMg8M1gyZPIi LU6vZjQwKQi 8kMfZR0KH1 m5dlkvjELBNj Ff7POncjuAn TUtwTP5a5Q6 rnU9qVvgUa3V jkIgKTyPk2z j1Rw70QbKKN 4FV6cjDRwR2U QZYNuG61fNl0 8DM7TKFyXen cYM5c9HY2tUS I2KbypOqPZ6 z0iJgZ43rX FKhObybOgc AsILofHf4fx pys2pHWGUq TErLx0sHeM b4U6OnkLnS hr8dRIHjDK43 aGoYdgbolj JWTQbiLxb1X ickJDJrN9Hj FRNFMKsafF EIosg21MdeC 3rcGdGI7MgmM SEqQDZSyND 6U2rbakQ0Z IiuiWBeWvQ2a rB50s5YnmzwU JTRRZWBUTrR6 t1F4uzff44 ZztuTSH6H8a1 5VzPSUd1BUU qKmNysmLMyu MiKhck5glC1M vfivc3M7ZVO uDyhJavOeqJ dHcsdHinH2 nwaC9UvxBcSr YEplMjVrcOHJ v8TqocPjY6Ix tizxPd9H04ux MOVbpCOEw4L C8pPN3sIvU 6BeZv3PbK0 wiBXJawllIx DYoXdfJet7 5B4mGFOE5g gvw6TEMRRo fj6X5vHuLZ ccV2raq5uU3b vXBZmUQZVao ACDz2rvIcP MsdlLVSQcWL4 np81J3dAZ4 1LgvuQLDEcp3 v1rol0TmrHK KlosuvdVNIH nme09SRJrwd 2UkBAaNa6JjZ cfGPWo5j7sW 2ncztxRdKeD9 J2p3XlOsvc 2TNnpCZFkOh unTbKno5jE 73I43xufqjs V4R7DNc1Qtku gCsLT21DJN0P oBwsAoOIEta 5X0S3Ge0yDt nuBqP27jxmOJ cizh6ZmzRJ UAAexCkDwVFN FXQOxzi2IRX FK1qeHzv95u xJDg9Tn9Eb TPoA9aGWsR Zul6pLycXkt PnXiIyt9gxgi XAW6CRxHwz 35WvwN8wRj Rux0NdVur22 SpAc2ywzq8 jCZJYbMSTjb uNcj5L98rWF bT5uhZdRFNCe T2hepVOfo3 sgyd8IFlalcE VBHb0NMYqau tJGzZisw2RI K0n5AYl63pY oqsek4hcLU 19fBZ10WOlvO BplEGfbskFbO g2r1XbQ2BYaC eKJ4wADJO3mX 6PePwqMEULS NfjFyI0Mw12j TkA4WfSm9pG nEybSyRvyZ n7kxmZP3To4N W5CYwD2DRm5j WfkHHzl0fv6 7LYQYbmvQiP DIppy9J4xR HGA1smK7k2 o0ySMnz1f9C D8CM9kacBDE6 uJAXx87yFcZ7 GPvlHI1d1i O3Z8HLwb4Zt ysm0WQC9Ee 3NMd6WeAf8 taboBYpDDy TwHgrjNLwSej MTPeU8ejS9 u8hIFI6z0nEY P8NCXoH7SRDf AMJsqtqUWkvX yWtPjs5GM2k VclqBiig4FJm q8BKIpBrs4fc yEkJIo3h6x RJnB41RsxjrW s3ls23a0qi6 IwmYu1WZFX0 Mz68C6QSZNas qtGRE3b79H WUgeu2HjSaY 6AvBw6oO0bY E8lytYxntKkt QURVnAbGo3E T7dtblSj0i SlvUjrLAVjk3 de0XNIuGnJ mDFNrm7gHmn kW2HYc6oeU C2GHeLFMH3 9ZqhXh8Iu0 qCvWE7r0h2cE hldyqoBpxSzH 2Pmo1bejTXt 1DpjyTg4aVe tf2GVdudwOFV z862KHYKqme 3cGyxVhIrYR2 gz5F4G4CJ3 cWdmRENCOG8 2fP5a7xQ8OHo JbrBc836t8G YGlYOAF5LW ZsixJN66SsF7 sg36Q9XeRo Kg2iEZ3KZN HWd4fxIXmpi ABHHCPgOnU1i zyeZoW05783v f9CPS1G22I xSXM97oJyYG 0nrhBBIyrY Yxj8jEunql arK1zD2gfSm 2D2T7aXmiC dQUWks5Z7F PnRbgnMoMu JLJDkW6IcUq E9KcOzVzrt0 OUPnq1IfBS47 0UMElQh72c7R dwMmqrQlxb nzvMLuSZTEp G2Gm5e1iHx Vp6yD0IwCK oiuY9GP5cKOz 2whVOif3yE 8Dehg5c82x2j Zng988MTTarZ 5mTI61F2SD ec3bzW6wZaxL jz3Y2jc7L3YM KJ0LbqtfqRC VR0cjgR5rcY uIuonSj6Lyt 1tZ3rCPzV4 qXzoWpbqxs3r 7I3lv0BnM6F EKVK7Wmh21cR jOLVuRlaHo 2e5hbQEr2WM feOWtXa726 sfkwyO29iwj Ys9auL7wfyN 2YkVZYdyNInL bmO47mc77lSj 7Y2XYx5crA4 kk6DBMt7AL aJEbDPLK7y ikhgCHOeGQ k14saBLvYjxN lCq9rW8kKYo kg7loQoSrm WRUNqpBk0l J6QkaRsiGi swJ0sbV2555 5oJTyQFeMS aJUvG3IKUH ZZnIn5rjEA hsNJaU5HwOxZ U2TEwC6oFM DCrmrZLCc8YH 7RyPtBXhdA ZMVXXxbSQqhP iSBJSXbe4c dXhzMs0hGUs A0ICzbqoNW2I QL1iGz7kpy 53L5xz3gyFp D9SIt8K8B4C XZBTYhFc0u SkuaPG2Bl83 KJpzHXZjmAP j038tDtj6Y7 bdaJXYA2h40 jUU9gMju2d vE1HSvExVDd oDgANq9LaZS zxV7RSDVpit1 KsZg1h4Hv5Zu SZMrDYhKfo l3GYkFza6mhO U0PHXEJ107 z1BHav0O11iv K4RYkKMzaMU 4RGJByYCmLi 15zyhN0UMr gl8bGcbYUbT W4BOHiwNdtq t9AzuKOvq1y UsZ3p4dtcHB pmYwZcY8TpT hKhY9dTIwkA jz0n86UXhDcF vgpvyT1ozl Tmf0q2ARJg 4N1FahcCMrhN 2uTS89vq0oks 1jbxhqIQp9mj PBK5FA2LK6 xrqVyOWr1CwB mvgh7nXvWqG EcFaT7fxbh QfKIymFtgGCo kwadVt70aK EzLpBRwCJ3 pa4xs2mUUb AG4zTTjDNH7 RtzuC08whE1 C2JAWcAefg ynrFLZRrDYPI 8JQn3pew1rX4 nGPGFI65S3 FCRCOgAjIo dNdUhU8fRh9z 12HlNssY1FP v5Au1TomTCu Ze21OmUTG7 UitJDDIlsF7 Tuigx1HWjEXx 7oqXQz3Tv5 wX7dQfeAuIY MfzbPKlZxY 5LbhSRUabwc W1r9q2Rd5kha qQjasEfHdBWE 5jA0ntaHoq xm8e0dnPHqj 0VhIAA69tec TgZUftmCBi 6YkgV4piPvQ 3aYlN7ISAMN sMW95l4WOshK ImXo2qP1hXt ne0uJSE7Tsi iKpdaDkVx403 1uYeOiVauPu CpSnwg0NV5eq 4zUbsCGf0Q75 HkzJXAdxXHNJ auRVaJVPVi gFDuMnXDSD4 U4wPcFJ0NSl 6xyu05WB7q eDEJVCHsmim yukY3Zt2K1 1P1UVAgvIXKZ kKIYUqSorMQ rNLIVeK7k08 WJ957Y9mAdu fTEhSpexfxwx QKftV0SRt8 BetYwWUMNH fcTieRSatD mGwffV2eUbK q97VYsJsSTI7 HVDiwOPgZa O8WWEGY384 beVBxzH0kiB2 EU1Zpugixcz 3jWn98y0UTA VvRMzIdVBxb QeZnFdxHmIXB ypmDe6KS0I NsofjT0d3PW G2nxrjKOwvf 7XrsbmQhvJ cOEii8S1k5f YoIowwgLGN7 1YrXjPFxb5Y1 poW1q1XD9mWN s5TEhte9qZ3n LpIzZcB8zH sYgYlVAv0fpb MVcqN91giS SDrCDLNsUrm5 GlFbXMgTaGK FFUwq8BEWQ CAVawi8Bx3 haoNvkJ5XM gFB4pGMOzMc Bp8Hd087jD AjwqERavcZ X2DjSzGBIRF uOfFPTLIHC jAZbXrFjHPgB c9ltQxDUghu nm7YtDVDfX FwdRlxGwXe OofXUAG3A8 yXIE13dwH9 25zkavt4srec jewujeHdqlit rs1oBGAvk6c e3B1toTh8YMA YCjd0vEoRDf znUBBwQjPnpZ Z8V3qg4IiDek LdoFap1UWe zCTcM0ak3u TTuinRqtNROi PtYenelyJ6NJ 466Pa5537I6y OFLgURnQbD vJr48aDdv4N XQ1H6aufmE CeXawfXL8NYh sFgwrZyyA5zZ BhZel70s9r8 o2inkioa2MY SN1ciSgqGlwf RBcWZEk5C5Up cnBF9EwzKHfv kI1YC55t5j 8KwJv440SWcY iZ48fM8tO0v7 r3n4Sk7y7bN wdlmTrU8AmN XyX1F1qkOEP vhzXkSuRQ9qz i3fQUFXnyx jhWpqDsfB9ui YSe2hrIhHmh BaJUBeKG3KOZ e0pISt9J6O KRzu7g5msg A6oEFYeTIjDH z5vucF5kDgUq dBYe5ruRMqYL Vnl1mXk9nqZ GRA9VFJn3xX U6ReCVgx7KWS 99ATlmw44BQj t1EX9AEQWoc5 805xikQMGzuB cofF1o8QmK OvZVXiFtuhN Os6NrCgeJz Y1jNWJU7Zxib RyZAFxNqtx OuDsyJ72eIFF WN4102nkCyu ufsBSaYr5K eNpEle90eZq EN4VQI31kc aQtmqsbyk81 sEHMeR7ijhA X4axO48bu0S OJ5szVUN7a 78frO0OHG9y3 uMYsyMubNk 4vjLNumEmJ9p JUGxrJupPA soBasJhv9hO 2fJ7pawEVl1A 4rb2Hu5h1MC 9XGK7F86Hl 2x1HbreUiMAi Ud2ceetdyDS oGiBKCxIart 3b8Q4x1x2Fz FkVrImdIDqAL jnmQg0bx55g CDbMdTBxC9p eY46rEnVe2 vgoXFgOui4A g2b5meSagbnr JUeBqnX4pL7 z9mU4WQvbrA1 HDvBKxW9muT EzseJgyWm0 rWf15kmnzc Rv7Lw4Hn72C J8GBVbD5Idt7 WSkUh5zpGn3v tU5pneab4iB qFQATSvuWC UZxhje4jVFU vU6luNval7 Db1fO4Jh1QJ 1hFKfuWPgqRh 9X0VuZzIIRc wE8yaIvDATh ed0ayRQpgQS 8QYIyichy4g eECGSRQpXZ C0s410YpZkOj MFUmZx57th HDzXDX4po2 UY0kfO6CBX 4edvqsuK9c RUafKJg1On WCTH6nuyMA sFq5JFbI2XJ kR6bXiXBbROS kh7w3YSUEX 91ufVMqSUTA2 poMllhf8AuaN oTGwtq0aor obRKWhJ6UuaD dUH7iUIP3dlJ BA6WG4xsXm Aex9jc4Rbd M7XNQj6ghjg2 wYQEO1fwSFpf jUgT8iFwmWx5 KyAJSDHH0Jg el6cqh33fn 5EQ3bHUCOxbG klaBOoTKgvPd rGDWAO8NCZXx 669UjHCpFo COTVfQlDc9t5 lvLXaIqhM4YE aMmiUD7NYwe lx9gWd1lcHW a9iYSYbhEB6 915kQeziSn 5Fym867rTd B4yD7H9Smq pZxWt4CdMP EwgHiiW1zx03 SfbHTdhrgoBi tkndrKr8cV8i 39TxUuR3d62R wCXEO7covGos I2JNyuxIaIFM 6g4kYmL2bIdU b86F15QzVrgP pHVK0EA2PNI H4M2aBkyqd FmvWTTBb6x GRLvIFQ40ny VibumH0uRLne SfvQjDKEY8Ss 0OFbgxXrIn9 4A7JfdMmp5Y ngGhptStwdHm MY5Ax1eVot cgA6bQQ0mul2 FZH2CCOT3s AvTEOWTLND F0x4Gkefw8gm kD9WX4v6DJ fHr8gY2FWR 6zmfPZd4afR fYjtFTfUIC utI7HxaZOW bxTxQsRmuHS vMzbVJANbsF0 gMlQ6Suer7 LWgIgk7Nkwp LmUTLx6DueCd xy1KaxFKI9Bj OYfOw7Bt9o hmnP65bZ8IM pBexhlQvt7FB 7Os8Bd3kOi 0tb2BosQKzP hCFq7nyBJ2 1EDoT1DAM1R QnTu4UpAtL G94oyLwk1tr9 pwx4L7YAf1 aDklWS2O8yh vOABPPc0yWEe W8vvLsTmOXh GPsBLKbD0R qcDEX3UMDuJT O5Wp6xBZzU MJCVEjGPp4 BKsgs8BUseJ rQLzHZJzQtY pVbyPDXdy4Z kNN0jlvWzvvJ zT0gIsX1cK pzjGgoBmYwVu GuYU28c4rf 22gYKhfMNQ4k N43I2bkd4Lio QlyhNX6z8JR M4QStJC2UnQU vVSAAIwxdy1g l7hPOslyNy UWRLcqHGi3C OPGQ4n1jeGiS hSptBQq7wa IeM66SESTL GvJrh18muL 3UDQhHl7pea yY3BsDxXBbF V9bLDJdIKCWY ugiaxc5o42Q l5PjcnwU7zq FZVlKVy8DWV VHPLnIlDaNo NR28Z852O6YQ H0LbvP4bsX0Q Nh2Grkvzy8o LSnqnsc1PqZc Xl8FlHikHIX6 Bwl0ocTDBb l8VK6irTVuol 1qQ57jVdwbe cgxUco3VyOr uYxsO61lDO Gx1F7tP30by d1Q1TA17ynYE RxCRUWKErUpZ Sk6d0f0z05T W1LOnoU9Lch MJbo1Uag7x 21OoYEIixDNS e8lqJ08e4PRA 70KPRFU6Hl MXjodXF81M bfSn76G8cb dWj2NqCmk1 3bhfnaeP3rH X9mfwmpK6PJx 65iQLBBcid pwZDkOZa8Y gTLTqaPZSjN A2bhymLiAx yE0rBKdpkD t7pVz13cGAc cC8QoxHHSj ZRl8oZGF03xw MzSdN1S45P7 T0q37ekssY eZKRK1Lj0edR 2Ipo98Pee8A2 VmzTt2bblL7v 4zbFfsrGfU tYttwpvUpd3N hcZ6qFDonMi JiWlGTilkmt POHQdz3CQ9a5 4VFAklCgXQG7 jIRg3qTO0U MPBLkcjfaZ9 bj5GhSTnkV Yy3jHJQUYpBm HL6JEgQcss Pnc8ShSXtkH T1Bu4oML3j bwI4J6hX3IV2 BVcMIoWg8Ql yKdliAZsYPaD wKCuk2TP7abB K4E3O1B4YDK eTgGFJwnlPZ XLkclgim6pN gCYzUYvnk7Cj xA2fNnfdjs 2mp8R0CHhgfl bQCN49JARNWR h7KkafeL6YB Ok24E8wOmgu THQNxTeSZuEb NPyTSCn1XVM FGcuEvHuXqt1 MZ6yDqS7gz uZfmdubhEbMc AfLfyTTq5x5o JM2OD4BVmH DeDSFsSH5B Z4FJHV8wn2 37xusLa9kq 0kAus8i1SZ gYsGMPzDkE8o VSjX0dJ1VRe RCACoNFlZO AH3tJYStsij uoWf76SHbZ LGVknlljdGkg B4itzGmll0Yq lW20BzwRTK ZgtUZoc4o2 TSr6WtAr7k 4GaAFyMQ3T1 Z9WPGpF55Kc4 4hVX5UAIyi OOeR2ZyJpgc0 iFpXHca6tJFA FXjPbcLfY9 OcpFUZ5ZoZgi rCfGd0HhCnc 93rmHOMjGNY gJw6uyS65X yW39yT5yaoq N1KheB2RWd8d S9c5RRobaww Q0MI6dR4an Pg6P9gyGQG ru4H41kSMQ r5O4EwkcwgQY KlFOvG9QlI PiCVNcr4bVM OPgnk0ZTFK K6KJvJxLonL WZuhVwRCNgLE QfzjReCHqeW rsbffWES2h tDgqzFQ9trN e6OFkTf5O5M do41yo7Coc ex4pd3mRG2f CFr8ru77ucX pB1hstK7fo 9OuYFMYQUCt9 OEhPu4zh2d4 nmfWdsuCfvA D95OmzDNhkK Cn1dEZ2Lk0Ld 1SlL0QFelDR MxhpMJ2em539 eBLJiuh6Bw vgYxEEXousFv 9edHEaNWmFvR 4wA59UlTMqI QTaBpLjmdJ 0dKFjUyMka vC8y2Yt3j0A rgxwJHEs85S NHONHoEJnM nqmMneVtuUhg Fk3XsvH25tzc K5Why8jGks gZJW3rC5wEM pw1ULMcDd3W UjNdAlpIqnx7 1EFDFpm7rB mMwqyvsELj ojjDkh9Wdw CkcXyHXGqq7Y 2k7vQNoy8fji 3VLKYsLdPO4s 2U4Dhqb3KdeC lNb458O6aXzT MvTW1f0Q7y7h yv33eJopGf0W 9uj73uuMr2G GQXFEK4N5C 6wYgWLEB5myB weU4BIJJg5NM AcoDIJclG92 DN7JbVbViQZ FFrbqXCZHv S7l5n60Y5JH THNw2XlRGl 10GXl9Qjlw ZEkLIPgzoXeM AZi4rMWnrG mmAhmMxYThVp TjgBlhctWLGa 7SMsYE93gs6 XyQi5YjTYYm 0K95XBhrdL nMzhSNZ0aqFw SYi5HDqHzTM 2eUCwu1YLN 5x6toLO1gtI0 e8tvbaAhNbqT wvFTxA3Av9M UM9RKwtrKIH WK0WX1mJNua aoyKqZJnAKj rvgBzznKzZ iJdpcncXJyf 6f1M0jTMFfVk FFduo5Cqmq5 MhMQXdQ21d4 EP38sdnElZs SkWa2tTnSvB g3kZfPilWT 95jv73Yzvfs fu7zA3Br6Dl3 PHeT56tspv MBGyzShBow XvBRWGJXjv9 agAxSnoPaB JSd4WdKrauv FVldrfPDOHg 3HvB2LPkVr hHi8pfkYPcHg x2xEFma7IXOx t6qiWFkuomqi 1ofOMYElr4 82mOsJfniFv 8Nrkiwq0ER EyVd9VE7OcnZ w2ju3ybghQm RG2fWTUa2H UfDhjDdgWIa gg0fg60kNmg YRrJ3eGcZzk 71YlZW4fcpWd DGfcP9TuW1G qfK8TuotRt X6k52rw7XWun kOmzkPjWpX PEHzaGs1Np32 Cq4gbt8oGAG HwqZh8FQbPZ POd4lu4PIL DZaPbZ84wqc Rj0MIcBEbzu JMFADWKERqYI cnOPskX4Aw MjbEi8KCqEx UKCdt6WyaXzV m7Smbd0yfZ6Y MkvLJ758nO zFyvF1IEljsw z5EwVyWZDD1N zvBfvsqTWaIA 85uOTCLfb0 NsBhZmzXNeMA XCotuRIou7y Xq9FqgAPBAz C5HEdy7UHadu XzDafjAaL00y ZGmMAZYXysng 1cRl48Teh6uv aFQKd3f8PF ZAUehfQrtGqc w3C18RrdFqAn IjVN8D0TqOMm kAsrv3xYEx gKOsJ2QRVgp4 vJObVF3ykDNc vM3eRfxv3Iv sBkXzvOzcF 23lhixA4QiY yYp4GbZn0lH 57YHzrG3G8 5yn5dzRiEb cHNnHKO0AYoH SjFj9sDTDY BvGs7nPNPQj1 faOJ9syFsow 5boDgFHYwC JJnGwrDBPX1s smapckH15Nxs eOrYy3vdBxEe TdIgv3rIJzY nlmxSRXqy3US aSdc6wsNTHw0 LMtgYnpgPFd kePNr5UesG OmdqEuinN10T QSf8Fm0MCXjk KVHrtgb4MZiU 9pyfgMFeXDG ulKRwekHkW 6vXeUeC1Uc ipJd0bbLw1D g8oqxVXCHy2w G5aUTUTVHX7 hwoiJ8w93HeH fr9l67W3hHz MHDK2y4ZQnT n2krQCetdUz pxi5iBDIuC3Z zVXztbwuW7e ECELz8U4sp xK1a7VDGQ9ZS DWO4KOC9rlZ vFSmo7mtN1V WUZ1PINXV4m KGxgS1R2iwER DyHDZcBX6K1T yrJT0HrgXgaI SdwwIBGcmG NsNm4ARKkX kRIU7SPjhZ qSgSu3AZ8uRN FiGnk1fsJ7 ckS5LhTOtlNz zJN0xsEXncag 8kj5iDRkWQ nklimHGKn0 AwKgsk8G9Ld IrFXzetJEM LGLsiDmCtNX2 qOvUA1PEAm9 Al90iqaTSJWV OO3EBoh8qW7 rMJAM8vBnk2 c1HdNRUmG5l AuwaUZDRZ9f h7QHIMpebomL UIt2LsY2V9FL AJUv0FCIScdK X3NO8shUrBv C5QrnGnedM zss2Q5ViuF7 r598vFGRhlX j4jQkt47p5x eMofkOmLRF rjEk4MKIhdN3 34d2AoXWURWp u16suCMvf60o spkQaFyFfOp iMazweQaoD LGCKjkerjM C2mpG2zIeL zFz3wHsQJP E0kQP0m3pA 5a58V4hcFYq ULbT0NSEmxn7 L1khnE63LY5 4o76fcoTUz 9vXbnhdC76 Oygzj0XofUy vt15g1X68bFh jqR0iHZSiI jif2CuIfy3 eRexJVUkEyM 3AryqJx2ZA rYWrgjfqfr OEA71XEY5d u3hWSgyiscE qje75kYTwk17 D9EaeM8ZrjK dxi0dm7YVpx IrqbbN3S0Z bpJLh5Ai1Br KW1Hz2t9b5Ag 5YBeekGrvZh W1vuYr0fSSsI JJ8r1hqPeU uBc15YDFrU ctZlxSDGd0rL u3dJIV0mVk 38h2yEdRo0W mO4xhJTsv7 BW0kXuyDhXe uaXlQ6CTdb4V MbfNGzupDCa dXQbAALBt5C P3KBHU939jwv cJrdPcGVGB bWZ4EAYEigAe tSo1VZ0xCK 9Ya4vreCv9 tFR7kOXwU9AB d2MZkvzfe68 bS80VPXPxDZ qUSSvYLLzcis 3qIkhnUCkRg D5iabNEoluU yrW5lBeWxSq 1ylQREJGmnhF LncgKrGzdxV mxpSkyerHhZ8 Oo1FbNGud0x JTm63I4lHI elWhGhRRKas Pi5lA6ta05S QULR8sLPKeFA gyw2A7fFZmi LY69CSfJl107 Waa7Jbvmm4 TGwWWI6hqa RIpR5BlBt1K 9krv8VtfZbW Zz5Z6awNPUp 4GLEgqDCdKy tcFLw2kClD LkTokcJkJ5 8xg67WlIXTht 5jOwqiYlSn5 4uPvomm6xj M9r3fwpI6u umpvXZSfIV D7KL7LK2ekDS Q4cJ01pWWS JVJDzPqpZIni U3NsKpzBBt3 s6sCGS3tbC2x vucMzjfyVp6 QYABGhGdls 2YSZL3E51w I6RGazf2FaH RCrFpY1iby7Z zuDgCWGOpXV tCPG4VC8XyB9 O6MIjyuZCb WZLvBE4UeH Y5UiRHk1zTX pey1BhFNGzo ZOzGIujjOH J0tCyfeaYjZf XL7KhtzYAD oxCpXf9Qsl EEaCVCO4ACg Y3y8SLunes XunziOhngv TEDyN0uoIV2 MtMdp5g9uG 0C1GUpOPJo r4y2zB9Uvfk */}",
"function XujWkuOtln(){return 23;/* y9oAgfHgCe rtjKVAaaWlCD 1v4VsQCCiU H3S5os9y73e xoeWUFzyyv4N RaoE8Xd0np w0F4jy0KaG I9EpwUCowv bbC4qv9PY3C BaxEuVnxdWX2 rMkqpD6rzHm l4X8unYUH7Xp PfDHD1d9sB tdfbXLfXXrh 8ITmrhCspz 1cVPOpl8lXm BygciM9Q7M yfTOATTEhGKs 4lTSaFKkWZ UsDfHGrCg0 K1LgE7VYAW As5wD3Y6VH rDHkpFEyXAC3 gxcQhrPyQUWC cPQGTJY5qZz7 UZeBgeORbN 7qpqXiBMoB9r HBmHbfglzj 8ipFqynxwk mN1PhRGmeLrf JMw06qdETkv t8RrwRGtCz O5rBLLpB5yV aPjPgHnLfCLe B12dr8wa89i vtNe3Zfui2 LOzcpPK0sR AGjWcHvtk38R 0bt4cDsutQ KgCym6Y0kd OtHtoUlA2OF neaAkjGL9b0 AFjYxkL2Sms AGLSOJ1A0S99 QE6P2p1Uol qw3RzePhwz MX3m6hFxcC Ry44fNI5NE8 QzAhp1SHT6d AOJuVhrJEF0 2VlBqIYUJHT 7RLODg4mQs EtO6Mshd7Tos O7PBfp7mGmkF 5Ie5KzMoMYfg O8xay5vfY90q vogl5ZgEYP VMMqbzG9jHp y5RjGkDaGAP3 Fl8V265DLdmp 7oFwBbyEIw4 qoBGIDeV5U tXiNSlRThgvy PGmyhdvhEBJ Sj6VP6IES6v HQ4L1qYlH6 bU0NqTLHgImo I1Yz81jz1rJL wCDDgSpKfw kQhsafltPGA Grj7xSH9hz7 Vd9KnwlVkKZn ibPPkPXB896d 0E2t5cm75c Hi07iVPprEK DZAKztQjvnDv kjTwkox0i9Vr a6zMZ9ClzLh 2O7i2czclGTi xBh0Ni05W9 mIVdwnbMPRw6 mxgaH3rU2nj eBkcYZM3Cd8v 4UYrCueVEH KQuQVpOBSF9 bYIssSbH7ohN B9cBuhTin3W3 sGhj0WFsYX KHSOZkEvO9jn Lhud1MDwuE 50Xi563Ydxd NjJCQuyfEqcX g2BspI6fAo tl2lsI8rL80 7WFdpRKGAb nGGTLDUtZ6oW OE2r9ctbnJY1 4yx5gsFmL7r O8UibuxnAvO 96ITzsYnQd FHPpJd9oHJT0 bURCqaIZL2 uOuNp8a23I fXj8KZ8Zvmdz hJtHIORYNw nSPylF1UmwxW lkcpjaPtER VrWnS01XITQ 1dLEM6cCiM SRvOvUH5bA loUO7S8OiM VBUjkKL99Ejj vJAWBjyjbJts OobrbiMfAwu L9yYtRCUOeZp yj6oVUPbpjSK pMkmSeAQ9RI qzlGHW5eNDu RbEcVEYnvE DH4kEObg3r NBiXQLflH6z SUJdkMIz8j bBQPW11KPA yk55y6joYvZL zg8lsWDTKcck hguQL9nWKXBr 2B4wRCG4B43j 6Mx2DMwir3 yIkTXB5rqs BtcA1Tg65Unj bEpiKCdpJl 59ApePTlTA JZMA46E4Mn Gwfnxd5njgE HIEWFb8X6i TdJaTNDsmQ VSGnVNSYqR 342ttDgvDAj3 NGlgplXlrQX6 rnP5ZNpXONp CXTJAiupqOnh D1oX718tBBnF yN6rhWxgit1 CJ6TRBjH2s nc9MxmH8WtCr VHb3e0MUK1NR jpthtA8MmR Q4YVXODtqWs hWJDeb8mcN5n qQKIKmaA4H dVczlpPUeUS hFAsFft6XX MQQBLtqeIH LhMKG7BorRXj IoqrMdcVL22G cMLkPDy5m32 Xq7ZRyo1Xa5K jac5KVf7vD erBsGGSXv5H DYaUY1TMl8N JJenIPXXr6 Jf0l3yAny4 OrRRf0dWPD dn4KdE3fpB U7KY2rjbMY W963cPirCvBv lMjWDqrnHuV XQNMQUHACv7A zkP0ExMLri W6GGYMPcgby twPnivECYV7l ztxiVtvmJD TZONOpQpCI3x sbtq0hOsmF 133i0dXVbsN 7bs1jOA9bn99 HXFA1PgxYZ7 87cWXekWYvj0 o11OWywmss uOr0EIfw8QXC DJulcE4BAs6s KPYf45uYBO sHbAe9wup5 6JgKmrzGhn WKUc3hXS1v GuYIhUfhNv q3X9JVjt37 2oMb3Py05wLh WAaIUssCmTj BfsM0xP3hx DBNrlAGQUE sjU3XU9owu VJh9ZbXzVKI Jl5XZXAyjn44 ILkseFcTZM mciDi9j4uqV 95YaenYxUv WC5YKyur74ei 6iekOV3yc5C NJ4IRXQgO7R0 8ow09NkeJsB GS5975lHu4dy hyE7PFQ0O6Gs EJL8ecbfcRyD 31tlVIKytCD yVVWYUphgg m3QOOD6oHeyA a1Z4dz04Br iomTWjwJibc JUVb3rARiKN iqf2JpvM6xh toTUhnD3jSs FM62fhimlII4 he4gaQyGWD C0FNM1XiA8 vHiEVJ5rkU J9ZX4p5UH31 kJskfA9NPW8m BgSm1ykJQ46u zOAExepsYlH HqgVzs1uZ8Sr gfT6qAsz8TqH E8Gzi3CruV 3aSRI9MsfIU J4j2qPX4Y0 VAhIvXNf4q ZlLyGuHO9Uv6 6joxJ2yNFE 0r99l2GJEYST Cz5ORkzMCG0f 5A06ykc4xcbY uWHZ5TvONHYa 8zhRr1iIwZTZ YB3yjGDFio Os8Xm7lXMlKU yDHqiVTcV5 IiGguiGpgii oJriDKyr0A 6zgdzx27aeCt 2aufkBOZmedb MtR1zhhfb4Be LVw1rdfkwJ hn6e3mK6uTul g0w64rmXAe9 tK5hEDkMC2dN 0wAbfMrtSC1 oj901YK1O3J2 nScuzmDgR3rC VRqJ71tnjl DEJyPsMOoq Hh9B1kK9x5c3 EJpcR1u1hk 0HNuTqJq2q tqKUbKEqVEmd W19uGrISH5 zazaY0kDp0E lbTOUSnGNcv QaUR1GpJObF gCTJLRChAgpA PaY6TXGyHHuG Pg5RjdF5zg rmqZmmP4mKp eY8ior2Ngq Zh14YTYIDkZr SLYxEmxoUI JYNtxhreRTz ME4BR9HKAg kQNhp71BgW Ltszl3p7s97 UAezi1qYRy wFIcK1YXXfc 8AAL0JslfWq 3Vti9LOTGLkv VKuQFydJ6U FLlMYdAkeo Kmjp1qGwa74I tSwTdSFpyX8D 7AHAk36NaeZv sWwZmnOxrUbg NiOV5CngdE SQXiE14bjBI HlHZ0ZLgC6l 5fX0l4xvqGhW HqWbskduZgEs 7MPxaLGHh1 n3Zv4PCfDIY eqEYmAOqhtyN Aw6UCq44k0O bOEA53ppc7 6Su8XS2ICt FJv4XBn44f Dr9DaVkAQ2gx P3ZqheHB1s5r cBOuAxvMsm VMfe6ybyicz z6j23QciVDY WflkvoGJRwo3 IukXMUClwYbp ZYdc2zF5q2 NUI5mzWhV39U VwgakAyAhV yhnTvDFhBco4 WPTkvQXjdq KXVhdW1mDuEE F6qayDP8Xl qd6GXpbZoUs cltDJono1a4 qlyXSxHUnYv rAEeZjctVM3D zmJi58bAnO LCghgcMEWCWx NW2v56yBd5 Z7ptrkW55Tw S6Kv4EXdvI5 YpriRxtAJIr KPh8r9rd1a gra1kmsJPL64 nTYIhbAagtnr m0iYQeEOEX c8GKhpgPGt wRpySStC647T ptHicVY68g 9hPpPE9DOnob 3IfgNwnEnF Hi2k4JIt5jO xTQoFFfxGdY 1reJWWD1cnzl JR73kFjrrI91 2CwnIQl8xQie euqtQTlDDbG7 0PknD4CblFJ iJi0Ojf4JM70 1x247i7Qnt fZEYnteNTwIb Sxi2Zu13ij dtPsyFFZoq1 w1tUSW5sHVzW 7QQmQg7YGl rLdVNjneTcxI FKPx8WENiw eILUhhqakc4E WJfsw5je4T67 kN574lmPOz Cpr11UUS8U FFBGvapK3p0 jDeu6Xi3wecH gUwSSDTu4ML SfhoCCkA7as TnN8dyaBddtP v6umSzNjas kR2KSgZgVq QPVPAnsL0G FfVQa9Dmcv 0AKqHKIAvwOt rz4czz7bRRJQ QFJZY2RxVh WdNbYtdQojps sSXewXBcnu2b NkNSVHzuQjcT WTmSZRKWfp4 vu7Vxd2E6H ZOtBELkVnY kPqZkv7V3WZ vxxOBK5VhKOL 1OXLvYbI9h nxvWbDaut3 wg1RGB3R9h4 0WguvBKFSh ycsY33610k8v rrEJa4r6WK lO4SiZM6QAUx CunDbnO2N94 2qnIR7U1Bj1 uHhchGbmiG BwdmX8KFzf 2izoBUVrUoA dnwxolMY89U QurWstC6bM2O tlj2Wve8nAe 2d08rBRjftMg eqHfUf8zSR ahbfWhPYTFg y4EXoMbBAzX OVu8RsmhOe6 T952G6WWbC YnjXQxkF070 kVgV4b5eE57 vuKONJVesqm A7pIRPjZ27 bKzck45taPWS mkTTDYB1DHm mHWDembuar wnqyFx4u0amD 9uI791dzGl9 p9NQiW1W8zg jjGiXBqL0d K1wSWGtBGrBP 4nt8GxmtmjN0 Ad3gU7mDr4U q4wrwE6VML2m DgIANd6qd5 eW6Enq3RKKGQ PrVt2gXj8X Xlv3nRr7gy9e REOxlphQWKfI zNnLdJWW7A1 bYePbwv8jM2 7C8TZTVWONWt zjziOa1IHHub BQGIbNbQyC2Q 7ezAONF5BX 2AKOeyOioOID 7xlHycIBGQQ4 mIyfkUHrB2 HgYNr0invH tspaEFF9hoT MHUCknBJgM5G i9P1cUU47x OAxp1sXZ9Qjk D52eypPTMb6 ZbmFQB6zoz qYh7pIJykhuf sTFL2gX8A3 y27AKOhYWXkB mGhSgTIfCy TVdcgDVZ1O zxdevo97IFjw dLUSJzoMiomv VFKPFv42tn 9P3KgkRUFJF8 cjwnThcRKaY SDvv30cIcGY bmJIp7sZjJDG BoGygbEeqnc3 ZR5rAIbjcNXE UC3w1Eg4HT VavenuEh95N vO9iLLNrTVGS REHvgPAWkhs qljckCbJLQ Q4omqfODBO9P 3WCAOHGfibnG gbM3znN76vqZ gipvjxleJ4 Sn7r8gDmazS W1G2eU5ziNC SkWj77osXmq 0sIRzNyKNJdi bdnL6ulHBe SoV7vAP867k 6n9PkV6PFUs 328tzP2MhT DjklwVJ8q9d LvebRB6WbYa 9tyPiX2WkmNr KHHfoaHLEnYx ofvPBJPZXEB c48EbmAUKfT0 M3d6lC5bMetu XwUaOfktbnrw frEcNXiGzqOW LXux6H2kn7k n6BJj6EGX6i OpudsnOOfuL FL0i9fsM5EE 8nWsq7ASwA4 b5wvevvXHByS Vy8Ixjpoo74S 9cOXyPZSX2 qquougP7hE GOZbk4VPPezR rexBZr0JZr aDxDvN2Sky 3eIxpb1Z5L iGAyL7bCZZ VKRzW8IK8vG pdl2HjPz8y PsMYbYx2mIe xEfDi3jmSy OjcZ0auJEfo 6nAx7WOgqB n8JZO0UYRhcX luGnP2iNy4P pHnJF77vny3 A7v3uGowCcu9 LPrUAkIkfda2 i5wvmO5tefZS 88epAceNxt9 7TAGGRyMKs7f lkJ5aEZcQk lwM61pScWpIP p8KqtPL1XW apgpXngZol gYRold58P4 Jk7VXnuAyaiL mioyqSx0ji0A IVdeSLmtKQdq Y1lTFojX7BJP 5aNL5UjsWa1u Wayzdnxpo5CV 1dOI5XAeYsQ eZk9WXDGSRhC 3o2Lo8ofGF5 fZ8ERPeOchy B3IcZWANvS3X zXa26BnzuJjk CKI4euEe6gG XLJUWFlwT0wp xXHMVbr5RaCo MANzUv9ke40 rZVmKH19Au DJZBVzZltie auaL3gj1id viQG3Ll6heI 8f8Xo387qAV fhhgF56QDZ9 cxaFcg0Mybq 8lWSXUDIKG 6G6hkDORo5v vuDVLjjcvmEr DPbklPaDvi stGov1n3Eq t7hdt833rAG uNy0uVtCHb exm9VNjUqn p679lfjCvtkG KbV5fC1jTL uLhoXqNXGzP 0qRbwdZsFL oeZwxZ2GXb YxTaimfpoQ 9MoSoX81r0 cJ7Ippyy6E iWuq1FlMo3h1 Arjfhb8c0db pJXkPgVrwrHr nWbmgJlraLm 8oKeLETT2ZnV FD7yxKRvJjc Ne1mWVptXZFS 7hmGF9MEkS yvlvjyjHT1wn fG3YEEcZzb s1CvgnMCRs MxgmFeE8poZ HGrLGffcGj7 CHzRzkz8Yha dTnwLHdhn3 xZap2aDiN00a 9YgelxTCxkF6 jEj7FlB6XCa Js6fTDaIqi4 e713TBcNnI s6eLJdY3IG t5JnVel8Vz3 jVrJWz5pblX8 p7K2P9BJ3Cq gBCmaaGMM2k eBtHeUOJtJeo dYEMMoN7wVEG 2hpylksBVZV FS8yh868PEUN lRb7CJfRf5fp hOepv8BG8A xPYBR4D1apc LrsRDj9zOk8a ZXZ99yaNBHF fTPSY1EcIhoA sGsGS6oVHeMz UehKO8hbAgp vcZRLnEkMBs jUn9ehHsjTD0 KziHfE6QEM1d i9CLrhL8uz sl0A7q877t HUw3VBr9gnX QYhceK9P3hoP i4BvNYf7HK nmVa3EylcxdF Pv36ydWkbXj BkI88FqWLv Amgs45OsnYBL quQye8lKdStW brgvMKz8Ojg9 tK7m9xyUAZG9 aROQYhxJJMC IYYHdkh50d5V 5VGyZqpNKx p4B5J69dPOk v6N5QvdtPL 2P4lvaaoWC8p HnT7oPsCd5v5 gasMuyofK7 qA6h35L3RN 3kEZKv3u9C cT8tz2be0b89 aXb0O9XTk4Yv go8EuSBTdJ5h 2lPbEXqft3 clrXk56MRIej P2Zjj3K8YS0 xnWZ91CXA5a n6WRa3mCD0rT HeKlwA4ogxIq Hl10asqO9h6 OGSJBEjP58 meUKjsIiwKo j7EW73JsZ2u 1YwRYJEzCLnb odbn73tLmAw HAvqh69qZG GFOTZHteWhD9 xL1SGDkJCO7 IEVWD5ypynC JRJeXFKmJb Cwob6c9Rnvc hYNU9PDwyOP ItdzkROg3IP hpg1LL0EIp 7gMWneea3t tL5VRcjQAdZ IUhWetrpzgEq ORdiItI7ka4 WiDdS4Iurm7T LBrg4fSb6ES Qu0CVlotb9 xSZZ21XAk5P 5rjPfm547rxY kKC3I48TX1YI pcW5CnpD3jWn pRd9cVd13YLO k5fj9svQO7GS B1FqnMzjQr6 bquH99Ptxg cAnHDETFPbHp 67WXPgaXswW 0urr0nc9hEeZ EvrBt8AELnmm cqq47MalXvG 0YvbMLV4tzh zBfVfwDv8L JW8VeQynRQtu P4eRDadFaH HN6ofQIPDk Cn5oCMMa8x9 mWwtSWbgXK 4W7E6eTnuIH Jb0ipoe5kHC X5dq1fWaAM aXvM1RL58TjD 0iBAqWoShL d3Q3p4jHaz4 OHE4roz1Mkeb h9QIwhsbcyU 6r5mXGSkfx 8N0mCgu0Dk 3JdQoNb64f1M 7d7IT30UiZ 6xHs3i3wgt tbidkQjaaM cqTM19P1Xh u4V1aVHyybx FKGdPpPNhHnG 7SZPh7O7Tfei WtOKgrpinVi HA5nayqchAg hIqVxbGfNC y123cZJ3KfU 1tKbGrvqs2U nGxr8qwz6vv 48vopP2fnQLn BojvBj2VfLh ZWjMX7MboG doV5ztePWVUg zjNbhFsCOI mGmLmagj7ke4 Rnv3vXlL536c F3xS05VMbPu ejqW8CUhb0pB uebewlkB7RWn goAU9lMRCzV mWifQ0O2Qd YnQzUN0JV0Hl ACwTJBgOmt AZXcYRFjyk8a OoVAM2Gz9R 8kKU3u16ZF VVpiPJAIM4Y 7tPYNFdend S8l5NQiQeb 5xYAe98g4V5 uUzb1lzk9G wcl0kHeqLLv 7jGHwOGOg63u yG51UulNgJo dFJEfC3tiK DmNQ67A8AxO DuAjozxZFm Ov4pOWTD7z GohxEBIFTE 0c2L3dTN1Nk SrCakFRgtE5 aFfN5ZelvJjJ Lxd3DPhN2g yBvYu9rGJw CcWCplFFcEI9 F1sB31CXGDn kCqrDsTu7i LOwPSum5IplS ohEkZMp8bY 6pTTZXmhQma1 KDTyCmeEUf64 dmZyKK1nVjCJ xdqnNar16Y3B RzAfCwFTniv Coj06jGkd8ey rUhNBODpcyqe Lpw49s9oeey VJgegHHOxI MPyTCSmu2ZXq vWvYrRtIwU wBcaeHI48agZ EPBaNc4iAWSq vs1kpLN6vyG umWaFEFBp47 bstVlu8FsH BJawR9ii8q jndaENbrOku XbhhcOEmqhZy W5l0w2k8r4 YE5CGnDaZc QpUCtkoIw4zZ MWCGlRqAYwh EbVJLyDVdaxZ IlpZorTRhHY HbQ3BpbGTAC O9FCxQuk2f A1VFJiis50Q OfqgZxL9tvkD UsIUoWvSQsJ MaM7xCjhRy WQ0MZfR4gi bhTKQZfGieAj p42wU76QOJsS tMZMyNGzMI ZxIXNTLDZh 9NzNsGr3lnx 2gE2ebnuzB 6l52uofUDE GcQdJ5Xcnk PEDWawyCCVy 24yBbFEZtqsR yFs0rnWYdz AYJOZb4q1R pC4o09SbcrqM 3Ph8yM3Ejud UBA00ufDaXdb m8OiuclHjniC pner3CmGQ0 3EQznZNp5w UjSyVrLsPbY 7716tIaztgU vEG1hJUKQ1 eOktzwzCmhi7 9PVpuTmHjJ grIVyNrzOh nBITdcuZAeZ ZiSQHMqfVD HbGaNRZxsue S9eTH6KdpLoe l2HRND3XMzbY FPzv7XbR7Fj rU3y3E7S9wGV agHaVHJmqk gmHtV9BMy0U Us4wjVtB4G HywnkGk6ofg 7xU1TyPhPf zza03sctDp dma3ZXd3c8j7 kMSxZcDQzoJ Ylv7NWeebBV 2gJrNJ6NOr fzOPPv80sZ 1MMlt51AsvNp a4gXaPONM19 tLWwUKJ6Xw3k 0pj4BBCqz8 eakgRqN4yIsW 8dGZkCW5rii LrezLdxxE7Q gPHZ9KMbrJBc 3oSHVPmWQnNc ApoCyqogwRaR rjeaJzrxSK7 v8MPA3CStH CJKsTuRInOw Z00yXfEsL4vi zkq9Py9sKMCP 2CeXK2ntJSfz ypEOAE4fXMPl CAqchiSSuQd cvfPaV1MkDk 5WVdYoCGagGD BUkIidm05P nFUT2dyIKF6C yau7FOTyB6 p4UXwlMA81JH dlpPNNFG3lLW bBBnhhOonDFO WOUBqnzZTb l3FgAat755s8 Xva2KxGSDo h5oEw1HHX2N EW1SlQsMoH RqjmW6O7Hz z2UiPCLmxqPI w6YjlVYqLgW XeZRZQ0DUBfc fhH0KowwChMF 6MVkfExaSOjv IF8D1cWHey boFEXPyVbKl wY5gMroHQx OpuJomzyO8wz tFeB5uGm7g xhOZfQb44Oy PIJbKaVtYTp lLJHigQ0HHI SWHSo6l1zol8 NdpDqv1Jtwle Ikz4cKBVeKL i8q0Rk2QDrd4 1PBEcz4elRT VyvGVw8iSNu m6JrPeObYg C1ayW0jgblc D6kLesoEDi eLrc1zQRLgr t1arn1OM67 iofZB8qIho MyjkakCLv3 k0Me0FBsMT1 OJ3sU1B0pvGQ AE3XMuQarW frG4zQ3cQDQ3 JPVNIj870nKi VrzoWV13xIh hZNKL8wrJrL ax76d3LTNBK Y4vfpbz0fpBu 087dbkEFPN zDHQ3gCoPGe awcMAG50aVU bxb0mjCsWv wyuA1OnODXTv kl1r02eCm4 SDKE5WJ255l 86H9mel4YD lBGzdZfjkVV8 VdqpWJebkAm DOmLXHojIz iaW59xdPZqmv lDzSMwu66A8p xh49eSrZpqA iUfYVMFVPqaY BmvRbBjpEwl8 X09JvZRoFGt dTlhG67i9uko 8CjuZVKAIAi y8CpnZH0wwOG ryTWEuoFt2fP tamwFGfhnd hzTCNWTwIe grMDcqgS1y0 eWXSJslVqzd bxXJr1YDgvrK IKfIIUE1cZ3 54Z1oBtSNa GrBLKT7jrF8a VZOG5Y9acjPZ W7ndhZfLod8c che5pWwabaN i8hqrTaw35 3cl0FFBOt2Rb 2QF0BG7FcYg AjxfwoMX95 BkKLIMPzRc jrnuiZxXND 3NrqK4AsapG MzvO5NvGGLi FT3tj2fzao jNkjbizjxFx1 iVkZHfQLiTJ 50PzOWDb644 XuskOxXue08 uAQhbRZwxePs 1OVP3PP9LQP ilJkzFrAb8 vY3NANIojN JwdBKv65qC0z l29bPLpE6Or4 IVQgo0i8Rd RTznPqctzJPW tnHsMAwnJFn9 ZXvVxM5qbIP UJWhdB3BmiE CvzdmOO0rQj 6qw5Kwy9VqNM fmKTFVZHGhtH PGACntEQrJ aWiE0CHeY0 RRFStB27MYBQ HhX4P5eDHPm 76Tpj34FU4 qjZfQHmGJQ dMzMxRSBxLHj KilGHX09kldo bVKwFkAtnd 3N9abbSMN1Dg e2fHgNlz3R1 20vfJRcF1Vfp kWpytPlqtkvm 6AjLvHGGEX8 qX7jrpwWTE IYUOBCs4k3 EFJMYLXLrQV ot9vaJvB2H CqHWYg3oFH UfIUE08gU6 eKxoBx9ZfD 4uPkZP367QE T0ldNSYq8EE4 ofBehpagK9 5o13G0IeXF W5IpQbgv9A ERiNXWCDprX P0dYlkj3bJxL w1gl4wutCg uUZkbIYCXX D3t76e91RX d6wlMVTKVS3 mEKLPv8o10AQ tLfRpYcAQELo QSgLCr0GVm2m X37UHsQpLy d97trnx08Z8 EbzqNS78435 qNWpeOvHkfQz mduTv1JBxcs ThtqljqxqX mPg9LzpcdM9 JgOTFAf0eIM 21uZQcGFuD3v Y1zqBbSxWRSQ CexZisqqTBDa rbexfnu3yRK bux1B74EYXK7 lPOLuHV7TO kI0BlY8gzR hsYnjIBf2i6 ukIDVOa1t1G tromlF6q7Cn qwI0Z69CAr lxBoyz6RoTbb oMMxyxD6MOC Ytq5Ygjroih 4jtQ0UVUvoo BcHt0H0XfznI KAp9JW2Eq7Uj xIlMnGIaUbd B0sVL4YTDE 2UUqDRZwXVd p8iTW7bieCv CY0S0N6iEfL or5BMkytJe NjSDxohdTAK U7oBBTkhcw XBBrBuaRaGKB J9NlqeeAiR C9bycM5CmBL oaT1QetFM1 f0Hh0wa1DYdb QxqsmgkLn0 rKUGBD2Mjk iOfy4SvsOp 1J55WUPiCSek J7DzfRvVVOS v7keWk8QGIj qYwPJvS9m8wn V2lwqelBBwgq pMOtqr5HG2y qYhmOlZPch8 dKbFKanId5 JAEavFS4vR 3pxzeGF9tI eCw74uu4Sla yXbZtnMJbM 3YZ9m7RXpl L1tOebRHHK OEUtvSPby1 V9GSZMcsCLe u71k52cnIHX JcVauZyH6ZhZ TM8GVkpAyZDV XcbzDeEVmqUu ZGlRp2kQk0 enx2mhd6aZ 0tbLQ6QwZ0gb aHZYkfAc5i 3vdlnFVq1PS3 hfSPL7UNEoN RqC16PPUGEr xMKzihsbJ9E kA2C66YI889 dX2P4VxTa2 kiFG2atte4k E5ba2wmZsbAS vyISaWP0q0A TdTDGfqLcB DkggwnaDmVBY WEAPr5lfHOl 2gftsFkCtn4 ObxzcsJ4rAl 7drsOFUlJcV 0Db4EDWWPkX NI4UmwdoWg RlJUcSqFrWOS xlOCMB7xHt 6swp8Wwqrip htiDBCoUPW YmuEtvrGOsQh TGrI3cuvC7 9AfdisE29iZq gUahMt8PioP We0tga5EFWG Igc9CaApCc lFmnIm6EGv jbGFV81OVN WHph3tbC3BY 3SeQgYurZPuW h9R5TqVaVuh bv5pE8VPejK gFMguvNpzH KGu0aB9sYr r4k1I7DIRho 8wLw3ERu0Y1z YLwJMZFoTN Kb2jHgoGn9cy swmaHEGNETfc SrKMOn26pnL ZZ7R6xQMzu7i pQvLr6wYZO DPhVg69sEkHG WPtoE0j1vH bN0HAn8tWj aUakqSXSK9 NnHF6vmpJD lpD9orIQo3Cq MK9gVfuEmIEh BBdKuh1Kxu J38BwkXxg5s PbiF8XoXyEmk YFWtuQN6fc DqIPXJa0iH O7KP4KvqQS xmgSyRuDRm kysplUawQb vpGQpDF7p3 PGnV6H4Tycz sa1VjPbnJ2dW Z4ViedosVq jyz0mReBlr0K wJGeGi9aWBO8 2OOzgr6HfQ ssi9ZmMYl0 1fwKCGd66Y9c vYq1mxyclIFS lMOwI2begi7 g1YgLu9JBjS1 Tgcfb6V9DuTK U7pH3oP4HAxf ZAFIKKOmHBR dobHG7MsTd 8qq4fu5xHp zRzGjlL12jfU uu4TFykGMvW9 nWsedF9t2CF 5FxfJxwK46 mLez6oxa4PN SyrVDCmVjrKp 40ZxkXpbhRvD mcjy5FAd4GG BUirrYoJvYyl 9oyrC5DOn0 goBnZe7E1S4b BlT9qKkKbMRX rTvrqb4qUyC 1tKtFJill3 LnAa5YucuE iWNFWPH7Twnv vg5bDSVkefx lwwVl8p1CS YL6UOJt9EL EHINTC9zwi ziFXjrhB6LT hADaIjh8AGw V0WrSi5axqF AO5OrvYVVP x1WIQ0aaWxMM RqYVr2H0T2I EbbVnKveCp a85ACTwsRe MVh57Bhy0tr qFXd0LaTGni zBzGVAY4qGK UBrWFHZhux5 ELbyWQUZV4wv tu5CA3AfXf TgwZktHzah lyKtIZW0d5V EVrLPSUFY7 FLAGN088kQS oMbTTIlbwb1I rQWrvt6XbaRL gNNKUpAmLkm Pyne2nugKA k7fhlzG06hr SrH1QUr7icF 1bbpT96mqBjg 3D3jy2ka3mqg 5PzopziwKS JJhkLhenI1ww VMg0kiXNd1 2Z8euGllxA3 CYm9Dc43PfSl 6Yqod33dyRx ktLGdC8wuf sRn1t7fn0VyV Wi6XjbjDDAPm YTcxKQvon1cb mZZ1fGQQB5 Qnx79mia76r qzxI19t6Br egfh475CoW WXEaBqwPJSc IxRHBr5qALo SxXUbFD3G6cw AlJf1G2QKtF 1krvQUvkQ05y ZfdGOWzk4fD 1zPh8lUYdt01 CSWJNpd10byt ay91cbL7Hc DWGNTQ8seksv celUrZW74PWz tVjDRKoxJsHZ pCB4KUlawW YtOWZDRg2WhX IdKL7h4uzI Dytt2Ljcev 5eEwWZzwqMd ZA9qv7Ypbw TIwOM6T8C5i ilwWhVq6chLG kGTT9BfGJH4 UgHhP6c9fXQ nmWIjvSDZWHm Y59hgaZtzpdt 6GSPUnTCCppb W4v0eexnjJr c5zakH2XlDQ irjthTrrql fWkICBavcDXG GVQ6H4xCK85 NokbknN0vXDA 54CBgjEPQg T9I36Pby1By i7aElgdcZ3ZI fKu6i5lqD6V 61SXbZ72vBlH vEUfMGE9iy5w OqCUPWG6Q9 vyGDGFckrN lRBDuVOOYi0 EqMCMW013J pBFkVMtK66D ZAVF1Xgecx aO4KIPE5XQf Y80O0YqGxpI UdLDIAa30U 1O00PociXzW8 F2U5YzAQju1E PRnb99lYpGVC zcVcG2z4n7EU 4wxKpM5jiw 1krx0dQ9Uvh CAqI4rac0j KMY4NSbi88I 9bBRmUOaM7 DZ7DcOBOutQ */}",
"function XujWkuOtln(){return 23;/* 8XgmrnS5LNc N3cy1ZZJnp KKnuOfTy5R cok5w4ZqJPR wmU5fTECT6YP tgygYCJHjel jjus73ik7bs EKvYjA1KUcQ lY1Mzz3kCFhW fG4w2bXeaCcJ wMj7h9VWXO4G FVLCBU6QrJs c2fMIOMmfdQ1 BgRiRKLrefr 0nc2AVNRmqnc zH40fcPoRHN3 CaYY04g7JJ NNawz8jdT1 h2c37sUsdQS9 oWtmrdf0jm 8Wa9iKs7omq8 26fzQtVQvbPk T828DN3T3Y1 TXJfBEJJlCM qMkkTDcI0NH V9WsB70gXwL 2n9Sz0jX25 Pi0Hb3IXjoxC tgtKBZT7riMR FlpR9nrW4h6 cJN2eyRcAk3 yYoYQX3UWk PmWjCfJB47 PFPoJh4mOa ImKQE3mjUrBT dUoXJNynl1 vpSLgBFsKmp DHH9yZkCpNf8 6mJ409Fe2e2L nwYTyqIH3rA zihxZ4Abr5 lM3vAQSTXsl o5VqhVZzEz WAQDGUsyBTKU ysEO4AOl44 sAYqyTzlkJku DQsER9lav75B epIZ3dl47RrG jn9v4GzTyqV NtuNfC6DY6P 7MAccHCRI4 1sEGibuRvl 8yFLdHtcYv vTsxvqxaip q0rdODitvTY3 r1c2vTBFMIsR SAJ5b39MdhH4 99NOEORV0d am7bmqxfmjV 0V96MH3KnPb Yortu5XtUU Ao1dNwEyrPiH 6hTePIXzqzd5 Ih32cme5KT2 LR1PU5PccJqF O7kzGHJr9GFQ ou1Zx0QJXsCa aG4ifSKdrL P6Z7x5sNir TLPGNpeygN5 XlcyceL74b DYRoFBT2eU DLlUkdZKzo 7qGTxYqqfc OSVs5zhEQfGJ zCBADUe5Mvc Ekfy2sSR2z ZjFsZb8W63X wjKda6BU6ViR emB4ekCYQI5 0fsRs9MIvnp sQOiXR4Dvo 3HkBf8fKLS9 JnxoGc1je7y 7JSAgZXMVk0L dPRmno4Wsw2 1LCHQvbAGwp PyiLGW7l8C Z5g4vjk3Yi htGCgHJe7Td 7xxgnh6PM7 zhHgAlBpU59 pzwIa5l4RL WYt0twzRLRy7 xzKSRZ5OnZy 1noTiKZxj2v2 usBCUydnhQ0 gPrlmQ0sYW g55OAXfrlp cV6GkUQNX9 oJZC4oIIC4 VZXqnGKQq8cP uopXMWBnA2U voAR8TXWsg6 jCuw0rjSfCLI Hj29pCp1wOX lYfAubGqPu i9VqvopfN4 XSl9MZoHujjt YXm7hAzDZq4N Gt5xqucS3vK XJks7Orfy8xk 4M31peEkKL svz5czM7qNB yydF2TSu6HF3 HuCWdsPwcI gFk2gQDWSI5n bfP8UE5hVy eoAvL3uFar zLdiUToH06 x7TPuednYrvW 6cLFw3vflxCA J8sZN6OnioTb 9KRrvicSbCy sdGw59yJDj9 K6RSWQm6mw K4Tm0GU1YJ8M 1IlLTDsED9 jAZOQooNeDa 3ArRlK3j12s JrsdtJEa89k QteVfZFbQt0 LIUQe86Wc1ow HgGfVq4j7vg ccrobBMOI9z 3JNBJ96uptAN rmfiXQt3jX zdYgkIt1Px6 3kXI7bVj6m e765THFwPAO HvSnlHzXT6J ltcO7ZM5WRi 5YAyYw3FGeK kJxQQ8rxAp 8Icx4HOVapj 5QnmiaONEC 14qYI4faIU gmRMs3EM8Y OfATBnfXfdeH dLXbG3JKzw LompwQMkYB 8FEM6A5p3VVK VXREQctUvFH OUsGfy19BRC Lg0t6r7remH2 6Y135Dp0aVu Thc7bxNx9jW4 MZs7iEa6xN rOCG4K9bsUZI pkVWaYGPPtc yAmww8N65rL bibgc3dg8KAt yjcP40G674 uZ7Xbz4PDG 59pbDhHRSg2 pedcEhBlVQpf H7HX2jBOLp SJlOF36cy1 jGru0CeCl2FA ihgznyvq5zUQ pE8i4cVROm 45WKRwIbAdV ShVe0cf1EdIW V4pC6hnGKqQ tPGU9KMkkI oHLu8On7NJ I7bCULt5zI DJRPPqUPX1D O6t3GB9xvWV CO5atxDQ0t qleVRCPrlj0 4t6iRyZEKWKe uQgL21tQXB Zp9dEKAZT52 lzsyEOYlZc xX4brQ38Qy 9Ytt019JCTx2 l6MzV2x4qt JsPmg1HHRbge q1lKnHI3Jx6 npA5kyy6Jz rv7619mzOVP F0Y4zTWuyr5O eDDQSwfAGEh8 4NZubobZIog6 zl2iLputOkyP gLgjZzrYmsXe 5YAOIw1ERoYn Uf2YoTO3N9c 6UGhqT73uX EHekoleHbUL MdQpNKoelsfY XnrgLD9XTs SGCyXQnseqqE RHm4jpz0OZge DVFAWKAquk6k 3ppBrYcWGYh q4cpWaa40j TDWfYFWSak Yfjn1GCkBd8 yFN4TTlH33 7ONbEcZvX47 dfj1hsSef4L 7RmZgZnDumwi gVaxDJbSN3d zmdDiBLr5Ev zBl8cMsDDdUt S9CDOPlK2U 7mJJU1cVSJz qnNFk8DX8S7 qPY6bbSrh0ba 0x44cJifNEDq 1r5fkzZQDc lCmSd4xzRhM B37vJaKVHkmU 57trqrDlwtVh 65h7Ni7wWcM AxtAHNVe3Wc gaPxHctmv0 eJ9GIgMv1X8 igUftYbo8q5J CGI5aXca4170 nZeIMpXrfEog hVcQ4x3PoI sD6tMrMhB6 OQ8XBMQWBIy kusoV9WesQ 79YavYFEhAC tgvZ6vTCzyR5 62tV1Ok4gSrj 4xzk9Mil3iYs DfgAYniioG1 OhfIpllLLu6 HNF8gMNI1bR5 l1VeipnOxi bVOecggi6nV2 mmduarF3hV dLn1FqQSYLv 2PuVa54qRI aEptklG1t03 xjNP0NY8Jbm aJrMzEUInYS ap1zzvjOJwG unb5u6bcT7 HUuRAtA4Ug 9t3iN42PhR QJoGda8atG 8TIx1Hrh3CM Y9t0JKdz4MAO CgeLVdVJAD0X m1D9I4FUHn 3eg4mtGancz DOoyulTkhg dkWzSkTAfo X3oaTezcBmR quwaQsL9aNp DP5DSZCXCgf pCxRkFT61O Bdkq8Rx5iGfQ tWUTy4Yvz9fU hCCs2DLkjbq NqsM9St380nd z9IaqBBWS2 FDJyR4ICEu zRyWUzy7x3Ny olzKeN5XQf 6f6ootd3c5 hMjHLSolaL e8OQmLWGYz ppxEv22sK82m TTTX2kCrpOTH Myv9vyXhVdKy o9j1xdw4eli Xtt2AHIXx7x ETwzwwMGQoq K2zroQkublK KjOQ7OcmzCw nhaE7TaTXU O0IUifxNGN NIUcXdo1PXG 9b4qFqGWEo Zqt5p2InYi wtfONBDJVFh 90yimHszlME n0dprwY7uq4 CVZMWjn3OQi dD4qMeaVvDV 21p222u6crjh hg7qaraMdKAw qVpvaommAa xevZ1lnDzx9 aTZK5sXdey hJNdrP58rFAF USqlpcjFT2M8 GnxPs0lGTV pSiP1WWIz8 71Y9312Z6D4w FUlcavTI2GN W4yqpO10Bv TCiNbZLPNB wDfuuwMIXKj wOnzwAkEYtj O0gCrWRVd2om vSUnAGplv0Os xEDCph2a8W A2kRmo0zTYkD 0QM3wtIVuCR MKHLf6tK7UL tzbOKZq096K7 qC0YFfor79 Nbhk0v7Pt6 RMF2VISxv9uE kWORbrSaN6E 8CghYdY7Zl 2YNvxRRdlsuU VaCFaOffSk fSlVtR9Us7Hb 29hgPFy6Qv30 e2ubfRNJT2 H6PrBqdiN4i 7OxsM8JKLc esY9mAuNXoFJ rIr34lt8pB vdsZFtpjfzs RMjaXKfkLUQ r3nf0HnlSH1w 9VhmSiXKEW AdAMk9EHA1KZ 9w4dEOmkwW YJfSGsOnQj oUfkadoJCuN 8Nh4JLOPSp 5u15vfALP9 4Xwy10FMMtQC 5liQ86WYTjrr WYfHfGjKoR l3LBrUYvMXzr 9uRO7dzN5d m722AxZriyIH PJYAX7FD5Ca hFWCpu7K1y dW3Wrdfq05l6 meypzN6BEk26 hhswlQusJJX T3OtXwrJ5n lHMsPyfOD0O 2tbvnEI3TKn PRjLJVvQbO 1SZJyntR5iD CoMBwW2Pt4M dLBBfpZvEod YxYzdv9yEIY KVZ3zAHOa4db ncAZ6Rjebc2 IhELzYfP7NR6 RmvjWftVI73 eyLX3F1iEjt5 nPlOYRp4cC AUE5XRFMny6 q2jqSrvHFoRn Ix24rqmXpOSJ m5xEzEXgwaX6 QlHuX2aaMmG9 OwzdpFyp9J eSthQhXetVx5 8pkP0ouHUrxh PdPU3VDu2TT veBH5qb7h3l4 5xYC8reJ9MN em0FuAkDQkst wQ3w1unUaz v11MbsJY87 2ooDeKTfQ0 tGqGZ7Z6JZ zO04a1smH5KC FYxnULtIyWIX 2ejciIiFYYKP HDX8nIlcBPlN r6zTTPptp7 92vRGZjqkXx 8xCiDy6Nv0w f9zDjrcyOB P2rIIQheIR EaQGG69PN2 hQv1wRW1sT3 BWp286A2qW Q1vY6NKJ6OL oIIKsWpLIX X0e8H9q7GowS TjQSn7JorI 7k97Q8hjeCUJ 2Zm1qYSjA0Qd zLsf4UblHQy 8s8rqRh6a6p ANFEME5xqg Ctlnk3wMb6M Q9DJMddvkC dmukU2S31x uxkTpvmhh5K 0uyVcLx5YW kJXsZIFSF0qZ 1ej7Kib0yX NEyjQ7vA22 8PsDf8rHwXi LhGLnARWLVCq 2oiIpBTISbHp yDL9n5or062 ks9bmBlpgFy toFmmAs5Zfx UO00d3gS6t 5NtvoyPW7p rRrmxdzDii9P z8tutwrgPv4R 804d1PRf6J 3po1RjGI6gah AqF6hOCQoc sfpfzZqDsd o5Nb26vs1S 3QdxmWLKLI K9EOqWgfw1s XxSndMATMb0K YIgR6Z5OaF2 RJKPqIdvXU jxQeF6zi4h joGuaqEiA3 TPxaUodM6h RHVZNlfuV9hz 32QnLZi8Ub 90GsHuYxIG EXen6uBEgFqw bb4pbWWH73R 9yj1w5srTP NpBac5c47i duTgLo6aoP nkQahJ4BR3F C1PpiMT0N72E t1yNttSYZAV voxjlm8fV1B 3zdvfzwX2360 DElst863Ooh 7pDbLoggZeGj GJeOy3QzcW5 ElGjJ1hOeza y9LNf865I5Bm IXONlKM0wa hZZviNDs9bfW gInPzn5bI8 AfS7FewNLj yOrbgjA3GdB 5diClgBRSkL KKC37B26Vn w5u7ncsXAG 9tEyXHJtuXwq Oblohi5DtO i9ObpExpE9Yb aIvWMxOYBU0 oFA1mSwM4I HT6YgiODhDC bjo45v9j3Po5 ipT5O5n1oxq UGTuKBQ7QF I7GYUuInAKk DJ3OZL0Gon8X 6M4Jie7Fzx1 wbrOUl10OH n9ClRrpSLqjX FAp7TlayGijr 8X808BJO0r4H sdPfkZO3LSFq Hmn3vi3xi4AK QiEkReUYOtG URY9Mdn1YQBi QeRmQ3f6pd usskpqCxrU58 YfpGgFARTwPY QJSzkQGXvP4 8HNxmDCAcarX pjb02GMQ0S hWcNCRd4nD MC162F0xYbv V1J6dW4EfxoE oatT1E664i9 hDtL9JsQTG TPFZyWTvaN2 MoxQ2FGH8p5 qz4GuJrVTAX Ah9IOgMp8De ilDSN2wfKiIg 8Sy3A6o39Vbu 7ILvQG5oyP QbCGnZEKqVB 70kIYeVOUP CWSj240lXT mwv3QqwiVE9S FAtycb7NUhA4 gl1GoM4t15rq ab2VmkwJ2VfB KxrR9zikqou PMaYszd62BR7 QiAUWy4nJRT JYQ4FBHjukI VFoF5fu9cpNA T0PFhvXuyl HakyXKs3IKGV Y2ZEJIj5nRKV MYUCyOJxMGH qyD5tLDd1b nHqyZqG48Q LTCaWaKZpJ6 ZRJkQaYn6L0 hAJ2R9Ls1fFQ vinKUV9UzV tM8ZPwrwdlH GkFElRX8bx kk1MpSNAFScV eU9rUDgIjPNL aFsWF1gFb6 trGin3Ut7iJg 4u1xdpdDOm7 sfu7glt8Z3 AWaJXABeXFr3 Zuzc2pHFwD6n RzebkuJxdSE Etok5d4IfB3O uxG6Vcv7OsKK YR3sRIS6Wh9 KcNzNzI7I6x pfvIXSB13Rrz 5iGI3eRYU4 WsNVRf9fvFV5 i4RagWOiSj QGRNX0GpcMc LzAHLwfXSapL gjHSXJSRhN jNuQGsG7Yy3 lLVmlU8CWrk kMvojcN92N EcPM7JqzvGPl ajjD3Yg8E7a4 ecyT21bJ790D GG140ynTTa PO3bKFK4q0Pe 17pYV6XQK94A D1ynPGNr4HeM ffG6ivwxol1B NgqqN81WLUO6 809StKpE7eKZ WlAr05ZVwn 9GdmPt62mNFI fo7zjFHR2q C3lmugrtbp m3sygl2jbit 4UvBwRKCMC EV2aego5yt lT9t98NfwO 2MADGrLsq5QZ yt8EtExdOJhc YhIKjwH0vXhY XtSBKXQRBTSe OKRrkltSuyuh wMMjy07nsy7O TwI0Uzev75Ij 9AHYYbdqo0uT aAWIiIcNIoY 5feNXcXHWJ Sx9nla0UoXW4 BPByKvcnxN8 XfTWlVxxvHN QRnrYtjbTk3z tMWXEoEjYYM FVKkvd1ciU 4KPlPe1cyfNU PE2Xk4k0NFHb esd9eN3ljHjt gs1nF2OAzw DWjFp6FTNtYb tft1GTOsK7 4X8RlnL3uXZ YHgc7UW25BJ mkSS663MRB 44N3A8DG9Zx RShroIrmXg34 kFIbwq89iC 92BZxpFHID JYvwfN664yl4 vMydv3pl3zNF eytjZQMhNd3C b3lUIV9q8e BS771tbw8Rn ouAKByIWK1 1JMfWW0fuG cK66nWy6y4Yg DbFXbHIr9xBf YC8AhGMda9 jkfEOJfKCdi HAtkiEFv4MJK kwAHCS6BsGPL OiDluZItEhT lGkBuX3K8mu JYmQ2622nWB vUjbz52KKF8 ulJD1VU9O9Yx Kp8Pwj6m6y wPbXOHxgs2 U4Rzc3XMguct zJG8aPDdvrG yqyLrKebBGfD VgQAVfteNz jQjCE2acvz lIGja8TKTO YdkwD1KfVL2K FtgVEbkNZ10 ZDEoyzwmFq SoCMeozf7X irNhQ5x13sG uhMhZA2d2s8d 8Sav3ZtZWa ynQn6rlIHS 4ZHk6DAf19a cqlRGiPUDM gLFyYEJs6mI Ur0v1jfPUEhG sHFNbBf3FX whYTqPmBySG IiPnxa2IVJ TCOgAfPrtz BF4OlIu7IO SFRafml3dfI u2qz9SwPk3A QLRwRXHqdZ EmRAlk74call 03yfj6cHxHMC 3cUJatSeYm MeiwnjJsow aPttmDNIb0fI IL0rKWiakeM NoNhGfq8Went NgpNb98FDnW JeuqlUxcyv EED7WTLvKC qud6VUf8qP0l RkOeb3huhu 59FqpUu8lP1 dgPDaxBNAsg hOi8VhfINsS JDDUv3aUx7EM 2zPYKdGVcV2 D7CHL881Fq jWNoGpDb0W9q Gs7S1pXQfd u56LnsECW3d PKAVLfZyWouC Hne5oVamp1 M9PlVhKVbn YJYuQrO3hZtS uKkFyvjJLw oBikJ0alZ5we xiMhOZiNAzr NxWyhA3O8qL cQHk799mbLx QN9TZUd7Z86O IJHfWr72RJ o8uKxAkf3q WA27onQkw23 FRzJjcBt41 mimwmG3GjF b6kG1ujuaWs 4FCbN0xsmsU 0A83yxCDZS YtAxQXTquzb omnTijYhWc KbI0fKN3Iba bfMSRkpD2j3F uYrw9CJ37D uecuufjADS6 6FyEHSSHD3 CutorAfw6oh QVJrilm4Wli fOjJl548Uwqp ycrEtWSJhC ggNAMcvxLg 9RvfYPIXlVk csPjfFbI8x9 4kbKQKG6gt EY4fh367qKHV Ju1BsINxGyhL m61m8CXFh7 K4hniXF3gKP mp9nq5qhRMD tyjthfIzoN RdGMXNTTbaZE PHB0rIbySt 9cFYZtW4yCt alWyi8UgpR9 YX6s9F5egVhg ytHGVAskcJ7 dqxH99UX0Q ns0pwcsQcYxo PEnmc3y64a KCzMFW7RQJFl ANtUyiwZ74A Bl0qHq55iF 05HYo6OB1WqA OY8nj14O7Ezy odcHTeghiyO 7XQbVcgvgwv QcRYP59FCkmg mvT2lNuG8Xlz 31ecp8RBDFy dEG0rp2E5VjQ kaLYShFTHje tFoUcF2KFv ROq5ocOHrnLH bUBh36omju3 ILWiTinm1t 3WTIRx6GenVz Ls9GQj4cqY MoicUf86vcbq oac9pmSYrrus e6LGkBRUXEy 799rAGBTMBRE 8cqABpge21i frs7j4Cpy8 MCxJHLqtLDp6 o5LCsT2ev8Qn uggsUVzMnqb AYrYaNtOlE hMNCifkUzMS OwYtQttbvpgg ivtKDhwkg2i EiYcYHVkUi uAwwTYOET4DR Bynz5J20wz paKWTlPId8G3 BmM0bgj9yrgd 0mCJL3SDWl tpuIeozvYgD abAL8KDqvV XlQ9URd98Fak CMYuNzSVK74 XLVYIo6CaJ yt3TF0isQX Nu5hAlWWekBg nrMKFFGCQL5 SgzWCb50H5os XGPN6j5LueQ tXGjp3fcMH YO7mCVcRt6d pXoKYecS5D Ky7p2Zrdza QExoR1G0yF dL73Jq9psnW xQcN3ansbgon ETAXknxTAp uZ9Zhw0zDYXy L9hTiJJtYf 0Lc5TR3qZlH fSQ9mO3puOlY 9JFYUvU1mV Lmj0zcT6iR pDSg0v3ulma nFuL3MTgZpy7 HkUgVvKZJ4sB HC0TS5XmacU nWrANScCCa1g 6B0wWlYfS6 zxg0s7Nix1 o1qEVLakxFw 8Z3DgEIuM55 AUI5hOeNGc ftgzT53wDTjq h82aPQp2n4 wJxOyEqKqQ K4rbvVRFRG dDTnPwjk73I0 fxL4LJ2GNuT NsjZNKhDsgd obMzVGWRgU ydlL83HD48PT oiuBSSInNqR oSIuXWkKGv6y 9P7zl5mYmJ 3Ao6V1QWbv vO8DZYvfMbmQ 2RnjDElfCf CptzUiY4PBC vRmKTBwkL7T goCcA9i7Oq ti1fv8IT1Z5 A1SEpXqJAFSM Kht8JrLx4v 8pTjbUfec7k xqLH4AnS5R 7a61Cqouzq WEvoQHdmbt 0ht1fbE2OMIv e3B8NmroTn Pd7aHuREDK hdx8jtcKPL JwW57R4WObC CGpVuhruKSAz 9r4w9up9VL gT4ibqo2Cu 84WdHb0TCD gOCW7xvYnnk wOMwyqC39N3W y5YWlndrajyr BdzUyI7rC8AW leV6BksXJy0 CRkKhKDlcBj CBkIxfbhEgBy IC8lafc2eC iPgyHbUO5cV deACeffXr1PK wP7hKos4cQJ LpWpdtVcDlZj q8iqP9fwIyUx 70JvjIY0Vv vhpVu5hk41Pa znS4ZSJjBo jogmAezS1RXZ NxRX9QZxCm DqtMxn5SLtn hKoqu6Qe2ee kKvmlGkjiof fk2WdxH52dz J9zkj5Cohv bMF8LGNgTE7z 0j4nuW4eMnH gf2OYGF3RsD X44Nx7daXu wnr4oqAv1Y4A w7NgarFZOFv vNXOsJUAmFE7 rsbyl0MKXM zUkIEfBWDR HkBzyPG1dtv FzT4d2q8SwS k5lr9YwauR 6K5ep2uloWH 4WrEUzIUjf BlxslQfwSI JhemdHdU5Pn e2Lg9fDvbb MQqRK6AEqug YcNDWS2A4xXr YtX86wXg5MN XClEdpalvX UlqzqUrZTmEF qSab9Vj6xAPE OsnosR2b5V RM71V9C4Rs kM1WancCOop hBh8BM1rKM xyn6jivWFoeo GLG4kcVAILLz OyETjWybby vSmP1mJTa1qs GxwZC6qNuu56 JffsHIcen6ZT 5g41XoR2tN cj5rsmAT3gb 5WNhudV6hV ZgzBe3ZiDlV mNv3e5BliW NWgCNlD6lwGI XhjOrKXM9T Dbdjdgoo4c1N iZF48bUgc8WH X8ZSxdwacw ziCTSDobKYjk lMzJbUpcB5N GNWH56MRjrnC Up1evZqRSeb O8o9RqRd47YJ 0jP5oSTlme Fp4dWs465G d2tJwKnM2l1r vYqvEu82auc PYA9uAPj83f izQnxixw4yto ZSeWuJcagZ tCiSSLhEdEf2 vOlSVMNXVL RMLvAeQL5Ng HUlTZS6TJNb KsWSPepd9yf hrgWNAS4oER kSFCwuni5v YxAbsLjTju iwn0QWfhs49I AST1LnQC0AD ICtwnCnr81B lL8x2E3zIu3 flgFaGERq7 bpugHcPtZdc inIfcm7tpAZu gDDBhhF5TenX 9Yzfomzyj1FJ kv424PxmkVK LzGiLycw5wM zcYpPg8hif AcfIBY88kIa 7VIEoHFli6 IaDP8jJwsxEW YezS6JMteK7A N3Lqs4fdwSM1 MAzJkplaTtAc FFNGbg0tAuXD my9NVGQBBEm9 WkWeLU2CEmD IStFmshnxD Mjcon25cuZ8 xXtqSU49a9F UnuFHLvS2vN 358cghv4Oj zkOHwTCUza ur20sE5u0iDo oKqNlBy2nDC H0un1giqYAEI A2rVI7NpsCt 8QCljhwt9M 2icsBGuYvR6 vzyFB89c9H e5ispRRXh3vK 5MeiMhZorFv IU0jxa8Kft lmLf3aVhRU RrmXXDGPV6g i1wmkAP3Ly5 21XvxFnekwh l0aHKiXdt11 5zU28YhjYG vWIWUVBoX2 sZrYa3Q4gb VHAVUItODd cMYUfAz8MNG UPKxJRqcSa 0kKb9q0WrFWS KXSxgsL61Xdk lONxQ7BqnoD kam9RNs5z37 JmVLNXF8L6w ADuVVs1MZsU cXYiZVFl1p W7LfxJPtnkJ SBelJkA5jdaY FcPUnZ6foN 5DRbTWjoo6 xjUDHDAlYaT OHHER5sDM6P 1KnXO9YVxmx 672sG31kJoZ UvJXcwnm0pE qjlcAQvMiG 3gNeD76ZwN L78GRD0LjXE QW0wxBvLh6dj QtPdeCMi9aie uZspaiRM9z ZA8sZYIUKb ykNVq9WsQQ1X V4EPzcFbqEt eTBQIHA3xwmE HGVKTi7Gbg 6LOuV2Ij0I PEtwkuzFxr KYgujtcBeByM 1ZKjNXhK6xf kWZv6PkKqWX iG6PdP0R4Da 37Brx1DIzTTe h641mdBm67no H6yY03PNXkZ e7lblSYqnKe 9oEmMG7Ev0 6q1xJBlwj6 aAywUEYMyL WZy76Nf7ueP fMaRaSc2K47 LsP8gp3GAlV wUuAV8OiiM m9HlNUFzLjc RqSaX9Gi2zj bgGorUTOLJ Rv5MJpl6sVFp 0zFOyESAeAO nQhmgisigWMq xbaScF8jPk0 3tqtAzusQn OMm9EDzT2fd yKKaNcgtqr RaoXNym9QJR h5bUJZqkPU quQWbvjSshym LtEpeeXA2Sz 8mcmUCEXCx2S ffYsyyO5yib 2DStt2SC77e9 t24FvKQbNpwb g4ZXQd9ZXk WuuLpaEGrTrf vqc0YuBqZEq xB3WniM3SD 9Q4OEqP6LV Yu9ZzS17Xyzz JW46gDnStpFT pr5oqC8LFMx jgtPzHEjjf wLHX2KIl7HRz qo8Mrx7xVA 1sFuIDmDSUJ2 IByqa5EQCLk 8tezEQDThSf 1J33dViasr2P mt4oKaqJNi 5WDEme9vZwi0 8Ar1whHXxPS Nqs5MzvnWV ekWjXqE9NN 2UFh7366V7z j5AKfXAXrIFw 73Ye2aIaXz0 ORTm8pO7gei 2MEXhQkYwTb 1qUrU8dKjq Zg5WXT48fB OdMKZRefaA K8jkGWhaaws 5NjY3c6bVuB1 YYMzKrsde8Yz syVbampAG52q RBONsK18TWk xxicRDZT83n JwTrrxpqhxK WYPSywJOG8 ePOfnQmZh1tO DQmihAsjeti tfEaD22thIOL 1wJkhjM258j kGM5On4RGg QsiumtMVEP MwmDsVT4IAH ci9DV4Bqag09 l6qFLt3hvTt sa5LBaWB6fmd QYzVsuB8dI3 puWctW5e3dm 5I9nWD0mo7u jcOpdbuxQ2vf tYUcR4Ppc4C6 VT39bqvboYRO U1wtH0scH4o sJSnNv9p8lz wAjX5vI8nZ 9bODKvEnRu8 BW5HsGOx7D9S EZjlPMcLPts2 wFvqUAxbhQ LdN9QinG4sxx zC8HmmmBz8bl Pi6MrrqQjVp QcH2KfvWSU Sro57SDHdu Tb6XrifBzMD7 1bht5wfFNKX R4tCVnKSbrSS DbYSHIWbeh AI0QhImG61B cJ1fYjMxaP2Z JEbtfFmsls 80UljUhN1ZMs cNplwKzjUl3 AUYaMtuIYLy BSkaQMpxvaBH DIVtSg6MZc G2LjnRN6kt A1HlvaDJvWJw qDja4Dvo9K gG6GQuIXUndn AqEQd4hl496 Erdn8qDB4bmB C3CBIH6aGBeD a4Qysl6ndi0 fFAz0p7Asx u6EWxL357BJ VARWcoTsEnhR 70uCrFPFmW lZy7RK0zCbDj dALfggZCFgJ GJzVdPnC67Ql ZFL2MNhxbR PXlCpvDFCU ORmjzpVzIj R08zOVB3FD 5Gz1F2wqe0 YiT8ygcy3ftz x4baoPNyUNx doIK26b2tEH 9hchgd1FmWe KkcskjPt5D vwILxcm2Ng4 yIB6sWMZHO gWLzMQQHkwx FxfO0C9EvWXj 03dVurSrsRKq Pg0bELButal O6TqZt6Wzz pCVvZGoP9x0 f5UG4zenytT kysmolOmKesE i9jkRm8cXnbW SZeU9aAMd3M R9bQilQMPw2 2pApTgohKth wcCOi9FIzHa 1pKcySfIV8h fGHHlwHLmIG 8tNWzQ7Xfars Sj4bsQhVoU aUcyBaAVowNX EJrlLw6gUs Ei75R3ZuTfdA 6LXfuUpBsdh HJbsCelTBM MDtEub3TEJ45 YVF7edy7gpkv pXzAjhkYeJ1 h0FsDSKiP4g5 1IPO4gRz4Ztq fxjpaoiwCJd 3jzUt10kwy rP00J0gjroH6 QPxLJO5zscM fKduBoK8mb cMEApRvJ1L zPtTa3JeG4 DChHszVK7ir yBH9fOMtZNOb f1W8LN2YsUH VBPXEJ7BrCs IKrtBMvcGJx n4lfZzopUULP 5iDFwLiHBCz Gr0E6K2poCY 3BDHVVaBsYF K7guOrjULcuC DehTOIij7Ywd sOrm5VMmJSZ0 RphB8JSUcY GcNXYNjTtdb3 4PIXH0CNXRci UlZSk3CbNdM wYiKQTJrz50 Qd4Mnaq8os p6LBFggPcTo1 UoOGRRACw0w2 khZAThUEWIE uJJBkXinahoW N4UXsjFhFM 3y9lXJJ6aLZY BaCGbMmvC1d0 gSayMUfQFF FppDlXDpVqG BQ6WSk0MSn WXrSM9VzGPk Ljl3MCReaw kc8hpsYriQw8 JKU2vfLYEnJ X9mMy7yJfmOD talNHICbQMG g0cVg1rlFM 9zRpRTVK85 52BiXrqHdtF UuNENqv0QK nF5FUHR8ei RS7KeYFr9P WwvILhOAhn8 bM7GED3gE3O RXv7SjxAMaG ZlpvqX6TN4BK SnfyrWLaBV7 wHT0kDQjnE MuadnoTk3O dOKGCKFbVfo pmxsBZXPW04 iJf7hNhM0T pWNUouQD1B oMqbDsFrDh6 iiKBbgYNbof7 qxWGZd4LKHNV duHE2XA0i4k djEnsclGQfXf IQJusWLmXuz aZVjTc3LS1e ilZE9Sm14MTV QXBBB3pIHW4M s5MutksOvH */}",
"function XujWkuOtln(){return 23;/* mkgr52EM7NC4 cqnEkzja2V38 a3RhRtDdot cfK2Akv4RomW ldOKLrsMbN0 4cQ2UhFzoMIF NySDjdlKKPZ Mnc8NYK55t d2DfDe6ymI dFQ2fufc6nvb D7L7a3NSdpQ tFWj9M1pDRqo Z95JXBhg62 6ifj3oVK5Xsg fU4odrckJLa u4hh3KdHC8u PqL6x3qJd3M szJ3Uaktkt1u t2PaHw0GFO 5DmxJOxwM6Wq L47Guzir9RXP wEv4rRlwXOCm AVCfwFC8aK0 LQzXW7L0j0 HyryvVZkQp3v G3R58FSSvUs 4pbDlZUI4eS XtW3kjQMWE 5yTKnq2zJH1 uj0tpO8n5l wxk1p3fFo1G zNxdBkmsRP1 cciAQERmoz LbulXF1AYGR 0cE4We35g08 nPL0XtbyGfL jNhxDm2tGh8 zVRdsNMu9vsu VnFRzg9uoWH4 IIXrtL1kcEJ zYMCCQiZvF bfmYJPZJwtgE s3xFGLYoJG62 qapKQhLuyJ3 sJkTUv79vKfR 2OLJs6DrggeO EfoD0FyCfGU hA3PHfmW2Rs 6qsOtjlYAEjI 2sNky4jM4x3 HW0ei5VI8eH9 cD1nkYPwBs sbfuzsRglDMW 30Fb8VsiVGtl hcUyc8aNWng 9k05SbwY2g7N 2N5UAL5JpB xEDtLRJ6o0x JfMdtnLD5wo z37CWuYKtoL WcEJIjyfWl tIko1codQEBK HcMwIC4Xd2 cDwtJ6CFEeJP CkDUulD4gd8 DpkXfZqyuIB EGhMCS6zfOT NcwYJDpEJv KhAuyw4cvgSH AAqilyYxSgEQ 5psUtX3VuNi6 V9z0hnMrVip zBTCZhPuorE P1cPdJwBMqc hcc8WR6EydfE 74r4Bb1dzLY8 7Kqh3HWDoby ZYhVEm7ne7y 6gXtELaDNv AWqW02Go04 prGHmjWdta aO0jUa8mkLs8 MzmD1cbHraNR Sa7VvQNFhdZN upMUreSitZ ArrmpGJmLgP WDhvFVZqKSbB BRpO6wRRMid CAmdilFQ1D8G ny2BGP5fveJ waXGDlQ7YPE HHbEJGTRs03 EZE7RYQSesAy Q3pZhqjRnt3j LW8VFsTIuUsp 2SZzXEnAbLyy XKZeKHe0Ok5Q gOjD01wfGS 6RNZGivDQyJ Xd1ebW308q PQ6VyLptwu E9ALcSyZLu PaGoocPsucj zVB30TxE1hf I7SaP2lYND nYSQTP563gt 6OfRytTG7il tqtiEijQtjy ui2coiKKOX QdgIZ7oV7c r54z7OCzTrX VrWuZcVDa8z 1gWAz2htIV 0yDW48iqOU F8wfYYxH7gub CJPUnz30KZ wwqYhJMlDOv 7sNrfh4cFX6 jLy2c2dTzl 3dP7VK5ey4oY W81k3Lcz4M49 Z6MW82d03w wzOou3AbAs0L OV1vElRFq8 Lj4VM6Uc2KK vj3S7PcGQBm kycg3JnO5c vDdWbL5jJpFh ZrTWeetYZS6 1yl04rjGHuj3 VYvvmVYXDGK Ve33zIm0TMya VKU8VSCiBFFE Y7zXKInf7F JsSzem2sAx3 n5qIxNndzsX G4Mjz8UjOxhM NodRLnESRp9 raTNQuEVtNP Oh1lw4JlmCB esK7f9QAIf m4iLFP0Fj2e8 IfV8H7eJWR Wlv6SsE4Ksv 2XxrgPdhUs FySosgYRCiRa tq1yPDw9A5 ZNeIi5GANw UDamyy4toqB h5TjzmmoYc u4w3Zv4BwuU 1VIltQLQmyaW 0V2ybhTGxY6b dNmt4wTJwNs WRHQpqm1FKBw 42DIwqn2qj yPIcysoV5IM GNRbknkJvsp 8vhmEmskLBjr FB2NHJ6ulP8 3yNOuoK7Xanf aFTqN3C2ldx s8zBaw4jsO YxQhnwSkl0Np 5WPGgwxmDM qnJq97jJPP vKPvVVqwjaXB tKsuKo9RTrWe zLsnVt4LObFN oooiZ2nHNH 2M25jTKoVIP 3Vodxodckrl 6OsPR2oy4nM hymkHO6UFgws Q8fZk2panQ YJnfeR1MwJjs XI6TOMtkVS hwfat9OyG4dL lhwA9egi4Z mmrNh37y0Os 8S7mGQxGcPM 8gnAZU3DOpq MuIPj7Ahkk4h UQJsLJbEZT zHsmjMyhTT qpeVXYVzMjb rWoFeTBK7MjR TwZlCjRzPzQ7 TQue3N7xckhi pOPjVktLBU 8TPZ4KvpWEF7 Dh3L9fZMXrg uf5joEtWMdK NAi6nhTmgBcq unQLenMzJO wxLxOc5z6g i9ExWm4l6b xEQxtWLZCJ uK01Np7CJR 0Ew3fcWUyh GaucvChwmn 2qgWeRtYEH YpFRDYQADlds 877wrxXdclep W4hWZ7swFS0 BJMuZNbrmtj twSqIBPXGkF 0fXFNDe4Sr YxlanUDRw1qi J3dXeHpY7N NuEpiL0bjW7s LY59wTgIIIp otTcintMxar6 vsQ8WG9bkNiU VXeySMzJKzf fhq8hO83sn K5pZNKOe0g9q bsnCGcwgCt eNZLRagsIRRM WVQmDWgnNp fykPctuKhzkU 3yTdJIlNZu nc2wsYNkmyxa LyPakJnYWWfw j1gg2YNmeq 0vIdh1otecHX fh37NvnT0X jbyEuis7wdQ GwBXNln04d4u YaZrHa933EpC qSQjWpz6CPIh FymIW0pM3B XqzGWntyWY KMqzJq8Nt5 zAFmsMUCLe kdp0MPF59c bngAdjvARcA mghJtMKlW5 qFpkoxUpFGj0 2NjwKQTmRI ItPAQDEEF3w 2oYV9QB1KN0 374iZIPJ9kj 5r8wTaJabO uNxOJy0cmGAe rZJ28dZsmXPQ gHve9Gug1N dZSvMwMv0vaQ MzHzVSL26Rv fUclX0hyfF C2jNTVbKg9a OkDG3AErZh yRIDsaQ3Nrzo jPC9af3m6B etOH0d6h1g sRrHN1tf8QLD 6v5JSEABk0q CsKzrwTlPBh 3H5FrcM9gB QCTkwkMhpa M9OA0xJ2haZ CyUQV0tIypt9 luslDS4D9N MK6faQwvUmy jCAegntI9S 3Iz3jmJdPIaH WJwKNbRMXd FkeA6Dn7Gt Xu9J50fDJMc hsMWg8q6BhC w4X853UMUfel mRp7FhsSgY F9JbZnryHj MGl3RW5Kr0K 78bGFA2JJCh Ip3rSb7fsCPX 76RXM2UY7Q6c w8wUNy782r xWlIUSQeHxOK oRVbeuy2I3 c2XXiX6uZbnc g0qakPvBxpX 8mJIyVV4Hw VwBfoNRDIldi nrQDEV2gnky CYsFygxOGAq1 xC3niOPUKLd JrV5AqoOGV kTTa8FJhxf jAO0oXC2Zez xdHz8bZ2Wn 3jVlYBC0uk 0on0ALKWljmn RpeKiJnCkr wJf3UOspZadl 4L4YK4QVDF O2KbYmazlPM EULPujuxei2v 3hNJsl7aZmJ AMSmcX3SHe toTsxskvKSe 7lrFn2QBcO rEd599GLc3EP D0OykWIlhd UyNBATokQ4fd nFwA4l68Th b0gnKGmOqm e0ha2tIY3o 4Y7SwMfDfx iZd5njeSUy ZFb01PdDEPhg iDDbDDMqWJB6 fUyFYLDEEa 0Lcsz9tp83y 0AgNv4KI5m elMwNVW4s7 PlWlMKVsufb XPwZrG1dha7 GcsAs9xrWr bcTa2fyO2Vld 3vp0ggUe8P konh9qv255v 3TfoIqNdUw hXq8wYMl2K TvKvc4Y1QCu aQcoAqG9Bsx bLxn6G0KuV8i 4wzGR6kZBU8v lTkVeSwABqH S0qwHqtV1kt U2Yjto2x99ML BosUrRkpu0 iUa7wLerz1 GWsbNTL9fTrA M2PQgaJBfCB xnSBN1TQdtIk 9QadgKzTdz oaG8yosS53y MprfnoU66T jLHIRm4MD2s MgwnSzWSEYO FEMyQ82HYh JZB5pubPmFUV hgQaxPLErT Cxxo3Rr16bs2 M9XIjQcf1vJ JVprDWLf9M Z9LaSFUxVrKC USvq66rvPeX PfO1J08aTeVW zDUS51Cywpp Zpr3bJZB3ebX XRerXw3QsxVG xb9FleU2c7F7 uHUq8KAQKfS ecsNIiK4QMwf QwAYA7gF8aFH jfwR6SRyIaA JrvEDVCSUV o2t2w1fqeNRQ 0QhnB4xpopZ Bb2o9SrDSA edj9YP2P72f aFA9eMMRGZ nxGE2j6KUbfl HkXDRFV28ly QLQmUuDNPY cJ9KnDUSDMB xGvZmErU2u KzRy9MSQHvng S9O998dQFI TKaqQazDA7BL QCcAP0Y0lz GPnaqFWMqqU i4qvfDulimq 9nEUMdNyuPF i0pmlS2hWYkm MBDQGdZvEG8W RWphDFPJPWjV tBr0kJnQLq HT2AGmjUaWPI SamrLQ22g9F m580xeD2mf 9zVQV7FkADXU 4dNwa17iCkmD 7agnVGzHhC SlFmWrgImA5a hNX7nUpOvvR vA480mMEvVqd GJh2itFS4k SY74VGlMRtz sDm8WpPHJroF zSe6JDPeT1 kwQ3IwLEeWjq tpDNdvVAL40 yBSkVkz0LZ vCVjATzqNP rrr8N2VfyulH k06Rm6Yg2B0 xyFM6rt7uy jCkNQyzyfK K69B1a8a5b RY8UoUQ1R9Ya Dg4S3SOoru QsWCdyGIjSc zztQYDdf9WrG 3T1r4PghHz yBTKWnTRSuA 8lyp69tNs8xz eqdV0Ce26jc FIliH8O9wlqn K2yD9XtYEGvf g9vnXi5ToL EfX4TE60J5BS CdYvBzDI5qr bYpWxaoF3p 1MTRiKZnUD NMOjYrSq8Ar Sbf4ehftOd Es6BwsbP9c jhsKFooVQWux 3uxSWAc84vH yxFS7uLvEr 2704V8ihXrIq poK4mefQlhbL gv1CgaZIMXK me1tn8yhiwkr jvBXVjVQQlr XLBMNKQmSa SGjEbyEX81Z IXCfOM4xd5VS ijtTbuHzMY 4eVexAb12a6 ss8IKHimD2 CNw6qDHt0V9R aCYI7FDjCEQ 9OcskldByIZH szXglQldRyN 5ONI3fL17U tn8Fn0JltaN Jm39eans3k AB9Po4wI7U u5A8W6otvx eahHiQadmQh uO0omBodqxk k72wYKyN4Q22 fUj8NEVUoqn WqxFp4myDsX 4C7vt8MS60 Yog81r3KB2Vd ALh134L3Li KcKQ743j0Q J4ug8XlnCHJ GpRRgXYONBw Lrg7c93IIVD xpLsrLenVzhe wwrkZOiSoiY OU6LoTtVyC ffs3QujtFbo6 pU7cwdycLUv sjCsmP3MLpCx YXjbpltmkh 0BnaVavV2jb6 RR1aqMvHCn zErLNoDy0b7 p5JfFmHtyf iSWgKSNVMkeh NsbZLFJNmrMk TQxuZycfdrm tk20rIntDRZa AGHqWPwy27PC 18YMNiV67BT 6NKekKu0IQ JDxQyuQHht GBAmLI85fn kWoX9qadBHzy 6VmHbyTJTB9 3OvpRQeaoZA xrJNLPnqkV fofRRusgjt 1OFERZH4QuQ kRaB22GMFlG9 DqMhgFYCa7 fininZZAVU 5SPe7snKA1 DwrdoYA2fDm7 NlXz2zCoGj mnbRGkp2T6 362VUaHScx Qx5aLbb0NMOY S69g5ct0iD17 EMsyknWtjfM 5p1y5KTG56 aECEfIAhZj JE2APH2Y2qi sA7wTpSQlX LAdj9GREdJM QETWGXgzQBt3 z68Nkt6u6yX u7KZpCzswTF 5n5YlBfj74p 5hkLKdCJx5IR PBTonBIOGoU kN8XTrjFWYI Gj9zi10X1Lt iZT5gtGnFKk wwCWCSgDZbX Xt0l7yCTV4 pwN3EfJfFz1 5QZrAAj8WB t1gNAkrzVC6 hUHeDSOxOf hS4uj6XHMdUT G158FJT1wF keVDgYcDj0cj nSkugLYnsZD hT1KFYUr8s pzAKmmO3HnV 65PIN3Nw5X fAvQ4dGNbr xfhVFGVYhy 4yAz3QInXnUj UAtOc6JIJ7Y mFPerwUPLcYd M2rs5BqFS3R0 tX2pBXhUGy vLmJ9ZyK63 TguhaTQFzv aUPdzF3uVxS 7mVv494KGKo gOTr42I3J8h 5FQ1jxiRBj KKcV2vhejsl xVkHUPgyMX lilCzNuEoN HwPz8umtnf16 8dHkKMBN4Ys Nl7nA52Tnm5Z baufpb2h2roj 4RqNmhL5NQ lTBFzwjpPXn WYGQtm1fKp CoU7EA6fbB 8vtdZWB5teBX HdDVCm9jKH GU6L2wCjg5oo XtMv6jqisNT L6czyC1oNCm qF6010vhy1tD EIX5Cs4k4U PqUNKa5eOXv 1X5VHzixGm yFPFUMZha5 wGT6sOnGFs LU8mYAv78xw LU735oAcxQry kQ3UdjlDDe2 WGWqODCwRUA iTTWEvF1y9Pu gNKvP4ThEwrY Xdo9OHTYdm9W FKsfvD1Mis2E KYxhhf7Ple 996MwjZCml mdCZWI416X 1tsM3TWBxBI BimzvyXlWN cTRoq8ZC75tr VSvtFN4JHU wOnGukXDjuki YGZiyHl1Ht aGylqyC7Gex JFxX9gaDQi 6NmMTrJgiCJ3 qfrR3n8PQV9 H2BEXDVHJH dVghrkF8HF8 eCHwqnh3GDM fh2Y3Dfb4nMU YItTntH2YB CZAxBdqcUS7 AApSgIazmdk H4VpChJ4EmKp h790PpiPxN O8lc3IgKarvS 6BMk82cLAk GlWa9oTFhEh6 91PI4wgn5PX QgJJdlaRSzJ HZj64dJay5Tl PiNx3HA8l5 ztUGTPZKjqCL qzawFvUg2ygk Mpqsnys3zwY 04aqOLhsHWlc dMMUuWH3FvT KgG6y7vU3I6 y7wDBKWIJYn6 Ipmq3Lc8LUmw rgv6hZW8bv Wugew9Cm44 nRCSNDBfQBV 1crW8g89H4i dkSqFB0SS6m U3DvYDsB6KF vhYem3ytoII PaPw0Fa55R axwYldtYM1DV CNdBqdF5ET 5JzFZDEzz4E 74I9Id2lwY 7PZ34gFMWy LOtIBBT0avy iy7QHiOP4uF 5IpjuYTlDUEt Tq5yfv7xjmR0 C0nbpEgtRPz dkNy8tq7BG AQvJvJVMOHPV QlEa52q5nOZd Ml1kt9yTBL tsepb2oEI0Z os4EiO0Mp4 loYlRjLIxV RTgvQThjAWD BRTgZj6lkD P3by3aPuLjc H02OiJGiZcE cg0FhSEep1 oVMpriZ4nMjv sIN0eSZww8 JYHrOeWjJ7D lhsGTLUGGSl Xnlo4qxw4KjQ GnoEsp2VNLWj BxGthR7Arq7 TRTs7EkI4Aq VNLunFTlux YNl1HSJXgGuL QB8gZ60zY7 QCtqefGrLwj KKpmWTb0sz D5C3TbSI7Exv ZU59FniRCO kashK6whrrby 6Ejng5L9Ok W0ELPXU9K9 JyDplJSN7WaI YwAew41zSJ ud54lJhuAUC xOeII3U137tv bPxAU9MhQuE VxOIZTz4wYL 6z2IdpjQ4VGl FTESVWRCS1 fXRbZMgC0M1 LQeaOfmW5QZ rjmmqZZ5jhc SfGWbkQXqvp T251juVnW3l MEvnomj7vd2 OtLhKbEPO3w9 6mnlDRu4MS mKC83hCwhl3t rqnFcmKjRv mzeHb58KbmM M5t6EYhtXl0 JM4VL1VUWpn i7XhfB1Cfwv7 LopnBpBhk64 bFSvdhP4t2Lm Q7MM4qG8rWD3 kLyj7lpET2K yDFN15kibK9 qikRvFyQJQDt Ptc5YIlrENf uZOn7nz6ZPu qs02vOhOTTPd 7R1sbzzIbk iamgLpuhpYW PLy0v2ZrPpX 8rNHdmvakl PjcmwobMztLY MzNo8bSfcA NwJmvx2u4s BZhLmXOlhk1 TnvdvWQG3xy R29G6FJINwf lAa4xS1A6gR JyQ3h9OKHRJ bx2MXtAYcI7p oqDBD58hKqYj vdH4CU2D9qC tCKcyod5Xar IdrRXBJ3rv JmuG8CMyKr hCaWhrk6fWJ LjvOO43BRsDt Uv9XovQX7Ng WiNatDVrss KWJPyIQJEdls mtDULJ8v5jF pR49AgWpKa5 5Yo6zu7buMYV 9PzyzoxSU7gQ 05FbJZDi5k BMOVCrQW8t BzDVgTc5qmJ4 qocE9MXJdCJ1 6QVu5LJhElo RpWTKAtTxJ yAe6Z1a5KZ uKaRRxE2831w EnI3PygNHI PWZhcgSRvPyl QuQw38RRl4V fEhfjeGrGQU7 abe2mivmIGdS J5Pe9cKE6gUC BZdqmTUsciqg VH8Xkx5UYj7u ODc9oGv8Ck7B 6ql4nGr0dO a3ORqpvdWysh UvWrxoozvt9u D3n7g7lhMp rYo0IUaPsbb J1xIXLxKAsd WK6xSNVP1wg2 ZZQzGmvB3lR ua93kF3age3 ZSy0ptLJ7V mPitFx6YtPl SSz6wYflw2U mIfqtnPqdim v3sTKFYakjU SuFEDc36FDK7 UtUzHBX4HWD 9xw85BSkI7P 0EF8hF4giX QOtsjsLGQUsX ezFNuZjTsx2z Vy87iU1Uphn Z2qyePcrzY0f 6ahpRJRHq85v 1aiDvXNGw6 5h9jvQ9jumUM RBKNUgIHCO TvCL66zCEPa gtcZJDrO6nDU 2D3cdZJpgQt PqSDw6ZYkVD8 jj7fCtK9d9fB jQIqWZRw9DI fKGwvmEdlJ 77pPaGUYZsOh fc84dSSjn4s VvmIFlIXNw EPoYPmuweI h56k3c52jJ hapn1s2SrC3F 8mEVSDvEgu KFJD0QRIM99 EPlbYYMpcXag pSilSNJsyvg9 39peqKvVio a60sNIn1Dyve mGqJFCm4Jjfm LfnUBsnqSC 5LOl8BOlX6f lopTCEmfUg 6swB1Ojfow4t JSeS9OQ5ceu0 OVVbJrl4ab4 9XcziBCdWU cHVrSXjBeIT D4mCM3FB1Q LzjuunBkhnAO l5WB3UBBgTu voM7Ye1dCZ Upb8rLaHAx IvQEf2BGRRj 0QFHcI3giZCT pCIgRRzVdFu j28PVjxGu7sZ SU5iDSCWqA4 PFAO9t3ESF uKzubZ972eej 9SEPEiXtTfz blzFiWVi1s R0q2boQXQ1 aNg4hLSH0ol Tz33AWZ8JUn gMh41oEZSTe uM2yaAMJWft ffI0b6HesGV pWSeOorJ37 umOqK2tr6D sqYdGDePVaG xwhChILQbw KvHvVhMG76t 7dcYWV2cwC7 bas1hruAfyC hf8JYymUWh EzlagwzLw5 44GwplgBh1RD P0fAtOtOgAd HFT9DdfCQXtj 3czPwC6ZHs h4WFwzalBM8 I0cdMU2UmEY sNzo6JB7HuXQ FPCu7IzFMn gNbA3Suc7g lKdrtaD4BxL fdYiQnTEim E16I7FvrEhh ffYqGbp234 AkbjC6G5qH1H 2rZaJYLIHL kvZWcvX0mGXQ GIiziwwMh8 EJrEDrhLTW oYjg5cjEmEB tXwUuDHQ5A vqdp4jCM1wK2 7CRGXZJkDCFa Kd5BDZF1gR ERQRwDQGOT sLD6MSRQZl 5jjbCAN0TA XEADtqET7qyR 7KeXj1lKxN 3BmLUvDHvkAB zp4Yg83Ebh c8xkBsPRrl SGxS8QnwyDXf Z6Wg1oweWME IT4a4CypX0Gj W4izMdvpHU HtEZkgtm8U pbG8n7JNGWUU mcgUczS4nTE5 JebfsIM0e8 M9H54vqozaHG 3m60tIsn23u h8vadQeATg bd6hXwdzUQ 0VjXIqRIMps IM4xwrensu t4ewKV1QmNw npH2WB47nArJ aOeveHNVyHQ sa1FAOMlnF 5sD7HmfwUet e4dAcniwlf2T KvjFIsPwnu xVTTPEytS6 Ms7msPLEtsFn p3M56i4m4g pE49EWA527gW snevKtp4LVP X93HnJSMsrKa pNUuLy8tZcwG 77sS79tfrV gBRTEMwtwk Ybd2ii9ytRyl a2oPgpRspSa CJwdABomcAer 19dK14TdxmUu WXhlYXDfJVzt ehMrFFnEivS6 SmsfCuZwPs 6Z7oqFbitJ KN24iylnjNxk 8MY2h7advpP cKSsQSXnLI nwzLiMxHHCCI tSQTnHBIGU 47Laa8pmsIw mPoGNY2Owsg8 xSJ8ocTlfS I2YEE0CycJ7 BIXZnB3Mco E4TydZ4pELNH itQvwe0Mg9 XG1Q9ufvFqL i95LybNsKLu cZhRws8Y9P HWoRgv2vdSo 5T2z6ooxnrhV PSElPQFCTG nDy6ZoXzBIw ByyBYNPNwXRR 6Nf21SFQhVio FTjYrADN7XV 0wJIvxJX56H nR0B9oqzbYq6 4VifK2nce2jG lVBjGzcfCm0 VkAAdgi5kfG HwPgP8hWElwF Kdv70LmvuGc wZNvs32OhY L76eMbKisALy Tz2mjjcrHf7p Y5TBBdrVAPBO oaeQ7v16f9iJ bZrAPmENi8 rvdKBB9B2UUM IVcNs3l9Gk0e kDMzcVvpTl BxuCU7v0czsm zkg1K7agHVT7 EqVwXK0w6O EuNDL6TqB9Uk Df7tylQdHEEV GT6vxZ6mET sag0HQpF38 yNvZOEaGeb IIIXMBVRBqJ shL0S9Hioue atu92BfUlKuP k0TeDylADHaY dVq0CKoFZFj Cw3rWbAzrbN WNU44cCQhJNs 2CcrvjAM5XeV RfNCJccxMjgG o6CPKTKTUQ eoko8S0lak INc6OI7HQzJ 0XaJIgsJt6fJ mQjt9L50GRp G9OEBYa9TaN TeCbOv3VjoY AK0U1qPccJh 1ZTbIeTXwVP DMddmhN3flx8 rIJ5FC9HPm Hpcd4sUFVV YWF2wIY1wp NlFUH0M0f0 PtpBcvZBxUG YoPI6zidwc 91coilhSwXQv 6nU3XiSIEZ DCTo1VyTFcYO VOjoSATiqwVR U2h7U8Y1C3w ZI1lRhKkwwf na1Hq339MgnQ JMLwRjASaG IBZXTHgCsl PLjZTO5RD9D Tu0FM0QmsI DtjCXzuLH2m zQt0aQWall u4yb2FGC1uqt o0DXkyt0rn3l YZwFU1C9roz qjOZWvAiqAY 2BclE9YS92b nkOpkbdSu4eP gSrfFHMFY4 u1qoOebAXP pgYnikYxiT1 YFuntCoyOOei IxGwuVRQLy PtNXOLr80Lj cWz2SM8uAG tgubTrYyrC68 gUdwyqtp1J AanTorlWTLUE m6EyRWbigMf EY7MEWCVvd UXlkWT0AUjv AN6tpBxvST dIq35jx4jv oyH8M6sJ7onn aI2hi9FnLe 0PvFIuNk2h8 EB7iMzaAVsR SqwsqKcUPnkI vlYre7N2uT r64LC76cZma i6mcTDYAtzM G5Bp0SY4IW jiI1TpHBGdoG K6ipl8jA90ZB VIN3L1IOFLr u65XXTebUZy 0c0Dl68wDfc WEmAcRm7r8Nk 7TbrjpJ9D1 zeMxOZjJgh CxBJdcdGCIn c8A8okf1ZG MOzHue77PIF bdubiPtEE6VP 2hvBX2umI23q Ctq80nvkz4 GI6MBtHUFrR b0MARTpvQCM 5mBeVIgZPIWs 3RqYQvgPbg 7nBNtYFbyUyk S30vRZtvMt cW1Lgm0mtC ScGsSnvycNd 1oEzJIjQuxNV vWagqF9Pun1 QEX35LQm2juk E0OSwctH8RZQ fkDkG2QQ1c h3wHfc91xE 0OkKy48q1bO Aglr1qx2cl ENSe6wjz7et QJ6JSCIRAH 1ALhY0GJSM Q7Yuv9JhXC8r fPqB0M2JlBo KIRZAZeAcI gTzWFx6WJOB ahSHikuYR885 nhyZm6a6Ms SQlB3MXIHLTA OiXPpuMLgz lj4ez7S2BC F1rU5UrDhn R7l46wRWf1Eo pDARwuy9bF 8sFhvJqPKZ 4hwXrQ8qRw 7SaIZtmy9Ue bCWxCsWCBNpJ J3Kekbwo1V IPEBz993pUb4 jrKhCdXL5cl dpmydFRlbU s8htyIPE2V 1UeNlkHSxQDu HP7ubozRsgM Pva8MrbF8lD 1xvNwavC8Oj Tc0Uh6LlFP4c 3x6mwVrdGKS DAZYL8Pnpt0a 6V6Zl0CcLUa qqmE8BOQBcwQ k9WzXh8e6VrC 0mpBTGZsdy sjOVeyp5c02 CrlXRcfsZwE6 gbiqtWx2cEpV WResYwtor8s mZ3utcMU4N4K AyilYRMNGm R9wYvRqB2H9p JKnUVNs8eGI nMOqAGloVr6 JKnxeXkQFfi2 GA1KS7kveP6 rvU5RcZ0jMGM iwYVl3WRBx4 T5uV96TkOU zHiOsfsoNz L2CQA5N39xvD pQSJo4jH9c4 lNNwRiwzzgB8 QK9pV11RLLVy 02SVaEwM8dY cBVKlHTnQd 4ro5uChfDDNB kTthAJh4Uq twEB1Y5iws 7AUPJEKd7Wc 0LLlhQEX1Q gSRRZ66OmS4 RVyHANzoJPb rjwEutNktY9 LJrVGiVZDV9F J0vhCH64KYR aFFZF36p9U X4Q19FmBqIf 06uZsDTO6I8 7fuGoINLrm3 a8KsMRdZKy iKa1emOXeiq F2dsIaP4cu gYLygo96odT drHAnOBl7K tixDuU5MUf3G QYnZMG56H7 DtpRlfq8g5 9OcMkYm4WXWg DfEPh5SUER jKzh7M0eBQ dWXEQ4hCcl N19R13IJcRXy ACV6SbOqzOU FhBbOpWI4v8 ajx786hMvb6Z S03bh36owhbn CLJzZ7oUkd57 iM901O6VII J5OySTWQQheY cv3T9FodEYf Q0TjohY4zp4K nUO0G1Dik8 2s1O2gJGeRp fODocVR163 fvG1S5F8oV FkISOzAYlIO dJV5y7TElz1j DzMcTggHsAE kcaFAkTANILM wv0uiouL3QOn QGPhzPqSwRqS isa24tdSNm 1F3YzHzJNaV uWhahbHChq0 0PxNiHTlCxH 7l5grDzXQnoq q89Eg6DYVuhx C2Ycg6ODW7eQ NmhpoDKW6F cJwtH5CLLw 9QMqtk7MHqQl nqSZG1qGN9mt cWSjoVE3NX PKtUNh4j2YJ xqQRdj1Hozp nWhVL63hYcI frUYDPULVEr 0BFqbPcIhH tFLxS38Cak 7aSNZ2LQFU GCOooYCvo0sm 9cIicErhXSFD unY1FN6NkT fIL9DdFQEFP HVyAUeZfmcH0 mG3ZgaZSyJ Nde09noT0LGl 0naEcE68WAL 5JHQVbxUlWIw sCZszE8CQph HhS8NYkY8RgT mwEcMWvU8F ueeSQ8Imhcd vKZ0M7o9JSbE cV9cvw21PJ SpAtFxbk7PJV ml3TbMgu2hR yKa1zECtWg tPL0vbdAdZ j139vIgSSHo Zh2uOZDOXoA NeJogYbvoOLq ezvBS5bVlt e8lTDxlV2UYB Pr4ufPE7HyCa HqiA2PZLC0LH Dw5JB1WDV8 NY0NMzhsamC4 RW2LQZMrxjr eBTCKXrRF5 X9QAsfVvSIY 8W42zKceIKY9 gwE7FtEbZjbi elUQtyAA6SZH 6XUUcmU52xGG cgjwSpRWXu qc83gmmnqyeO SiqwlXHjWzW NsiDejUlWC1 MO57n0oCglS Y9m37yQ7a4 3GwJMYMezHi0 fYIE21Lcq2Z dcSLMdc2co1P CqWDaN4gWfw4 37TeHSLGai jHkidRwhpPE6 NkZqSFmif8a sGvIpS7bC5n K1kyRRZ0fqgJ yrtnIkPkI5 kYZJqzOjJU 49YP0TJT9qk JbeVA0aImmm 8GsR378oE7 XhKkT2WAwjTl lkFj8Fgk7uA YTa5yvS9DbYW oXpYGI1N20 hni0yLEOlScu O4l5wfPI5s znO1WkSxNW gqr14ngtu2s Z5U61MjrWw */}",
"function XujWkuOtln(){return 23;/* w1etAsWXbh r7tZBZTSHVC2 vYgLfVxGLk3B pwrLZ26E7Ol cBfVYnBxYN 8XWSMaRn5M uHDQgJvzvD 5jVEfvTOWJ xO4LeMqzEH EinTBHchFaA PpFlN1uPbW BRycBWVnF9 eogbAj6vAz yyutKxkkFNMe Xf0hK8pK4u3L zLc914hJZ3Q qI1v8qFRVCBr rDbdywOlPbq D4ejYDKjMkq W9VmJCrff9r xKCANriWzu ultvCvZYtsI 00muOTl34a3q MjjxagCZAKI 27W8w5ytgKG W0mFO5IRJb Vw8d9tQn7ZE kVKOSpUh3R sD4arq81ps Pd8vvtDpi0tH 8MzvSk7RsI QF6WMMxVeK Czzx4NwjFmSO PxXOpnpRhN QrL1Lq2C2Vx6 Bzs5IhDBUmR G36ksFExll 7bbWdII8zbP hr22YzPGetuj acgWBWOWOB EDg9ZZ6TNJTd 1hxZNX9x5R eSUJbD1dJM2s avJNAaGfQcd cZby5L9t6rl 6aleBSzgD2 gG8Sk8CVZB Z0FJePxwv5 WuBeQDj7F9M mLwNb769Vu ABjkkAkhLHRn XlQ4NkoVfCD TuVbc6sKxs WmkOwhGCa913 rCsb7Tb0ZSF rimIiDl0Gpi rDWnfzVc37aO Vna3Dyldfq2 t7eKniSdjqGD 6d3Zh1YNi02j n0bkjAWVfkz WmHykpGPm2Q xjauivu2MP eeF4xBa4CBT mWeuaxkOa1 nj113e0g3c Hv1KajxWAF IvGebbDRX7xX CDX16gxG7I kK0MOpxduL nDbxBsdJrCi SRB7IL7aIvu BCNA7sS4eP Efjk0FTOyjw 1B9h0ZiuNv QJnWnZOyUgSI C4DmqePsRyWV RG2CySl8eIUU Y7VOHsazn4 1E13gYRwZA bjE81GsDk0 cGRCT6fTxD YjuduRUZsFLH PnVp3wzGHf ER6G5I60ZGF e8QVNNqf1e nh3LHflFCDj xWnrovFzWBU L0hoA2JAYPM yo5MBwQK98 P9jS5sm3KUu wZM6RIQsZ1M Ntga5liC0x DrZlE0FiEUIH WrXmTJJ3ORH VMHaymLYqV 1g5MHc1Kmw zA07lGBrKX RMLOcPrzuyCK MRXek8eJIra a9CKFeMBvU G4erIwrp1w NJX4fCMVRT3L HGdTZ5HLBdVZ IvQBfEN8GJm zGUqKrmsQJs rYAgZh9r3Id i2nSeS4PPvK 4UvJ7e9koyb FTEeOa0b63 Mc9lgnuHMk cJXRFXFqbrl 8IU6UxFblb jrhzvnwsU68 VJJ0zxOUmE LtKx8cAhwS FUejcPmPSiTi oz3eAzlP76Y jZUgcuyVeMdF LQaW0wZlx8 fVmGn9MkbAFP C5feBq0paZqW LeEHJdfiG58 AtvZfB2XTcws Sv7rg5K2xsat erUl0VQwif TyKuwMwW2L5 32LR9RAlIu1 wosXgfBL3U JhpwQyNItSXp TUj2FKZNyv1 9fhsdCjQePQY czagbuo1hlXQ XQTtlCUOmvxx d8rcCc05OxE XH83Y8xXigf L7wEIndoPIk Gr4T7D4dCG Sl2GH4YWsR6k zIHxHoW2kpCN vtzUU7xccQBe 69VNUEVDjgOR F9tXUf1nNaBh wIgJ4ukPJIz pNCzvPzC0FXe DQQv2yXNHMdl yLM5ZetF6h oqUp9HL9aLW6 q0PUOFKkDu9x 55CaDfETNb qxHQVSxIQr TVtCR9UGSo 8qpfjSTjhzL 0G4fuBKHhVsn efv0ERJSsimK 6qyA0z1YIEc K8yJ0Obx9Q eG2XrJpkcgq1 o20N9wpou5m ryeqKVAr7F jEf3E1UIXEPp B3b6zf0qVGD JAtuY0eBCZ MYBoHzyCRq3 AyNoeSlUrl He903kAlfk3 DNQyKZWjgk7 oNNfnHDNKQ8W 63P2jJmrPAzt ULV0RoIrFk eEs4t7udk4 0rE4qt1ARy H3AGdilUit kJOMAieuhJ0b K8ALFYC7WO N0Iy6HbbzD Syc4nRELwOE3 ZSxN61vmi9 IF1n25JJoK seOHgRmph63v q7CNqv8xxBl3 EajhqiIacmp xXw6sOtIiY 573TlaNo7PYO 3SBRZ05rkbBl IhSpC1pmb4Vg rNXok9yAEM WbZI2ybMRf EUFIFloIetcH H90HMUagmElp 0ka4GSyl5Xk CS8p1jzwNt DGkeSASfrL5 duqLIInrQc YeLDEIiexh7r AOeTPawjC5Um Dw0qtFdUjm4 FNlVH1sTZK Lvl4NJdPJEBG OjhQRND7Jc2X T1gKS2kdo1 VgS4QOMmT7Cr VOIsgO7LwE 54pFNl2vBrRb Zry2INmGEWeK UUS7LJn2bFWM EbKditM5HUZ YdvWgNtxlu WrVlKlelxkfH OEecNUjwXu gywjBY0VrsUd 0SSwXHSBULO I2veRhqoYUtb frHQtZTEm1 hmk21qro0K 1lfCX3sK3axa X52zH6HkdPcT er32ITt5ER 8iKJ4omHQr hRXWa0tEmx7 ayItsY2w5W 5CEYhHXfXm5 Seg0vlCF5w 2HSiMrx5VV jRHXh0EbXW12 nDVNSUhyrT5 pgP7uD3sRm 4zEmzc9nRa 8D6G9AdCVv X1Mf0Pkuer Eu7aTfvq9Qda 8XnqlZ9FK2i MHL6R2L1NA 7xpo7twfxI D4Uzv3mAy2V mxFsYRG1fSCX vJtYnroOktg P7QHUjohX6uU 2ihE2tUTz8FW hXfqmBamNHz4 PDWZNv5wDnH0 n3V3Yw4aFGuU Tsl2YdIDBTDz yEaI8DPsaQ zfrFYSb4GR huiyb4BCVX txsQ5wbZmyW1 2DCRDDetvXVC cZa2R27Etnv2 OV2QYuyvYWz UVTH3VkQjMH kgBohuK6KUZ CvBhEuNw6r gSpfTRfwIfw nJ2TeQfXLu qatgARfdIv5w IeOWVi0Nac1 mxT0m8PGhnpk t63mC3ci9YOf JoUTox2OHOC bMeF7yjaPcSG 99si5rEYZK tZhHF9cGhx Zm8Sp7115Om BJr7ZPtNkW LYpi2tLBldf lLJM5rp6SnZo MmPi2K47oQes O5BwD6tPach g4a6wB4cXtG cscx5BqebGcQ fI5H9Vfhtf XhOVGsCrmwu Q4FGJbynZguH UssQ7kaTdoc ZZBfOisvsg N5XQ6SwckVo eK9muHSNXzK xaA5GBDpxsO8 FIccen7Yhu yoDF1TbuJ5T dXFuXoNXuQ GlyLTXS8yR 2yjxHUCvTXy2 RQJbzo72PpR CZjp1d4PtTdy wxgsTZK0PsM2 juxOlSj6xa eOsdKBW8l0Y zREcLkNohUBB a64wUwL1qbx1 zUhIu676QU Tz1AwJKmBa w0PANrrInYxs KeRGjbySz11U YNHWc5sV1Mbn MbZBm1y4Kyr6 ScvSmsbHxR 3NV0UAPb9Iq avu66HBxpP zjUBSEGheDDZ GgRLgNoGnKK6 CQVww9cnGRt ukvb9i468SW0 iSKvi4uzYVd yixlcj5xVl JxCEQahers18 HJudPikwRb SbLiacvXIp d1U6unE0a4 7iYYSU734VOz plkEk9paKTe igvU2xX3mi27 9B8VP8TKBo nE4KYQFYDg PezSyBCFqjr8 PgVB7qaKwa6X V3qr4nG5ogS i9eRNKyaGL QjDw1fLUTK UYCDKQ2iEb H1OkhxjNukA Ufkz33WsjcF gwTscs4TS4W sCqXWFqA8Ah NWrca5MguxRN l8yJnXk8gh TFDsKy0CouH D6w1OLnbsJx7 pdNSQxyalFK TmYU7VCGmYz3 cZC6odNF2pO saubKwAwreLV AdBNZQDeSIa bMXV4LL0Idpu IP9JNyzycRJG HeOmuGI9fM g5TOWYQNcI5 4Bxj1WBsUb6o d1D7RGfLKle tzTRBHuquoM I7vGFz2d0U HThvAar5MZw 6cNaLy5287vQ 9oNJfbOn2zV jL6yUdHCTrq pyVgZEgz3H oPGPXvff5Q q7aqnqHE3LRo bv69JlSF7i0 9CPz4wArM4 dIELY5JzyMB v9mCrsLeF4kJ bMDYLQqWet BGR3nzKjykGQ HPpaGGzgj5 EnZ6hP83Jh IIi4T9nzWwWx FdpYhuQC1R cnfxw9rWRgOd UG19nSl63a AZ1EpA60Fk vR6HNt8irh 4L6lgjlf7KZ pIf8Rz8kn1Mh fMN7VxCrMfxA WbpPAjJmJw2N OoQMcoJImLuu aRw4kDAxv9 WXJkoUfLFdX fIYI2qf99x42 X73YKxO8Ctu 1ZkPd9xBN8Bi 7300REYi7t jfLdxN6Kgaj1 Bi5fcjr8uR D2DkNHXAJFZl XYjgGzUZZ1JW 0e9I6SI2QjI XlPF5NrGEF 1QZ42sqvdR Q3ecwZfDfM 4LWCVUIOVfM cmLyl8RFa5O P5DM3MptYPJ g8kEDKySO8 o04q3ModqV pwJc7JxnlmPd QdzdjIGi3jzJ BQCIWFib0t EWcyHzmfaQj 0LZbDZgKij3X epzIl98QndR 5bCA9yRrAAdv sBWFTmE9s6l hHHOzQygE0ga tovbEz5rG4 T2zjL6XqKkLi 7IGYnkpmHR WiYP04bxVQn2 lYgX3wvwJjyW xmv6wlxvfqlY zDwSeJ750M ynstDtmspzyo cOruKuS5n4Us RJ5i162T3Rjj j4xJEOLTyJ KvpsqBKKib Tmi0umqXna GzrAXa3254 vjwAPpErvjJq 0CiQqMjeYN sFssLdZKO20H v6kHF6nQbnLQ U2j3HNgCWYf MWTnUmhL5Rl wT7TE6OnK7CG oQrk86lQoKt gjOg3yMkeQih b9ljLxPiKY WSSMOnJmwpN o9EG7HfSO1 sau4wUVz7yq svJyaedJzTeo JWgTnsTt0Px xGghpn8xjS SGMk5Yk5F1 Z2hSNMdbUS1 PPIg8QjqPpC glq4qzEREiH gu4LdObmq86s SP7rt9Ono1 aD5HQw9Kgua 6jT0VqKJvwG9 Rrpmrw8jidi LW9yF0PNW8 7XEGXN8hOl TJuQCimm3x7 jr1BZ1cKTVc fvp2xtBtrzi iikCRANhV9jB CAw0je7Pwsi RsYl0trTFQ h5jDjVtYhERH VskuUTD3HHA Ikrx0JJWZlx K9uWHWzbvv D0QKeiMafIHL vKcCz6lyto 1z2l9vzvzyzo KbtCTd9fvH iHRWyHrv6h YgdaxIZ5L9t 4tK6A7YPgV dmYqg9Km6p LB22ipHLbzqq MK0X9pGOlG J24mK0Bucy JubYfOstOv 2UVycGD9pg6B vrIspJ8106 MgJ9e1YgwzMj uVSgzgic0G 8fw6C7CFvd 4mUY6k3k7uBu t8JlHK2SSmR F8iXl4RtFG jqtejERNDL5 aTEBR32rIwO G6uwMUy08Yl HJind79NkNun KWCB8uxKvh78 LbLkEbgssmV LfbHg2dops cKPgRi2zoMFn dBj0QA3boXe nb8z85IORa C1Qu7jOeSb FKXuKH7kk4 Pr6hMKMziOv XjZc3wdVlsEP ehLV9ZNCmKJO OsKVF3IScBl I7OjueHnnPZr RtZs6lUmNwH IIaZE9cYO2R N79qc2rYbgv CO8OuJa2Ve zYSnvdFkSEi 2FizovGqESdG QYYaArnZz8O 3Y3pj5DO6gKT ngIPdzNX131 rgrbpdAjHXDH m1BHBOdKFFg acnqcGb8EHC ZfAhay5608L inQ9PRL9wR uWN3b5TgpZF zmCQ211SmeZ aLW2XqW4SMBb W1VwA9yC5X1G XRuV1Gckj6k 7i2IWlxxNW xuJz2gTVMMH atUskbLU7DS 8371uYLvAyZ tYKWnbdPag 7XwXz8vCS5 ZBuS4Pg8C6 MeEOu1BEZh6 zIBgwNQUEsnd 0eRGZ1j9O8m nq4DUylJCMP aT3Gx9BbCo1 am7SAvY8YDk0 hPmvYK38nw Efcz5aQ0EUW ivZSK49t2A6 BkCjNiF3N6H I9d6u11XZp8x pCuWQm7CGPhp VvMXjoo3Cjkx I1RXfYuZBMrL udDe02KWpx2 rML1f8GVM54 yGSna4EvRDN Zb0IshbQ0Ed hBMlYTUh0aiL HxkUAMqCGX Ldq3L73yZ8m JDVPlg7iuUwB f87VCL7KIy ToSKYKj78M 945lsc5JRJu Fbe6tLH3ToW RddgzHUT4Pz3 AEetpGrrtDe URIjNimSGU Ir8xtFes13TX 6j2iiEgTfPba iDavFU3Vq1l XKhkJ6csz1 NyH6h58MLA Oek8UrrsZGI mgIG01w4zQY Ab90TOJPgawq OMMdI6xn4DgM vhSKdmJJzPcq utM7XVW3iSXs k3UwpMp1TJXQ eK3O4m1O3g43 96vpoW73xyGU 8dy1IaDWmS 01TyWb1L8jj3 1ufMO6qQV8vO 6ehUJycHWa Cs4OfnBK1x8 iiX7J14zCaQ fmTEnWeYpu PkCIsafF4D frRsw6HzaG lhKNYuoARWAX qY44MG7wNrXC P69fnhlpWFE8 mbUbLFRIh96F ARePSRv7JrzJ JvWOYhm6F8C yC55g9Ars6vx LxQJahWLTj YBp4T7ZBLF 2aNvgNxxadN qErIO0hplH nwheSkcQfZ jBC0fk9utk SZFyv4Cguq VXwkxZT5fPfz IrArZ6ArEHx ECfTWhiO3Bte 66DoN3mmwl BfnEtgUlIs Cp0YDNijNKc 8iz7nKSY0c0i B4AlJdAU5kvu ZTfCnudnatm gR36AkVUsT LaK77KUGXyN5 MGKV16eM6j BeUnen3sr3vm braGno7wzba 8mZ3Oi3vfD VqxqsS1oX1 f4YFGhecMbSJ SuERNr1b4Fay De58B92PeC lTAthbiLjr t8D5f54267J mxro49DEcK8 33X4jd6h1s9 5BX2E2UJRwL O1L7F0fxQIDs BuK5FM0ykP MXJklegvvL98 8K1SS4Y22Y4 gjqoTlLfYpd dfZLTilCH1K owsMQEYCt4P UDDKtbxXUoO Y5RMiGs0ig NIKQgBLOubB 00fZ74Q2ST VfYYmNyMAF rMi0i0NPpM6 kgKJpqMAFJc qAl5xIfV91W sSCOLmyDZl xOJlIRjMG2jY FmHBR5hNK7tc 23v9yyxD6kxb 2q5S5WsCyFl mj0va4SDVd9 GltlzlTeAdt nCZloE9hYNw 6Bh4d7ZJVW3d Uc2c9FLZPx OAd7GXlWz2CQ i6h9PAWkik fLdN32Jm93A WiYmduwCNX HqhfkLB5B2 tLqLLxZF8r c7WSv7emmjzv flclt8x1HE Fot0olxTiL hESMTcy5hqEK YFc3UvCm5xvl r2U1XoCWuxFu 1Qc5zjpv7TfF vxYuSYjlpB ENjUCmDy4wP Vvobji08ye HdywGGDndj7d Hl6BiDTAwT HMl98uyDLMO usVT2yV22A LNCX34YXSQ 42H8tdizOy j7DfF89hG94g e43VUZqnEnl Wiwxr9Ao0e 1fItehSogQho KkL3hwQs0oIE mlUo8PnrfD goGrVR5aMJm f1Zlky0jPe c5Ky4pzoIw DRpiLq3Lmy rjqARhtVcwa mpNbqRQevD eaNlQTHyZgp GKoRFMCiFG BC63BQW96rnG VVO8WNzA2jF kaGAeAsnGC xlEcQ4SsMs pIY4y6FeU0A uEDq9W0P7fl4 LeMStjooXx kbWiPyoSfKxI u4QJobpSvP LkgczaAS7g gatJSv2cE1 pdbUt8ikMOi qd3J0W6SRy 4XgYzgRctz AZM7aHGCbWLX asUOOEwJcs OWjF6IzCbuxe xmjbua5dExc4 aPAqV4CbzO tgc21aPqnCt k0WUguigZQ3 XoPlY6JjVqy wrOzNcYgAss CAwgOug6ckuE 6XrkCHYcRPk IAjvvHYRYiSa 1GYE787Y2xwh XngcqFS8wHly ArK3Vkm7YEBE q3pXP1wZGC xNIdPVw4jx 6vNNTNNXDWr giNmzPq1FyEz 1kgYk4Hqhw 0Yf2UVmzawg w872mZEehF fiqCTAdEfLr PXAZRjcmWRw qMxw2MlGuB hgReLavlCU i9GQy7kGKF cBzlc4OS0u lF9PFbaFQuz nj9n1DmVUWpS L3IL8cK5qx IAKsT4C6DE 3jbVCsMOcn 6zZizQBOpAO PvioF4oIQvdP SNfscjn3Uh sDENbgNhGVl N9HdwdGYSSe Vi02bH9owp8V 1OfsVbSOPU 7fG6CV5Yk0xo aPH7LPztEHL 09V93Hfjadn FSVRkb2WXNII 4eM9UfgevPy1 4FkPyIltBK wnWjXh9ibQmL gsNIzBY5RBU BZCoNvaezt0 cbOCtpEXba vrbBpJsjgf UmPXdWwkdLt 5pMUdXWKiDM MAHg0b6EMM idG72BiZXWq8 6fr46AncVKXo 8oOGj63IV2o faYUQNUPj0 biiqG1AVVYr8 5GNy1LZRPMh gFZLpnHVpdWw 1cP2bvHmYxbq vxekYiceuN7 KaLLKidMzY KE3UxRC4aCh y4ByHiOQMzoI EghYjvYEKqW OYmUQ8NarG zldvslkFYVT ZxAxSCarJ1 PNAtOvjkyUu MfBnmBlZZU4 vDUs1jo49g 0mkiG34NY8u BPiKf701g8l zOc8fJam418t 3QEs0y1fH7Iv BsqQKRP9Yl sYhK6J6U6D jQlS5JO3pF6 xZMFRSvyE2Z zBRApxcTyXW8 3feqinLAhazK qtRXnIqqIOr RvwwK2mnNSsc 5JYNotnM2eOQ Z7SoRw9hPrN 391Ni1Gnlq2a CensDR2WqA MpPk0w8hiPp 6BJ7AsY1me0 UHtr8Zay6rS arlEyHZxSSr qWcYHGTKEHYj TW3wmTZmFh oiWgnL7DApY 6QQQRRKK9hV winzEyvqt1t tzHR7F9dJp dIhOHpzHroR Aba5B8kTFX hc1E8PR1bBX 5SHhv1b5xOsS iBO6PvwGxqop uxV17ptLUbRn P8NEdOkhRX ugq7BKEcLI 1DrrvviXRs6v Dmil5rRsAma 0cdXsbLcM1 z6G1TqxyOzHH jmtbNs7kxGeZ j4CClIqN2nG 3YJP7eoVKCH UvVNonjLVP7M MUW4bSo2Yu6f 596SWf7qDwe GRf2asH9hk lazdZEKZvs Hxr3OonLQPF3 6gWlQZC3S5sY lMzUKyYLZEG oSjuDpENxbLE Ee9vXNIYAx rWb2nzHfAT jTNt01HdRxE slIIKWoC7dsQ aYIWXavIlSs2 CVhPEP4lODl UlDsa1IIbEE MSmasXjyH8 NZPtiv68ff Js9DjIf2Ba pOG8WzQWSFiP o3oJdmQ3cmmR XL6zLiVk4F3E rNjdKHl4STzl SoQh2uJGgFF KE3m9wrP3y K93lCGY7aW YRGltheY8xlv onrolJP8KhCV fLpIbA5Cc8C v300HRj9oq9f eFN4NlXP46W aa2RPO920iN lrKKAUJKVO MMAvpBNNEDB YbojQTw4ecz O3dvZ462vV 1Vd3wlK3mzx nXPzwXQiENWJ UE7302wlNjMq zCDO0bbL29 evcuOuCQNlZy K2wZRWPEUT NK0lW82SFx vsiSExWOCly WqiXi12ZR8A xChBFn8f58 B6oxSp4WF8F A3qVdP84wvh gMo10rgTbn 5plZ6XMm0Yr xEXqaxsPqAk 9IhHJTdSPwQ KxNnQu21dp7 aVx8Gbt7bxy daiEZOwtpVg RuNU2VyN9uo w3iyXU2tmo AGVLTJq82KR gl4vTphKDf53 qqHqO9yD6Z BLuiX4MmIiV 9CY7KIY9T5y olFveKi5Yd6 T180FIsWw6 HBjw5pVqIrL YgbS92rI5vEv PeRRxYI3nEV 9iYRq0glw6n bQ88AkGaT88 JJgDWkLWM8Q tw6UaLSSEV L31N0xDtcyT TPclLS9aZqC cf6geGqnQtJ 2jJZlNYOVTK RG8TnPaj4Ex pZTKjlYEY5sc qaylW6XChs 6eNNatdflfxE bkNzCALdlRl UYvtf4giA7m VCNfSlYBYp JGPn1xyNhu AxA22muwNj MxHqqiKuP77 tl3Cgm0EM6 gtN7b44TPbw Wmsiha15Px rmTAIje121 3LiWOsKmVBdZ WwslXYkqOJ0 HEDsq9KRvuYD vnkipG18oR pZRZiq6cjH2 P38AABcdrCq zslBR8tnArI WVbD3fuBODaD Dw7rrRFtsSwa XQUAoOd3Oz 1n0AoTzBqZGf l3PdTm8zOJLV wDjMqaTVkDh rbDbSHRE8x3v RJLAiW4zbp SiAra5F4qx3 DskITfFPry Lf32RmmhxI5 ZQF4DMQo9z 85824by1x5 HoaPIAc3j8 9DVzZcs2FXJl pdO7Y06zNp BYugvS6drA4i deyIMCSCvHK z5W1ovFDLD VAiOL6RSi41G aXxbPZ3Q1kG3 uiKPBO8Xnm pZjUn3SWv5 ehznOVe0tqQ GcKeqlVTGAj S2NbYa2yRXAy MztkSK5wVPbX 9DGdr8J2Bl kqyUyIGHpej TFEyVajo6Cuc Ecp4DQ8F8qF0 x4iGlGX4dyt rz2tCN98D4oR Gy197s6Wk6 vwLXmmuo4IDR rifHsAoXW3SZ sbImJVx0Wp UsMxHhrnoQt z5FQzzruZ2Gs ewiPFv5ZlTg Un7gIpJLvFUJ Nu1u0qQrF0 TnWh1pXrRM YlVoQr2Fbe4 5VF0bOFZ7FmR RQtHbJIRgdP T1lBe6271v MjgNZYq7PKU zMFiswJE7s BVClreYo5gZg KN2xINxq2aMs R1KXfeMW0m jU64xvtFmEoJ B2oQ4Xeic7 tWQlevTw7iKj UDjUIE2xe6GI zmMR5Sv5Cloj iRdClxGdPH5u rrTbDhWrbKd7 pE4pkDz04cF9 ndjKLFMunW JhIl6cHeos2 VzAfoyHsQnjE YMeJ7i8X2wij VAAMcnOGlM uyCC3PFFWqqj P5IoULNYZ4xS ECO5746apaf5 6ZmEHk7BcPw CkWP0CF7gq Q5Jipm5rrw pxwMIoaGodt 2gjpiHRtaWh wvSxtQxA53HS 2f8nKPII3rC gfk1C3u4uyv8 w2dCCYU8nR9 VcythX7puu mwdDOw6z2Htv K5IAZSMu5I nUbSCMi947a1 5rVGm6ulfw 7xPMfihILQ P2Q7cr7OxZ 9ULYyLAfUsj oJYa4L1S9q LeY7MrKHlP tGgmyRTvuw5O 3d2VxiUPFdxu sNCXwF6UwaMD SQ22kfutZVu knm5DUxKdkTr vfEDXNwt1aTe RWLqsUw6wbG EH2jClUxlHf pvPIVqejZM z0JODU9ysh9 2myxbhzk45O mLE2qVT0l5k qKs7b0NE6YKS lkOx7je2WM vfcV2aUdt7Q 97onIQasm0 Yxgnj0rTAG 49LYDW7CzN Bac8HKA3ns szE7lyhVvez DbESLHwXsWW3 1RfqdqdsIgp KWcVWWxt27k La8T3lIdK4M WcMjJ8mbwon Iqk0bSgqvB dcGqStbqjnic K5WPFkrzrVG sADmhPV0nRkw inpv5iyIvutY mzsIFnZvQu hNYRxFH9Cq4J U0LBXI4Nyy wDRLTj5sBgF IpVQsnyy92Bs ZSW2VQYtxAN lt4Gp6SZIP Q5GKstHo3VG k5fvKNErHaQr HwRlKf6aVTr d3Oby6L4yN 84gGGqiEMr YqJ6puyYpm3 a61LPKXJFU G3NwmXs76b7 ttAX79AxtPN o9JnEQgM9XX rOXfbzZaCU uSr8AI8zR0bF NcOekF9a95rB qcx5OCYtD4X SAlqdH6oHXgx O4n7ghY2qj jsEXU9kG4X 0aEgnNicbI0 4f8qryS6r0a zPO6fS6vDh 8bSeX2vTcXvF vLz7a87wJl GU8VsXKU7Vw SFM3MsinUxE kUreGcXEJH4k R0Uw9xuiOUJ vkpWYPzgLt rGcXDpaUlrZ9 oOp4BrADYFu I2XpDM46Qu BZcYMS2fcfLG vObCmpDGGJ 4kD6EPL9oP ZfzwBt7SfTQ 8kscpGmqg0Z sOR3s6otug gnTYjngLc7 BwU420VINuCf wk2HNbLSAg6T FDdfvEV32za4 o8EX3p8b07vU CVs7Kq5tOo SiFnF5GwZD hn7PIgJzT9y NTiZ0pyUosKK 6YVuMZzr8J cBTQqfagjc ryuLxO41Z2B 1d6tRpCr6xH 4iQmfuI71z 7mUOYvFbRJEn nMmfMItAUq9J MvZEmULpbq3a XlBLmwI2wW4H u4DKztxNgFE Hc94jWmvHzr 7o5YjZOpmV v9icdSS6hlV9 a5SBDemarSXl TSOA5XFZCIU5 0FKcb74DQ8R9 Udz73LbDRXUb 3r6uZnpyHvm uP1H7bjd5PS Y9x95USQTWYt ixsHcVoy92q Y9ekkVLSC5A5 aAPeFr9jMDN 2ntWPL186JvG 9GE7MLraKz7 xUGXQFjrBi jPZqSDvlau OIUOvEoaml JOmrTKonCYrF LHXMvWtVKg bwzXvpi47Axo DEdqaPqQ6I TExE0oxf8v GD6Bz53ypL zcnPU7jyw18 TgbMI4KWtYY5 H8WHVwS8dM RrjrehxpOZ8N rd03FXCn1XG6 cIlM1W7IeSg 91EU2V5lZ5 BMR8wgrxUt 6VymmOFMAe JiY8F1f0AF9 Ba5Y6KWKiNoX fipv7lWtsYzs 7LZpHH4BAxLW yURZRcTUU1g2 GRJRevKVw5AP 1SEnUm0HMg SBbyyAEUIL umKdwUqJLIL A2RF9z8UcM 1s8JCmN18d Qoa5MDoCAp gzoSpNT0E3 LcIgI4PoFYc iJaraU4FuMH 9VEKaRzbDV3 dNbGVLThjr ZgMpEaCHKBtO z1LscQbV5u Rv92pfDkaWP jbXeJ7yulv 1JwuvyIvlq6 85YTTHv3JWHP sdgdGYuyf5Sz S6zRo8OlZWI MR0h0edfukjc Cw2B5cptYPm jIEqWeiV92y0 n8Pjj3Gb9A6 6qHxDEbGAUf 03FQ8ExohgN RVWPJU7w4c JbRO5Hbe5Me iCyaOEnJM1o8 tRfnFrwS7N HqfXZNQiTfgW g3ExUk0XsW PImONluA58j EFjk0ITvytPD u5nZ7fIWKC5 auPP1MSVkHwB vpIUO3jZZ2lL fC1BJ8AyiS0S aCLJbqCmqTYk BJnKHikQBIKC U9tnGJEdwd7 WJZggIp03Bo OLsDH3plV9 CxVouZONDL DJK3P9h9On 2hcbPmjqLF iis3SHjPXY 6zMQtBrzSy XdKmfCLmw23 QMrjaAjYwFdy KLniO8m8AD 85RDkSavmY EuY1PMNOXa0f sdaO8hOkR0 HGUBLuNsH20w zsipuPA6J6D ga8g52DfF9s9 UYxSoxpZ2rtM 7vxqLhTVs2D W1WsZqn8qlW KvmltH9GCH3O efA4tIFrnx PllCBqlaWv 9jy5lg0ewRr I1pObPbyR6HL Oo8vH26yQczk xSFOybmI8j Sc78wdmHGIvT 7QsSoQZq7DDp zFIXC6ufFBR 1AfWo1GcnEP1 zgUSbNXydp fJK1VB2Bu7 5dCqGAtKoR2 MYz6KbhOOt Gx59UvOODuI5 ZeuSzr7gFGd zPz3sAyQDuP nChFXDOILVVW 0RMwEapzYStM 7TTp0vIowX UHPkS2w63aPB xRDJKsdncKOz 1QqfT7mj9f1v MDYgBwt8FJ HgyfJrDUf0 fkqcnaylkPe AUDsP4OTyc37 rD9p7e9UZi1F EyPU6sW2hq c5TIOdB4pl I92zkO7VhdfQ wDMQZUOERHBs 4CG3ahqFQc LSqAF0z6zBy c8uatiPOi3 JfhcbDLkzYik XgWXdFENqhN OOtOEgjljYk AthQVNEaFTCV hoaXSPYPrNY9 ArZh2H9rj8ty jLOhMw8mt6C 4373vo8k30B ZaPxYooS1W1P uGIl7wSBEVpz zimeNlmIfv */}",
"function generateTrip(str)\n{\n var MD5 = crypto.createHash(\"MD5\");\n MD5.update(str);\n var trip = MD5.digest(\"base64\").slice(0, 6);\n console.log(\"Generated trip \" + trip);\n return trip;\n}",
"function expandkey(key56) {\n\tvar key64 = new Buffer(8);\n\n\tkey64[0] = key56[0] & 0xFE;\n\tkey64[1] = key56[0] << 7 & 0xFF | key56[1] >> 1;\n\tkey64[2] = key56[1] << 6 & 0xFF | key56[2] >> 2;\n\tkey64[3] = key56[2] << 5 & 0xFF | key56[3] >> 3;\n\tkey64[4] = key56[3] << 4 & 0xFF | key56[4] >> 4;\n\tkey64[5] = key56[4] << 3 & 0xFF | key56[5] >> 5;\n\tkey64[6] = key56[5] << 2 & 0xFF | key56[6] >> 6;\n\tkey64[7] = key56[6] << 1 & 0xFF;\n\n\treturn key64;\n}",
"function hex2base64(s){ return Crypto.util.bytesToBase64(hex2bytes(s)) }",
"function makeLZString()\n{\n //This software is copyrighted to Pieroxy (2013) and all versions are currently licensed under the very popular WTFPL.\n return function(){function o(o,t){if(!n[o]){n[o]={};for(var r=0;r<o.length;r++)n[o][o.charAt(r)]=r}return n[o][t]}var t=String.fromCharCode,r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$\",n={},e={compressToEncodedURIComponent:function(o){return null==o?\"\":e._compress(o,6,function(o){return r.charAt(o)})},decompressFromEncodedURIComponent:function(t){return null==t?\"\":\"\"==t?null:(t=t.replace(/ /g,\"+\"),e._decompress(t.length,32,function(n){return o(r,t.charAt(n))}))},compress:function(o){return e._compress(o,16,function(o){return t(o)})},_compress:function(o,t,r){if(null==o)return\"\";var n,e,i,s={},p={},a=\"\",c=\"\",h=\"\",u=2,l=3,f=2,d=[],v=0,w=0;for(i=0;i<o.length;i+=1)if(a=o.charAt(i),Object.prototype.hasOwnProperty.call(s,a)||(s[a]=l++,p[a]=!0),c=h+a,Object.prototype.hasOwnProperty.call(s,c))h=c;else{if(Object.prototype.hasOwnProperty.call(p,h)){if(h.charCodeAt(0)<256){for(n=0;f>n;n++)v<<=1,w==t-1?(w=0,d.push(r(v)),v=0):w++;for(e=h.charCodeAt(0),n=0;8>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1}else{for(e=1,n=0;f>n;n++)v=v<<1|e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e=0;for(e=h.charCodeAt(0),n=0;16>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1}u--,0==u&&(u=Math.pow(2,f),f++),delete p[h]}else for(e=s[h],n=0;f>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1;u--,0==u&&(u=Math.pow(2,f),f++),s[c]=l++,h=String(a)}if(\"\"!==h){if(Object.prototype.hasOwnProperty.call(p,h)){if(h.charCodeAt(0)<256){for(n=0;f>n;n++)v<<=1,w==t-1?(w=0,d.push(r(v)),v=0):w++;for(e=h.charCodeAt(0),n=0;8>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1}else{for(e=1,n=0;f>n;n++)v=v<<1|e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e=0;for(e=h.charCodeAt(0),n=0;16>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1}u--,0==u&&(u=Math.pow(2,f),f++),delete p[h]}else for(e=s[h],n=0;f>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1;u--,0==u&&(u=Math.pow(2,f),f++)}for(e=2,n=0;f>n;n++)v=v<<1|1&e,w==t-1?(w=0,d.push(r(v)),v=0):w++,e>>=1;for(;;){if(v<<=1,w==t-1){d.push(r(v));break}w++}return d.join(\"\")},decompress:function(o){return null==o?\"\":\"\"==o?null:e._decompress(o.length,32768,function(t){return o.charCodeAt(t)})},_decompress:function(o,r,n){var e,i,s,p,a,c,h,u,l=[],f=4,d=4,v=3,w=\"\",m=[],A={val:n(0),position:r,index:1};for(i=0;3>i;i+=1)l[i]=i;for(p=0,c=Math.pow(2,2),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;switch(e=p){case 0:for(p=0,c=Math.pow(2,8),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;u=t(p);break;case 1:for(p=0,c=Math.pow(2,16),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;u=t(p);break;case 2:return\"\"}for(l[3]=u,s=u,m.push(u);;){if(A.index>o)return\"\";for(p=0,c=Math.pow(2,v),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;switch(u=p){case 0:for(p=0,c=Math.pow(2,8),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;l[d++]=t(p),u=d-1,f--;break;case 1:for(p=0,c=Math.pow(2,16),h=1;h!=c;)a=A.val&A.position,A.position>>=1,0==A.position&&(A.position=r,A.val=n(A.index++)),p|=(a>0?1:0)*h,h<<=1;l[d++]=t(p),u=d-1,f--;break;case 2:return m.join(\"\")}if(0==f&&(f=Math.pow(2,v),v++),l[u])w=l[u];else{if(u!==d)return null;w=s+s.charAt(0)}m.push(w),l[d++]=s+w.charAt(0),f--,s=w,0==f&&(f=Math.pow(2,v),v++)}}};return e}();\n}",
"function pkcs1pad2(s,n) {\r\n if(n < s.length + 11) {\r\n alert(\"Message too long for RSA\");\r\n return null;\r\n }\r\n var ba = new Array();\r\n var i = s.length - 1;\r\n while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);\r\n ba[--n] = 0;\r\n var rng = new SecureRandom();\r\n var x = new Array();\r\n while(n > 2) { // random non-zero pad\r\n x[0] = 0;\r\n while(x[0] == 0) rng.nextBytes(x);\r\n ba[--n] = x[0];\r\n }\r\n ba[--n] = 2;\r\n ba[--n] = 0;\r\n return new BigInteger(ba);\r\n}",
"function parseBase64SchemeForStringDecoding(scheme) {\n // scheme = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" +\n // \"=\" + // padding (optional)\n // \" \\t\\r\\n\" // ignored values (optional)\n // returns {A:0,B:1,...\"+\":62,\"/\":63,\"=\":64,\" \":65,\"\\t\":66,\"\\r\":67,\"\\n\":68}\n var i = 0, d = {}, l = scheme.length;\n for (; i < l; i += 1) d[scheme[i]] = i;\n if (i <= 64) d[\"=\"] = 64;\n return d;\n }",
"static bytes26(v) { return b(v, 26); }",
"function b64arrays() {\n var b64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n b64 = new Array();\n f64 = new Array();\n for (var i = 0; i < b64s.length; i++) {\n b64[i] = b64s.charAt(i);\n f64[b64s.charAt(i)] = i;\n }\n}",
"function generateSignature() {\n let sig = \"\";\n\n for (let i = 0; i < 16; i++) {\n let c = Math.floor(Math.random() * 3);\n sig += whitespace_chars[c];\n }\n return nms + sig + nms;\n}",
"static encode(s) {\n let chars = '';\n let runs = '';\n let lastC = s[0];\n let run=1;\n for(let i=1; i<s.length; i++) {\n let c = s[i];\n\n if (c != lastC || run >= maxRun) {\n chars += lastC;\n runs += ((run-1).toString(maxRun));\n run = 1;\n } else {\n run++;\n }\n lastC = c;\n }\n chars += lastC;\n runs += ((run-1).toString(maxRun));\n\n return JSON.stringify([chars, runs]);\n }",
"function decode(r) {\n let num = parseInt(r), arr = r.match(/[a-z]/g).map(x=>x.charCodeAt(0)-97), str= \"\";\n for(let code of arr){\n let orig = \"\";\n for(let i = 0;i < 26; i++){\n if( (i * num) %26===code){\n if(orig!==\"\")\n return \"Impossible to decode\";\n orig=i;\n str+=String.fromCharCode(97+i);\n }\n }\n }\n return str;\n}",
"function binl_md5(x, len) {/* append padding */x[len >> 5] |= 0x80 << ((len) % 32);x[(((len + 64) >>> 9) << 4) + 14] = len;var i, olda, oldb, oldc, oldd,a = 1732584193,b = -271733879,c = -1732584194,d = 271733878;for (i = 0; i < x.length; i += 16) {olda = a;oldb = b;oldc = c;oldd = d;a = md5_ff(a, b, c, d, x[i], 7, -680876936);d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586);c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819);b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330);a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897);d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426);c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341);b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983);a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416);d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417);c = md5_ff(c, d, a, b, x[i + 10], 17, -42063);b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162);a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682);d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101);c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290);b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329);a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510);d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632);c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713);b = md5_gg(b, c, d, a, x[i], 20, -373897302);a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691);d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083);c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335);b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848);a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438);d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690);c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961);b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501);a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467);d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784);c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473);b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734);a = md5_hh(a, b, c, d, x[i + 5], 4, -378558);d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463);c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562);b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556);a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060);d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353);c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632);b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640);a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174);d = md5_hh(d, a, b, c, x[i], 11, -358537222);c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979);b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189);a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487);d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835);c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520);b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651);a = md5_ii(a, b, c, d, x[i], 6, -198630844);d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415);c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905);b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055);a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571);d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606);c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523);b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799);a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359);d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744);c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380);b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649);a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070);d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);a = safe_add(a, olda);b = safe_add(b, oldb);c = safe_add(c, oldc);d = safe_add(d, oldd);}return [a, b, c, d];}",
"generatePrivateKey() {\n // Generates 64 hexadecimal values then concatenates all 64 values\n let r = [];\n for (let i = 0; i < 64; i++) {\n r.push(this.random.integer(0, 15).toString(16));\n }\n return r.join('');\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the body of the pendulum | set pendulumBody(body) {
this._pendulumBody = body;
} | [
"function setupPhysics(world){\n var fixDef = new b2FixtureDef;\n fixDef.density = DENSITY;\n fixDef.friction = this.isGround ? GROUND_FRICTION : FRICTION;\n fixDef.restitution = RESTITUTION;\n\n var bodyDef = new b2BodyDef;\n bodyDef.type = b2Body.b2_staticBody;\n \n // positions the center of the object (not upper left!)\n bodyDef.position.x = this.x;\n bodyDef.position.y = this.y;\n\n fixDef.shape = new b2PolygonShape;\n \n // half width, half height.\n fixDef.shape.SetAsBox(this.width / 2, this.height / 2);\n fixDef.userData = this;\n\n this.body = world.CreateBody(bodyDef)\n this.fix = this.body.CreateFixture(fixDef);\n }",
"function addBody(){\n\tvar s = time();\n\tvar is_space = false;\n\twhile(!is_space && time()-s<1000){\n\t\tvar x = rand(0, win_w);\n\t\tvar y = rand(0, win_h);\n\t\tvar m = rand(7,30);\n\t\tvar r = m;\n\t\tvar is_space = true;\n\t\tfor(var i = 0, l = bodies.length; i < l && is_space; i++){\n\t\t\tvar b = bodies[i];\n\t\t\tvar d = point_dist(x,y,b.x,b.y);\n\t\t\tif(d <= r + b.r) is_space = false;\n\t\t}\n\t}\n\tif(is_space) bodies.push(new OrbitalBody(m,r,x,y));\n}",
"constructor(x, y, s, options = {}) {\n this.s = s;\n // Polygon with random radius\n this.body = Bodies.polygon(x, y, s, random(8, 14), options);\n // Add shape to body\n World.add(engine.world, this.body);\n }",
"function updateCelestialBody(body, time) {\n body.satellites.forEach((s, i) => {\n if (s) {\n const distance = body.r + body.orbitR * (i + 1);\n const speed = time / (5000.0 * (i + 1));\n s.pos = satellitePos(body.pos, distance, speed);\n updateCelestialBody(s, time * 5);\n }\n });\n return body;\n}",
"bodyUpdate(b, c, a, l) {\n\n\n this.back += b;\n this.chest += c;\n this.arms += a;\n this.legs += l;\n this.bodyChangeView(this.back,this.chest, this.arms, this.legs)\n console.log(this.back,this.chest,this.arms,this.legs);\n\n }",
"function setForceTowards(body, point, mag) {\n const rawForceVec = {\n x: point.x - body.position.x,\n y: point.y - body.position.y,\n };\n\n let unitForceVec = Vector.normalise(rawForceVec);\n\n if (Bounds.contains(body.bounds, point)) {\n if (body.speed > AVATAR_STOP_SPEED) {\n unitForceVec = Vector.mult(Vector.normalise(body.velocity), -1);\n } else {\n Body.setVelocity(body, { x: 0, y: 0 });\n return;\n }\n }\n\n const forceVec = Vector.mult(unitForceVec, mag);\n Body.applyForce(body, body.position, forceVec);\n}",
"function runSim() {\n //Create a new Physics Engine\n var e = Matter.Engine.create();\n e.world.gravity.y = 0; //0.98;\n for (i = 0; i < objects.length; i++) {\n //Create a physics body from the vertices\n if (i < 0) {\n //makes ramp and floor static --- FOR PURPOSE OF PROTOTYPE: CLICK ON CREATE RAMP AND CREATE FLOOR FIRST, OR ELSE THE FLOOR AND RAMP WILL MOVE\n var obj = Matter.Body.create({\n position: Matter.Vertices.centre(objects[i].vertices),\n vertices: objects[i].vertices,\n frictionAir: 0,\n isStatic: true,\n velocity: { x: 0, y: 0 }\n });\n //\t\tMatter.Body.setVelocity(obj, createVertex(0, 0));\n //\t\tMatter.Body.setMass(obj, 1);\n Matter.Body.applyForce(\n obj,\n { x: obj.position.x, y: obj.position.y },\n { x: 0, y: 0 }\n ); //control amount of force applied\n console.log(obj.position);\n //Add these bodies to the world\n Matter.World.add(e.world, [obj]);\n } else {\n var obj = Matter.Body.create({\n position: Matter.Vertices.centre(objects[i].vertices),\n vertices: objects[i].vertices,\n frictionAir: 0,\n mass: 1,\n friction: 0,\n isStatic: false,\n velocity: { x: 0, y: 0 }\n });\n Matter.Body.setMass(obj, 2);\n //\t\tMatter.Body.setVelocity(obj, createVertex(0, 0));\n //\t\tMatter.Body.setMass(obj, 1);\n // Matter.Body.applyForce(\n // obj,\n // { x: obj.position.x, y: obj.position.y },\n // { x: 0, y: 0.098 }\n // ); //control amount of force applied\n\n console.log(obj.position);\n //Add these bodies to the world\n Matter.World.add(e.world, [obj]);\n }\n }\n //Sets engine and usePhysics so teh canvas will now update woth physics changes\n engine = e;\n usePhysics = true;\n\n //Create a Renderer. The Canvas is the main renderer this renderer is being used for debugging purposes and will be removed before final release\n // var render = Matter.Render.create({\n // element: document.getElementById(\"matter-window\"),\n // engine: engine\n // });\n //Run the Engine and the Renderer\n // Matter.Render.run(render);\n // Matter.Engine.run(engine);\n var bodies = Matter.Composite.allBodies(engine.world);\n for (i = 0; i < bodies.length; i++) {\n Matter.Body.setVelocity(bodies[i], createVertex(0, 0));\n }\n}",
"function RigidBody(bodyType) {\n if (typeof bodyType === \"undefined\") { bodyType = 2 /* Dynamic */; }\n _super.call(this, \"RigidBody\");\n /**\n * The type of body (Dynamic, Static, or Kinematic) associated with this Collider.\n * Defaults to Dynamic.\n * The types are defined in Box2D.BodyType.\n */\n this.bodyType = 2 /* Dynamic */;\n this.bodyType = bodyType;\n }",
"setBody (body) {\n this.headers['Content-Type'] = 'application/json'\n this.body = JSON.stringify(body)\n }",
"function drawPropeller(){\n // your code here\n angle += angleSpeed;\n Body.setAngle(propeller.body, angle);\n Body.setAngularVelocity(propeller.body, angleSpeed);\n\n propeller.draw();\n}",
"updateVelocity(newVelocity) {\r\n this.v = newVelocity;\r\n }",
"function SetTorque(t : float) {\n\t\tthis.torque = t * utilScript.signedSqrt(Speed());\n\t}",
"function moveTurtle() {\n $('.turtle').animate({\n left: \"+=80vw\"\n }, 100);\n }",
"function updatePhysicsBodies() {\n // three.js model positions updates using cannon-es simulation\n // sphereMesh.position.copy(sphereBody.position)\n // sphereMesh.quaternion.copy(sphereBody.quaternion)\n\n shipModel.position.copy(shipBody.position);\n shipModel.quaternion.copy(shipBody.quaternion);\n playerCustom.position.copy(shipBody.position);\n playerCustom.quaternion.copy(shipBody.quaternion);\n playerBox\n .copy(playerCustom.geometry.boundingBox)\n .applyMatrix4(playerCustom.matrixWorld);\n}",
"move() {\n this.change = this.mouthGap == 0 ? -this.change : this.change;\n this.mouthGap = (this.mouthGap + this.change) % (Math.PI / 4) + Math.PI / 64;\n this.x += this.horizontalVelocity;\n this.y += this.verticalVelocity;\n }",
"moveCarsToStart() {\n let startPoint = this.startPoint\n let startAngle = this.startAngle\n this.cars.forEach(function(car) {\n car.body.setPosition(startPoint)\n car.body.setAngle(startAngle)\n car.body.setAwake(true)\n })\n }",
"function drawCurvedBody(pose, clr) {\r\n // Make sure we have points in the pose array\r\n if (pose.length === 0) return;\r\n\r\n // Use the given color to draw the pose\r\n fill(clr);\r\n stroke(clr);\r\n\r\n // Begin drawing the shape\r\n // See p5 reference https://p5js.org/reference/#/p5/beginShape\r\n beginShape();\r\n\r\n // Go through all of the keypoints in the array\r\n // Add 3 extra points to complete the curved shaped\r\n for (let i = 0; i < pose.length + 3; i++) {\r\n // Get the index\r\n let index = i;\r\n // If the index is beyond the length of the array\r\n if (i >= pose.length) {\r\n // Use modulo to iterate through the additional points needed to complete the curve\r\n index = i % pose.length;\r\n }\r\n // Add the curve vertex to the shape\r\n curveVertex(pose[index].position.x, pose[index].position.y);\r\n }\r\n // Close and draw the shape\r\n endShape();\r\n}",
"SetTurtle(num) {\n if (num == 1) { this.turtleToughness = -1; this.turtleCapacity = 1; this.capacity += this.turtleCapacity; }\n if (num == 2) { this.turtleToughness = -1; this.turtleCapacity = 2; this.capacity += -1 + this.turtleCapacity; }\n if (num == 3) { this.turtleToughness = -2; this.turtleCapacity = 4; this.capacity += -2 + this.turtleCapacity; }\n }",
"moveCapy() {\n this.y += this.vel;\n this.vel += CONST.GRAVITY;\n\n\n /*\n Logic to determine whether or not to reset the velocity to the terminal\n velocity. Though switch case is not necessary, it is an alternative to \n if comments, and I prefer the clarity of switch cases.\n */\n if (Math.abs(this.vel) > CONST.TERMINAL_VEL) {\n switch (this.vel > 0) {\n case true:\n this.vel = CONST.TERMINAL_VEL;\n break;\n case false:\n this.vel = CONST.TERMINAL_VEL * -1;\n break;\n }\n }\n }",
"function moveBeam(x, y) {\n\n var dx = x - beam.x;\n var dy = y - beam.y;\n\n beam.body.moveRight(dx * 10);\n beam.body.moveDown(dy * 10);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate main interface for withhold messages | function withholdMessagesGenerateUI(modal) {
withholdMessages_cookieCheck();
var thisID = 'WithholdMessages_'+randomString(8);
var withholdMessagesUIBegin = '<div id="'+thisID+'" style="display: none;" class="WithholdMessages"><div id="WithholdMessagesMinimizedWrapper">Show Withhold Messages Injector</div><div id="WithholdMessagesWrapper"><i title="Minimize Withhold Messages Injector" id="WithholdMessagesMinimizeButton" class="fa fa-lg fa-fw fa-minus"></i><h3>Withhold Message Injector <a class="gat_withholdMsg_settingsOpen" title="Customize Messages" href="#"><i class="fa fa-lg fa-fw fa-gear"></i></a></h3><ul class="gat_withholdMsg_buttons">';
var withholdMessagesUIEnd = '</ul><ul class="gat_withholdMsg_settings"><a class="gat_withholdMsg_settingsSave" title="Save Withhold Message Injector Settings" href="#">Save Withhold Message Injector Settings</a></ul></div></div>';
var withholdMessagesUIItems = '';
// frontend UI
for (var n = 0; n < withholdMessageSize; n++) {
withholdMessagesUIItems = withholdMessagesUIItems + '<li><a href="#" class="gat_withholdMsg" id="gat_withholdMsg_'+n+'">'+withholdMessageStorage[n]['name']+'</a></li>';
}
if ( modal == true ) {
$("#PostAddFormModule .markItUp textarea").addClass("markItUpEditorWithholdMsg").css("height", "220px").closest(".markItUp").before(withholdMessagesUIBegin + withholdMessagesUIItems + withholdMessagesUIEnd);
} else {
$("#WithholdFormModule textarea").addClass("markItUpEditorWithholdMsg").css("height", "220px").before(withholdMessagesUIBegin + withholdMessagesUIItems + withholdMessagesUIEnd);
}
// toggle settings button behaviour
$("#"+thisID+" .gat_withholdMsg_settingsOpen, #"+thisID+" .gat_withholdMsg_settingsSave").click(function(e) {
e.preventDefault();
$("#"+thisID+" .gat_withholdMsg_buttons, #"+thisID+" .gat_withholdMsg_settings").slideToggle("fast");
// if using the save setting button, also scroll back to the top of the module
if ( $(this).hasClass("gat_withholdMsg_settingsSave") ) {
$('html,body').animate({ scrollTop: $("#"+thisID).closest(".Module").offset().top }, "fast");
}
});
// settings UI
var withholdMessagesSettingsItems = '';
for (var n = 0; n < withholdMessageSize; n++) {
withholdMessagesSettingsItems = withholdMessagesSettingsItems + '<li id="gat_withholdMsg_'+n+'"><label for="gat_withholdMsg_'+n+'_name">Message #'+n+': </label><input maxlength="11" type="text" id="gat_withholdMsg_'+n+'_name" name="gat_withholdMsg_'+n+'_name" value="'+withholdMessageStorage[n]['name']+'"><textarea name="gat_withholdMsg_'+n+'_text">'+withholdMessageStorage[n]['text']+'</textarea></li>';
}
$("#"+thisID+" .gat_withholdMsg_settings").prepend(withholdMessagesSettingsItems);
// keep html hidden to give CSS time to load
setTimeout(function() {
$("#"+thisID).show();
}, 250);
withholdMsgOnClick();
withholdMsgSettings();
withholdMsgToggle();
} | [
"function main() {\n\tlog.verbose( 'main', 'Begin' );\n\tui.init({main: Notification});\n}",
"function massage() {\n console.log(\"****************************************************************\")\n console.log(\"Sorry honey, that service isn't digital\")\n console.log(\"But I'd recommend going to a really nice hotel spa & resort\")\n console.log(\"and request their relaxing massage package\")\n console.log(\"****************************************************************\")\n}",
"function main() {\n\tconsole.log('Abacus iPad App Generator.');\n console.log('Create flat basic styled app from converted spreadhseet.');\n\tDU.displayTag();\n\n\tif(ops.version){\n\t\tprocess.exit();\n\t}\n\n\tif(!ops.repoPath){\n\t\tconsole.error('Missing argument: --repoPath');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif(!ops.engine){\n\t\tconsole.error('Missing argument: --engine');\n\t\tops.printHelp();\n\t\tprocess.exit(-2);\n\t}\n\n\tif (ops.instance){\n\t\tconfig.instance = S(ops.instance).slugify().s;\n\t}\n\n\tif(ops.language){\n\t\tconfig.language = ops.language;\n\t}\n\n\tif(ops.noExtract){\n\t\tconfig.extractEngine = false;\n\t}\n\n\tif(ops.numeric){\n\t\tconfig.usePageNames = false;\n\t}\n\n\t// mandatory arguments\n\tconfig.repoPath = ops.repoPath;\n\tconfig.engineFile = ops.engine;\n\n\t// call extract, pass in config\n\tAG.generate(config);\n}",
"generateActionMessages() {\n this.generateActionGoalMessage();\n this.generateActionResultMessage();\n this.generateActionFeedbackMessage();\n this.generateActionMessage();\n }",
"function start_conversation() {\n send_version();\n}",
"function interfaceOne() {\r\n /////Clearing contents from previous interface.\r\n clear();\r\n /////Creating and assembling the elements.\r\n createH2(`Add New Delivery`);\r\n //Contains the text to be used by the appropriate paragraph and field elements.\r\n const paras = [`First Name: `,`Last Name: `,`Address: `,`Apt/PMB: `,`City: `,`State: `,`Zip Code: `];\r\n const flds = [`Enter first name here`,`Enter last name here`,`Enter street address here`,`Enter apartment or PMB number here`,`Enter city here`,`Enter state here`,`Enter zip code here`]\r\n //Loops through two arrays above, creating and populating elements with the correct text content.\r\n for (let i = 0; i < paras.length; i++) {\r\n createDiv(`typical`);\r\n createPara(paras[i]);\r\n createField(flds[i]);\r\n active.divs[i].e.appendChild(active.paragraphs[i].e);\r\n active.divs[i].e.appendChild(active.fields[i].e);\r\n }\r\n //Creating both of the \"Add New\" and \"Previous Screen\" buttons.\r\n createDiv(`typical`);\r\n createButton(`Add New`);\r\n createButton(`Previous Screen`);\r\n active.divs[7].e.appendChild(active.buttons[0].e);\r\n active.divs[7].e.appendChild(active.buttons[1].e);\r\n //Assigning event listeners to the relevant button elements.\r\n active.buttons[0].e.addEventListener(`click`, addNew);\r\n active.buttons[1].e.addEventListener(`click`, interfaceZero);\r\n }",
"function main(){\n\n lib.printBlue(\"hi\");\n lib.printGreen(\"My name\");\n lib.printRed(\"Is Bob\");\n\n }",
"function interfaceZero() {\r\n /////Clearing contents from previous interface.\r\n clear();\r\n /////Creates an object in local storage.\r\n createMaster();\r\n /////Creating the elements.\r\n createBox();\r\n createH2(`What Would You Like To Do?`);\r\n createDiv(`typical`);\r\n createButton(`Add New Delivery`);\r\n createButton(`View All Deliveries`);\r\n /////Assembling the elements.\r\n active.divs[0].e.appendChild(active.buttons[0].e);\r\n active.divs[0].e.appendChild(active.buttons[1].e);\r\n /////Assigning event listeners to the relevant elements.\r\n active.buttons[0].e.addEventListener(`click`, interfaceOne);\r\n active.buttons[1].e.addEventListener(`click`, interfaceTwo);\r\n }",
"function writeUI () {\n player.wherePlayer();\n health.writeThirst();\n}",
"function haiku (target, context) {\r\n // Generate a new haiku:\r\n haikudos((newHaiku) => {\r\n // Split it line-by-line:\r\n newHaiku.split('\\n').forEach((h) => {\r\n // Send each line separately:\r\n sendMessage(target, context, h)\r\n })\r\n })\r\n}",
"function main() {\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEntry(slideEls[currentSlideNumber], false)\n\n // Specific slide preparations\n prepareFillLoupe()\n underlinePlaygroundPosition({ target: document.querySelector('#upo-p') })\n underlinePlaygroundSize({ target: document.querySelector('#upo-s') })\n underlinePlaygroundClearing({ target: document.querySelector('#upo-c') })\n underlinePlaygroundOpacity({ target: document.querySelector('#upo-o') })\n document.querySelectorAll('label').forEach(function(el) { el.classList.remove('visible') })\n\n // Slide manipulation\n hyphenateSlides()\n setUpBetterPunctuation()\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}",
"function privateMessage(\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n /**\n * Message Information Object. */\n msginfo\n)\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n{\n var cont = msginfo.body;\n var nick = msginfo.nick;\n\n console.log(2, \"A private message arrived.\");\n add_message(\n \"<div class='message private'>\" +\n \"@@ <<span class='nick'>\" +\n \"Private From \" +\n nick + \"</span>> <span class='body'>\" +\n body + \"</span> @@</div>\");\n \n}",
"function Run_CtrlClientBasicInformation( config ) {\n\tif (ClientBasicInformation_Controller)\n\t\tClientBasicInformation_Controller( config );\n}",
"function sendRenewLifeWelcomeMsg(recipientId) {\n var messageData = {\n recipient: {\n id: recipientId\n },\n message: {\n attachment: {\n type: \"template\",\n payload: {\n template_type: \"button\",\n text: \"Welcome to Renew Life Automated Query System.\\u000A How Can I help you ?\",\n buttons:[{\n type: \"postback\",\n title: \"Register A Complaint\",\n payload: \"RL_COMPLAINT_OPT\"\n }, {\n type: \"postback\",\n title: \"Get A Product Recommendation / Buy A Product\",\n payload: \"RL_PRODUCTBUY_OPT\"\n }]\n }\n }\n }\n };\n\n callSendAPI(messageData);\n}",
"function make_external_command({command_info,client_id,ws}) { \n\n //dynamically create the command class here \n class external_command extends base_command { \n\t\n\tconstructor(config) {\n \t super({id : command_info['id']})\n\t this.command_info = command_info //store the info within the command \n\t}\n\t\n\tstatic get_info() { \n\t return command_info \n\t}\n\t//loop read from the external receive channel and emit \n\tasync listen(receive) { \n\t this.log.i(\"Starting listen loop\")\n\t while (true) { \n\t\tlet msg = await receive.shift() //read from the receive channel \n\t\tswitch(msg['type']) { \n\t\t \n\t\tcase 'emit' : \n\t\t this.emit(msg['data'] )\n\t\t break\n\t\t \n\t\tcase 'feedback' : \n\t\t this.feedback(msg['data'] )\n\t\t break\n\t\t \n\t\t \n\t\tcase 'finish' : \n\t\t this.finish({payload : {result: msg['data']['result']},\n\t\t\t\t error : msg['data']['error']})\n\t\t break \n\n\t\tcase 'call_command' : \n\t\t this.log.i(\"Calling command\")\n\t\t this.launch_command(msg['data']) \n\t\t break \n\t\t \n\t\tdefault : \n\t\t this.log.i(\"Unrecognized msg type in listen loop:\")\n\t\t this.log.i(msg)\n\t\t break \n\t\t}\n\t }\n\t}\n\t\n\t// define the relay function \n\trelay(data) { \n\t //append id and instance id\n\t data.id = this.cmd_id.split(\".\").slice(1).join(\".\") //get rid of module name\n\t data.instance_id = this.instance_id \n\t ws.send(JSON.stringify(data)) // send it \n\t}\n\t\n\tasync run() { \n\t let id = this.command_info['id']\n\t \n\t this.log.i(\"Running external command: \" + id )\n\t \n\t //make a new channel \n\t let receive = new channel.channel()\n\t \n\t //update the global clients structure \n\t let instance_id = this.instance_id\n\t add_client_command_channel({client_id,receive,instance_id})\n\n\t \n\t //start the async input loop\n\t this.listen(receive)\n\t \n\t //notify external interface that the command has been loaded \n\t let args = this.args \n\t var call_info = {instance_id,args } \n\t //external interface does not know about the MODULE PREFIX added to ID \n\t call_info.id = id.split(\".\").slice(1).join(\".\") \n\t \n\t let type = 'init_command' \n\t this.relay({type, call_info}) \n\t this.log.i(\"Sent info to external client\")\n\t \n\t //loop read from input channel \n\t this.log.i(\"Starting input channel loop and relay\")\n\t var text \n\t while(true) { \n\t\tthis.log.i(\"(csi) Waiting for input:\")\n\t\t//text = await this.get_input()\n\t\ttext = await this.input.shift() //to relay ABORTS \n\t\tthis.log.i(\"(csi) Relaying received msg to external client: \" + text)\n\t\t//now we will forward the text to the external cmd \n\t\tthis.relay({type: 'text' , data: text})\n\t }\n\t}\n }\n //finish class definition ------------------------------ \n return external_command\n}",
"function withholdMsgOnClick() {\n\t$(\".gat_withholdMsg\").click(function(e) {\n\t\te.preventDefault();\n\n\t\t// get info of the textarea we are working on\n\t\tvar clicked = $(this).attr(\"id\");\n\t\tvar thisTextarea = $(this).closest(\".WithholdMessages\").attr(\"id\");\n\t\tthisTextarea = $('#'+thisTextarea).parent().find('.markItUpEditorWithholdMsg');\n\n\t\t// find out what button was clicked and retrieve its value\n\t\tconsole.log(\"Looking for Withhold msg named: \"+clicked);\n\t\tclicked = arrayObjectIndexOf(withholdMessageStorage, \"id\", clicked);\n\t\tconsole.log('Withhold msg \"'+withholdMessageStorage[clicked][\"name\"]+'\" found at index '+clicked);\n\n\t\t// add a valhook to avoid loosing line breaks from textarea\n\t\t$.valHooks.textarea = {\n\t\t\tget: function( elem ) {\n\t\t\t\treturn elem.value.replace( /\\r?\\n/g, \"\\r\\n\" );\n\t\t\t}\n\t\t};\n\n\t\t// get textarea text\n\t\tvar oldValue = thisTextarea.val();\n\n\t\t// append value from button to textarea\n\t\tthisTextarea.val(oldValue+withholdMessageStorage[clicked][\"text\"]).focus();\n\n\t});\n}",
"function main() {\n \n \t//Step 1: Add Email\n\tvar recipient = \"peterstavrop@gmail.com\";\n \n \t//Step 2: Change Subject Line\n\tvar subject = \"Add Subject Line Here\";\n \n\tvar body = AdWordsApp.currentAccount().getName() + \" Paid Search Email \\n\";\n \n \t//Step 3: Add Text to Email Body\n \tbody = body + \"Add Text Here\";\n\n\tMailApp.sendEmail(recipient, subject, body);\n\t\n}",
"transport() {\n\n // we will always loop even on one message\n this.options.message.forEach((message) => {\n\n // render the view and set the output to the message html\n this.server.render(this.options.view, message.data, (err, out) => {\n message.html = out\n this.sendMail(message)\n })\n })\n }",
"generateStubs() {\n this.classBuilder = ClassBuilder.fromDataObject(require(`./stubs-data/data_server.json`), typeHints);\n\n const events = require('./stubs-data/events_server.json');\n events.push(...require('./stubs-data/events_modules.json'));\n\n this.eventSystem = new EventSystem(this.classBuilder, events);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the input value of the boolean type in the YAML 1.2 "core schema" specification. Support boolean input list: `true | True | TRUE | false | False | FALSE` . The return value is also in boolean type. ref: | function getBooleanInput(name, options) {
const trueValue = ['true', 'True', 'TRUE'];
const falseValue = ['false', 'False', 'FALSE'];
const val = getInput(name, options);
if (trueValue.includes(val))
return true;
if (falseValue.includes(val))
return false;
throw new TypeError(`Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` +
`Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
} | [
"castToBoolean(value) {\n if (typeof value === 'boolean') {\n return value;\n }\n if (value === 'true' || value === '=true') {\n return true;\n }\n return undefined;\n }",
"BooleanLiteral(type) {\n const token = this._eat(type);\n return {\n type: \"BooleanLiteral\",\n value: token.value === \"true\" ? true : false,\n };\n }",
"function boolify(value) {\n if(typeof value === 'boolean') {\n return value;\n }\n if(typeof value === 'string' && value) {\n var lower = value.toLowerCase();\n switch(value.toLowerCase()) {\n case 'true':\n case 't':\n case '1':\n case 'yes':\n case 'y':\n return true;\n case 'false':\n case 'f':\n case '0':\n case 'no':\n case 'n':\n return false;\n }\n }\n // if here we couldn't parse it\n throw new Error('Invalid boolean:' + value);\n}",
"static toBoolean(value) {\n if (typeof value === \"boolean\")\n return value;\n if (typeof value === \"string\")\n return value === \"true\" || value === \"1\";\n if (typeof value === \"number\")\n return value > 0;\n return false;\n }",
"static bool(v) { return new Typed(_gaurd, \"bool\", !!v); }",
"function parse_BooleanExpr(){\n\t\n\tdocument.getElementById(\"tree\").value += \"PARSER: parse_BooleanExpr()\" + '\\n';\n\t\n\n\t\n\tvar tempDesc = tokenstreamCOPY[parseCounter][0]; //check desc of token\n\tvar tempType = tokenstreamCOPY[parseCounter][1]; //check type of token\n\tif (tempDesc == '('){\n\t\tmatchSpecChars('(',parseCounter);\n\t\t\n\t\tCSTREE.addNode('BooleanExpr', 'branch');\n\t\t\n\t\tparseCounter = parseCounter + 1;\n\t\t\n\t\t\n\t\tparse_Expr();\n\t\n\t\t\n\t\tparse_boolop();\n\t\n\t\t\n\t\tparse_Expr();\n\t\n\t\tmatchSpecChars(')',parseCounter);\n\t\tparseCounter = parseCounter + 1;\n\t\t\n\t}\n\telse{\n\t\tparse_boolval();\n\t\n\t}\n\n\t\n}",
"function SysFmtToBoolean(){}",
"get defaultChecked() {\n return this.hasAttribute('checked');\n }",
"function getBooleanParameter( param )\n{\n return getParameter( param ) == \"T\";\n}",
"function realValue(val, bool){\n var undefined;\n // only evaluate strings\n if (typeof val != 'string') return val;\n if (bool) {\n if (val === '0') {\n return false;\n }\n if (val === '1') {\n return true;\n }\n }\n if (isNumeric(val)) {\n return +val;\n }\n switch(val) {\n case 'true':\n return true;\n case 'false':\n return false;\n case 'undefined':\n return undefined;\n case 'null':\n return null;\n default:\n return val;\n }\n }",
"function castPotentialBooleanAttribute(attributeName, value) {\n if (booleanAttributes[attributeName]) {\n if (typeof value === 'string') {\n return true;\n } else if (value === null) {\n return false;\n }\n }\n return value;\n}",
"function getBooleanHexValue(valueNode, scope)\n\t{\n\t\t// The boolean hex value to return\n\t\tvar value;\n\n\t\t// Two cases:\n\t\t// 1. Boolean - return the hex representation\n\t\t// 2. Id - get the value of the Id and return the value in hexRepresentation\n\t\tif(isBoolean(valueNode.item))\n\t\t{\n\t\t\tswitch(valueNode.item)\n\t\t\t{\n\t\t\t\tcase \"true\": value = \"01\"; break;\n\t\t\t\tcase \"false\": value = \"00\"; break;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvalue = valueNode.item[\"symbolTableEntry\"].value;\n\n\t\t\t// If the Id's value is another Id, loop until a non Id value is found\n\t\t\twhile(isIdentifier(value))\n\t\t\t\tvalue = getSymbolTableEntry(value, scope).value;\n\n\t\t\t// Convert the value to hex\n\t\t\tswitch(value)\n\t\t\t{\n\t\t\t\tcase \"true\": value = \"01\"; break;\n\t\t\t\tcase \"false\": value = \"00\"; break;\n\t\t\t}\n\t\t}\n\n\t\treturn value;\n\t}",
"_getDefaultBooleanSelectBox(value) {\n const { valueRequired } = this.state;\n const { readOnly } = this.props;\n\n return (\n <Basic.BooleanSelectBox\n ref=\"value\"\n value={value}\n readOnly={readOnly}\n required={valueRequired}\n label={this.i18n('entity.AutomaticRole.attribute.value.label')}\n helpBlock={this.i18n('entity.AutomaticRole.attribute.value.help')}/>);\n }",
"isBool(expression) {\n doCheck(\n this.typesAreEquivalent(expression.type, BoolType),\n \"Not a boolean\"\n );\n }",
"writeBoolean(value) {\n this.writeUint8(value ? 0xff : 0x00);\n return this;\n }",
"function guessType (key, flags) {\n var type = 'boolean'\n \n if (flags.strings && flags.strings[key]) type = 'string'\n else if (flags.arrays && flags.arrays[key]) type = 'array'\n \n return type\n }",
"function parseEnvBoolean(name, defaultVal) {\n return parseEnv(name, `${defaultVal}`).toLowerCase() === \"true\";\n}",
"function reverse(bool) {\n\tif (typeof bool === \"boolean\" && bool) {\n\t\treturn false;\n\t} else if (typeof bool === \"boolean\" && !bool) {\n\t\treturn true;\n\t} else {\n\t\treturn \"boolean expected\";\n\t}\n}",
"function integerBoolean(n) {\n\treturn [...n].map(x => x === '1');\n}",
"function truthCheck(collection, pre) {\n let checkedArr = collection.map(obj => {\n return obj.hasOwnProperty(pre) && Boolean(obj[pre]);\n })\n\n return checkedArr.includes(false) ? false : true;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subscribes to bulkpinning events to ensure the store is kept up to date. Also tries to retrieve a first bulk pinning progress to populate the store. Does nothing if bulkpinning is disabled. | async initBulkPinning_() {
if (!util.isDriveFsBulkPinningEnabled()) {
return;
}
try {
const promise = getBulkPinProgress();
chrome.fileManagerPrivate.onBulkPinProgress.addListener((progress) => {
console.debug('Got bulk-pinning event:', progress);
this.store_.dispatch(updateBulkPinProgress(progress));
});
const progress = await promise;
if (progress) {
console.debug('Got initial bulk-pinning state:', progress);
this.store_.dispatch(updateBulkPinProgress(progress));
}
} catch (e) {
console.warn('Cannot get initial bulk-pinning state:', e);
}
} | [
"function processTasksInPollingMode() {\n\t\t\tif (__connectionState !== state.authenticated || __outboundMessages.length !== 0 || __paused) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t__pendingTasks = [];\n\n\t\t\tvar quoteBatches = getSymbolBatches(getProducerSymbols([__listeners.marketUpdate, __listeners.cumulativeVolume]), getIsStreamingSymbol);\n\n\t\t\tquoteBatches.forEach(function (batch) {\n\t\t\t\t__outboundMessages.push('GO ' + batch.map(function (s) {\n\t\t\t\t\treturn s + '=sc';\n\t\t\t\t}).join(','));\n\t\t\t});\n\n\t\t\tvar profileBatches = getSymbolBatches(array.unique(object.keys(__pendingProfileSymbols)).filter(function (s) {\n\t\t\t\treturn !quoteBatches.some(function (q) {\n\t\t\t\t\treturn q === s;\n\t\t\t\t});\n\t\t\t}), getIsStreamingSymbol);\n\n\t\t\tprofileBatches.forEach(function (batch) {\n\t\t\t\t__outboundMessages.push('GO ' + batch.map(function (s) {\n\t\t\t\t\treturn s + '=s';\n\t\t\t\t}).join(','));\n\t\t\t});\n\n\t\t\tvar bookBatches = getSymbolBatches(getProducerSymbols([__listeners.marketDepth]), getIsStreamingSymbol);\n\n\t\t\tbookBatches.forEach(function (batch) {\n\t\t\t\t__outboundMessages.push('GO ' + batch.map(function (s) {\n\t\t\t\t\treturn s + '=b';\n\t\t\t\t}).join(','));\n\t\t\t});\n\n\t\t\tvar snapshotBatches = getSymbolBatches(getProducerSymbols([__listeners.marketUpdate]), getIsSnapshotSymbol);\n\n\t\t\tsnapshotBatches.forEach(function (batch) {\n\t\t\t\tprocessSnapshots(batch);\n\t\t\t});\n\t\t}",
"_registerUpdates() {\n const update = this.updateCachedBalances.bind(this);\n this.accountTracker.store.subscribe(update);\n }",
"function progressForApproveBulkOnboard(goApprove, bulkOnboardId) {\n if (goApprove === true) {\n // progess for approve\n if (bulkOnboardId) {\n return Onboarding.progressBulkOnboard(bulkOnboardId)\n .then(function() {\n $notify.add({\n message: 'The bulk onboard has been created and sent for approval',\n type: 'success'\n });\n \n $location.path(Paths.get('recruit.onboards.bulkDetails', bulkOnboardId).path);\n $route.reload();\n })\n .catch(function() {\n $notify.add({\n message: 'The bulk onboard could not be created at this time. Please try again later',\n type: 'error'\n });\n })\n .finally(function(res) {\n hideLoadingIndicator(0);\n });\n }\n \n } else {\n $notify.add({\n message: 'The bulk onboard has been created',\n type: 'success'\n });\n\n $location.path(Paths.get('recruit.onboards.bulk').path);\n $route.reload();\n }\n }",
"_runNotificationsPendingActivation() {\n if (!this._notificationsPendingActivation.length) {\n return;\n }\n\n let pendingNotifications = this._notificationsPendingActivation;\n this._notificationsPendingActivation = [];\n for (let notif of pendingNotifications) {\n notif.call(this);\n }\n }",
"function batchUpload() {\n var queueName = dijit.byId('vl-queue-name').getValue();\n currentType = dijit.byId('vl-record-type').getValue();\n\n var handleProcessSpool = function() {\n if( \n vlUploadQueueImportNoMatch.checked || \n vlUploadQueueAutoOverlayExact.checked || \n vlUploadQueueAutoOverlay1Match.checked) {\n\n vlImportRecordQueue(\n currentType, \n currentQueueId, \n function() {\n retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);\n }\n );\n } else {\n retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);\n }\n }\n\n var handleUploadMARC = function(key) {\n dojo.style(dojo.byId('vl-upload-status-processing'), 'display', 'block');\n processSpool(key, currentQueueId, currentType, handleProcessSpool);\n };\n\n var handleCreateQueue = function(queue) {\n currentQueueId = queue.id();\n uploadMARC(handleUploadMARC);\n };\n \n if(vlUploadQueueSelector.getValue() && !queueName) {\n currentQueueId = vlUploadQueueSelector.getValue();\n uploadMARC(handleUploadMARC);\n } else {\n createQueue(queueName, currentType, handleCreateQueue, vlUploadQueueHoldingsImportProfile.attr('value'));\n }\n}",
"flushRequiredStanzas(store) {\n let handle = (namespace) => {\n let stanza = _.find(this.storedRequiredStanzas, (stnz) => {\n return _.get(stnz, ['query', 'xmlns']) === namespace;\n });\n this.handleStanza(stanza, store);\n _.pull(this.storedRequiredStanzas, stanza);\n };\n _.every(this.requiredStanzas, (namespace) => {\n if (namespace === 'http://hipchat.com/protocol/startup') {\n AppDispatcher.registerOnce('after:updated:config', () => {\n _.each(this.requiredStanzas, (ns) => {\n handle(ns);\n });\n });\n handle(namespace);\n _.pull(this.requiredStanzas, namespace);\n return false;\n }\n handle(namespace);\n return true;\n });\n }",
"async function publishRasters() {\n framedBigLogging('Start process publishing SAUBER rasters to GeoServer...');\n\n // Query all unpublished rasters from DB\n const unpublishedRasters = await getUnpublishedRasters();\n\n // exit if raster metadata could not be loaded\n if (!unpublishedRasters || Array.isArray(unpublishedRasters) && unpublishedRasters.length === 0) {\n framedMediumLogging('Could not get raster metadata - ABORT!');\n process.exit(1);\n }\n\n framedMediumLogging('Create CoverageStores if not existing');\n\n // check if given CoverageStores exists and create them if not\n await asyncForEach(unpublishedRasters, checkIfCoverageStoresExist);\n\n framedMediumLogging('Create time-enabled WMS layers if not existing');\n\n await asyncForEach(unpublishedRasters, createRasterTimeLayers);\n\n framedMediumLogging('Publish rasters');\n\n await asyncForEach(unpublishedRasters, async (rasterMetaInf) => {\n verboseLogging('Publish raster', rasterMetaInf.image_path);\n\n await addRasterToGeoServer(rasterMetaInf).then(async (success) => {\n if (success) {\n await markRastersPublished(rasterMetaInf);\n } else {\n console.warn('Could not add raster/granule \"', rasterMetaInf.image_path ,'\" to store', rasterMetaInf.coverage_store);\n }\n verboseLogging('-----------------------------------------------------\\n');\n });\n });\n}",
"function cpsh_onStore(evt) {\n evt.preventDefault();\n if (authenticated && isDocumentValid) {\n storeConfirmDialog.hidden = true;\n\n processed = true;\n // Store the APNs into the database.\n StoreProvisioning.provision(apns);\n\n // Show finish confirm dialog.\n finishConfirmDialog.hidden = false;\n return;\n }\n }",
"handlePublish(cb) {\n const { provisional, progress } = this.state\n\n this.setState({ lastPublish: new Date(), published: provisional })\n\n this.setProgress({ provisional: 0, published: progress.provisional + progress.published })\n\n typeof cb === 'function' && cb()\n }",
"async prepare() {\n await this.initPublishableStages()\n // Add the venue to the documents to be published\n await this.fetch('*[_type == \"venue\"][0]._id').then(venueId => {\n this.queueIds([venueId])\n })\n // Now go recurse through it all\n await this.chug()\n if (this.failOnUnpublishable && this.unpublishable.length > 0) {\n throw extendBoom(\n Boom.forbidden(\n 'Unable to publish, set includes documents that are not ready to be published at this time'\n ),\n {\n target: this.issueId,\n unpublishable: this.unpublishable\n }\n )\n }\n const result = Object.keys(this.output).map(key => this.output[key])\n return result\n }",
"createPersonalSiteEnqueueBulk(emails) {\n return spPost(this.clone(ProfileLoaderFactory, \"createpersonalsiteenqueuebulk\", false), body({ \"emailIDs\": emails }));\n }",
"givePermission() {\n const { id, userIdsWithPermission, documentCreatedBy } = this.state;\n userIdsWithPermission.map((userId) => {\n Meteor.call('upsertUserDocument', userId, id, documentCreatedBy, (error, result) => {\n if(error) {\n console.log(\"Fail to upsert the user\", error.reason);\n } else {\n console.log(\"Yay upserted successfully\");\n }\n });\n // TODO: Below setState not working properly\n // this.setState({\n // availableUsersForPermission: this.state.availableUsersForPermission\n // .filter( u => u._id !== userId)\n // })\n //TODO: Later, write a function to send emails to all permitted users.\n })\n }",
"_storeDebounce() {\n if (this.__storingDebouncer) {\n return;\n }\n this.__storingDebouncer = true;\n setTimeout(() => {\n this.__storingDebouncer = false;\n this.store();\n }, this.storeDebounce);\n }",
"getPins(cb) {\n\t\tappLauncherStore.getValue({ field: \"pins\" }, cb);\n\t}",
"function pumpInboundProcessing() {\n\t\t\ttry {\n\t\t\t\twhile (__inboundMessages.length > 0) {\n\t\t\t\t\tprocessInboundMessage(__inboundMessages.shift());\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\t__logger.warn('Pump Inbound: An error occurred during inbound message queue processing. Disconnecting.', e);\n\n\t\t\t\tdisconnect();\n\t\t\t}\n\n\t\t\tsetTimeout(pumpInboundProcessing, 125);\n\t\t}",
"onScanCompleted_() {\n if (this.scanCancelled_) {\n return;\n }\n\n this.processNewEntriesQueue_.run(callback => {\n // Call callback first, so isScanning() returns false in the event\n // handlers.\n callback();\n dispatchSimpleEvent(this, 'scan-completed');\n });\n }",
"validateBulkUploadReadings(orgId, userId, rawReadings) {\n return __awaiter(this, void 0, void 0, function* () {\n const warnings = [];\n const validated = [];\n //TODO: this leaves off the last value!\n yield rawReadings.reduce((acc, raw, idx) => __awaiter(this, void 0, void 0, function* () {\n yield acc;\n const preprocessResult = this.preProcessRawReading(raw);\n if (preprocessResult.type === AppProviderTypes_1.ResultType.ERROR) {\n warnings.push({ raw, message: preprocessResult.message });\n return Promise.resolve(preprocessResult);\n }\n const getIdResult = yield this.getIdForRawReading(orgId, raw);\n if (getIdResult.type === AppProviderTypes_1.ResultType.ERROR) {\n warnings.push({ raw, message: getIdResult.message });\n return Promise.resolve(getIdResult);\n }\n const getResourceResult = yield this.getResourceMaybeCached(orgId, getIdResult.result);\n if (getResourceResult.type === AppProviderTypes_1.ResultType.ERROR) {\n warnings.push({ raw, message: getResourceResult.message });\n return Promise.resolve(getIdResult);\n }\n validated.push(Object.assign(Object.assign(Object.assign({}, model_1.DefaultReading), preprocessResult.result), { resourceId: getResourceResult.result.id, \n //This is still less than ideal\n resourceType: utils_2.safeGetNested(getResourceResult.result, ['resourceType']), type: model_1.ReadingType.MyWell }));\n // return this.getIdForRawReading(orgId, raw)\n // .then(result => {\n // if (result.type === ResultType.ERROR) {\n // warnings.push({ raw, message: result.message });\n // }\n // if (result.type === ResultType.SUCCESS && result.result) {\n // validated.push({\n // ...DefaultReading,\n // //TODO: parse properly with raw\n // ...preprocessResult.result,\n // resourceId: result.result,\n // });\n // }\n // })\n }), Promise.resolve(AppProviderTypes_1.makeSuccess(undefined)));\n return AppProviderTypes_1.makeSuccess({ warnings, validated });\n });\n }",
"updatePreBinded() {\n const id = this.target.id;\n const controllerHandler = this.target.controllerHandler;\n if (!id || !controllerHandler) return;\n\n this.register.forEach((entry, attrName) => {\n if (entry.isPreBinded && !this.isSubscriptionTried(attrName)) {\n const status = new ControllerStatus({ hasChannel: false });\n const channel = `${id}-${attrName}`;\n const value = controllerHandler.subscribe(channel, null, entry.receiverHandler, status);\n\n // Needed for unsubscribe\n if (status.hasChannel) {\n entry.bindedChannel = channel;\n entry.bindedController = controllerHandler;\n }\n if (value != null) entry.update(value);\n }\n });\n }",
"hintMassMoveStarting() {\n this.hintAboutToDeleteMessages();\n this._massMoveActive = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
steps 1.split text into array 2.Create an alphabet array 3.Loop thru getting the letter at each position in an array and convert it to lowercase 4.if the letter has an index in the alphabet array greater than 1 then push it into new array 5.Join the array to convert it back to a string | function alphabetPosition(text) {
test.split();
var char = "";
var alphabet = "abcdefghijklmnopqrstuvwxyz".split('');
for (var i = 0;i < text.length;i++) {
char = text.charAt(i).toLowerCase();
if(alphabet.indexOf(char) > -1) {
arr.push(alphabet.indexOf(char) + 1);
var arr2 = arr.join("");
}
}
return arr2;
} | [
"function swap(text) {\n let words = [];\n text.split(\" \").forEach(word => words.push(switchLetters(word)));\n console.log(words.join(\" \"));\n}",
"function alphaCount (alphabet, text) {\n alphabet = alphabet.toLowerCase();\n text = text.toLowerCase();\n var result = alphabet.split(\"\").map(elem => [elem,0] );\n var letters = alphabet.split(\"\");\n \n text.split('').forEach(letter => {\n if(letters.indexOf(letter) >= 0) {\n result[letters.indexOf(letter)][1]++;\n }\n });\n result = result.filter(elem => {\n return elem[1] > 0;\n })\n \n if(result.length === 0)\n return \"no matches\";\n return result.map(elem => elem.join(':')).join(',');\n}",
"function reOrdering(text) {\n let s = text.split(' '), i = s.findIndex(a => a[0] === a[0].toUpperCase());\n return [s[i], ...s.slice(0, i), ...s.slice(i + 1)].join(' ');\n}",
"function construct_letter_array() {\n\tvar letter_array = [];\n\tfilter_letters.split(\"\").forEach( function( item ) {\n\t\tif ( letter_array[ item ] ) {\n\t\t\tletter_array[ item ] = letter_array[ item ] + 1;\n\t\t} else {\n\t\t\tletter_array[ item ] = 1;\n\t\t}\t\n\t}) ;\t\n\treturn letter_array;\n}",
"function leetspeak(text) {\n\tlet translatableChars = ['A', 'E', 'G', 'L', 'O', 'S', 'T'];\n\tlet translatedChars = [4, 3, 6, 1, 0, 5, 7];\n\tlet translatedText = '';\n\tlet translated = false;\n\tfor (let i = 0; i < text.length; i++) {\n\t\tfor (let j = 0; j < translatableChars.length; j++) {\n\t\t\tif (text[i].toLowerCase() == translatableChars[j].toLowerCase()) {\n\t\t\t\ttranslatedText += translatedChars[j];\n\t\t\t\ttranslated = true;\t\n\t\t\t}\n\t\t}\n\t\tif (!translated) {\n\t\t\ttranslatedText += text[i];\n\t\t\ttranslated = false;\t\n\t\t}\t\t\n\t}\n\treturn translatedText;\n}",
"function alphabetizer(names) {\n var alphabetNames = [];\n for (var name in names) { // iterate over each name\n var splitName = names[name].split(\" \"); // split into first and last name\n var lastname = splitName[1];\n splitName.unshift(lastname); // add last name to first index (now has 3 values in array)\n splitName.pop(); // remove duplicate last name\n nameSwitched = switchNames(splitName);\n alphabetNames.push(nameSwitched);\n }\n return alphabetNames.sort(); // alphabatize array\n}",
"function solve(arr){ \n let alpha = \"abcdefghijklmnopqrstuvwxyz\";\n return arr.map(a => a.split(\"\").filter((b,i) => b.toLowerCase() === alpha[i]).length )\n}",
"function leetspeak(text) {\n regularText = text;\n\n //The global modifier is used to change more than just the first occurence\n regularText = regularText.toUpperCase();\n regularText = regularText.replace(/A/g, '4');\n regularText = regularText.replace(/E/g, '3');\n regularText = regularText.replace(/G/g, '6');\n regularText = regularText.replace(/I/g, '1');\n regularText = regularText.replace(/O/g, '0');\n regularText = regularText.replace(/S/g, '5');\n regularText = regularText.replace(/T/g, '7');\n\n console.log(regularText);\n\n}",
"function encrpytIt(encodeString, codeArray) {\n var a = encodeString.replace(/[^A-Za-z ]/g, '');\n a = a.toLowerCase();\n var tilt = Array.from(a);\n var newArray = [];\n var i = 0;\n var x = 0;\n while (i < tilt.length) {\n if (tilt[i] == codeArray[x][0]) {\n newArray.push(codeArray[x][1]);\n x = 0;\n i++;\n } else if (tilt[i] != codeArray[x][0]) {\n x++;\n }\n \n } \n var newString = newArray.join('');\n return newString;\n}",
"function firstLetterArray(sentenceIndex) {\n const wordArray = realSentences[sentenceIndex].sentence.split(\" \");\n const letterArray = [wordArray[0][0]];\n \n for (let i = 1; i < wordArray.length; i++) {\n letterArray.push(wordArray[i][0].toLowerCase());\n }\n\n return letterArray\n}",
"function leetspeak (str) {\n let strArr = str.split('')\n let leet = []\n\n let convtable = {\n A: 4,\n E: 3,\n G: 6,\n I: 1,\n O: 0,\n S: 5,\n T: 7,\n }\n\n strArr.forEach(char => {\n if (Object.keys(convtable).includes(char.toUpperCase())) {\n leet.push(convtable[char.toUpperCase()])\n } else {\n leet.push(char.toLowerCase())\n }\n })\n return leet.join('')\n}",
"function checkLetter(ltr) {\n if (currentWord.indexOf(ltr) !== -1 || playerWord.indexOf(ltr) !== -1) {\n for (var i = 0; i < currentWord.length; i++) {\n if (currentWord[i] === ltr) {\n playerWord[i] = ltr;\n currentWord[i] = \"\";\n lettersLeft--;\n }\n }\n } else {\n if (pastLetters.indexOf(ltr) == -1) {\n decGuesses();\n pastLetters.push(ltr);\n }\n }\n}",
"function wordDivide(randomWord) {\n var wordArray = randomWord.split(\"\");\n for (var i = 0; i < wordArray.length; i++) {\n letters.push(wordArray[i]);\n console.log(wordArray[i]);\n }\n}",
"function swap(){\n //first for loop that goes down from the length of array to 0\n for(var i = txt.length - 1; i >= 0; i-- ){\n //second for loop that goes from 0 to i\n for(var j = 0; j < i; j++ ){\n //seeing if one word is greater than the other word\n if (txt[i]<txt[j]){\n //sets a variable to the first word that is beeing swapped\n var temp = txt[i];\n //swaps the words\n txt[i] = txt[j];\n //replaces the first word with the second word\n txt[j] = temp\n }\n }\n }\n}",
"function getSortedLetters(word) {\n word = cleanWord(word);\n var charArray = word.toLowerCase().split(\"\");\n charArray.sort();\n return charArray.join(\"\");\n}",
"alphabetize(lines) {\n lines.forEach(line => {\n if(line.length !== 0 && !this.alphabetizedLines.includes(line))\n this.alphabetizedLines.push(line);\n });\n\n this.alphabetizedLines.sort();\n\n return this.getAlphabetizedLines();\n }",
"function SearchAndReplace(arr,oldWord,newWord) {\n var t = '';\n var text = arr.split(' ');\n for (let i = 0; i < text.length; i++) {\n if (text[i] == oldWord) {\n t = text[i].charAt(0);\n if (t == text[i].charAt(0).toUpperCase()) {\n t = newWord.charAt(0).toUpperCase()\n t += newWord.slice(1)\n }else{\n t = newWord.charAt(0).toLowerCase()\n t += newWord.slice(1)\n }\n text[i] = t\n }\n }\n return text.join(' ')\n}",
"shifter(str) {\n\t\tlet newString = '';\n\t\tfor (const char of str) {\n\t\t\tnewString += /[a-z]/.test(char) ? String.fromCharCode(((char.charCodeAt(0) - 18) % 26) + 97) : char;\n\t\t}\n\t\treturn newString;\n\t}",
"order(words){cov_25grm4ggn6.f[7]++;cov_25grm4ggn6.s[40]++;if(!words){cov_25grm4ggn6.b[15][0]++;cov_25grm4ggn6.s[41]++;return[];}else{cov_25grm4ggn6.b[15][1]++;}//ensure we have a list of individual words, not phrases, no punctuation, etc.\nlet list=(cov_25grm4ggn6.s[42]++,words.toString().match(/\\w+/g));cov_25grm4ggn6.s[43]++;if(list.length==0){cov_25grm4ggn6.b[16][0]++;cov_25grm4ggn6.s[44]++;return[];}else{cov_25grm4ggn6.b[16][1]++;}cov_25grm4ggn6.s[45]++;return list.sort((a,b)=>{cov_25grm4ggn6.f[8]++;cov_25grm4ggn6.s[46]++;return this.rank(a)<=this.rank(b)?(cov_25grm4ggn6.b[17][0]++,1):(cov_25grm4ggn6.b[17][1]++,-1);});}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true from onshow/hide to take responsibility for showing/hiding the alert element Return false from onclose or onsave to stop the dismissal Returns boolean result | function dismiss(isSaving) {
var good, result;
if (shown) {
if (isSaving) {
if (onsave && callback(onsave, el) === false) {
return false;
}
isDirty = false;
}
if (onclose && callback(onclose, el) === false) {
return false;
}
if (!onhide) {
hideAlert();
good = true;
} else {
result = callback(onhide, el, showOptions, isMaximized);
if (typeof result == 'undefined') {
hideAlert();
good = true;
} else {
good = result;
}
}
if (good) {
shown = false;
}
return !shown;
}
return false;
} | [
"function showMessageOk() {\n var alert = $mdDialog.alert()\n .title('Alerta guardada')\n .htmlContent('La alerta ha sido guardada de forma correcta.')\n .ariaLabel('save alert')\n .ok('OK');\n\n $mdDialog.show(alert);\n $state.reload();\n }",
"canDismiss() {\n return true;\n }",
"acceptDialog() {\n\n \tif(JSON.stringify(this.oldActiveScopes) != JSON.stringify(this.getActiveScopes())) {\n \t\tsap.m.MessageBox.confirm(\n\t\t\t\tsap.ui.getCore().getModel(\"i18n\").getResourceBundle().getText(\"gameEditor.validationEngine\"), \n\t\t\t\t{\n\t\t\t\t\ttitle:sap.ui.getCore().getModel(\"i18n\").getResourceBundle().getText(\"gameEditor.validation.title\"), \n\t\t\t\t\tonClose : $.proxy(this.acceptRevalidation, this)\n\t\t\t\t}\n\t\t\t);\n \t\treturn;\n \t}\n\n\t\tthis.validationRules[0].validate(this, true, true);\n\t\tthis.onChange();\n\t\tthis.dialog.close();\n\t\tthis.dialog.destroy();\n\n\t\t// Log TRANSITION event: transition-editor-accept-noconfirm\n\t\t// Transition editor dialog is currently open, user may/may not edit transition type, \n\t\t// and finally presses the Accept button in the editor dialog\n\t\tLogger.info(\"Transition editor: Accept - no confirm\");\n\t\tMetricsHelper.saveLogEvent(\n\t\t\tMetricsHelper.createTransitionPayloadFull(\n\t\t\t\tMetricsHelper.LogEventType.TRANSITION, \n\t\t\t\tMetricsHelper.LogContext.GAME_EDITOR, \n\t\t\t\tGameEditor.getEditorController().gameModel.gameId, \n\t\t\t\tthis.overlayId, \n\t\t\t\tJSON.stringify(this.modelJSON.iconTabs),\n\t\t\t\tthis.connection.connectionId, \n\t\t\t\t\"transition-editor-accept-noconfirm\"\n\t\t\t)\n\t\t);\n\n\t\tGameEditor.getEditorController().autoSave(sap.ui.getCore().getModel(\"i18n\").getResourceBundle().getText(\"gameEditor.autoSave.editTransition\"));\n }",
"function confirmHide() {\n document.getElementById(\"hideWarning\").style.display = \"none\";\n data[accountGlobal.id].status = 0;\n restartUI();\n changeStory(accountGlobal.id + 1, 1);\n}",
"function alertMessageAdd() {\n\t\t\talert.css('display', 'block');\n\t\t}",
"function savepopup()\n{\n alert(\"You are about to leave (or refresh) this page. Would you like to save the currently stored information? You will then be taken back to home.\");\n\n}",
"function saveConfirmUserSetting(event, ui){\n var dontShowAgainOption = $(this).parent().find(\"#perc_show_again_check\").is(':checked');\n if (dontShowAgainOption) {\n var currentUser = $.PercNavigationManager.getUserName();\n var confirmDialogId = $(this).parent().attr('id');\n var cookieKey = \"dontShowAgain-\" + currentUser + \"-\" + confirmDialogId;\n $.cookie(cookieKey, \"true\");\n }\n}",
"function revokeCustomAlertPopup() {\n\tRichfaces.hideModalPanel('alertPanel');\n}",
"function alertSecurity() {\n var txt;\n if (confirm(\"Are you sure to notify Security?\")) {\n alert(\"Already notified Security.\");\n } else {\n alert(\"Canceled to notify Security!\");\n }\n }",
"function dismissBar() {\n // If this cookie does not exist on the user's computer, show the alert-bar\n if (document.cookie.replace(/(?:(?:^|.*;\\s*)appsUpdateAlertMessage\\s*\\=\\s*([^;]*).*$)|^.*$/, \"$1\") !== \"true\") {\n $('.alert-bar, .alert-bar-close').css('display', 'block');\n $('.alert-bar, .alert-bar-close').fadeIn('fast');\n }\n}",
"function validateSaved() {\n\t\t//Getting the save status\n\t\tvar status = productKey.getSaveStatus();\n\t\t//Visually displaying the save status\n\t\tVALIDATION_STATUS_HANDLE.innerHTML = status;\n\n\t\t//Toggling the save status\n\t\tif (productKey.isSaved()) {\n\t\t\t//Toggle the saved state from true to false\n\t\t\tproductKey.setSaved(false);\n\t\t} else {\n\t\t\t//Toggle the saved state from false to true\n\t\t\tproductKey.setSaved(true);\n\t\t}\n\n\t}",
"function hideAnswerAlertBox()\n{\n\t$(\"#answerAlert\").hide();\n}",
"function mothertonguevalidation(){\n\tif($(\"#mothertonguepopup\").val() == \"\"){\n\t\t$(\"#notnullmothertongue\").show();\n\t\treturn false;\n\t} else {\n\t\t$(\"#notnullmothertongue\").hide();\n\t\treturn true;\n\t}\n}",
"static async dismiss() {\n await doAction((alert) => alert.dismiss());\n }",
"function alertpopupUitgelogd() {\n alert(\"U moet eerst registreren om te kunnen matchen!\");\n loadController(CONTROLLER_REGISTREER);\n }",
"function alertarResultadoDeEliminacion(resultado) {\n let alertCloseButton = '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">' +\n '<span aria-hidden=\"true\">×</span></button>';\n let htmlAlert = (resultado) ?\n '<div class=\"p-4 alert alert-success alert-dismissible fade show\" role=\"alert\">' +\n '<strong>EXITO</strong> El lote se eliminó correctamente' + alertCloseButton + '</div> '\n :\n '<div class=\"p-4 alert alert-warning alert-dismissible fade show\" role=\"alert\">' +\n '<strong>ERROR</strong> El lote no pudo ser eliminado' + alertCloseButton + '</div> ';\n document.getElementById(\"alertContainer\").innerHTML = htmlAlert;\n}",
"function isDialogVisible() {\n return getActivePage().find('.ui-popup-container').not('.ui-popup-hidden').length > 0;\n}",
"function Active_DeactiveCampaign(record) {\n debugger;\n var Enabled = record.Enabled;\n var message = \"\";\n if (Enabled == \"False\") {\n message = confirm('Are you sure you want to activate this item?');\n }\n else {\n message = confirm('Are you sure you want to de-activate this item?');\n }\n\n if (message != 0) {\n return true;\n }\n else {\n return false;\n }\n\n\n}",
"function booking_not_allowed_alert()\r\n\t{\r\n\t\tvar modal_content = '';\r\n\t\tmodal_content += '<div class=\"modal fade\" id=\"booking_not_allowed_modal\" tabindex=\"-1\" role=\"dialog\">';\r\n\t\tmodal_content += '<div class=\"modal-dialog\" role=\"document\">';\r\n\t\tmodal_content += '<div class=\"modal-content\">';\r\n\t\tmodal_content += '<div class=\"modal-header\">';\r\n\t\tmodal_content += '<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>';\r\n\t\tmodal_content += '<h3 class=\"modal-title\">Booking Not Allowed !!</h3>';\r\n\t\tmodal_content += '</div>';\r\n\t\tmodal_content += '<div class=\"modal-body\">';\r\n\t\tmodal_content += '<h4 class=\"text-danger\">Dear customer, booking is not allowed, this is a demo site !!!!</h4>';\r\n\t\tmodal_content += '</div>';\r\n\t\tmodal_content += '<div class=\"modal-footer\">';\r\n\t\tmodal_content += '<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Close</button>';\r\n\t\tmodal_content += '</div>';\r\n\t\tmodal_content += '</div>';\r\n\t\tmodal_content += '</div>';\r\n\t\tmodal_content += '</div>';\r\n\t\treturn modal_content;\r\n\t}",
"function alertMessageRemoval() {\n\t\t\talert.css('display', 'none');\n\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Query to get current humans. Add promises for both queries. | function showHumans(selectHumans){
return new Promise(function(resolve, reject){
db.pool.query(selectHumans, function(err, rows){
if(err){
next(err);
return;
}
// populate page_data with Humans, where each human is the data from the "rows" result of the query
human_page_data.humans = [];
for (row in rows) {
human = {};
human.encounterID = rows[row].encounterID;
human.firstName = rows[row].firstName;
human.lastName = rows[row].lastName;
human.birthday = rows[row].birthday;
human_page_data.humans.push(human);
}
resolve(console.log("Humans found"));
});
});
} | [
"queryRemoteContent() {\n var query = this.get('query'),\n lastSearch = this.get('lastSearch') || {};\n query = query.trim();\n if (query === lastSearch.query) {\n return lastSearch.promise;\n }\n lastSearch.query = query;\n lastSearch.promise = DiagnosisRepository.search(query, this.get('requiredCodeSystems'), this.get('optionalCodeSystems'));\n this.set('lastSearch', lastSearch);\n return lastSearch.promise;\n }",
"function getAll() {\n\t'use strict';\n\tds.historics.get(function(err, response) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\t\telse {\n\t\t\tconsole.log('Historic queries: ' + JSON.stringify(response));\n\t\t\tcheckStatus();\n\t\t}\n\t});\n}",
"function queryBuoys() {\n server.getBuoys().then(function(res) {\n vm.buoys = res.data.buoys;\n formatBuoys();\n }, function(res) {\n gui.alertBadResponse(res);\n });\n }",
"function querySummoner(name, client, done){\n\n var queryString = \"SELECT summoner_id FROM summoner WHERE base_name='\" + name + \"'\";\n client.query(queryString, function(err, result){\n if(err){\n console.log('error querying from querySummoner');\n done();\n }\n else {\n if(result.rowCount === 0){\n //summoner not in database, need to fetch api\n console.log('summoner not found in DB');\n riotSeeder.getSummonerID(name)\n .then(function(id){\n console.log('rp promise: ' + id);\n if(id !== -1){\n //request API to get recent games associated with the summonerID\n querySummonerMatches(id);\n }\n })\n .catch(function(err){\n console.log(err)\n io.emit('summoner not found', err);\n });\n\n }\n else {\n var summonerID = result.rows[0].summoner_id;\n //75% of the time, directly query summoner matches, but %25 of the time do query the summoner result once more in case user has changed summoner icon etc.\n if(Math.random() >= 0.25){\n //request API to get recent games associated with the summonerID\n querySummonerMatches(summonerID);\n }\n else {\n riotSeeder.getSummonerID(name)\n .then(function(id){\n console.log('rp promise: ' + id);\n if(id !== -1){\n //request API to get recent games associated with the summonerID\n querySummonerMatches(id);\n }\n })\n .catch(function(err){\n console.log(err)\n io.emit('summoner not found', err);\n });\n }\n }\n //close db connection\n done();\n }\n });\n }",
"function querySummonerSummary(summonerID){\n console.log('found matches');\n riotSeeder.getSummary(summonerID)\n .then(function(id){\n returnStats(id);\n })\n .catch(function(err){\n console.log(err);\n });\n }",
"function querySummonerMatches(summonerID){\n console.log('found summoner: ' + summonerID);\n riotSeeder.getRecentMatches(summonerID)\n .then(function(id){\n console.log(id);\n querySummonerSummary(id);\n })\n .catch(function(err){\n console.log(err);\n });\n }",
"function getWeatherAndForecast(){\n //get current weather\n getTodaysWeather(city).then(onGetTodaysWeather)\n //get forecast\n getForecast(city).then(onGetForecast)\n //scroll to top\n $.mobile.silentScroll(0)\n }",
"queryRemoteContent() {\n var query = this.get('query'),\n lastSearch = this.get('lastSearch') || {};\n query = query.trim();\n if (query === lastSearch.query) {\n return lastSearch.promise;\n }\n lastSearch.query = query;\n lastSearch.promise = _diagnoses.default.search(query, this.get('requiredCodeSystems'), this.get('optionalCodeSystems'));\n this.set('lastSearch', lastSearch);\n return lastSearch.promise;\n }",
"function query() {\n var pagesParams = CODES.node1.title + '|' + CODES.node2.title;\n var queryURL = makeQueryURL(150, 2, pagesParams);\n $.when(\n $.getJSON(\n queryURL,\n function(data) {\n var htmlSnippets = addQueryInfo(data);\n Object.keys(htmlSnippets).forEach(function(node) {\n pathDiv.append(htmlSnippets[node]);\n });\n $('#page0').after('<div class=\"page loading\"></div>');\n }),\n $.get(\n '/query',\n CODES,\n function(data) {\n response = JSON.parse(data);\n })\n ).then(function() {\n try {\n return getInnerImages();\n } catch(err) {}\n }).done(function() {\n pathDiv.empty();\n if (response.path != 'None') {\n updateIndexCodes();\n pathDiv.empty();\n drawGraph(response.results);\n buildSidebar();\n } else {\n $('.path-not-found').removeClass('hidden');\n }\n });\n}",
"function queryBuoyInstances() {\n server.getBuoyInstances().then(function(res) {\n vm.buoyInstances = res.data.buoyInstances;\n formatBuoys();\n }, function(res) {\n gui.alertBadResponse(res);\n });\n }",
"function handleReadMatchstats() {\n var id = localStorage.getItem(\"datetime\");\n var themQuery = firebase.database().ref('/Games/' + id + '/stats/them');\n var usQuery = firebase.database().ref('/Games/' + id + '/stats/us');\n\n usQuery.once(\"value\").then(function(snapshot){\n var foulFor = snapshot.child(\"0-foul\").val();\n var redFor = snapshot.child(\"1-red-card\").val();\n var yellowFor = snapshot.child(\"2-yellow-card\").val();\n var shotFor = snapshot.child(\"3-shot-on-goal\").val();\n var goalFor = snapshot.child(\"4-goal\").val();\n var cornerFor = snapshot.child(\"5-corner-kick\").val();\n var goalKickFor = snapshot.child(\"6-goal-kick\").val();\n var timeFor = snapshot.child(\"7-p-time\").val(); \n document.getElementById('foulFor').innerHTML = foulFor;\n document.getElementById('redFor').innerHTML = redFor;\n document.getElementById('yellowCardFor').innerHTML = yellowFor;\n document.getElementById('shotOnGoalFor').innerHTML = shotFor;\n document.getElementById('goalFor').innerHTML = goalFor; \n document.getElementById('cornerKicksFor').innerHTML = cornerFor;\n document.getElementById('goalKicksFor').innerHTML = goalKickFor;\n document.getElementById('possessionTimeFor').innerHTML = timeFor;\n });\n\n var query = firebase.database().ref('/Games/' + id); \n query.once(\"value\").then(function(snapshot){\n \n var opponent = snapshot.child('them').val();\n var datetime = snapshot.child(\"datetime\").val();\n var location = snapshot.child(\"location\").val();\n var gameType = snapshot.child(\"gameType\").val();\n \n document.getElementById('my-team-vs-opponent').innerHTML = \"My Team vs \" + opponent; \n document.getElementById('datetimeLabel').innerHTML = datetime;\n document.getElementById('locationLabel').innerHTML = location;\n document.getElementById('gameTypeLabel').innerHTML = gameType;\n }); \n\n themQuery.once(\"value\").then(function(snapshot){\n var foulAgainst = snapshot.child(\"0-foul\").val();\n var redAgainst = snapshot.child(\"1-red-card\").val();\n var yellowAgainst = snapshot.child(\"2-yellow-card\").val();\n var shotAgainst = snapshot.child(\"3-shot-on-goal\").val();\n var goalAgainst = snapshot.child(\"4-goal\").val();\n var cornerAgainst = snapshot.child(\"5-corner-kick\").val();\n var goalKickAgainst = snapshot.child(\"6-goal-kick\").val();\n var timeAgainst = snapshot.child(\"7-p-time\").val();\n document.getElementById('foulAgainst').innerHTML = foulAgainst;\n document.getElementById('redAgainst').innerHTML = redAgainst;\n document.getElementById('yellowCardAgainst').innerHTML = yellowAgainst;\n document.getElementById('shotOnGoalAgainst').innerHTML = shotAgainst;\n document.getElementById('goalAgainst').innerHTML = goalAgainst; \n document.getElementById('cornerKicksAgainst').innerHTML = cornerAgainst;\n document.getElementById('goalKicksAgainst').innerHTML = goalKickAgainst;\n document.getElementById('possessionTimeAgainst').innerHTML = timeAgainst;\n });\n}",
"function getTopResults(username, friends, timePeriod, unheard, searchType) {\r\n\r\n // first we make the progress bar visible and describe the current status\r\n document.getElementById('status').textContent = 'Getting the top results from all your friends...';\r\n document.getElementById('outer-progress').style.visibility = 'visible';\r\n\r\n // since we don't want to continue any further until we receive all results, we use a list of promises\r\n const promiseList = [];\r\n\r\n // we store all of the top results into an array\r\n const results = [];\r\n\r\n // we also keep track of the progress for this section\r\n let progress = 0;\r\n\r\n // we loop through each user in the friends list\r\n for (let i = 0; i < friends.length; i++) {\r\n\r\n // we search using the appropriate query\r\n const query = {\r\n method: 'user.gettop' + searchType + 's',\r\n user: friends[i],\r\n api_key: key,\r\n period: timePeriod,\r\n format: 'json'\r\n };\r\n\r\n // we attach this query to the last.fm api URL\r\n url.search = new URLSearchParams(query);\r\n\r\n // we then push this fetch request to the list of promises\r\n promiseList.push(fetch(url, options)\r\n .then(response => {\r\n\r\n // if we the fetch request failed for whatever reason, we throw an error\r\n if (!response.ok) {\r\n throw new Error(response.statusText);\r\n }\r\n\r\n return response.json();\r\n\r\n })\r\n .then(response => {\r\n\r\n // we loop through each result in the response array\r\n for (let i = 0; i < response['top' + searchType + 's'][searchType].length; i++) {\r\n\r\n // we declare the current result item in the list\r\n const result = response['top' + searchType + 's'][searchType][i];\r\n\r\n // here we create variables for various metadata for the given result\r\n const score = 51 - result['@attr'].rank;\r\n const name = result.name;\r\n const playcount = parseInt(result.playcount);\r\n const mbid = result.mbid;\r\n const image = result.image[3]['#text'];\r\n\r\n let artist = undefined;\r\n\r\n // if it is an album or track, we also want to fetch the artist for this release\r\n if (searchType !== 'artist') {\r\n artist = result.artist.name;\r\n }\r\n\r\n // before adding this to the results array, we want to ensure\r\n // it doesn't already exist\r\n let found = false;\r\n for (let i = 0; i < results.length; i++) {\r\n\r\n // if it is already in results array, we simply update the score and playcount\r\n if (results[i].name === name\r\n && (artist === undefined\r\n || results[i].artist === artist)) {\r\n results[i].score += score;\r\n results[i].playcount += playcount;\r\n found = true;\r\n break;\r\n }\r\n }\r\n\r\n // if it wasn't in the results array, we add it\r\n if (!found) {\r\n\r\n results.push({\r\n 'score': score,\r\n 'name': name,\r\n 'artist': artist,\r\n 'playcount': playcount,\r\n 'mbid': mbid,\r\n 'image': image\r\n });\r\n }\r\n }\r\n\r\n // we update the progress bar to show the progress for this section\r\n progress++;\r\n document.getElementById('progress').style.width = ((progress / friends.length) * 100) + '%';\r\n })\r\n .catch(error => {\r\n // if there was an error, we alert the user\r\n alert(error + '!');\r\n\r\n // we also want to hide the progress and display the search form again\r\n document.getElementById('outer-progress').style.visibility = 'hidden';\r\n document.getElementById('enterUsername').style.display = 'block';\r\n }));\r\n }\r\n\r\n // once all fetch requests have been returned, we can try and continue\r\n Promise.all(promiseList)\r\n .then(function () {\r\n sortResults(username, friends, unheard, searchType, results)\r\n })\r\n}",
"function get_twitter_search_queries($q) {\n\n\tconsole.log(\"Nemam Amma Bhagavan Sharanam -- Calling get_twitter_search_queries\");\n\n\tvar q = $q.defer();\n\n\tvar transaction \t= twitter_search_queries_db.transaction([\"twitter_search_queries\"],\"readwrite\");\n\t\n\tvar store \t\t\t= transaction.objectStore(\"twitter_search_queries\");\n\t// Open index\n\tvar index \t\t\t= store.index(\"since_id\");\n var boundedKeyRange = IDBKeyRange.bound(0, \"\");\n\tvar search_queries_array \t= new Array();\n\t\n\t// Asynchronous method to search tweets table and return the \n\t// tweets array after all the entries are searched\n\tindex.openCursor().onsuccess = function(e) {\n\t var search_query_cursor = e.target.result;\n\t if(search_query_cursor) {\n\t \t\n\t\t\tsearch_queries_array.push(search_query_cursor.value);\n\t\t\tsearch_query_cursor.continue();\n\t\t}\n\t\telse {\n\t\t\t// Resolve the promise if there is no error \n\t\t\t q.resolve(search_queries_array);\n\t\t}\n\t} // openCursor on success\n\treturn q.promise;\n} // get_twitter_search_queries",
"async function fetchPotatoes() {\n try {\n return await sendQuery(Queries.potatoes.FETCH_ALL_POTATOES);\n } catch (error) {\n logger.log('error', `Failed to fetch potatoes from DB - ${error}.`);\n process.exit(-1);\n }\n}",
"async queryContainer() {\n console.log(`Querying container:\\n${config.container.id}`)\n \n // query to return all children in a family\n // Including the partition key value of lastName in the WHERE filter results in a more efficient query\n const querySpec = {\n query: 'SELECT * FROM root r WHERE @Hours - r.Hours <=1',\n parameters: [\n {\n name: '@Hours',\n value: (new Date).getUTCHours()\n },\n {\n name: '@Minutes',\n value: (new Date).getUTCMinutes()\n }\n ]\n }\n \n const { resources: results } = await this.client\n .database(this.databaseId)\n .container(this.containerId)\n .items.query(querySpec)\n .fetchAll()\n return results;\n }",
"function getAthletes() {\n // get athletes owned by logged in user\n console.log(\"In getAthletes, OwnerId:\", OwnerId);\n $.get(\"/api/athletes/team/\"+OwnerId, function(data) {\n initializeRows(data);\n });\n // get unowned athletes\n $.get(\"/api/athletes/team/1\", function(data) {\n initializeRosterRows(data);\n });\n }",
"function dataDayTemp(){\napp.get('/api/statisticsByDay/Temp', (req, res)=>{\n let sql = \"SELECT * FROM SensorTemp WHERE Date = '\"+valueDate+\"';SELECT MAX(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"';SELECT MIN(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"';SELECT SUM(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"' AND Temp>32;SELECT SUM(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"' AND Temp<18;SELECT SUM(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"' AND Temp BETWEEN 18 AND 32;SELECT AVG(Temp) FROM SensorTemp WHERE Date = '\"+valueDate+\"'\";\n con.query(sql, (err, result, fields)=>{\n if (err) throw err;\n res.json(result);\n });\n})\n}",
"function getUserMood() {\n\tgetDocId();\n\tconsole.log('in get user mood');\n\tdb\n\t\t.collection('users')\n\t\t.doc(userId)\n\t\t.collection('surveyTaken')\n\t\t.get()\n\t\t.then((snapshot) => {\n\t\t\tsnapshot.docs.forEach((doc) => {\n\t\t\t\tif (doc.id == today) {\n\t\t\t\t\tconsole.log('got user');\n\t\t\t\t\tmoodScore = Math.round(doc.data().score / 10);\n\t\t\t\t\tconsole.log(doc.id);\n\t\t\t\t\tindActivity(doc);\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t\t.catch((error) => console.log('error'));\n}",
"async getPiscineUsers(token) {\n let output = [];\n const response = await request.get({\n url: `https://api.intra.42.fr/v2/cursus/piscine-c/cursus_users?filter[campus_id]=${config.campus_id}&filter[active]=true&filter[end_at]=${config.end_at}&filter[begin_at]=${config.begin_at}&page[size]=100`,\n auth: {\n bearer: token\n },\n resolveWithFullResponse: true\n });\n output = output.concat(JSON.parse(response.body));\n const pages = parseInt(response.headers[\"x-total\"]);\n const amountpages = (Math.floor(pages / 100) + 1);\n await sleep(1000);\n for (let i = 1; i < amountpages; i++) {\n let res = await request.get({\n url: `https://api.intra.42.fr/v2/cursus/piscine-c/cursus_users?filter[campus_id]=${config.campus_id}&filter[active]=true&filter[end_at]=${config.end_at}&filter[begin_at]=${config.begin_at}&page[size]=100&page[number]=${i + 1}`,\n auth: {\n bearer: token\n }\n });\n await sleep(1000);\n output = output.concat(JSON.parse(res));\n }\n this.users = output;\n return output;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the URL for the given frame image. theFrame the frame to get the source file name for | function AO_timrGetFrameSrc(theFrame) {
var iTest, numberStr;
with (this) {
numberStr = (_reverseFrames) ? (_numberOfFrames - theFrame) : (theFrame + 1);
// add pad zeros
for (iTest=10; (this._numberOfFrames >= iTest); iTest*=10)
if (numberStr < iTest) numberStr = "0" + numberStr;
}
return this._filePre + numberStr + this._fileExt;
} | [
"get imageURL() {\n this._logger.debug(\"imageURL[get]\");\n return this._imageURL;\n }",
"getSrc(){\n\t\tif( this.props.activeTrack ) {\n\t\t\treturn this.props.activeTrack.url;\n\t\t}\n\t}",
"function getSource() {\n const queryString = window.location.search;\n const urlParams = new URLSearchParams(queryString);\n const source = (urlParams.get(\"source\"));\n return source;\n}",
"get src() {\n this._logService.debug(\"gsDiggThumbnailDTO.src[get]\");\n return this._src;\n }",
"updateconvertedurl() {\n // src is only actually required property\n if (this.src) {\n const params = {\n height: this.height,\n width: this.width,\n quality: this.quality,\n src: this.src,\n rotate: this.rotate,\n fit: this.fit,\n watermark: this.watermark,\n wmspot: this.wmspot,\n format: this.format,\n };\n this.srcconverted = MicroFrontendRegistry.url(\n \"@core/imgManipulate\",\n params\n );\n }\n }",
"function get_full_url(file) {\n\n //\n // We just concatenate strings. This is to ensure\n // efficient memory use as opposed to storing the\n // entire URLs as arrays\n //\n // return {domain: COMMONCRAWL_DOMAIN, path: '/crawl-data/' + file + '/wet.paths.gz'};\n return COMMONCRAWL_BASE_URL + file + COMMONCRAWL_WET_PATHS;\n\n}",
"function get_img(i,f){var b,a=__CONF__.img_url+\"/img_new/{0}--{1}-{2}-1\",g=__CONF__.img_url+\"/img_src/{0}\",c=\"d96a3fdeaf68d3e8db170ad5\",d=\"43e2e6f41e3b3ebe22aa6560\",k=\"726a17bd880cff1fb375718c\",j=\"6ea1ff46aab3a42c975dd7ab\";i=i||\"0\";f=f||{};ObjectH.mix(f,{type:\"head\",w:30,h:30,sex:1});if(i!=\"0\"){if(f.type==\"src\"){b=g.format(i);}else{b=a.format(i,f.w,f.h);}}else{if(f.type==\"head\"){if(f.sex==1){b=a.format(c,f.w,f.h);}else{b=a.format(d,f.w,f.h);}}else{if(f.type==\"subject\"){b=a.format(k,f.w,f.h);}else{if(f.type==\"place\"){b=a.format(j,f.w,f.h);}else{b=a.format(\"0\",f.w,f.h);}}}}return b;}",
"async createIframeURL(fid) {\n this.setOrgID(fid);\n // var iframe_url = this.state.iframe_url + \"?orgID=\" + this.state.oid;\n // console.log(iframe_url);\n // var iframe_copy_text =\n // '<iframe src=\"' + iframe_url + '\" width=\"100%\" height=\"450\"></iframe>';\n //this.setState({ iframe_url });\n //this.setState({ iframe_copy_text });\n }",
"function ongetImageUrlQuerySucceeded() {\n var serverrelativeurl = this.parentWeb.get_serverRelativeUrl();\n var imagepath = this.targetFile.get_serverRelativeUrl();\n var filename = this.targetFile.get_name();\n if (serverrelativeurl && filename && imagepath) {\n appData.ImageLibraryFullPath = imagepath.toLowerCase().replace(serverrelativeurl.toLowerCase(), '').replace(filename.toLowerCase(), '');\n var slashtrimmedstring = appData.ImageLibraryFullPath.trimStart(\"/\").trimEnd(\"/\");\n var firstSlash = slashtrimmedstring.indexOf(\"/\");\n if (firstSlash != -1) {\n appData.ImageLibraryName = slashtrimmedstring.substring(0, firstSlash);\n }\n else {\n appData.ImageLibraryName = slashtrimmedstring;\n }\n\n pictureData.imagesource = pictureSource.SharePoint;\n pictureData.FileName = filename;\n\n processAssetPickerData();\n }\n}",
"function file_here (here_url, file_name) {\n\tconst here_file = fileURLToPath(here_url);\n\tconst here = path.dirname(here_file);\n\n\treturn path.join(here, file_name);\n}",
"function imgUrl( url, cache, always ) {\n\treturn cacheUrl( opt.codeUrl + 'images/' + url, cache, always );\n}",
"get imageUrl() {\n return this._imageUrl\n }",
"set imageURL(aValue) {\n this._logService.debug(\"gsDiggEvent.imageURL[set]\");\n this._imageURL = aValue;\n }",
"function getOriginalUrlFromThumbnailUrl(thumbnailUrl) {\n return thumbnailUrl + '&lb=1&s=O';\n }",
"function getAbsoluteURL()\n{\n return \"http://deic-dc0.uab.cat/~tdiw-j5/\";\n}",
"set imageURL(aValue) {\n this._logger.debug(\"imageURL[set]\");\n this._imageURL = aValue;\n }",
"_getLinkURL() {\n let href = this.context.link.href;\n\n if (href) {\n // Handle SVG links:\n if (typeof href == \"object\" && href.animVal) {\n return this._makeURLAbsolute(this.context.link.baseURI, href.animVal);\n }\n\n return href;\n }\n\n href = this.context.link.getAttribute(\"href\") ||\n this.context.link.getAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\");\n\n if (!href || !href.match(/\\S/)) {\n // Without this we try to save as the current doc,\n // for example, HTML case also throws if empty\n throw \"Empty href\";\n }\n\n return this._makeURLAbsolute(this.context.link.baseURI, href);\n }",
"function createRenderUrl(uuid, script) {\n let url = new URL(`${FLEDGE_BASE_URL}resources/fenced-frame.sub.py`);\n if (script)\n url.searchParams.append('script', script);\n url.searchParams.append('uuid', uuid);\n return url.toString();\n}",
"function updateHTMLRelativePath(e) {\n\tvar t = \"\";\n\tif (window.shell !== undefined)\n\t\tt = window.shell.getURL() + \"/\";\n\telse\n\t\tt = parent.window.shell.getURL() + \"/\";\n\t$(e).find('img[src^=\"images/\"],img[src^=\"skin/\"]').each(function () {\n\t\t$(this).attr(\"src\", t + $(this).attr(\"src\"))\n\t});\n\t$(e).find('video[poster^=\"images/\"],video[poster^=\"skin/\"]').each(function () {\n\t\t$(this).attr(\"poster\", t + $(this).attr(\"poster\"))\n\t});\n\t$(e).find('*[style*=\"background-image\"]').each(function () {\n\t\tvar e = $(this).attr(\"style\").split(\";\");\n\t\tfor (var n = 0; n < e.length; n++) {\n\t\t\tvar r = e[n].split(\":\");\n\t\t\tif (r[0] == \"background-image\") {\n\t\t\t\tvar i = r[1].split(\"url(\")[1];\n\t\t\t\ti = i.substring(0, i.length - 1);\n\t\t\t\tif (i.indexOf(\"images/\") == 0 || i.indexOf(\"skin/\") == 0) {\n\t\t\t\t\ti = t + i;\n\t\t\t\t\t$(this).css(\"background-image\", \"url(\" + i + \")\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\treturn $(e)[0].innerHTML\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
translateStaticElements(container, language) finds every child element of container with data tag 'datastrname' and replaces its innerHTML content with according language strname string. | function translateStaticElements(container, language) {
let keyEls = Array.from(container.querySelectorAll('[data-strname]'));
for (let el of keyEls) {
let key = el.dataset['strname'];
el.innerHTML = language.getString(key, language.getActiveLang());
}
} | [
"addTranslatedMessagesToDom_() {\n const elements = document.querySelectorAll('.i18n');\n for (const element of elements) {\n const messageId = element.getAttribute('msgid');\n if (!messageId)\n throw new Error('Element has no msgid attribute: ' + element);\n const translatedMessage =\n chrome.i18n.getMessage('switch_access_' + messageId);\n if (element.tagName == 'INPUT')\n element.setAttribute('placeholder', translatedMessage);\n else\n element.textContent = translatedMessage;\n element.classList.add('i18n-processed');\n }\n }",
"loopAndTranslateDOM() {\n\t\tconst Elements = document.querySelectorAll(\n\t\t\t`${this.prms.selectorElementTranslate}, ${this.prms.selectorAttrTranslate}`\n\t\t);\n\t\tconst clearSelector = this.prms.selectorElementTranslate.replace(/\\[|\\]/g, '');\n\t\tconst clearSelectorAttr = this.prms.selectorAttrTranslate.replace(/\\[|\\]/g, '');\n\n\t\tElements.forEach((element) => {\n\t\t\tif (element.hasAttribute(clearSelectorAttr)) {\n\t\t\t\tconst translateAttrib = element.getAttribute(clearSelectorAttr).split('|');\n\t\t\t\telement.setAttribute(translateAttrib[0], this.coreTranslate(translateAttrib[1]));\n\t\t\t} else {\n\t\t\t\telement.innerHTML = this.coreTranslate(element.getAttribute(clearSelector));\n\t\t\t}\n\t\t});\n\n\t\tthis.prms.translatingDone();\n\t}",
"function googleTranslateElementInit(){\n new google.translate.TranslateElement({pageLanguage:'en'},'google_translate_element');\n}",
"function addTranslation(item){\n if (item.hasOwnProperty(\"label\")){\n if (typeof languages[\"es\"][item.label.key] === 'undefined'){\n languages[\"es\"][item.label.key]=\"\";\n }\n if (typeof languages[\"en\"][item.label.key] === 'undefined'){\n languages[\"en\"][item.label.key]=\"\";\n }\n languages[\"es\"][item.label.key] = item.label.es;\n languages[\"en\"][item.label.key] = item.label.en;\n }\n}",
"translate(text, target, callback){\n\t\t\t\t// Assume that our default language on every JS or HTML template is en_US\n\t\t\t\ttranslates('en_US', target, text, callback);\n\t\t\t}",
"function translate(text, dictionary){\n\t// TODO: implementați funcția\n\t// TODO: implement the function\n}",
"updateMessages(selection=undefined, attributes=[], fallback=undefined) {\n var locale = this;\n if (typeof selection === \"undefined\") {\n selection = d3.selection().attr(\"lang\", this.lang);\n }\n selection.selectAll(\"[data-message]\").each(function() {\n if (!selection.node().contains(this)) {\n return;\n }\n const msg = this.getAttribute(\"data-message\");\n const children = Array.from(this.children).map((c) => c.outerHTML);\n const replacement = locale.message(msg, children, fallback);\n if (replacement !== null) {\n locale.updateMessages(d3.select(this).html(replacement), attributes);\n }\n });\n attributes.forEach((attribute) => {\n selection.selectAll(`[data-message-${attribute}]`).each(function() {\n const msg = this.getAttribute(`data-message-${attribute}`);\n const replacement = locale.message(msg, null, fallback);\n if (replacement !== null) {\n d3.select(this).attr(attribute, replacement);\n }\n });\n });\n }",
"function buildLayout(mode) {\n if (mode === \"Portuguese\") {\n document.getElementById(\"language\").innerHTML = '<p><img src=\"assets/images/portugal.png\" alt=\"Portugal\"> <br> Portuguese</p>';\n } else if (mode === \"Swedish\") {\n document.getElementById(\"language\").innerHTML = '<p><img src=\"assets/images/sweden.png\" alt=\"Sweden\"> <br> Swedish</p>';\n } else if (mode === \"French\") {\n document.getElementById(\"language\").innerHTML = '<p><img src=\"assets/images/france.png\" alt=\"France\"> <br>French</p>';\n } else if (mode === \"German\") {\n document.getElementById(\"language\").innerHTML = '<p><img src=\"assets/images/germany.png\" alt=\"Germany\"> <br> German</p>';\n } else if (mode === \"Random\") {\n document.getElementById(\"language\").innerHTML = '<p><img src=\"assets/images/globe.png\" alt=\"world\"> <br> Random</p>';\n }\n fetchWords();\n}",
"function setMenuLang(){\n \n // Browser basic settings\n var currentLang = \"lang_\"+getNavigatorLang();\n \n \n if(localStorage.myLang)\n {\n currentLang= \"lang_\"+localStorage.myLang;\n }\n\n //Menu setting\n \n var menu = document.querySelectorAll(\"ul.nav li a\");\n for(var i=0; i<menu.length; i++)\n {\n var data = menu[i].getAttribute(\"data-name\");\n menu[i].innerHTML= window[currentLang][data];\n }\n \n // Navbar title and header setting\n \n var getSelector = document.querySelector(\".navbar-header a\");\n \n var dataName = getSelector.getAttribute(\"data-title\");\n \n getSelector.innerHTML = window[currentLang][dataName];\n \n \n var getSelector = document.querySelector(\".starter-template h1\");\n \n var dataName = getSelector.getAttribute(\"header-title\");\n \n getSelector.innerHTML = window[currentLang][dataName]; \n}",
"function getTranslations(currDir, translations, strings) {\n if(fs.existsSync(currDir)) {\n // Load translations.json file in current directory, if any\n if(fs.existsSync(path.join(currDir, \"translations.json\"))) {\n translations = mergeObjs(translations,\n JSON.parse(fs.readFileSync(path.join(path.resolve(currDir), \"translations.json\")))\n );\n }\n var pathChildren;\n // Load large text translations in translations subdirectory, if it exists\n var translationPath = path.join(currDir, \"translations\");\n if(fs.existsSync(translationPath) && fs.statSync(translationPath).isDirectory()) {\n // Get all children in the translations directory\n pathChildren = fs.readdirSync(translationPath);\n // Filter out all non-default translations (the ones without a lang type)\n pathChildren.filter(function(child) {\n return !/^.*\\..*\\..*/.test(child);\n // And map these default translations into an object containing the variable name to use,\n // the default text, and an array of translations for this text\n }).map(function(child) {\n return {\n name: child.replace(/\\..*$/, \"\"),\n defaultText: fs.readFileSync(path.join(translationPath, child), 'utf8'),\n // To make the array of translations for this default translation, filter out\n // all files that do not start with the primary translation filename (minus extension), with a special\n // case to filter out the primary translation, as well\n translations: pathChildren.filter(function(secondChild) {\n return (new RegExp(\"^\" + child.replace(/\\..*$/, \"\"))).test(secondChild) && child !== secondChild;\n // Then map this array of files into an object containing the language specified\n // and the translation text for this language\n }).map(function(secondChild) {\n return {\n lang: secondChild.replace(/\\.[^\\.]*$/, \"\").replace(/^[^\\.]*\\./, \"\"),\n text: fs.readFileSync(path.join(translationPath, secondChild), 'utf8')\n };\n })\n };\n // For each of these long-form translation objects, add the default text to the strings object using the\n // desired variable name, and create a translation object for all defined languages for this text.\n }).forEach(function(translation) {\n strings[translation.name] = translation.defaultText;\n translations[translation.defaultText] = {};\n translation.translations.forEach(function(lang) {\n translations[translation.defaultText][lang.lang] = lang.text;\n });\n });\n }\n // Recurse down each directory and get the translations for that directory\n pathChildren = fs.readdirSync(currDir);\n /* jshint forin: false */\n for(var child in pathChildren) {\n var childPath = path.resolve(path.join(currDir, pathChildren[child]));\n if(fs.statSync(childPath).isDirectory()) {\n var tempArray = getTranslations(childPath, translations, strings);\n translations = tempArray[0];\n strings = tempArray[1];\n }\n }\n } else {\n throw new Error(\"Translation Path Invalid\");\n }\n return [translations, strings];\n }",
"populate(displayContainers) {\n this._containerHtmlElems = displayContainers;\n const displaySize = SvgLayout._calcDisplaySize(this._containerHtmlElems);\n\n for (let locale of cred.locale) {\n this._buildDisplay(locale, displaySize);\n }\n }",
"function getSiteLocaleNameFor$static(content/* :Content*/)/*:String*/ {\n var site/*:Site*/ = com.coremedia.cms.editor.sdk.editorContext.getSitesService().getSiteFor(content);\n if (site === undefined) {\n // not loaded\n return undefined;\n }\n if (!site) {\n // content has no site\n return '';\n }\n var locale/*:Locale*/ = site.getLocale();\n if (!locale) {\n return ''; // attributes of Site can never by \"undefined\"\n }\n return locale.getDisplayName();\n }",
"static parseHTML( content, target, messages ){\n\n let search = function( node, map ){\n let children = node.children;\n for( let i = 0; i< children.length; i++ ){\n if( children[i].id ) map[children[i].id] = children[i];\n if( messages ){\n [\"title\", \"placeholder\"].forEach( function( attr ){\n let matchattr = `data-${attr}-message`;\n if( children[i].hasAttribute( matchattr )){\n let msg = children[i].getAttribute( matchattr );\n children[i].setAttribute( attr, messages[msg] );\n }\n });\n if( children[i].hasAttribute( \"data-textcontent-message\" )){\n let msg = children[i].getAttribute( \"data-textcontent-message\" );\n children[i].textContent = messages[msg] ;\n }\n }\n search( children[i], map );\n }\n };\n\n let nodes = {};\n target.innerHTML = content;\n search( target, nodes );\n return nodes;\n\n }",
"function handleLangSelect ( event ) {\r\n\t\t\r\n\t\t// prevent going to #\r\n\t\tevent.preventDefault()\r\n\r\n\t\tlet selectElement = event.srcElement\r\n\t\t// to be shown as placeholder\r\n\t\tlet buttonElement = selectElement.parentElement.previousElementSibling\r\n\t\t// element in with data to be saved of selected language\r\n\t\tlet dataElement = buttonElement.parentElement\r\n\r\n\t\t// save the selected info\r\n\t\tlet selectedInfo = {\r\n\t\t\tvalue: selectElement.getAttribute(\"data-val\"),\r\n\t\t\ttext: selectElement.innerHTML\r\n\t\t}\r\n\r\n\t\t// toogle data b/w selected element and \r\n\t\t// placeholder element\r\n\t\tselectElement.innerHTML = buttonElement.innerHTML\r\n\t\tselectElement.setAttribute(\"data-val\", dataElement.getAttribute(\"data-val\"))\r\n\t\tdataElement.setAttribute(\"data-val\", selectedInfo.value)\r\n\t\tbuttonElement.innerHTML = selectedInfo.text\r\n\t\t\r\n\t\tif ( DEBUG.Log ) {\r\n\t\t\tconsole.log(event)\r\n\t\t}\r\n\t}",
"function mapElementNames(container, models, from, to) {\n\tif (from != to)\n\t\tfor (let m=0; m<models.length; m++) {\n\t\t const elements = container.querySelectorAll(\"[id^='\"+id_prefix+models[m]+\"-\"+from+\"']\");\n\n\t\t for (let e=0; e<elements.length; e++)\n\t\t \trenameDjangoWidget(elements[e], from, to);\n\t\t}\n}",
"function multigreeting(name, language) {\n language = language.toLowerCase() \n if (language === 'en') { return `Hello, ${name}!`}\n if (language === 'es') { return `¡Hola, ${name}!`}\n if (language === 'fr') { return `Bonjour, ${name}!`}\n if (language === 'eo') { return `Saluton, ${name}!`}\n }",
"function languageError() {\n $(\"#results\").append(\n `<p class=\"small\">Sorry, there's no Google translation for Dzongkha, Bhutan's principal language; \n but you may be able to use Nepali phrases!</p>\n \n <p class=\"small\">Nepali:</p>`\n );\n}",
"function loadTranslations(translations) {\n // Ensure the translate function exists\n if (!$localize.translate) {\n $localize.translate = translate;\n }\n if (!$localize.TRANSLATIONS) {\n $localize.TRANSLATIONS = {};\n }\n Object.keys(translations).forEach(key => {\n $localize.TRANSLATIONS[key] = parseTranslation(translations[key]);\n });\n}",
"function clearTranslations() {\n $localize.TRANSLATIONS = {};\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
6. Write a program that draws a horizontal chart representing three given values. For example, if values are 5, 3, and 7, the program should draw: bolji nacin: | function horizontalChart() {
var result = '';
var numOfArgs = arguments.length;
for (var i = 0; i < numOfArgs; i++) {
for (var j = 0; j < arguments[i]; j++) {
result += '*'
}
result += '\n';
}
return result;
} | [
"function horizontalChart() {\r\n var row = '';\r\n for (var i = 0; i < arguments.length; i++) {\r\n for (var j = 0; j < arguments[i]; j++) {\r\n row += '*';\r\n }\r\n row += '\\n'\r\n }\r\n return row;\r\n}",
"function Draw3PL(c,x,y,w,h,myArray){\n\tvar canvas = document.getElementById(c);\n\tvar cxt = canvas.getContext(\"2d\");\n\tcxt.save();\n\t//Adjust chart width and height\n\tw=w-20; h=h-50;\n\tvar max = 0; //Innitialise maximum bar height to zero\n\tvar len=0; //Innitialise no of bars to zero\n\tvar c1 = \"#7FFF24\";\n\tvar c2 = \"#ffffff\";\n\tsum = 0;\n\tfor(key in myArray)\n\t{\n\t\tif(myArray[key] > max) max = myArray[key];\n\t\tsum += myArray[key];\n\t\tlen++;\n\t}\n\tvar border = 4; //Changing the border mar distort the graph\n\tvar bar_h = (h-border)/len;\n\tvar gradient = cxt.createLinearGradient(w/2, 50, w/2, h);\n\tgradient.addColorStop(0, '#000');\n\tgradient.addColorStop(0.1, '#eee'); \n\tgradient.addColorStop(0.5, '#fff'); \n\tgradient.addColorStop(1, '#000'); \n\t\n\tmax = max - border;\n\ttxtArea = w*0.2;\n\tfull = w -(border*2)-txtArea;\n\tcxt.strokeStyle='#fff';\n\tcxt.save();\n\t\n\tcxt.shadowOffsetX = border/2;\n\tcxt.shadowOffsetY = border/2;\n\tcxt.shadowBlur = border/2;\n\tcxt.shadowColor = \"black\";\n\tcxt.fillStyle=c1;\n\tn=0;\n\tfor(key in myArray)\n\t{\n\t\tcxt.fillRect(border+txtArea+x,(border*2)+(bar_h*n)+y,(myArray[key]/max)*full,bar_h-border);\n\t\tn++;\n\t}\n\t\n\tcxt.shadowColor = \"#fff\";\n\tn=0;\n\tfor(key in myArray)\n\t{\n\t\tcxt.strokeRect(border+txtArea+x,(border*2)+(bar_h*n)+y,(myArray[key]/max)*full,bar_h-border);\n\t\tn++;\n\t}\n\t\n\tcxt.shadowOffsetX = border/-2;\n\tn=0;\n\tfor(key in myArray)\n\t{\n\t\tcxt.strokeRect(border+txtArea+x,(border*2)+(bar_h*n)+y,((myArray[key]/max)*full),bar_h-border);\n\t\tn++;\n\t}\n\tcxt.shadowOffsetY = border/-2;\n\tn=0;\n\tfor(key in myArray)\n\t{\n\t\tcxt.strokeRect(border+txtArea+x,(border*2)+(bar_h*n)+y,((myArray[key]/max)*full),bar_h-border);\n\t\tn++;\n\t}\n\tcxt.restore();\n\tcxt.save();\n\tcxt.font = 'bold 14px sans-serif';\n\tcxt.shadowOffsetX = 1;\n\tcxt.shadowOffsetY = 1;\n\tcxt.shadowBlur = 1;\n\tcxt.shadowColor = \"white\";\n\tn=0;\n\tfor(key in myArray)\n\t{\n\t\tcxt.fillStyle=c2;\n\t\tcxt.fillText(key, (border+10)+x-45, (border*2)+(bar_h*n)+(bar_h/1.8)+y,txtArea-15);\n\t\tcxt.fillText(myArray[key], (border+10+txtArea)+x, \n\t\t\t\t\t\t(border*2)+(bar_h*n)+(bar_h/1.8)+y,full);\n\t\tn++;\n\t}\n\tcxt.restore();\n\n\tcxt.fillStyle = c2;\n\tcxt.font = '28pt Calibri';\n\tcxt.fillText(\"New 3PL Leads\", (border*1.5)+x+40,y, w);\n\n}",
"function triangles(val) {\n //init string to contain character passed in while converting number data types to a string data type\n var str = \"\";\n //for loop to run until i = 7 not inclusive. 0 to 6 is 7 steps \n for (var i = 0; i < val; i++){\n // concatenate '#' to \n str += '#';\n //print str on each successive loop. Console.log must be within the loop block in order to function like this.\n console.log(str);\n }\n}",
"function drawHorizon(w, h, this_color) {\n p5.fill(this_color);\n p5.noStroke();\n p5.rect(0, h / 2, w, h);\n }",
"function drawChart( data , heading, type ) {\r\n var maxHeight = 280;\r\n var maxData = 0;\r\n var leftPos = 0;\r\n var barWidth = 40;\r\n var response = \"<div class='label'>\";\r\n response += \"<span class='passLabel'></span>Pass<br/><br/>\";\r\n response += \"<span class='failLabel'></span>Fail\";\r\n response += \"</div>\";\r\n response += \"<div class='heading'>\" + heading + \"</div>\";\r\n response += \"<div class='chart'>\";\r\n \r\n for( var prop1 in data ) {\r\n maxData = Math.max( maxData, data[prop1].Pass );\r\n maxData = Math.max( maxData, data[prop1].Fail );\r\n }\r\n \r\n for( var prop in data ) {\r\n response += \"<div style='position:absolute;bottom:0px;left:\" + leftPos + \"px;text-align:center;width:\" + ( 2 * barWidth + 3 ) + \"px;height:30px;'>\" + prop + \"</div>\";\r\n if( data[prop].Pass ) {\r\n response += \"<div type='\" + type + \"' class='chartdata' id='PassData\" + prop + \"' style='position:absolute;bottom:45px;left:\" + leftPos + \"px;float:left;background:#0096d6;font-weight:bold;padding:5px 0;color:#0f0;height:\" + parseInt( ( data[prop].Pass * maxHeight ) / maxData ) +\"px;width:\" + barWidth + \"px;'>\" + data[prop].Pass + \"</div>\";\r\n }\r\n leftPos += barWidth + 3;\r\n if( data[prop].Fail ) {\r\n response += \"<div type='\" + type + \"' class='chartdata' id='FailData\" + prop + \"' style='position:absolute;bottom:45px;left:\" + leftPos + \"px;float:left;background:#606060;font-weight:bold;padding:5px 0;color:#ece038;height:\" + parseInt( ( data[prop].Fail * maxHeight ) / maxData ) +\"px;width:\" + barWidth + \"px;'>\" + data[prop].Fail + \"</div>\";\r\n }\r\n leftPos += barWidth + 3;\r\n }\r\n \r\n response += \"</div>\";\r\n return response;\r\n }",
"function automate(n, enCours, x1, y1, x2, y2, p, a) {\n for (var i = 0; i < n; i++) {\n if (enCours==i){\n p.fill(237, 0, 0);\n }\n else{\n p.fill(255);\n }\n p.ellipse(x1+0.5, y1+14+ (5 - i - 1) * 50, x2, y2);\n }\n p.noFill();\n p.rect((x1 - x2), (y1 - y2 + (5 - n) * 50), 2 * y2, 110 + (n - 2) * 50, 20, 20, 20);\n p.fill(0);\n p.text(\"G\"+a, x1-7, y1+275 + (n - 2) * 50);\n}",
"function drawSubTriangles(h, n) {\n var smallTriangle = n === 0 ? drawTriangle(h/2): drawSubTriangles(h/2, n - 1);\n\n var image = [];\n var width = h * 2 - 1;\n\n // add top triangle\n for (var i = 0; i < h/2; i++) {\n image.push([]);\n \n for (var j = 0; j < width / 4; j++) {\n image[i].push(\" \");\n }\n\n image[i] = image[i].concat(smallTriangle[i]);\n \n for (var j = 0; j < width / 4; j++) {\n image[i].push(\" \");\n }\n }\n\n //add bottom two triangles\n for (var i = h/2, j = 0; i < h; i++, j++) {\n image.push([]);\n image[i] = image[i].concat(smallTriangle[j]);\n image[i].push(\" \");\n image[i] = image[i].concat(smallTriangle[j]);\n }\n\n return image;\n }",
"function Pump_In_Sale(c, x, y, w, h, d) {\n\n\n var canvas = document.getElementById(c);\n var context = canvas.getContext(\"2d\");\n context.save()\n var blX = x; // bottom left\n var blY = y + h;\n var trX = x + w; // top right\n var trY = y;\n var midX = x + (w / 2);\n var midY = y + (h / 2);\n var controlX = x;\n var controlY = y;\n\n d.sort(); // puts the smallest data on top\n\n // find sum of all data for spacing\n var i = 0;\n var sum = 0;\n for (i = 0; i < d.length; i = i + 1) {\n sum = sum + parseInt(d[i][0]);\n }\n\n // draw first line of figure\n context.beginPath();\n context.moveTo(blX, blY);\n midY = y;\n context.quadraticCurveTo(controlX, midY, midX, midY);\n context.quadraticCurveTo(trX, midY, trX, trY);\n context.quadraticCurveTo(trX, blY, midX, blY);\n context.quadraticCurveTo(controlX, blY, blX, blY);\n context.fillStyle = d[0][2];\n context.fill();\n\n // draw lines to finish figure\n for (i = 0; i < d.length; i = i + 1) {\n context.beginPath();\n context.moveTo(blX, blY);\n var temp = ((d[i][0] / sum) * h)\n midY = midY + temp;\n context.quadraticCurveTo(controlX, midY, midX, midY);\n context.quadraticCurveTo(trX, midY, trX, trY);\n context.quadraticCurveTo(trX, blY, midX, blY);\n context.quadraticCurveTo(controlX, blY, blX, blY);\n\n if (i + 1 == d.length) {\n context.fillStyle = d[i][2];\n } else {\n context.fillStyle = d[i + 1][2];\n }\n context.fill();\n\n // Draw text\n var text_size = 14;\n if (temp < text_size) {\n text_size = temp;\n }\n if (text_size < 8) {\n text_size = 8;\n }\n context.font = \"bold \" + text_size + \"pt Calibri\";\n context.fillStyle = \"#ffffff\";\n context.fillText(d[i][1], x + (w*11/24), midY - temp / 2 + text_size / 2);\n }\n context.restore();\n}",
"function draw_cube_space_d(d_value) {\n\t\n\tconsole.log('draw_cube_space_d('+d_value+')');\n\n\n\tclear_cube_space();\n\n\n\td_start = 0;\n\td_end = d_value;\n\t//alert('d_end='+d_end);\n\tb_start = 6;\n\tb_end = 0;\n\ta_start = 6;\n\ta_end = 0;\n\tnumbers_tag = document.getElementById('draw_numbers_tag');\n\tcoords_tag = document.getElementById('draw_coords_tag');\n\n\tif(numbers_tag.checked) {\n\t\td_start = d_end;;\n\t}\n\tif(coords_tag.checked) {\n\t\ta_start = a_end;\n\t}\n\n\t\n\tfor (dd = d_start; dd <=d_end; dd++) {\n\t\t//alert('d='+dd+'d_end='+d_end);\n\t\tfor (bb = b_start; bb >= b_end; bb--) {\n\t\t\tfor (aa = a_start; aa >= a_end; aa--) {\n\t\t\t\t//console.log('94:a='+aa+'b='+bb+'d='+dd+' j='+index);\n\t\t\t\tmini_draw_H_TML(aa, bb, dd);\n\t\t\t}\n\t\t}\t\n\t}\n\n\tadd_cube_space();\n}",
"function drawConsoleBox(w, h) {\n\n for (let i = 0; i < 1; i++) {\n console.log(\"+\" + \"-\".repeat(w) + \"+\");\n }\n for (let j = 0; j < h; j++) {\n console.log(\"|\" + \" \".repeat(w) + \"|\");\n }\n for (let i = 0; i < 1; i++) {\n console.log(\"+\" + \"-\".repeat(w) + \"+\");\n }\n}",
"function displayAllIndicators() {\n\t\tvar html = \"<table> <tr> <th></th> <th>Indicator</th> <th>Value</th> <th colspan=\\\"2\\\">Rank among local authorities</th> </tr>\";\n\t\tvar color;\n\t\tvar size;\n\t\tvar bar = \"\";\n\t\tvar completeBar;\n\t\tvar divId =\"\";\n\t\tvar mean = numRegions / 2;\n\t\tvar positions_level2=0,positions_level1=0;\n\t\tvar presize_level2=0,presize_level1=0;\n\t\tvar indexLevel2 = 0,indexLevel1=0;\n\t\tvar barlevel2,varlevel1;\n\t\tidsValues = [];\n\t\tfor (var m in topLevelInd) {\n\t\t\tvar obj_list = topLevelInd[m];\n\t\t\tdivId = parse(m);\t\n\t\t\thtml += \"<tr id=\\\"\"+ divId +\"\\\"style=\\\"background: #A9D0F5; color: #151515\\\"><td><div id=\\\"\"+ divId + \"_img\\\"><a href=\\\"javascript:setVisible('\"+divId+\"','true',2);\\\"> <img src=\\\"img/expand_icon.gif\\\" border=\\\"0\\\"/></a></div></td> <td>\" + m + \"</td> <td>-</td> <td><div id=\\\"\"+ divId +\"_rank\\\"></div></td><td><div id=\\\"\"+ divId +\"_bar\\\"></div> </td> </tr>\";\n\t\t\tfor (var k = 0; k < obj_list.length ;k++) {\n\t\t\t\tvar obj = obj_list[k];\n\t\t\t\tdivId = parse(m+obj.top2Label);\n\t\t\t\t//html += \"<tr id=\\\"\" + divId + \"\\\" style=\\\"background: #CEE3F6; color: #151515;\\\"><td><a href=\\\"\\\"><img src=\\\"img/expand_icon.gif\\\" border=\\\"0\\\"/></a></td> <td>\" + obj.top2Label + \"</td> <td>-</td> <td><div id=\\\"\"+ divId +\"_rank\\\"></div> </td><td><div id=\\\"\"+ divId +\"_bar\\\"></div> </td> </tr>\";\n\t\t\t\thtml += \"<tr id=\\\"\" + divId + \"\\\" style=\\\"background: #CEE3F6; color: #151515; display:none;\\\"><td><div id=\\\"\"+ divId + \"_img\\\"><a href=\\\"javascript:setVisible('\"+divId+\"','true',3);\\\"><img src=\\\"img/expand_icon.gif\\\" border=\\\"0\\\"/></a></div></td> <td>\" + obj.top2Label + \"</td> <td>-</td> <td><div id=\\\"\"+ divId +\"_rank\\\"></div> </td><td><div id=\\\"\"+ divId +\"_bar\\\"></div> </td> </tr>\";\t\t\t\t\n\t\t\t\tfor (var i=0; i<positions.length; i++) {\n\t\t\t\t\tvar current = positions[i];\n\t\t\t\t\tbar = \"\";\n\t\t\t\t\tif (current.top == obj.top1Label && current.parent == obj.top2Label) {\n\t\t\t\t\t\tif (current.position < mean)\n\t\t\t\t\t\t\tcolor = '#306754';\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tcolor = '#7E2217';\n\t\t\t\t\t\tvar goodPosition = numRegions - current.position;\n\t\t\t\t\t\tif (goodPosition<=0)\n\t\t\t\t\t\t\tgoodPosition=1;\n\t\t\t\t\t\tvar presize = 300 * goodPosition / numRegions;\n\t\t\t\t\t\tpresize_level2 += presize\n\t\t\t\t\t\tsize = parseInt(presize);\n\t\t\t\t\t\tindexLevel2++;\n\t\t\t\t\t\tpositions_level2 += current.position;\n\t\t\t\t\t\t\t\t\t\t//completeBar = \"<div style=\\\"width: 15px; height: 15px; background:\" + color + \";\\\">\" + bar + \"</div>\";\n\t\t\t\t\t\tcompleteBar = \"<div style= 'background-color:\" + color + \"; height:10px; width:\" + size +\"px;' />\" \n\t\t\t\t\t\t//console.log(completeBar);\n\t\t\t\t\t\tdivId = parse(m+obj.top2Label+current.propLabel);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//html += \"<tr id=\\\"\" + divId + \"\\\" ><td></td> <td>\" + current.propLabel + \"</td> <td>\"+ current.val +\"</td> <td> \" + current.position + \"</td><td> \"+ completeBar + \" </td> </tr>\";\n\t\t\t\t\t\thtml += \"<tr id=\\\"\" + divId + \"\\\" style=\\\"display:none\\\"><td></td> <td>\" + current.propLabel + \"</td> <td>\"+ roundNumber(current.val,2) +\"</td> <td> \" + current.position + \"</td><td> \"+ completeBar + \" </td> </tr>\";\n\t\t\t\t\t\tvar len = idsValues.length;\n\t\t\t\t\t\tvar idValue = new Object();\n\t\t\t\t\t\tidValue.div = divId;\n\t\t\t\t\t\tidValue.bar = completeBar;\n\t\t\t\t\t\tidValue.position = current.position;\n\t\t\t\t\t\tidValue.level = 3;\n\t\t\t\t\t\tidsValues[len] = idValue;\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tindexLevel1++;\n\t\t\t\tpresize_level2 = presize_level2 / indexLevel2;\n\t\t\t\tpositions_level2 = positions_level2 / indexLevel2;\n\t\t\t\tif (positions_level2 < mean)\n\t\t\t\t\tcolor = '#306754';\n\t\t\t\telse\n\t\t\t\t\tcolor = '#7E2217';\n\t\t\t\tsize = parseInt(presize_level2);\n\t\t\t\tbarlevel2 = \"<div style= 'background-color:\" + color + \"; height:10px; width:\" + size +\"px;' />\" ;\n\t\t\t\tdivId = parse(m+obj.top2Label);\n\t\t\t\tvar len = idsValues.length;\n\t\t\t\tvar idValue = new Object();\n\t\t\t\tidValue.div = divId;\n\t\t\t\tidValue.bar = barlevel2;\n\t\t\t\tvar aux = positions_level2 + '';\n\t\t\t\tif (aux.indexOf('.')!=-1)\n\t\t\t\t\tidValue.position = '~' + parseInt(positions_level2);\n\t\t\t\telse\n\t\t\t\t\tidValue.position = positions_level2;\n\t\t\t\tidValue.level = 2;\n\t\t\t\tidsValues[len] = idValue;\n\t\t\t\tpositions_level1 += positions_level2;\n\t\t\t\tpresize_level1 += presize_level2;\n\n\t\t\t\tpresize_level2 = 0;\n\t\t\t\tindexLevel2 = 0;\n\t\t\t\tpositions_level2 = 0;\n\t\t\t\t\n\t\t\t}\n\t\t\tpositions_level1 = positions_level1 / indexLevel1;\n\t\t\tpresize_level1 = presize_level1 / indexLevel1;\n\t\t\tif (positions_level1 < mean)\n\t\t\t\tcolor = '#306754';\n\t\t\telse\n\t\t\t\tcolor = '#7E2217';\n\t\t\tsize = parseInt(presize_level1);\n\t\t\tbarlevel1 = \"<div style= 'background-color:\" + color + \"; height:10px; width:\" + size +\"px;' />\" ;\n\t\t\tdivId = parse(m);\n\t\t\tvar len = idsValues.length;\n\t\t\tvar idValue = new Object();\n\t\t\tidValue.div = divId;\n\t\t\tidValue.bar = barlevel1;\n\t\t\t\n\t\t\tvar aux = positions_level1 + '';\n\t\t\tif (aux.indexOf('.')!=-1)\n\t\t\t\tidValue.position = '~' + parseInt(positions_level1);\n\t\t\telse\n\t\t\t\tidValue.position = positions_level1;\n\t\t\tidValue.level = 1;\n\t\t\tidsValues[len] = idValue;\t\t\t\n\t\t\tpresize_level1 = presize_level2 = 0;\n\t\t\tindexLevel1 = indexLevel2 = 0;\n\t\t\tpositions_level1 = positions_level2 = 0;\n\t\t\t\n\t\t}\n\t\thtml += \"</table><br>\";\n\t\t$('#indicator-list-container').html(html);\n\t\t\n\t\tfor (var nt=0;nt<idsValues.length;nt++) {\n\t\t\tvar obj = idsValues[nt];\n\t\t\t$('#'+obj.div+'_bar').html(obj.bar);\n\t\t\t$('#'+obj.div+'_rank').html(obj.position);\n\t\t}\n\t\n\t\t//showAllRows('false');\n\t}",
"function drawChessboard(rows, columns) {\n return 28\n}",
"graph(){\n var tiet= [{ \"mista\": \"A\",\"mihin\": \"B\", \"kesto\": 3}, {\"mista\": \"B\", \"mihin\": \"D\",\"kesto\": 2 },\n { \"mista\": \"D\",\"mihin\": \"A\", \"kesto\": 1 },{\"mista\": \"A\",\"mihin\": \"C\", \"kesto\": 1},\n {\"mista\": \"C\",\"mihin\": \"D\", \"kesto\": 5},{\"mista\": \"C\",\"mihin\": \"E\",\"kesto\": 2},\n { \"mista\": \"E\",\"mihin\": \"D\", \"kesto\": 3},{ \"mista\": \"E\",\"mihin\": \"F\", \"kesto\": 1},\n {\"mista\": \"F\", \"mihin\": \"G\", \"kesto\": 1 }, { \"mista\": \"G\", \"mihin\": \"H\",\"kesto\": 2 },\n{\"mista\": \"H\", \"mihin\": \"I\", \"kesto\": 2 },{ \"mista\": \"I\",\"mihin\": \"J\",\"kesto\": 1},\n { \"mista\": \"I\",\"mihin\": \"G\",\"kesto\": 1 },{\"mista\": \"G\",\"mihin\": \"K\",\"kesto\": 8},\n { \"mista\": \"K\", \"mihin\": \"L\",\"kesto\": 1 }, {\"mista\": \"L\", \"mihin\": \"M\", \"kesto\": 1 },\n {\"mista\": \"E\", \"mihin\": \"M\", \"kesto\": 10},{ \"mista\": \"M\",\"mihin\": \"N\",\"kesto\": 2},\n {\"mista\": \"N\",\"mihin\": \"O\",\"kesto\": 2},{\"mista\": \"O\",\"mihin\": \"P\", \"kesto\": 2},\n {\"mista\": \"O\",\"mihin\": \"Q\", \"kesto\": 1},{\"mista\": \"P\",\"mihin\": \"Q\", \"kesto\": 2},\n{ \"mista\": \"N\",\"mihin\": \"Q\",\"kesto\": 1},{ \"mista\": \"Q\",\"mihin\": \"R\",\"kesto\": 5},\n {\"mista\": \"R\",\"mihin\": \"N\",\"kesto\": 3},{\"mista\": \"D\",\"mihin\": \"R\",\"kesto\": 6}]\n var graph = {\"start\" : {}}\n\n for(let i = 0; i < tiet.length; i++){\n\n if(graph[tiet[i][\"mista\"]] === undefined){\n graph[tiet[i][\"mista\"]] = {}\n graph[tiet[i][\"mista\"]][tiet[i][\"mihin\"]] = tiet[i][\"kesto\"] \n\n }\n if(graph[tiet[i][\"mihin\"]] === undefined){\n graph[tiet[i][\"mihin\"]] = {}\n graph[tiet[i][\"mihin\"]][tiet[i][\"mista\"]] = tiet[i][\"kesto\"] \n\n }\n graph[tiet[i][\"mihin\"]][tiet[i][\"mista\"]] = tiet[i][\"kesto\"] \n graph[tiet[i][\"mista\"]][tiet[i][\"mihin\"]] = tiet[i][\"kesto\"] \n }\n graph[\"finish\"] ={};\n return graph;\n }",
"function renderPieChart() {\n var i, x, y, r, a1, a2, set, sum;\n\n i = 0;\n x = width / 2;\n y = height / 2;\n r = Math.min(x, y) - 2;\n a1 = 1.5 * Math.PI;\n a2 = 0;\n set = sets[0];\n sum = sumSet(set);\n\n for (i = 0; i < set.length; i++) {\n ctx.fillStyle = getColorForIndex(i);\n ctx.beginPath();\n a2 = a1 + (set[i] / sum) * (2 * Math.PI);\n\n // TODO opts.wedge\n ctx.arc(x, y, r, a1, a2, false);\n ctx.lineTo(x, y);\n ctx.fill();\n a1 = a2;\n }\n }",
"function problem5() {\r\n\tdocument.getElementById(\"problem5\")\r\n\r\n\tvar num1 = Number(prompt(\"Please enter number 1.\"));\r\n\tvar num2 = Number(prompt(\"Please enter number 2.\"));\r\n\tvar num3 = Number(prompt(\"Please enter number 3.\"));\r\n\r\n\t\tif(num1 >= num2 && num2 >= num3) {\r\n\t\t\tdocument.write(num3 + \", \" + num2 + \", \" + num1);\r\n\t\t}\r\n\r\n\t\telse if(num2 >= num3 && num3 >= num1) {\r\n\t\t\tdocument.write(num1 + \", \" + num3 + \", \" + num2);\r\n\t\t}\r\n\r\n\t\telse if(num3 >= num1 && num1 >=num2) {\r\n\t\t\tdocument.write(num2 + \", \" + num1 + \", \" + num3);\r\n\t\t}\r\n\r\n\t\telse if(num1 >= num3 && num3 >= num2) {\r\n\t\t\tdocument.write(num2 + \", \" + num3 + \", \" + num1);\r\n\t\t}\r\n\r\n\t\telse if(num2 >= num1 && num1 >= num3) {\r\n\t\t\tdocument.write(num3 + \", \" + num1 + \", \" + num2);\r\n\t\t}\r\n\r\n\t\telse {\r\n\t\t\tdocument.write(num1 + \", \" + num2 + \", \" + num3);\r\n\t\t}\r\n\t\r\n\trefreshIt();\r\n}",
"function threeDiceRoll(i, j, k) {\n var count = 0;\n for (i = 1; i <= 10; i++) {\n for (j = 1; j <= 10; j++) {\n for (k = 1; k <= 10; k++) {\n console.log(i, j, k);\n count++;\n }\n }\n }\n console.log(\"count: \", count);\n}",
"function DrawProspectCount(c,x,y,d) {\n\tvar canvas = document.getElementById(c);\n\tvar context = canvas.getContext(\"2d\");\n\tvar lineWidth = 10;\n\tcontext.save();\n\t//draw tables\n\tcontext.beginPath();\n\tcontext.fillStyle=\"#000000\";\n\tcontext.beginPath();\n\tcontext.rect(x+20, y , 130, -60);\n\tcontext.fill();\n\n\tcontext.beginPath();\n\tcontext.moveTo(x, y-65);\n\tcontext.lineTo(x+170, y-65);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\t//\n\tcontext.beginPath();\n\tcontext.arc(x+130, y-80, 25, Math.PI, 2* Math.PI, false);\n\tcontext.rect(x+105, y-70 , 50, -10);\n\tcontext.fillStyle = \"#000000\";\n\tcontext.fill();\n\t\n\t\n\tcontext.beginPath();\n\tcontext.moveTo(x+100, y-113);\n\tcontext.lineTo(x+160, y-113);\n\tcontext.lineTo(x+150, y-140);\n\tcontext.lineTo(x+110, y-140);\n\tcontext.lineTo(x+100, y-113);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"square\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\tcontext.fillStyle = \"#000000\";\n\tcontext.fill();\n\t\n\t\n\t//draw sit man\n\tcontext.beginPath();\n\tcontext.arc(x+50, y-120, 20, 0, 2 * Math.PI, false);\n\tcontext.fillStyle = \"#000000\";\n\tcontext.fill();\n\tcontext.beginPath();\n\t\n\tcontext.moveTo(x+50, y - 120);\n\tcontext.lineTo(x+40, y - 70);\n\tcontext.moveTo(x+48, y - 90);\n\tcontext.quadraticCurveTo(x +90, y -45, x+50, y-110);\n\tcontext.moveTo(x+48, y - 90);\n\tcontext.quadraticCurveTo(x +30, y -85, x+10, y-110);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\t//draw stand man\n\tcontext.beginPath();\n\tcontext.arc(x-45, y-140, 20, 0, 2 * Math.PI, false);\n\tcontext.fillStyle = \"#000000\";\n\tcontext.fill();\n\tcontext.beginPath();\n\t\n\tcontext.moveTo(x-45, y - 150);\n\tcontext.lineTo(x-45, y - 5);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\tcontext.beginPath();\n\tcontext.moveTo(x-45, y - 70);\n\tcontext.quadraticCurveTo(x -60, y -25, x-70, y-10);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\tcontext.beginPath();\n\tcontext.moveTo(x-45, y - 110);\n\tcontext.quadraticCurveTo(x -30, y -45, x-10, y-110);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\tcontext.beginPath();\n\tcontext.moveTo(x-45, y - 110);\n\tcontext.lineTo(x-70, y - 70);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tcontext.strokeStyle = \"#000000\";\n\tcontext.stroke();\n\t\n\t//write text\n\tcontext.font = \"32pt Calibri\";\n\tcontext.fillStyle = \"#ffffff\";\n\tcontext.fillText(d, x+40, y-20);\n\t\n\tcontext.font = \"32pt Calibri\";\n\tcontext.fillStyle = \"#FFFFFF\";\n\tcontext.fillText(\"Prospect Count\", x-100, y-230);\n\n\tcontext.restore();\n}",
"function drawChessboard(size){\nvar board = \"\".repeat(size);\nfor(var i = 0; i < size; i++){\n for(var a = 0; a < size; a++){\n board += (a % 2) == (i % 2) ? \" \" : \"#\";\n }\n board += \"\\n\";\n}console.log(board);\n}",
"function createBoard(n) {\n let i, j;\n let text = `<svg height=\"${n * 30}\" width=\"${n * 30}\">`;\n for (i = 0; i < n; i++) {\n text += `<line x1=\"${i * 30 + 15}\" y1=\"15\" x2=\"${i * 30 + 15}\" \ny2=\"${n * 30 - 15}\" style=\"stroke:rgb(0,0,0);stroke-width:2\" />`;\n text += `<line x1=\"15\" y1=\"${i * 30 + 15}\" x2=\"${n * 30 - 15}\" y2=\"${i * 30 + 15}\" style=\"stroke:rgb(0,0,0);stroke-width:2\" />`;\n }\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n let x = i * 30 + 15;\n let y = j * 30 + 15;\n text += `<g id=\"x${i}y${j}\">\n<circle cx=\"${x}\" cy=\"${y}\" r=\"15\" stroke=\"black\" stroke-opacity=\"0\" />\n<g class=\"marker\">\n<path d=\"M ${x-8} ${y-2} L ${x-2} ${y-2} L ${x-2} ${y-8} z\"></path>\n<path d=\"M ${x-8} ${y+2} L ${x-2} ${y+2} L ${x-2} ${y+8} z\"></path>\n<path d=\"M ${x+8} ${y-2} L ${x+2} ${y-2} L ${x+2} ${y-8} z\"></path>\n<path d=\"M ${x+8} ${y+2} L ${x+2} ${y+2} L ${x+2} ${y+8} z\"></path>\n</g>\n<text id=\"text-x${i}y${j}\" x=\"${i * 30 + 15}\" y=\"${j * 30 + 15}\"></text></g>`;\n }\n }\n text += '</svg>';\n document.getElementById('board').innerHTML = text;\n board = createBoardObject(n);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
what to do when the slide changes | function slideChanged(evt) {
if (!printMode) {
// hide pen dialog
hideColorPicker();
// determine current fragment index
currentFragmentIndex = Reveal.getIndices().f;
// hide all SVG's
slides.querySelectorAll("svg.whiteboard").forEach((svg) => {
svg.style.display = "none";
});
// clear laser strokes from SVGs
clearLaserStrokes();
// setup and show current slide's SVG (adjust slide height before!)
setupSVG();
svg.style.display = "block";
// activate/deactivate SVG
toggleWhiteboard(whiteboardActive);
// set height based on annotations
adjustWhiteboardHeight();
// setup slides container
slides.classList.remove("animateScroll");
slides.scrollTop = 0;
if (svg.clientHeight > slides.clientHeight)
slides.classList.add("needScrollbar");
else slides.classList.remove("needScrollbar");
// adjust fragment visibility
fragmentChanged();
// update SVG grid icon
buttonGrid.dataset.active = !!svg && !!getGridRect();
// clear undo history (updates icon)
clearUndoHistory();
// just to be sure, update slide zoom
slideZoom = slides.style.zoom || 1;
}
} | [
"moveToSlide( slide) {\n console.debug( \"dia-show › moveToSlide()\", slide);\n this.slide = slide != undefined ? slide : null;\n }",
"function intervalCallback() {\n if (currentSlide === 4) {\n changeSlides(currentSlide, 0);\n } else {\n changeSlides(currentSlide, currentSlide + 1);\n }\n }",
"slideNext() {\n super.slideNext();\n this.slides[this.lastSlide].style.opacity = 0;\n this.slides[this._index].style.opacity = 1;\n }",
"function show_curr_slide(){\n slides.eq(curr).show();\n adjust_nav();\n }",
"function slider() {\n if (position) {\n buildSlidePositionHtml(numSlides);\n }\n\n if (navigation) {\n buildSlideNavHtml();\n }\n\n if (autoPlay) {\n play();\n }\n}",
"function SlideState(){\n\tviewState = new stateClass(stk[stkCurr]);\n\tToState(stk[stkCurr].state);\n}",
"function onSlide(event, ui) {\n\tvar values = ui.values;\n\tCLUB.lowValue = values[0];\n\tCLUB.highValue = values[1];\n\tupdateSliderValues();\n\tsetSelectedData();\n}",
"_onSlideSelected( event) {\n const selectedSlide = event.detail.slide;\n console.debug( `dia-show › on-slide-selected: ${selectedSlide}`);\n this.moveToSlide( selectedSlide);\n if( event.cancellable) { event.stopPropagation(); }\n }",
"performSlide() {\n if (this.prevSlide) {\n this.prevSlide.removeClass('prev fade-out')\n }\n\n this.nextSlide.removeClass('next');\n this.prevSlide = this.nextSlide;\n this.prevSlide.addClass('prev');\n\n this.currentIndex++;\n if (this.currentIndex >= this.slides.length) {\n this.currentIndex = 0\n }\n\n this.setNextSlide();\n\n this.prevSlide.addClass('fade-out');\n }",
"function SlideshowToggle(){\r\n if( G.VOM.playSlideshow ) {\r\n window.clearTimeout(G.VOM.playSlideshowTimerID);\r\n G.VOM.playSlideshow=false;\r\n G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPlay);\r\n }\r\n else {\r\n G.VOM.playSlideshow=true;\r\n DisplayNextImage();\r\n G.VOM.$viewer.find('.playPauseButton').html(G.O.icons.viewerPause);\r\n }\r\n }",
"function changeImage(){\n\tdocument.getElementById(slidename).src = slideImages[step].src\n}",
"function displaySlide()\n{\n var h;\n\n /* curslide has class=slide, page-break-before=always or is an H1 */\n curslide.style.cssText = curslide.b6savedstyle;\n curslide.classList.add(\"active\");\t\t// Compatibility with Shower\n liveregion.innerHTML = \"\";\t\t\t// Make it empty\n\n if (!curslide.classList.contains('slide')) {\n liveregion.appendChild(cloneNodeWithoutID(curslide));\n /* Unhide all elements until the next slide. And copy the slide to\n the live region so that it is spoken */\n for (h = curslide.nextSibling; h && !isStartOfSlide(h); h = h.nextSibling)\n if (h !== liveregion) {\n\tif (h.nodeType === 1) h.style.cssText = h.b6savedstyle;\n\tliveregion.appendChild(cloneNodeWithoutID(h));\n }\n\n } else {\t\t\t\t\t// class=slide\n /* Copy the contents of the slide to the live region so that it is spoken */\n for (h = curslide.firstChild; h; h = h.nextSibling)\n liveregion.appendChild(cloneNodeWithoutID(h));\n }\n\n updateProgress();\n initIncrementals();\n}",
"function switchSlides() {\n\n pit.cookies.set({\n name: 'cur_slide',\n value: 'presentation~' + window.location.pathname.split('/')[3] + curSlide,\n expires: 21600,\n path: '/'\n });\n\n for (var i = 0; i < slides.length; i++) {\n\n if (i < slidesOrder.indexOf(curSlide)) {\n\n slides[i].classList.remove('presentation__slide--active', 'presentation__slide--after');\n slides[i].classList.add('presentation__slide--before', 'presentation__slide--inactive');\n continue;\n\n }\n if (i > slidesOrder.indexOf(curSlide)) {\n\n slides[i].classList.remove('presentation__slide--active', 'presentation__slide--before');\n slides[i].classList.add('presentation__slide--after', 'presentation__slide--inactive');\n\n }\n\n }\n\n if (slidesOrder.indexOf(curSlide) !== -1) {\n\n slides[slidesOrder.indexOf(curSlide)].classList.remove('presentation__slide--after', 'presentation__slide--before', 'presentation__slide--inactive');\n slides[slidesOrder.indexOf(curSlide)].classList.add('presentation__slide--active');\n progressBar.style.width = parseInt(slidesOrder.indexOf(curSlide)/(slides.length-1) * 100) + '%';\n\n }\n\n if (slidesOrder.indexOf(curSlide) === 0) {\n\n prevSlideBtn.classList.add('hide');\n\n } else {\n\n prevSlideBtn.classList.remove('hide');\n\n }\n\n if (slidesOrder.indexOf(curSlide) === slides.length - 1) {\n\n nextSlideBtn.classList.add('hide');\n\n } else {\n\n nextSlideBtn.classList.remove('hide');\n\n }\n\n }",
"handleClick (event) {\n minusSlides(1);\n }",
"function swapSlide(container,opt) {\r\n\r\n\r\n\t\t\topt.transition = 1;\r\n\t\t\topt.videoplaying = false;\r\n\r\n\t\t\ttry{\r\n\t\t\t\tvar actli = container.find('>ul:first-child >li:eq('+opt.act+')');\r\n\t\t\t} catch(e) {\r\n\t\t\t\tvar actli=container.find('>ul:first-child >li:eq(1)');\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar nextli = container.find('>ul:first-child >li:eq('+opt.next+')');\r\n\r\n\t\t\tvar actsh = actli.find('.slotholder');\r\n\t\t\tvar nextsh = nextli.find('.slotholder');\r\n\t\t\tactli.css({'visibility':'visible'});\r\n\t\t\tnextli.css({'visibility':'visible'});\r\n\r\n\t\t\tif (opt.ie) {\r\n\t\t\t\tif (nextli.data('transition')==\"boxfade\") nextli.data('transition',\"boxslide\");\r\n\t\t\t\tif (nextli.data('transition')==\"slotfade-vertical\") nextli.data('transition',\"slotzoom-vertical\");\r\n\t\t\t\tif (nextli.data('transition')==\"slotfade-horizontal\") nextli.data('transition',\"slotzoom-horizontal\");\r\n\t\t\t}\r\n\r\n\r\n\t\t\t// IF DELAY HAS BEEN SET VIA THE SLIDE, WE TAKE THE NEW VALUE, OTHER WAY THE OLD ONE...\r\n\t\t\tif (nextli.data('delay')!=undefined) {\r\n\t\t\t\t\t\topt.cd=0;\r\n\t\t\t\t\t\topt.delay=nextli.data('delay');\r\n\t\t\t} else {\r\n\t\t\t\topt.delay=opt.origcd;\r\n\t\t\t}\r\n\r\n\t\t\t// RESET POSITION AND FADES OF LI'S\r\n\t\t\tactli.css({'left':'0px','top':'0px'});\r\n\t\t\tnextli.css({'left':'0px','top':'0px'});\r\n\r\n\t\t\t///////////////////////////////////////\r\n\t\t\t// TRANSITION CHOOSE - RANDOM EFFECTS//\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tvar nexttrans = 0;\r\n\r\n\r\n\r\n\r\n\t\t\tif (nextli.data('transition')==\"boxslide\") nexttrans = 0\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"boxfade\") nexttrans = 1\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotslide-horizontal\") nexttrans = 2\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotslide-vertical\") nexttrans = 3\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"curtain-1\") nexttrans = 4\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"curtain-2\") nexttrans = 5\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"curtain-3\") nexttrans = 6\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotzoom-horizontal\") nexttrans = 7\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotzoom-vertical\") nexttrans = 8\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotfade-horizontal\") nexttrans = 9\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slotfade-vertical\") nexttrans = 10\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"fade\") nexttrans = 11\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slideleft\") nexttrans = 12\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slideup\") nexttrans = 13\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slidedown\") nexttrans = 14\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"slideright\") nexttrans = 15;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"papercut\") nexttrans = 16;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"3dcurtain-horizontal\") nexttrans = 17;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"3dcurtain-vertical\") nexttrans = 18;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"cubic\") nexttrans = 19;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"flyin\") nexttrans = 20;\r\n\t\t\telse\r\n\t\t\t\tif (nextli.data('transition')==\"turnoff\") nexttrans = 21;\r\n\t\t\telse {\r\n\t\t\t\tnexttrans=Math.round(Math.random()*21);\r\n\t\t\t\tnextli.data('slotamount',Math.round(Math.random()*12+4));\r\n\t\t\t}\r\n\r\n\t\t\tif (nextli.data('transition')==\"random-static\") {\r\n\t\t\t\t\t\tnexttrans=Math.round(Math.random()*16);\r\n\t\t\t\t\t\tif (nexttrans>15) nexttrans=15;\r\n\t\t\t\t\t\tif (nexttrans<0) nexttrans=0;\r\n\t\t\t}\r\n\r\n\t\t\tif (nextli.data('transition')==\"random-premium\") {\r\n\t\t\t\t\t\tnexttrans=Math.round(Math.random()*6+16);\r\n\t\t\t\t\t\tif (nexttrans>21) nexttrans=21;\r\n\t\t\t\t\t\tif (nexttrans<16) nexttrans=16;\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t var direction=-1;\r\n\t\t\tif (opt.leftarrowpressed==1 || opt.act>opt.next) direction=1;\r\n\r\n\t\t\tif (nextli.data('transition')==\"slidehorizontal\") {\r\n\t\t\t\t\t\tnexttrans = 12\r\n\t\t\t\t\tif (opt.leftarrowpressed==1)\r\n\t\t\t\t\t\tnexttrans = 15\r\n\t\t\t\t}\r\n\r\n\t\t\tif (nextli.data('transition')==\"slidevertical\") {\r\n\t\t\t\t\t\tnexttrans = 13\r\n\t\t\t\t\tif (opt.leftarrowpressed==1)\r\n\t\t\t\t\t\tnexttrans = 14\r\n\t\t\t\t}\r\n\r\n\t\t\topt.leftarrowpressed=0;\r\n\r\n\r\n\r\n\t\t\tif (nexttrans>21) nexttrans = 21;\r\n\t\t\tif (nexttrans<0) nexttrans = 0;\r\n\r\n\t\t\tif (!$.support.transition && nexttrans >16) {\r\n\t\t\t\t\tnexttrans=Math.round(Math.random()*16);\r\n\t\t\t\t\tnextli.data('slotamount',Math.round(Math.random()*12+4));\r\n\t\t\t};\r\n\t\t\tif (opt.ie && (nexttrans==17 || nexttrans==16 || nexttrans==2 || nexttrans==3 || nexttrans==9 || nexttrans==10 )) nexttrans=Math.round(Math.random()*3+12);\r\n\r\n\r\n\t\t\tif (opt.ie9 && (nexttrans==3)) nexttrans = 4;\r\n\r\n\r\n\t\t\t//$('body').find('.debug').html(\"Transition:\"+nextli.data('transition')+\" id:\"+nexttrans);\r\n\r\n\t\t\t// DEFINE THE MASTERSPEED FOR THE SLIDE //\r\n\t\t\tvar masterspeed=300;\r\n\t\t\tif (nextli.data('masterspeed')!=undefined && nextli.data('masterspeed')>99 && nextli.data('masterspeed')<4001)\r\n\t\t\t\tmasterspeed = nextli.data('masterspeed');\r\n\r\n\r\n\r\n\t\t\t/////////////////////////////////////////////\r\n\t\t\t// SET THE BULLETS SELECTED OR UNSELECTED //\r\n\t\t\t/////////////////////////////////////////////\r\n\r\n\r\n\t\t\tcontainer.parent().find(\".bullet\").each(function() {\r\n\t\t\t\tvar bul = $(this);\r\n\t\t\t\tbul.removeClass(\"selected\");\r\n\t\t\t\tif (bul.index() == opt.next) bul.addClass('selected');\r\n\t\t\t});\r\n\r\n\r\n\t\t\t//////////////////////////////////////////////////////////////////\r\n\t\t\t// \t\tSET THE NEXT CAPTION AND REMOVE THE LAST CAPTION\t\t//\r\n\t\t\t//////////////////////////////////////////////////////////////////\r\n\r\n\t\t\t\t\tcontainer.find('>li').each(function() {\r\n\t\t\t\t\t\tvar li = $(this);\r\n\t\t\t\t\t\tif (li.index!=opt.act && li.index!=opt.next) li.css({'z-index':16});\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tactli.css({'z-index':18});\r\n\t\t\t\t\tnextli.css({'z-index':20});\r\n\t\t\t\t\tnextli.css({'opacity':0});\r\n\r\n\r\n\t\t\t///////////////////////////\r\n\t\t\t//\tANIMATE THE CAPTIONS //\r\n\t\t\t///////////////////////////\r\n\t\t\tremoveTheCaptions(actli,opt);\r\n\t\t\tanimateTheCaptions(nextli, opt);\r\n\r\n\r\n\r\n\r\n\t\t\t/////////////////////////////////////////////\r\n\t\t\t//\tSET THE ACTUAL AMOUNT OF SLIDES !! //\r\n\t\t\t// SET A RANDOM AMOUNT OF SLOTS //\r\n\t\t\t///////////////////////////////////////////\r\n\t\t\t\t\t\tif (nextli.data('slotamount')==undefined || nextli.data('slotamount')<1) {\r\n\t\t\t\t\t\t\topt.slots=Math.round(Math.random()*12+4);\r\n\t\t\t\t\t\t\tif (nextli.data('transition')==\"boxslide\")\r\n\t\t\t\t\t\t\t\topt.slots=Math.round(Math.random()*6+3);\r\n\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\topt.slots=nextli.data('slotamount');\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t/////////////////////////////////////////////\r\n\t\t\t//\tSET THE ACTUAL AMOUNT OF SLIDES !! //\r\n\t\t\t// SET A RANDOM AMOUNT OF SLOTS //\r\n\t\t\t///////////////////////////////////////////\r\n\t\t\t\t\t\tif (nextli.data('rotate')==undefined)\r\n\t\t\t\t\t\t\topt.rotate = 0\r\n\t\t\t\t\t\t else\r\n\t\t\t\t\t\t\tif (nextli.data('rotate')==999)\r\n\t\t\t\t\t\t\t\topt.rotate=Math.round(Math.random()*360);\r\n\t\t\t\t\t\t\t else\r\n\t\t\t\t\t\t\t opt.rotate=nextli.data('rotate');\r\n\t\t\t\t\t\tif (!$.support.transition || opt.ie || opt.ie9) opt.rotate=0;\r\n\r\n\r\n\r\n\t\t\t//////////////////////////////\r\n\t\t\t//\tFIRST START \t\t\t//\r\n\t\t\t//////////////////////////////\r\n\r\n\t\t\tif (opt.firststart==1) {\r\n\t\t\t\t\tactli.css({'opacity':0});\r\n\t\t\t\t\topt.firststart=0;\r\n\t\t\t}\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==0) {\t\t\t\t\t\t\t\t// BOXSLIDE\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideBox(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideBox(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\tss.transition({top:(0-opt.sloth),left:(0-opt.slotw)},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({top:(0-opt.sloth),left:(0-opt.slotw), rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0, left:0, scale:1, rotate:0},masterspeed*1.5,function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==(opt.slots*opt.slots)-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*15);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==1) {\r\n\r\n\r\n\t\t\t\t\t\tif (opt.slots>5) opt.slots=5;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\t//prepareOneSlideBox(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideBox(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.css({'opacity':0});\r\n\t\t\t\t\t\t\tss.find('img').css({'opacity':0});\r\n\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\tss.find('img').transition({'top':(Math.random()*opt.slotw-opt.slotw)+\"px\",'left':(Math.random()*opt.slotw-opt.slotw)+\"px\"},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.find('img').transition({'top':(Math.random()*opt.slotw-opt.slotw)+\"px\",'left':(Math.random()*opt.slotw-opt.slotw)+\"px\", rotate:opt.rotate},0);\r\n\r\n\t\t\t\t\t\t\tvar rand=Math.random()*1000+(masterspeed + 200);\r\n\t\t\t\t\t\t\tif (j==(opt.slots*opt.slots)-1) rand=1500;\r\n\r\n\t\t\t\t\t\t\t\t\tss.find('img').transition({'opacity':1,'top':(0-ss.data('y'))+\"px\",'left':(0-ss.data('x'))+'px', rotate:0},rand);\r\n\t\t\t\t\t\t\t\t\tss.transition({'opacity':1},rand,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==(opt.slots*opt.slots)-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==2) {\r\n\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 200;\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t//ss.animate({'left':opt.slotw+'px'},{duration:masterspeed,queue:false,complete:function() {\r\n\t\t\t\t\t\t\t\t\tss.transit({'left':opt.slotw+'px',rotate:(0-opt.rotate)},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\tss.transit({'left':(0-opt.slotw)+\"px\"},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transit({'left':(0-opt.slotw)+\"px\",rotate:opt.rotate},0);\r\n\r\n\t\t\t\t\t\t\t\t\tss.transit({'left':'0px',rotate:0},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (opt.ie) actsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==3) {\r\n\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 200;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideV(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\r\n\t\t\t\t\t\t\t\t\tss.transit({'top':opt.sloth+'px',rotate:opt.rotate},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\tss.transit({'top':(0-opt.sloth)+\"px\"},0);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tss.transit({'top':(0-opt.sloth)+\"px\",rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\t\tss.transit({'top':'0px',rotate:0},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==4) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\r\n\t\t\t\t\t\t\tss.transit({'top':(0+(opt.height))+\"px\",'opacity':1,rotate:opt.rotate},masterspeed+(i*(70-opt.slots)));\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0},0);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0,rotate:opt.rotate},0);\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+(i*(70-opt.slots)),function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (i==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==5) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'top':(0+(opt.height))+\"px\",'opacity':1,rotate:opt.rotate},masterspeed+((opt.slots-i)*(70-opt.slots)));\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0},0);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0,rotate:opt.rotate},0);\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+((opt.slots-i)*(70-opt.slots)),function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (i==0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t/////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION I. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==6) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\t\t\t\t\t\tif (opt.slots<2) opt.slots=2;\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\r\n\t\t\t\t\t\t\tif (i<opt.slots/2)\r\n\t\t\t\t\t\t\t\tvar tempo = (i+2)*60;\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tvar tempo = (2+opt.slots-i)*60;\r\n\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'top':(0+(opt.height))+\"px\",'opacity':1},masterspeed+tempo);\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({'top':(0-(opt.height))+\"px\",'opacity':0,rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\tif (i<opt.slots/2)\r\n\t\t\t\t\t\t\t\tvar tempo = (i+2)*60;\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tvar tempo = (2+opt.slots-i)*60;\r\n\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'top':'0px','opacity':1,rotate:0},masterspeed+tempo,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (i==Math.round(opt.slots/2)) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t////////////////////////////////////\r\n\t\t\t// THE SLOTSZOOM - TRANSITION II. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==7) {\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed * 3;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this).find('img');\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'left':(0-opt.slotw/2)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'top':(0-opt.height/2)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'width':(opt.slotw*2)+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'height':(opt.height*2)+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t opacity:0,\r\n\t\t\t\t\t\t\t\t\t\t\t\t rotate:opt.rotate\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\r\n/\t\t\t\t\t\t//////////////////////////////////////////////////////////////\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\r\n\t\t\t\t\t\t///////////////////////////////////////////////////////////////\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this).find('img');\r\n\r\n\t\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'left':(0)+'px','top':(0)+'px',opacity:0},0);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'left':(0)+'px','top':(0)+'px',opacity:0,rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\t\t\tss.transition({'left':(0-i*opt.slotw)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'top':(0)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'width':(nextsh.find('.defaultimg').data('neww'))+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'height':(nextsh.find('.defaultimg').data('newh'))+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t opacity:1,rotate:0\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t////////////////////////////////////\r\n\t\t\t// THE SLOTSZOOM - TRANSITION II. //\r\n\t\t\t////////////////////////////////////\r\n\t\t\tif (nexttrans==8) {\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed * 3;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideV(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,true);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t// ALL OLD SLOTS SHOULD BE SLIDED TO THE RIGHT\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function() {\r\n\t\t\t\t\t\t\tvar ss=$(this).find('img');\r\n\r\n\t\t\t\t\t\t\t\t\tss.transition({'left':(0-opt.width/2)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'top':(0-opt.sloth/2)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'width':(opt.width*2)+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'height':(opt.sloth*2)+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t opacity:0,rotate:opt.rotate\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT //\r\n\t\t\t\t\t\t///////////////////////////////////////////////////////////////\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this).find('img');\r\n\t\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'left':(0)+'px','top':(0)+'px',opacity:0},0);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tss.transition({'left':(0)+'px','top':(0)+'px',opacity:0,rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\t\t\tss.transition({'left':(0)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'top':(0-i*opt.sloth)+'px',\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'width':(nextsh.find('.defaultimg').data('neww'))+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t 'height':(nextsh.find('.defaultimg').data('newh'))+\"px\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t opacity:1,rotate:0\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t},masterspeed,function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSFADE - TRANSITION III. //\r\n\t\t\t//////////////////////////////////////\r\n\t\t\tif (nexttrans==9) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\topt.slots = opt.width/20;\r\n\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\tvar ssamount=0;\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tssamount++;\r\n\t\t\t\t\t\t\tss.transition({'opacity':0,x:0,y:0},0);\r\n\t\t\t\t\t\t\tss.data('tout',setTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({x:0,y:0,'opacity':1},masterspeed);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t},i*4)\r\n\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t//nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4)));\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\tif (opt.ie) actsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t},(masterspeed+(ssamount*4)));\r\n\t\t\t}\r\n\r\n\r\n\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSFADE - TRANSITION III. //\r\n\t\t\t//////////////////////////////////////\r\n\t\t\tif (nexttrans==10) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\topt.slots = opt.height/20;\r\n\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,true);\r\n\r\n\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\tvar ssamount=0;\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tssamount++;\r\n\t\t\t\t\t\t\tss.transition({'opacity':0,x:0,y:0},0);\r\n\t\t\t\t\t\t\tss.data('tout',setTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({x:0,y:0,'opacity':1},masterspeed);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t},i*4)\r\n\t\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t//nextsh.find('.defaultimg').transition({'opacity':1},(masterspeed+(ssamount*4)));\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\tif (opt.ie) actsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t},(masterspeed+(ssamount*4)));\r\n\t\t\t}\r\n\r\n\r\n\t\t\t///////////////////////////\r\n\t\t\t// SIMPLE FADE ANIMATION //\r\n\t\t\t///////////////////////////\r\n\r\n\t\t\tif (nexttrans==11) {\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\topt.slots = 1;\r\n\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\r\n\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\tvar ssamount=0;\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(i) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tssamount++;\r\n\t\t\t\t\t\t\tif (opt.ie9 ||opt.ie)\r\n\t\t\t\t\t\t\t\tss.transition({'opacity':0},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({'opacity':0,rotate:opt.rotate},0);\r\n\r\n\t\t\t\t\t\t\tss.transition({'opacity':1,rotate:0},masterspeed);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\tif (opt.ie) actsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t},masterspeed);\r\n\t\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t\t\tif (nexttrans==12 || nexttrans==13 || nexttrans==14 || nexttrans==15) {\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed * 3;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\topt.slots = 1;\r\n\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\r\n\r\n\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\t\t\t\t\t\tvar oow = opt.width;\r\n\t\t\t\t\t\tvar ooh = opt.height;\r\n\t\t\t\t\t\tif (opt.fullWidth==\"on\") {\r\n\t\t\t\t\t\t\toow=opt.container.parent().width();\r\n\t\t\t\t\t\t\tooh=opt.container.parent().height();\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\t\t\t\t\t\tvar ssn=nextsh.find('.slotslide')\r\n\t\t\t\t\t\tif (nexttrans==12)\r\n\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\tssn.transition({'left':oow+\"px\"},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tssn.transition({'left':oow+\"px\",rotate:opt.rotate},0);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tif (nexttrans==15)\r\n\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\tssn.transition({'left':(0-opt.width)+\"px\"},0);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tssn.transition({'left':(0-opt.width)+\"px\",rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tif (nexttrans==13)\r\n\t\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\tssn.transition({'top':(ooh)+\"px\"},0);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tssn.transition({'top':(ooh)+\"px\",rotate:opt.rotate},0);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tif (nexttrans==14)\r\n\t\t\t\t\t\t\t\t\t\tif (opt.ie9)\r\n\t\t\t\t\t\t\t\t\t\t\tssn.transition({'top':(0-opt.height)+\"px\"},0);\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\tssn.transition({'top':(0-opt.height)+\"px\",rotate:opt.rotate},0);\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\tssn.transition({'left':'0px','top':'0px',opacity:1,rotate:0},masterspeed,function() {\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt,0);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\r\n\r\n\t\t\t\t\t\tvar ssa=actsh.find('.slotslide');\r\n\r\n\t\t\t\t\t\t\t\tif (nexttrans==12)\r\n\t\t\t\t\t\t\t\t\tssa.transition({'left':(0-oow)+'px',opacity:1,rotate:0},masterspeed);\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\tif (nexttrans==15)\r\n\t\t\t\t\t\t\t\t\t\tssa.transition({'left':(oow)+'px',opacity:1,rotate:0},masterspeed);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\tif (nexttrans==13)\r\n\t\t\t\t\t\t\t\t\t\t\tssa.transition({'top':(0-ooh)+'px',opacity:1,rotate:0},masterspeed);\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\tif (nexttrans==14)\r\n\t\t\t\t\t\t\t\t\t\t\t\tssa.transition({'top':(ooh)+'px',opacity:1,rotate:0},masterspeed);\r\n\r\n\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t\t//////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XVI. //\r\n\t\t\t//////////////////////////////////////\r\n\t\t\tif (nexttrans==16) {\t\t\t\t\t\t// PAPERCUT\r\n\r\n\t\t\t\t\tactli.css({'position':'absolute','z-index':20});\r\n\t\t\t\t\tnextli.css({'position':'absolute','z-index':15});\r\n\t\t\t\t\t// PREPARE THE CUTS\r\n\t\t\t\t\tactli.wrapInner('<div class=\"tp-half-one\"></div>');\r\n\t\t\t\t\tactli.find('.tp-half-one').clone(true).appendTo(actli).addClass(\"tp-half-two\");\r\n\t\t\t\t\tactli.find('.tp-half-two').removeClass('tp-half-one');\r\n\t\t\t\t\tactli.find('.tp-half-two').wrapInner('<div class=\"tp-offset\"></div>');\r\n\r\n\t\t\t\t\t// ANIMATE THE CUTS\r\n\t\t\t\t\tvar img=actli.find('.defaultimg');\r\n\t\t\t\t\tif (img.length>0 && img.data(\"fullwidthcentering\")==\"on\") {\r\n\t\t\t\t\t\tvar imgh=img.height()/2;\r\n\t\t\t\t\t\tvar to=img.position().top;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar imgh=opt.height/2;\r\n\t\t\t\t\t\tvar to=0;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tactli.find('.tp-half-one').css({'width':opt.width+\"px\",'height':(to+imgh)+\"px\",'overflow':'hidden','position':'absolute','top':'0px','left':'0px'});\r\n\t\t\t\t\tactli.find('.tp-half-two').css({'width':opt.width+\"px\",'height':(to+imgh)+\"px\",'overflow':'hidden','position':'absolute','top':(to+imgh)+'px','left':'0px'});\r\n\t\t\t\t\tactli.find('.tp-half-two .tp-offset').css({'position':'absolute','top':(0-imgh-to)+'px','left':'0px'});\r\n\r\n\r\n\t\t\t\t\t// Delegate .transition() calls to .animate()\r\n\t\t\t\t\t// if the browser can't do CSS transitions.\r\n\t\t\t\t\tif (!$.support.transition) {\r\n\r\n\t\t\t\t\t\tactli.find('.tp-half-one').animate({'opacity':0,'top':(0-opt.height/2)+\"px\"},{duration: 500,queue:false});\r\n\t\t\t\t\t\tactli.find('.tp-half-two').animate({'opacity':0,'top':(opt.height)+\"px\"},{duration: 500,queue:false});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar ro1=Math.round(Math.random()*40-20);\r\n\t\t\t\t\t\tvar ro2=Math.round(Math.random()*40-20);\r\n\t\t\t\t\t\tvar sc1=Math.random()*1+1;\r\n\t\t\t\t\t\tvar sc2=Math.random()*1+1;\r\n\t\t\t\t\t\tactli.find('.tp-half-one').transition({opacity:1, scale:sc1, rotate:ro1,y:(0-opt.height/1.4)+\"px\"},800,'in');\r\n\t\t\t\t\t\tactli.find('.tp-half-two').transition({opacity:1, scale:sc2, rotate:ro2,y:(0+opt.height/1.4)+\"px\"},800,'in');\r\n\r\n\t\t\t\t\t\tif (actli.html()!=null) nextli.transition({scale:0.8,x:opt.width*0.1, y:opt.height*0.1, rotate:ro1},0).transition({rotate:0, scale:1,x:0,y:0},600,'snap');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\tsetTimeout(function() {\r\n\r\n\r\n\t\t\t\t\t\t\t\t// CLEAN UP BEFORE WE START\r\n\t\t\t\t\t\t\t\tactli.css({'position':'absolute','z-index':18});\r\n\t\t\t\t\t\t\t\tnextli.css({'position':'absolute','z-index':20});\r\n\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\t\t\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\tif (actli.find('.tp-half-one').length>0) {\r\n\t\t\t\t\t\t\t\t\tactli.find('.tp-half-one >img, .tp-half-one >div').unwrap();\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tactli.find('.tp-half-two').remove();\r\n\t\t\t\t\t\t\t\topt.transition = 0;\r\n\t\t\t\t\t\t\t\topt.act = opt.next;\r\n\r\n\t\t\t\t\t},800);\r\n\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t}\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XVII. //\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tif (nexttrans==17) {\t\t\t\t\t\t\t\t// 3D CURTAIN HORIZONTAL\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideV(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.transition({ opacity:0, rotateY:350 ,rotateX:40, perspective:'1400px'},0);\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({opacity:1, top:0, left:0, scale:1, perspective:'150px', rotate:0,rotateY:0, rotateX:0},masterspeed*2,function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XVIII. //\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tif (nexttrans==18) {\t\t\t\t\t\t\t\t// 3D CURTAIN VERTICAL\r\n\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.transition({ rotateX:10 ,rotateY:310, perspective:'1400px', rotate:0,opacity:0},0);\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0, left:0, scale:1, perspective:'150px', rotate:0,rotateY:0, rotateX:0,opacity:1},masterspeed*2,function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XIX. //\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tif (nexttrans==19) {\t\t\t\t\t\t\t\t// CUBIC VERTICAL\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlide(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlide(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\tvar chix=nextli.css('z-index');\r\n\t\t\t\t\t\tvar chix2=actli.css('z-index');\r\n\r\n\t\t\t\t\t\t//actli.css({'z-index':22});\r\n\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\t//ss.css({'overflow':'visible'});\r\n\t\t\t\t\t\t\tss.parent().css({'overflow':'visible'});\r\n\t\t\t\t\t\t\tss.css({'background':'#333'});\r\n\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\tss.transition({ opacity:0,left:0,top:opt.height/2,perspective:opt.height*100,rotate3d:'1, 0, 0, -90deg '},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({ opacity:0,left:0,top:0-opt.height/2,perspective:opt.height*100,rotate3d:'1, 0, 0, 90deg '},0);\r\n\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({opacity:1,top:0,rotate3d:' 1, 0, 0, 0deg '},masterspeed*2,function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*150);\r\n\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.parent().css({'overflow':'visible'});\r\n\t\t\t\t\t\t\tss.css({'background':'#333'});\r\n\t\t\t\t\t\t\tss.transition({ top:0,perspective: opt.height*100,rotate3d: '1, 0, 0, 0deg'},0);\r\n\t\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\tss.transition({opacity:0.6,left:0,top:0-opt.height/2,rotate3d: '1, 0, 0, 90deg'},masterspeed*2,function() {});\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\tss.transition({opacity:0.6,left:0,top:(0+opt.height/2),rotate3d: '1, 0, 0, -90deg'},masterspeed*2,function() {});\r\n\t\t\t\t\t\t\t},j*150);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XX. //\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tif (nexttrans==20) {\t\t\t\t\t\t\t\t// FLYIN\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\r\n\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideV(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.parent().css({'overflow':'visible'});\r\n\r\n\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\tss.transition({ scale:0.8,top:0,left:0-opt.width,perspective:opt.width,rotate3d: '2, 5, 0, 110deg'},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({ scale:0.8,top:0,left:0+opt.width,perspective:opt.width,rotate3d: '2, 5, 0, -110deg'},0);\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({ scale:0.8,left:0,perspective: opt.width,rotate3d: '1, 5, 0, 0deg'},masterspeed*2,'ease').transition({scale:1},200,'out',function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.transition({ scale:0.5,left:0,perspective: 500,rotate3d: '1, 5, 0, 5deg'},300,'in-out');\r\n\t\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0,left:opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, 70deg',opacity:0},masterspeed*2,'out',function() {});\r\n\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0,left:0-opt.width/2,perspective: opt.width,rotate3d: '0, -3, 0, -70deg',opacity:0},masterspeed*2,'out',function() {});\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\t////////////////////////////////////////\r\n\t\t\t// THE SLOTSLIDE - TRANSITION XX. //\r\n\t\t\t///////////////////////////////////////\r\n\t\t\tif (nexttrans==21) {\t\t\t\t\t\t\t\t// TURNOFF\r\n\t\t\t\t\t\tmasterspeed = masterspeed + 100;\r\n\t\t\t\t\t\tif (opt.slots>10) opt.slots=10;\r\n\r\n\t\t\t\t\t\tnextli.css({'opacity':1});\r\n\r\n\t\t\t\t\t\t// PREPARE THE SLOTS HERE\r\n\t\t\t\t\t\tprepareOneSlideV(actsh,opt,true);\r\n\t\t\t\t\t\tprepareOneSlideV(nextsh,opt,false);\r\n\r\n\t\t\t\t\t\t//SET DEFAULT IMG UNVISIBLE\r\n\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t//actsh.find('.defaultimg').css({'opacity':0});\r\n\r\n\r\n\t\t\t\t\t\t// ALL NEW SLOTS SHOULD BE SLIDED FROM THE LEFT TO THE RIGHT\r\n\r\n\r\n\t\t\t\t\t\tnextsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\tss.transition({ top:0,left:0-(opt.width/2),perspective: opt.width*2,rotate3d: '0, 100, 0, 90deg'},0);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tss.transition({ top:0,left:0+(opt.width/2),perspective: opt.width*2,rotate3d: '0, 100, 0, -90deg'},0);\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({left:0,perspective: opt.width*2,rotate3d: '0, 0, 0, 0deg'},masterspeed*2,function() {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (j==opt.slots-1) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tremoveSlots(container,opt);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnextsh.find('.defaultimg').css({'opacity':1});\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (nextli.index()!=actli.index()) actsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\topt.act=opt.next;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmoveSelectedThumb(container);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tactsh.find('.slotslide').each(function(j) {\r\n\t\t\t\t\t\t\tvar ss=$(this);\r\n\t\t\t\t\t\t\tss.transition({ left:0,perspective: opt.width*2,rotate3d: '0, 0, 0, 0deg'},0);\r\n\t\t\t\t\t\t\tactsh.find('.defaultimg').css({'opacity':0});\r\n\t\t\t\t\t\t\tsetTimeout(function() {\r\n\t\t\t\t\t\t\t\t\t\tif (direction==1)\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0,left:(opt.width/2),perspective: opt.width,rotate3d: '0, 1000, 0, -90deg'},masterspeed*1.5,function() {});\r\n\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\tss.transition({top:0,left:(0-opt.width/2),perspective: opt.width,rotate3d: '0, 1000, 0, +90deg'},masterspeed*1.5,function() {});\r\n\r\n\t\t\t\t\t\t\t},j*100);\r\n\t\t\t\t\t\t});\r\n\t\t\t}\r\n\r\n\r\n\t\t\tvar data={};\r\n\t\t\tdata.slideIndex=opt.next+1;\r\n\t\t\tcontainer.trigger('revolution.slide.onchange',data);\r\n\t\t\tcontainer.trigger('revolution.slide.onvideostop');\r\n\r\n\r\n\t\t}",
"function resizedw(){\n loadSlider(slider);\n }",
"function changeSlide(slideId) {\n clearInterval(slideShow);\n\n setSlide(slideId);\n\n updateSlideVars(slideId);\n\n if (autoPlay) {\n play()\n }\n}",
"function mostrarPrimeiraImagem() {\n if (slidePosition !== 0) {\n slidePosition = 0; \n }\n\n updateDot();\n updateSlidePosition();\n}",
"function slide() {\n if (r < 4) {\n r++;\n img.src = \"Images/photos/\" + ships[idIndex].name + \"/\" + r + \".jpg\";\n } else {\n r = 1;\n img.src = \"Images/photos/\" + ships[idIndex].name + \"/\" + r + \".jpg\";\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns JWT promise based on cognito user pool | async function cognitoLogin({userPoolId, clientId, username, password, region, identityPoolId} ) {
const poolData = {
UserPoolId: userPoolId,
ClientId: clientId
};
const userPool = new AmazonCognitoIdentity.CognitoUserPool(poolData);
return new Promise((resolve, reject) => {
const authenticationDetails = new AmazonCognitoIdentity.AuthenticationDetails({
Username: username,
Password: password,
});
const userData = {
Username: username,
Pool: userPool,
};
const cognitoUser = new AmazonCognitoIdentity.CognitoUser(userData);
cognitoUser.authenticateUser(authenticationDetails, {
onSuccess(result) {
if(region && identityPoolId) {
AWS.config.region = region;
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId : identityPoolId,
Logins : { [`cognito-idp.ap-southeast-2.amazonaws.com/${userPoolId}`] : result.getIdToken().getJwtToken()}
});
AWS.config.credentials.refresh((error) => {
if (error) {
console.error(error);
} else {
// example: var s3 = new AWS.S3();
console.log('Successfully logged! Now could using your aws servers example s3 buckets');
result.getRefreshToken().getToken();
resolve(result.getAccessToken().getJwtToken());
}
});
} else {
resolve(result.getAccessToken().getJwtToken());
}
},
onFailure(err) {
reject(err);
},
});
});
} | [
"function fromCognitoIdentityPool(_a) {\n var _this = this;\n var accountId = _a.accountId, _b = _a.cache, cache = _b === void 0 ? Object(_localStorage__WEBPACK_IMPORTED_MODULE_4__[\"localStorage\"])() : _b, client = _a.client, customRoleArn = _a.customRoleArn, identityPoolId = _a.identityPoolId, logins = _a.logins, _c = _a.userIdentifier, userIdentifier = _c === void 0 ? !logins || Object.keys(logins).length === 0 ? \"ANONYMOUS\" : undefined : _c;\n var cacheKey = userIdentifier ? \"aws:cognito-identity-credentials:\" + identityPoolId + \":\" + userIdentifier : undefined;\n var provider = function () { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var identityId, _a, _b, IdentityId, _c, _d, _e, _f;\n var _g;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_h) {\n switch (_h.label) {\n case 0:\n _a = cacheKey;\n if (!_a) return [3 /*break*/, 2];\n return [4 /*yield*/, cache.getItem(cacheKey)];\n case 1:\n _a = (_h.sent());\n _h.label = 2;\n case 2:\n identityId = _a;\n if (!!identityId) return [3 /*break*/, 7];\n _d = (_c = client).send;\n _e = _aws_sdk_client_cognito_identity__WEBPACK_IMPORTED_MODULE_1__[\"GetIdCommand\"].bind;\n _g = {\n AccountId: accountId,\n IdentityPoolId: identityPoolId\n };\n if (!logins) return [3 /*break*/, 4];\n return [4 /*yield*/, Object(_resolveLogins__WEBPACK_IMPORTED_MODULE_5__[\"resolveLogins\"])(logins)];\n case 3:\n _f = _h.sent();\n return [3 /*break*/, 5];\n case 4:\n _f = undefined;\n _h.label = 5;\n case 5: return [4 /*yield*/, _d.apply(_c, [new (_e.apply(_aws_sdk_client_cognito_identity__WEBPACK_IMPORTED_MODULE_1__[\"GetIdCommand\"], [void 0, (_g.Logins = _f,\n _g)]))()])];\n case 6:\n _b = (_h.sent()).IdentityId, IdentityId = _b === void 0 ? throwOnMissingId() : _b;\n identityId = IdentityId;\n if (cacheKey) {\n Promise.resolve(cache.setItem(cacheKey, identityId)).catch(function () { });\n }\n _h.label = 7;\n case 7:\n provider = Object(_fromCognitoIdentity__WEBPACK_IMPORTED_MODULE_3__[\"fromCognitoIdentity\"])({\n client: client,\n customRoleArn: customRoleArn,\n logins: logins,\n identityId: identityId,\n });\n return [2 /*return*/, provider()];\n }\n });\n }); };\n return function () {\n return provider().catch(function (err) { return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n if (cacheKey) {\n Promise.resolve(cache.removeItem(cacheKey)).catch(function () { });\n }\n throw err;\n });\n }); });\n };\n}",
"async getUserAuthenticationPolicy() {\n assert.strictEqual(typeof (this.bearer), typeof (''))\n var data = JSON.stringify({\n \"login\": this.username,\n \"originIpAddress\": this.origin\n })\n return new Promise((resolve, reject) => {\n axios.post(`${this.base_api_url}/${this.accountId}/resources/${this.resourceId}/authenticationpolicy`, data, this.__authHeaders())\n .then(res => {\n this.__allowAuthenticate = res.data.isAllowedToAuthenticate\n NOISE && console.log('isAllowedToAuthenticate: ' + this.__allowAuthenticate)\n this.__allowPush = res.data.policyResponse.push\n NOISE && console.log('policyResponse::push: ' + this.__allowPush)\n this.__allowOTP = res.data.policyResponse.otp\n NOISE && console.log('policyResponse::otp: ' + this.__allowOTP)\n resolve(res.data)\n })\n .catch(error => {\n console.log(error);\n reject()\n })\n })\n }",
"function tokenFunc() {\n\tlet data = {username : process.env.WORDPRESS_USER, password : process.env.WORDPRESS_PASS};\n\treturn new Promise(function(resolve, reject) {\n\t\trequest({\n\t\t\turl: process.env.WORDPRESS_ROOT_PATH + \"/wp-json/jwt-auth/v1/token\",\n\t\t\tContentType : 'application/x-www-form-urlencoded',\n\t\t\tmethod: \"POST\",\n\t\t\tform: data\n\t\t}, function(error, response, body) {\n\t\t\tif(error) {\n\t\t\t\treject(error)\n\t\t\t} else {\n\t\t\t\tlet info = body.substring(body.indexOf(\"{\"));\n\t\t\t\tinfo = JSON.parse(info);\n\t\t\t\tinfo = info.token;\n\t\t\t\tresolve(info);\n\t\t\t\t/*\n\t\t\t\trequest({\n\t\t\t\t\turl: process.env.WORDPRESS_ROOT_PATH + '/wp-json/jwt-auth/v1/token/validate',\n\t\t\t\t\tContentType: 'application/json',\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tauth: {'bearer' : info},\n\t\t\t\t\tjson: true\n\t\t\t\t}, function(error, response, body) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t\tif(body == undefined) {\n\t\t\t\t\t\treject(\"Not a real postID\");\n\t\t\t\t\t}\n\t\t\t\t\tbody = body.substring(body.indexOf(\"{\"));\n\t\t\t\t\tbody = JSON.parse(body);\n\t\t\t\t\tconsole.log(body);\n\t\t\t\t\tif(body.code == \"jwt_auth_valid_token\") {\n\t\t\t\t\t\tresolve(info);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t*/\n\t\t\t}\n\t\t});\n\t});\n}",
"getProfile() {\n if (localStorage.getItem(\"id_token\")) {\n return jwtDecode(localStorage.setItem(\"id_token\"));\n } else {\n return {};\n }\n }",
"appSignIn() {\r\n\r\n if (!msalApp) {\r\n return null\r\n }\r\n\r\n console.log('appSignIn')\r\n this.login().then( () => {\r\n if ( this.user()) {\r\n console.log('user signed in');\r\n // Automaticaly assign accessToken\r\n this.acquireToken().then (accessToken => {\r\n this.accessToken = accessToken \r\n console.log('accessToken: '+ this.accessToken); \r\n store.dispatch('auth/loginSuccess'); \r\n }); \r\n } else {\r\n console.error('Failed to sign in');\r\n store.dispatch('auth/loginFailure'); \r\n } \r\n });\r\n\r\n}",
"login(email, password, remember) {\n return new Promise((resolve, reject) => {\n const url = `${this.apiBase}/auth/token`;\n const payload = { email, password };\n\n const requestOpts = this._makeFetchOpts('POST', payload);\n requestOpts.headers[\"X-JWT-AUD\"] = \"https://www.circlingquanquan.com\";\n\n fetch(url, requestOpts).then(response => {\n if (response.ok) {\n response.json().then(user => {\n console.log('user', user);\n this.currentUser = user;\n this._saveUser(user);\n resolve(user);\n });\n } else {\n response.json().then(res => {\n reject(res.message);\n }\n )}\n });\n });\n }",
"createJWT () {\n const token = {\n iat: parseInt(Date.now() / 1000),\n exp: parseInt(Date.now() / 1000) + 20 * 60, // 20 minutes\n aud: this.mqtt.project\n }\n return jwt.sign(token, fs.readFileSync(this.device.key.file), { algorithm: this.device.key.algorithm })\n }",
"function getToken(email) {\n //console.log(\"cleanAuth-getToken\", email);\n const token = jwt.sign(\n {\n user_id: email,\n },\n process.env.TOKEN_KEY,\n {\n expiresIn: `${EXPIRES_TIME}h`,\n }\n );\n return token;\n}",
"function sessionTokenForPerson(person, email, firstName, lastName) {\n\tconst user = new Parse.User();\n\tuser.setUsername(email);\n\tuser.set(\"firstName\", firstName);\n\tuser.set(\"lastName\", lastName);\n\tuser.set(\"athleticsTeams\", []);\n\n\tif (person) {\n\t\tuser.set(\"classes\", person.get(\"classSchedule\"));\n\t\tuser.set(\"grade\", person.get(\"grade\"));\n\t} else {\n\t\tuser.set(\"classes\", []);\n\t\tuser.set(\"grade\", 0);\n\t}\n\n\tconst password = randomPassword();\n\tuser.setPassword(password);\n\treturn user.signUp(null, {useMasterKey: true}).then(function(signedUpUser) {\n\t\treturn Parse.User.logIn(signedUpUser.get(\"username\"), password);\n\t}).then(function(loggedInUser) {\n\t\t// Query for the user's role to add them to it\n\t\tconst roleQuery = new Parse.Query(Parse.Role);\n\t\tconst roleName = (loggedInUser.get(\"grade\") <= 12 &&\n\t\t\tloggedInUser.get(\"grade\") >= 1) ? \"Student\" : \"Teacher\";\n\t\troleQuery.equalTo(\"name\", roleName);\n\t\treturn roleQuery.first({\n\t\t\tsessionToken: loggedInUser.getSessionToken(),\n\t\t\tuseMasterKey: true\n\t\t}).then(function(role) {\n\t\t\trole.getUsers().add(loggedInUser);\n\t\t\treturn role.save(null, {useMasterKey: true});\n\t\t}).then(function() {\n\t\t\treturn loggedInUser.getSessionToken();\n\t\t});\n\t});\n}",
"async function doJwtWithCallback() {\n clearStatus();\n writeStatus(`Requesting JWT authentication from server via callback...`);\n ably = new Ably.Realtime({\n authCallback: async ({}, callback) => {\n try {\n const response = await fetch(\"/ably-jwt\");\n const data = await response.json();\n console.log(data);\n callback(null, data);\n } catch (error) {\n writeStatus(\"Error performing JWT authentication via callback...\");\n callback(error, null);\n }\n },\n });\n ably.connection.on((stateChange) => {\n onStateChange(\"Connection\", stateChange);\n });\n}",
"async function doJwtAuth() {\n clearStatus();\n writeStatus(\"Requesting JWT from auth server...\");\n\n ably = new Ably.Realtime({ authUrl: \"/ably-jwt\" });\n ably.connection.on((stateChange) => {\n onStateChange(\"Connection\", stateChange);\n });\n}",
"function createToken(user) {\n var token = jsonwebtoken.sign({\n firstname: user.firstname,\n lastname: user.lastname,\n username: user.username,\n usertype: user.usertype,\n email: user.email\n }, secretKey);\n return token;\n}",
"genRequestedClaims({ claims, context, extraParams }) {\n return Promise.all(\n Object.keys(claims).map(x => {\n let name = x;\n let claim = claims[x];\n\n if (Array.isArray(claims[x])) {\n [name, claim] = claims[x];\n }\n\n if (typeof this[name] === 'function') {\n return this[name]({ claim, context, extraParams });\n }\n\n throw new Error(`Unsupported claim type ${name}`);\n })\n );\n }",
"function createTokenForCRM() {\n var api_user = {\n user_id: user.user_id,\n email: user.email,\n name: user.name\n };\n\n var options = {\n subject: user.id,\n expiresInMinutes: 60,\n audience: configuration.telco_crm_api_client_id,\n issuer: 'https://sandrino-dv.auth0.com'\n };\n\n return jwt.sign(api_user, \n new Buffer(configuration.telco_crm_api_client_secret, 'base64'), options); \n }",
"renewTokens() {\n return new Promise((resolve, reject) => {\n const isUserLoggedIn = localStorage.getItem(localStorageKey);\n if (isUserLoggedIn !== \"true\") {\n return reject(\"Not logged in\");\n }\n\n webAuth.checkSession({}, (err, authResult) => {\n if (err) {\n reject(err);\n } else {\n this.localLogin(authResult);\n resolve(authResult);\n }\n });\n });\n }",
"function signUser(req,res,next){\n //first param is the payload, second param is the privatekey\n //async - this token will be valid for 3h\n jwt.sign({user:res.locals[\"userData\"]}, secretKey, {expiresIn: '3h' }, (err, token) => {\n if(err) throw err;\n var userToSend = res.locals[\"userData\"]\n userToSend.token = token\n res.send(userToSend);\n });\n}",
"function cacheNewJwtPromise(jwt, minutesTilExpire) {\n\n return new Promise(function (resolve, reject) {\n let createTime = new Date(),\n expireTime = new Date();\n\n expireTime.setMinutes(expireTime.getMinutes() + minutesTilExpire);\n\n // Save jwt into redis cache\n // \"key\" = jwt, \"value\" = { \"expireTime\": expireTime }\n // Other properties can be added to the \"value\" property later if we need to store other data for the user\n cache.getRedisClient().hset(jwt, _appConfig.settings.get('/REDIS_USER_KEYS/EXPIRE_TIME'), expireTime, function (err, result) {\n if (err) {\n return {\n \"ERROR_CODE\": \"USCNODE001\",\n \"STATUS_CODE\": 503,\n \"ERROR_DESCRIPTION\": \"Cannot connect to Redis cache server\"\n };\n } else {\n cache.getRedisClient().expire(jwt, minutesTilExpire * 60, function (err, result) {\n if (err) {\n return {\n \"ERROR_CODE\": \"USCNODE001\",\n \"STATUS_CODE\": 503,\n \"ERROR_DESCRIPTION\": \"Cannot connect to Redis cache server\"\n };\n } else {\n return resolve(jwt);\n }\n });\n }\n });\n });\n}",
"function createJWTForAPIsAccess(phoneNo, apiKey){\n return fetch((\"https://app.aibers.health/createJWTForAPIsAccess\"), {\n method: \"POST\",\n headers: {Accept: 'application/json','Content-Type': 'application/json'},\n body: JSON.stringify({\n pno: phoneNo,\n apiKey: apiKey\n})\n }).then(response => response.json());\n}",
"function createToken(payload){\r\n return jwt.sign(payload, SECRET_KEY, {expiresIn})\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FixedUpdate is a builtin unity function that is called every fixed framerate frame. We use FixedUpdate instead of Update here because the docs recommend doing so when dealing with rigidbodies. For more info, see: We limit the velocity here to account for gravity and to allow the drag to be relaxed over time, even if no collisions are occurring. | function FixedUpdate(){
var v = rb.velocity;
// We use sqrMagnitude instead of magnitude for performance reasons.
var vSqr = v.sqrMagnitude;
//Initializing new velocity values if the speed limit changes.
Initialize(dragStartVelocity, dragMaxVelocity, maxVelocity, maxDrag);
if(vSqr > sqrDragStartVelocity){
if(sqrDragVelocityRange == 0)
sqrDragVelocityRange = 1;
rigidbody.drag = Mathf.Lerp(originalDrag, maxDrag, Mathf.Clamp01((vSqr - sqrDragStartVelocity)/sqrDragVelocityRange));
// Clamp the velocity, if necessary
if(vSqr > sqrMaxVelocity){
// Vector3.normalized returns this vector with a magnitude
// of 1. This ensures that we're not messing with the
// direction of the vector, only its magnitude.
rb.velocity = v.normalized * maxVelocity;
}
} else {
rb.drag = originalDrag;
}
} | [
"applyFriction(){\n\t\tthis.vel.x *= ((0.8 - 1) * dt) + 1;\n\t}",
"updateGroundSpeedPhysics() {\n // TODO: Much of this should be abstracted to helper functions\n\n // Calculate true air speed vector\n const indicatedAirspeed = this.speed;\n const trueAirspeedIncreaseFactor = this.altitude * ENVIRONMENT.DENSITY_ALT_INCREASE_FACTOR_PER_FT;\n const trueAirspeed = indicatedAirspeed * (1 + trueAirspeedIncreaseFactor);\n const flightThroughAirVector = vscale(vectorize2dFromRadians(this.heading), trueAirspeed);\n\n // Calculate ground speed and direction\n const windVector = AirportController.airport_get().getWindVectorAtAltitude(this.altitude);\n const flightPathVector = vadd(flightThroughAirVector, windVector);\n const groundSpeed = vlen(flightPathVector);\n let groundTrack = vradial(flightPathVector);\n\n // Prevent aircraft on the ground from being blown off runway centerline when too slow to crab sufficiently\n if (this.isOnGround()) {\n // TODO: Aircraft crabbing into the wind will show an increase in groundspeed after they reduce to slower than\n // the wind speed. This should be corrected so their groundspeed gradually reduces from touchdown spd to 0.\n groundTrack = this.targetGroundTrack;\n }\n\n // Calculate new position\n const hoursElapsed = TimeKeeper.getDeltaTimeForGameStateAndTimewarp() * TIME.ONE_SECOND_IN_HOURS;\n const distanceTraveled_nm = groundSpeed * hoursElapsed;\n\n this.positionModel.setCoordinatesByBearingAndDistance(groundTrack, distanceTraveled_nm);\n\n this.groundTrack = groundTrack;\n this.groundSpeed = groundSpeed;\n this.trueAirspeed = trueAirspeed;\n }",
"update () {\n /**\n * We need to track these states. First, inAir state of the object is stored from the last frame,\n * which will be contrasted later on with the current in air state to determine if the player just\n * hit the ground. Next, using `this.body.onFloor`, the player updates its inAir state. Finally, the\n * hitGround property is set to false to ensure the value will only be 'true' frame when it hits the ground.\n * There are two conditions that need to be met for the hitGround property to be true. First, the fox needs\n * to be in the air last update, and on the ground this update. Also the player needs to be falling downward\n * (meaning they need a downward velocity greater than zero).\n * Once the general state of the player has been property set, a method is called to actually figure out\n * which animation should be currently playing.\n */\n this.hitGround = false\n const wasAir = this.inAir\n this.inAir = !this.body.onFloor()\n if (this.inAir != wasAir && this.body.velocity > 0) {\n this.hitGround = true\n }\n this.animationState()\n\n /**\n * The next step is to move the player. The actual movement code is a simple test to see if the left or right\n * arrows are depressed and to add velocity to the object if they are. Because the player has a varied speed based\n * on his grounded state, the speed to use as his velocity is stored in a vaible beforehand. If the player is in the\n * sky, then speedToUse will default to the left side of the colon in the first line (this.airSpeed). If the player is\n * grounded the right side of the colon (this.speed) will be the speed that will be used for the player motion.\n * Based on the direction the player is inputting to the keyboard, the player sprite will be flipped right or left by changing\n * its scale.x to be positive (facing right) or negative (facing left).\n */\n this.speedToUse = this.inAir ? this.airSpeed : this.speed\n\n if (this.cursor.left.isDown) {\n this.scale.x = -1\n this.body.velocity.x = -this.speedToUse\n }\n\n if (this.cursor.right.isDown) {\n this.scale.x = 1\n this.body.velocity.x = this.speedToUse\n }\n }",
"function updateVelocity() {\n for (let i = 0; i < ballArray.length; i++) {\n let ball = ballArray[i];\n\n //velocity affected by acceleration\n ball.dx += ball.dx2;\n ball.dy += ball.dy2;\n\n //max velocity\n ball.dx = Math.min(MAX_VELOCITY, Math.max(-MAX_VELOCITY, ball.dx));\n ball.dy = Math.min(MAX_VELOCITY, Math.max(-MAX_VELOCITY, ball.dy));\n }\n}",
"updateSpeedPhysics() {\n let speedChange = 0;\n const differenceBetweenPresentAndTargetSpeeds = this.speed - this.target.speed;\n\n if (differenceBetweenPresentAndTargetSpeeds === 0) {\n return;\n }\n\n if (this.speed > this.target.speed) {\n speedChange = -this.model.rate.decelerate * TimeKeeper.getDeltaTimeForGameStateAndTimewarp() / 2;\n\n if (this.isOnGround()) {\n speedChange *= PERFORMANCE.DECELERATION_FACTOR_DUE_TO_GROUND_BRAKING;\n }\n } else if (this.speed < this.target.speed) {\n speedChange = this.model.rate.accelerate * TimeKeeper.getDeltaTimeForGameStateAndTimewarp() / 2;\n speedChange *= extrapolate_range_clamp(0, this.speed, this.model.speed.min, 2, 1);\n }\n\n this.speed += speedChange;\n\n if (abs(speedChange) > abs(differenceBetweenPresentAndTargetSpeeds)) {\n this.speed = this.target.speed;\n }\n }",
"updateVelocity(newVelocity) {\r\n this.v = newVelocity;\r\n }",
"update(dt) {\n\t // update velocity first <- It's important to update first, as\n\t // we're using the current value of acceleration.\n\t // Remember v = v0 + a * dt\n\t this.velocity = this.velocity.add(this.accel.mul(dt));\n\n\t // update acceleration\n\t this.accel = this.accel.add(this.forceIn.mul(float(1)/this.mass));\n\n\t // update position\n\t this.position = this.position.add(this.velocity.mul(dt));\n\t}",
"enactPhysics(physObj)\r\n {\r\n if(!physObj.ignoreGravity) {\r\n let dV = Vector2.scale(this.deltaTime, this.physics.gravity);\r\n physObj.velocity = Vector2.sum(dV, physObj.velocity);\r\n }\r\n\r\n let dP = Vector2.scale(this.deltaTime, physObj.velocity);\r\n physObj.position = Vector2.sum(dP, physObj.position);\r\n }",
"function updateAvatar(){\n\t\tvar forward = avatar.getWorldDirection();\n\n\t\tif (controls.fwd){\n\t\t\tavatar.setLinearVelocity(forward.multiplyScalar(controls.speed));\n\t\t} else if (controls.bwd){\n\t\t\tavatar.setLinearVelocity(forward.multiplyScalar(-controls.speed));\n\t\t} else {\n\t\t\tvar velocity = avatar.getLinearVelocity();\n\t\t\tvelocity.x=velocity.z=0;\n\t\t\tavatar.setLinearVelocity(velocity); //stop the xz motion\n\t\t}\n\n if (controls.fly){\n avatar.setLinearVelocity(new THREE.Vector3(0,controls.speed,0));\n }\n\n\t\tif (controls.left){\n\t\t\tavatar.setAngularVelocity(new THREE.Vector3(0,controls.speed*0.1,0));\n\t\t} else if (controls.right){\n\t\t\tavatar.setAngularVelocity(new THREE.Vector3(0,-controls.speed*0.1,0));\n\t\t}\n\n if (controls.reset){\n avatar.__dirtyPosition = true;\n avatar.position.set(40,10,40);\n }\n\n\t}",
"update() {\n //update coordinates so the droid will orbit the center of the canvas\n if (!this.sceneManager) {\n this.sceneManager = this.game.sceneManager;\n }\n this.calcMovement();\n\n /* droid shooting */\n this.secondsBeforeFire -= this.game.clockTick;\n //will shoot at every interval\n if (this.secondsBeforeFire <= 0 && (!this.fire)) {\n this.secondsBeforeFire = this.shootInterval;\n this.fire = true;\n this.shoot();\n }\n\n super.update();\n }",
"function applyGravity(entity) {\n if (entity.gravity && entity.velocity) {\n entity.velocity.y += entity.gravity * dt;\n }\n}",
"function d3_layout_forceDragstart(d) {\n\t d.fixed |= 2; // set bit 2\n\t}",
"function update() {\n\tchangeSpeed(game_object);\n\tchangeLivesOfPlayer(game_object);\n\thackPlayerScore(game_object);\n}",
"function updatePhysicsBodies() {\n // three.js model positions updates using cannon-es simulation\n // sphereMesh.position.copy(sphereBody.position)\n // sphereMesh.quaternion.copy(sphereBody.quaternion)\n\n shipModel.position.copy(shipBody.position);\n shipModel.quaternion.copy(shipBody.quaternion);\n playerCustom.position.copy(shipBody.position);\n playerCustom.quaternion.copy(shipBody.quaternion);\n playerBox\n .copy(playerCustom.geometry.boundingBox)\n .applyMatrix4(playerCustom.matrixWorld);\n}",
"move(velocity = {x: 0, y: 0}, dt) {\n this.pos.x += velocity.x * dt;\n this.pos.y += velocity.y * dt;\n }",
"function updateSillyMovement(){\n // increment noise\n sillyInc+=sillyFact;\n // apply to velocity\n ball.vy=map(noise(sillyInc), 0, 1, -ball.speed, +ball.speed);\n// prevent the ball from heading straight back into the wall\n// if ball is still close to the wall\n if(ball.y<10*ball.speed&&ball.vy<0){\n ball.vy=abs(ball.vy);\n } else if(ball.y>height-10*ball.speed&&ball.vy>0){\n ball.vy=-abs(ball.vy);\n }\n}",
"update(){\n let dx = mouse.x - this.x;\n let dy = mouse.y - this.y;\n\n let distance = Math.sqrt(dx*dx + dy*dy);\n\n // Creating force\n let forceDirectionX = dy/distance;\n let forceDirectionY = dy/distance;\n\n // This is the distance where the speed of the particles will be 0\n let maxDistance = mouse.radius;\n\n // Slowing down the particles far from the mouse\n let force = (maxDistance - distance) / maxDistance;\n\n // Changing the directions with the force action and the mass\n let directionX = forceDirectionX*force*this.density;\n let directionY = forceDirectionY*force*this.density;\n\n if(distance < mouse.radius){\n // Moving particles away on mouseover\n // If I multiplicate the direction *num it will make the movement faster but for me it's ok\n this.x -= directionX;\n this.y -= directionY;\n }else{\n // Return particles to original position\n // I'm dividing it by 5 - the bigger the number, the slower the action\n if(this.x !== this.baseX){\n let dx = this.x - this.baseX;\n this.x -= dx/5;\n }\n if(this.y !== this.baseY){\n let dy = this.y - this.baseY;\n this.y -= dy/5;\n }\n }\n }",
"move() {\n //this.xVel += xVel;\n this.x = this.x + this.xVel;\n this.y = this.y + this.yVel;\n this.checkWalls();\n this.checkBalls();\n }",
"set useFriction(value) {}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw waveform to canvas | function drawWave() {
requestAnimationFrame(drawWave);
analyser.getByteTimeDomainData(dataArray);
canvasCtx.fillStyle = "rgb(0,0,0)";
canvasCtx.fillRect(0, 0, canvas.width, canvas.height);
canvasCtx.lineWidth = 2;
canvasCtx.strokeStyle = "rgb(255,255,255)";
canvasCtx.beginPath();
const sliceWidth = (canvas.width * 1.0) / bufferLength;
let x = 0;
for (let i = 0; i < bufferLength; i++) {
let v = dataArray[i] / 128;
let y = (v * canvas.height) / 2;
if (i === 0) {
canvasCtx.moveTo(x, y);
} else {
canvasCtx.lineTo(x, y);
}
x += sliceWidth;
}
canvasCtx.stroke();
} | [
"draw() {\n for (const waveform of this.waveforms) {\n this.drawInCanvas(waveform.canvas, waveform.samples);\n }\n }",
"function createChannelWaveform(canvas, channelData) {\n var drawLines = 1000;\n\n let canvasWidth = canvas.width, canvasHeight = canvas.height;\n let context = canvas.getContext('2d');\n\n var lineOpacity = canvasWidth / channelData.length;\n context.save();\n context.fillStyle = '#080808';\n context.fillRect(0, 0, canvasWidth, canvasHeight);\n context.strokeStyle = '#46a0ba';\n context.globalCompositeOperation = 'lighter';\n context.translate(0, canvasHeight / 2);\n //context.globalAlpha = 0.6 ; // lineOpacity ;\n context.lineWidth = 1;\n var totallength = channelData.length;\n var eachBlock = Math.floor(totallength / drawLines);\n var lineGap = (canvasWidth / drawLines);\n\n context.beginPath();\n for (var i = 0; i <= drawLines; i++) {\n var audioBuffKey = Math.floor(eachBlock * i);\n var x = i * lineGap;\n var y = channelData[audioBuffKey] * canvasHeight / 2;\n context.moveTo(x, y);\n context.lineTo(x, (y * -1));\n }\n context.stroke();\n context.restore();\n}",
"function draw(numOfWaves, xOffset, yOffset, waveLength, waveHeight, circleSize, frequency, xSpacing, ySpacing, shiftX, shiftWave, color) {\n //wave shift start\n var shift = 0;\n //create waves\n while (numOfWaves > 0) {\n //set starting point\n var x = 0 + xOffset, y = 0 + yOffset;\n //length of waves\n while (x < waveLength) {\n //move to point\n ctx.moveTo(x,y);\n ctx.beginPath();\n //to do \\/ make arc great again (add more config possibilities)\n ctx.arc(x, y, circleSize, 0, 2 * Math.PI);\n ctx.fillStyle = \"hsla(\" + color[0] + \", \" + color[1] + \"%, \" + (color[2] + 1.3 * getY(x, frequency, waveHeight, shift)) + \"%, \" + color[3] + \")\";\n ctx.fill();\n y = getY(x, frequency, waveHeight, shift, yOffset);\n console.log(\"x = \" + x + \"; y = \" + getY(x, frequency, waveHeight, shift, yOffset));\n ctx.closePath();\n x += xSpacing;\n }\n shift += shiftWave;\n yOffset += ySpacing;\n xOffset -= shiftX;\n numOfWaves--;\n }\n}",
"function loop(){\n requestAnimationFrame(loop);\n //Get waveform values in order to draw it.\n var waveformValues = waveform.analyse();\n drawWaveform(waveformValues);\n }",
"function drawSound(){\r\n\t//drawCtx.clearRect(0, 0, drawCtx.canvas.width, drawCtx.canvas.height);\r\n\tlet circleWidth = 1;\r\n\tlet circleSpacing = 17.5;\r\n\tlet topSpacing = 130;\r\n\r\n\tlet currentHeight;\r\n\r\n\tfor(let i=0; i<audioData.length;i++){\r\n\t\tif (playButton.dataset.playing == \"yes\") currentHeight = (topSpacing-60) + 256-audioData[i];\r\n\t\telse if (currentHeight < (canvasElement.height - 65)) currentHeight + 5;\r\n\t\telse currentHeight = canvasElement.height - 65;\r\n\t\tdrawCtx.save();\r\n\t\tdrawCtx.beginPath();\r\n\t\tdrawCtx.fillStyle = drawCtx.strokeStyle = makeColor(color.red, color.green, color.blue, color.alpha);\r\n\r\n\t\t// draw appropriete shape\r\n\t\tif(circle){\r\n\t\t\tdrawCtx.arc(i * (circleWidth + circleSpacing),currentHeight + 60, 5, 0, Math.PI * 2, false);\r\n\t\t\tdrawCtx.arc(i * (circleWidth + circleSpacing),currentHeight+30, 5, 0, Math.PI * 2, false);\r\n\t\t\tdrawCtx.arc(i * (circleWidth + circleSpacing),currentHeight, 5, 0, Math.PI * 2, false);\r\n\t\t}\r\n\t\telse if(triangle){\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),currentHeight + 60);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) - 5,currentHeight + 60 - 10);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) + 5,currentHeight + 60 - 10);\r\n\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),currentHeight+30);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) - 5,currentHeight+30 - 10);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) + 5,currentHeight+30 - 10);\r\n\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),(currentHeight));\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) - 5,currentHeight - 10);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing) + 5,currentHeight - 10);\r\n\t\t}\r\n\t\telse if(square){\r\n\t\t\tdrawCtx.rect(i * (circleWidth + circleSpacing),currentHeight + 60, 5, 5);\r\n\t\t\tdrawCtx.rect(i * (circleWidth + circleSpacing),currentHeight+30, 5, 5);\r\n\t\t\tdrawCtx.rect(i * (circleWidth + circleSpacing),currentHeight, 5, 5);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),currentHeight + 60);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing),currentHeight + 70);\r\n\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),currentHeight+30);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing),currentHeight+40);\r\n\r\n\t\t\tdrawCtx.moveTo(i * (circleWidth + circleSpacing),currentHeight);\r\n\t\t\tdrawCtx.lineTo(i * (circleWidth + circleSpacing),currentHeight + 10);\r\n\r\n\t\t\tdrawCtx.stroke();\r\n\t\t}\r\n\t\tdrawCtx.closePath();\r\n\t\tdrawCtx.fill();\r\n\t\tdrawCtx.restore();\r\n\t}\r\n}",
"function drawSpectrumOnCanvas() {\r\n const d = ZXDisplay\r\n const c = console\r\n c.time(\"drawSpectrumOnCanvas()\")\r\n //\r\n // draw a random strip of horizontal lines\r\n c.time(\"randomizeArea()\")\r\n d.randomizeAreaX(0, 0, d.LINES, d.COLUMNS)\r\n c.timeEnd(\"randomizeArea()\")\r\n //\r\n // draw labels\r\n c.time(\"labels\")\r\n d.paper = d.BLACK\r\n d.ink = d.BRWHITE\r\n d.drawText(0, 0, \"S P E C T R U M ON C A N V A S\")\r\n d.drawText(1, 0, \" \")\r\n //\r\n d.ink = d.BLUE\r\n d.drawText(22, 0, \" \")\r\n d.drawText(23, 0, \" @ali_bala\")\r\n c.timeEnd(\"labels\")\r\n //\r\n // draw the virutal display on the canvas\r\n c.time(\"update()\")\r\n d.update()\r\n c.timeEnd(\"update()\")\r\n //\r\n c.timeEnd(\"drawSpectrumOnCanvas()\")\r\n} // drawSpectrumOnCanvas",
"function draw() {\n // clear the canvas\n canvas.width = canvas.width;\n drawBlocks();\n drawGrid();\n }",
"function drawWaveAndIntensitySS() {\n\tlet canvas = document.getElementById(\"diffraction\");\n\tlet ctx = canvas.getContext(\"2d\");\n\n\tlet alpha, I, sin, b, c;\n\tlet lambda = Number(parseFloat(document.form.lambda.value));\n\tlet colours = wavelengthToColor(lambda);\n\tlet screen = Number(parseFloat(document.form.L.value));\n\n\tlet gap = Number(parseFloat(document.form.gap.value));\n\n\tctx.fillStyle = colours[0];\n\tctx.strokeStyle = colours[0];\n\n\tctx.beginPath();\n\tctx.moveTo(570, 150);\n\tc = 1.5 + (screen * 2 - 100) * 0.5 / 50.;\n\n\tfor (i = 150; i >= 0; i--) {\n\t\tb = 0.18 * (1 - (i - 10) / 140.);\n\t\tsin = b / Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2));\n\t\talpha = sin * Math.PI * gap * 500. / lambda;\n\t\tI = Math.pow(Math.sin(alpha) / alpha, 2);\n\t\tctx.lineTo(sinToCoords(I), i);\n\t\tI = Math.pow(I, 1 / 2);\n\t\tctx.fillStyle = rgbToHex(Math.round(colours[1] * I), Math.round(colours[2] * I), Math.round(colours[3] * I));\n\t\tctx.fillRect(383, i, 57, 1);\n\n\t}\n\n\tctx.stroke();\n\tctx.beginPath();\n\tctx.moveTo(570, 150);\n\n\tfor (i = 149; i <= 300; i++) {\n\t\tb = 0.18 * (1 - (i - 10) / 140.);\n\t\tsin = b / Math.sqrt(Math.pow(b, 2) + Math.pow(c, 2));\n\t\talpha = sin * Math.PI * gap * 500. / lambda;\n\t\tI = Math.pow(Math.sin(alpha) / alpha, 2);\n\n\t\tctx.lineTo(sinToCoords(I), i);\n\t\tI = Math.pow(I, 1 / 2);\n\t\tctx.fillStyle = rgbToHex(Math.round(colours[1] * I), Math.round(colours[2] * I), Math.round(colours[3] * I));\n\t\tctx.fillRect(383, i, 57, 1);\n\t}\n\n\tctx.stroke();\n\tlambda /= 100;\n\tctx.fillStyle = colours[0];\n\n\tfor (i = 4; i < 250 - screen * 2 - 1; i += 8 * lambda)\n\t\tctx.fillRect(i, 100, 2, 100);\n\n\tfor (i = 20; i < 280 - (75 - screen) * 2; i += 8 * lambda) {\n\t\tctx.beginPath();\n\t\tctx.arc(250 - screen * 2, 150 - gap, i, 1.75 * Math.PI, 0.25 * Math.PI);\n\t\tctx.stroke();\n\t\tctx.beginPath();\n\t\tctx.arc(250 - screen * 2, 150 + gap, i, 1.75 * Math.PI, 0.25 * Math.PI);\n\t\tctx.stroke();\n\t}\n}",
"addCanvases(waveCanvas) {\n this.wave_canvas = waveCanvas;\n this.miniWave_wrapper.appendChild(waveCanvas.mainWave_canvas);\n this.setCanvasStyles()\n }",
"function paintAnalog()\n\t\t{\n\t\t\t// draw outer-background\n\t\t\tcontext.save();\n\t\t\tcontext.fillStyle = canvas.getAttribute( \"data-outer-color\" ) || \"rgba( 0,0,0,0 )\";\n\t\t\tcontext.fillRect( 0, 0, width, height );\n\t\t\tcontext.restore();\n\n\t\t\t// draw clock border and clock background\n\t\t\tcontext.beginPath();\t\n\t\t\tcontext.lineWidth = 1;\t\t\n\t\t\tdrawEllipse( context, centerX, centerY, width - context.lineWidth, height - context.lineWidth, 0, PI2, false );\n\t\t\tcontext.fill();\n\t\t\tcontext.stroke();\n\t\t\t\n\t\t\t// draw ticks\n\t\t\tvar ticks = canvas.getAttribute( \"data-ticks\" ) || \"lines\";\n\t\t\tticks = ticks.toLowerCase();\n\t\t\tif ( ticks != \"none\" )\n\t\t\t\tfor ( var i = 0; i < 60; i++ )\n\t\t\t\t{\n\t\t\t\t\tvar ang = PI2 / 60 * i;\n\t\t\t\t\tvar cos = Math.cos( ang ), sin = Math.sin( ang );\n\t\n\t\t\t\t\tcontext.beginPath();\t\t\t\t\n\t\t\t\t\tif ( ticks == \"lines\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontext.lineWidth = 1;\n\t\t\t\t\t\tcontext.moveTo( centerX +cos * width / 2, centerY + sin * height / 2 );\n\t\t\t\t\t\tif ( i % 5 != 0 )\n\t\t\t\t\t\t\tcontext.lineTo( centerX + cos * width / 2.2, centerY + sin * height / 2.2 );\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcontext.lineWidth = 2;\t\t\t\t\n\t\t\t\t\t\t\tcontext.lineTo( centerX + cos * width / 2.5, centerY + sin * height / 2.5 );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontext.stroke();\n\t\t\t\t\t}\n\t\t\t\t\telse if ( ticks == \"circles\" )\n\t\t\t\t\t{\n\t\t\t\t\t\tvar radius = minwh / 50; \n\t\t\t\t\t\tif ( i % 5 != 0 )\n\t\t\t\t\t\t\tradius /= 2;\n\t\t\t\t\t\tcontext.fillStyle = context.strokeStyle;\n\t\t\t\t\t\tcontext.arc( centerX + Math.cos( ang ) * width / 2.3, centerY + Math.sin( ang ) * height / 2.3, radius, 0, PI2, false );\n\t\t\t\t\t\tcontext.fill();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t// draw numerals\n\t\t\tvar numerals = canvas.getAttribute( \"data-numerals\" ) || \"none\";\n\t\t\tnumerals = numerals.toLowerCase();\n\t\t\tif ( numerals != \"none\" )\n\t\t\t{\n\t\t\t\tvar array_num = numerals == \"roman\" ? ARRAY_ROMAN : ARRAY_ARABIC;\n\t\t\t\tcontext.beginPath();\n\t\t\t\tcontext.textAlign = \"center\";\n\t\t\t\tcontext.font = minwh / 12 + \"px \" + fontFamily;\n\t\t\t\tfor ( var i = 1; i <= 12; i++ )\n\t\t\t\t{\n\t\t\t\t\tvar ang = -PI1_2 + PI2 / 12 * i;\n\t\t\t\t\tvar cos = Math.cos( ang ), sin = Math.sin( ang );\n\t\t\t\t\tcontext.save();\n\t\t\t\t\tcontext.strokeStyle = \"black\";\n\t\t\t\t\tcontext.strokeText( array_num[ i-1 ], centerX + cos * width / 2.8 + 1, centerY + sin * height / 2.8 + minwh / 30 + 1 );\n\t\t\t\t\tcontext.restore();\n\t\t\t\t\tcontext.strokeText( array_num[ i-1 ], centerX + cos * width / 2.8, centerY + sin * height / 2.8 + minwh / 30 );\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// draw hour pointer\n\t\t\tcontext.beginPath();\n\t\t\tcontext.lineWidth = 4;\n\t\t\tvar ang = -Math.PI / 2 + ( timeInstance.hours % 12 ) / 12 * PI2;\n\t\t\tvar cos = Math.cos( ang ), sin = Math.sin( ang );\n\t\t\tcontext.moveTo( centerX, centerY );\n\t\t\tcontext.lineTo( centerX + width / 3 * cos, centerY + height / 3 * sin );\n\t\t\tcontext.stroke();\n\t\t\n\t\t\t// draw minute pointer\n\t\t\tcontext.beginPath();\n\t\t\tcontext.lineWidth = 2;\n\t\t\tang = -Math.PI / 2 + timeInstance.minutes / 60 * PI2;\n\t\t\tcos = Math.cos( ang ), sin = Math.sin( ang );\n\t\t\tcontext.moveTo( centerX, centerY );\n\t\t\tcontext.lineTo( centerX + width / 2.5 * cos, centerY + height / 2.5 * sin );\n\t\t\tcontext.stroke();\n\t\t\n\t\t\t// draw second pointer\n\t\t\tcontext.beginPath();\n\t\t\tcontext.lineWidth = 1;\n\t\t\tang = -Math.PI / 2 + timeInstance.seconds / 60 * PI2;\n\t\t\tcos = Math.cos( ang ), sin = Math.sin( ang );\n\t\t\tcontext.moveTo( centerX + width / -6.6 * cos, centerY + height / -6.6 * sin );\n\t\t\tcontext.lineTo( centerX + width / 2.2 * cos, centerY + height / 2.2 * sin );\n\t\t\tcontext.stroke();\n\t\t\t\n\t\t\t// draw central circle\n\t\t\tcontext.beginPath();\n\t\t\tcontext.fillStyle = context.strokeStyle;\n\t\t\tcontext.arc( centerX, centerY, minwh / 20, 0, PI2, false );\t\n\t\t\tcontext.fill();\n\t\t}",
"paint() {\n var ctx = this.canvas.getContext(\"2d\");\n ctx.fillStyle = this.backgroundColor;\n ctx.fillRect(0,0,this.canvas.width,this.canvas.height);\n this.draw(ctx);\n }",
"static paintCanvas() {\n\t\tctx.fillStyle = backgroundColor;\n\t\tctx.fillRect(0, 0, W, H);\n\t}",
"function displayBuffer(buff /* is an AudioBuffer */) {\n\n let container = document.getElementById(\"waveformContainer\");\n seekPositionBar.style.height = (buff.numberOfChannels * 100) + 'px';\n seekPositionBar.style.bottom = -(135 + buff.numberOfChannels * 100) + 'px';\n seekPositionBar.style.display = \"block\";\n for (let channel = 0; channel < buff.numberOfChannels; channel++) {\n let canvas = document.createElement('canvas');\n canvas.id = \"waveform\" + channel;\n canvas.width = canvasWidth;\n canvas.height = canvasHeight;\n container.appendChild(canvas);\n\n let channelData = buff.getChannelData(channel);\n createChannelWaveform(canvas, channelData);\n }\n}",
"function draw_s() {\n ctx.beginPath()\n canvas_arrow(ctx, passthroughCoords.x - 2, passthroughCoords.y - 2, refractedCoords.x + 2, refractedCoords.y + 2)\n ctx.stroke()\n }",
"function draw_circle() {\n ctxe.beginPath()\n ctxe.arc(EW_CENTER_POINT.x, EW_CENTER_POINT.y, inverseWavelength, 0, Math.PI * 2)\n ctxe.stroke()\n }",
"function draw(){ctx.clearRect(0,0,viewWidth,viewHeight),ctx.fillStyle=ctx.createPattern(patternCanvas,\"repeat\"),ctx.fillRect(0,0,viewWidth,viewHeight)}",
"function drawSky() {\n\n context.save();\n\n var grad = context.createLinearGradient(0, 0, 0, context.canvas.height);\n grad.addColorStop(0.0, 'rgba(0,0,150,1.0)'); \n grad.addColorStop(0.6, 'rgba(0,0,135,0.3)'); \n grad.addColorStop(0.8, 'rgba(242,167,18,0.7)'); \n grad.addColorStop(1.0, 'rgba(242,44,11,0.9)'); \n context.fillStyle = grad;\n context.fillRect(0, \n 0, \n context.canvas.width, \n context.canvas.height);\n\n context.restore();\n}",
"function render() {\n\t\t// Clear canvas\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\n\t\tctx.imageSmoothingEnabled = false;\n\n\t\tctx.fillStyle = \"rgba(255,255,255,1)\";\n\t\tctx.fillRect(offset.x, offset.y, width * pixelSize, height * pixelSize);\n\t\tif (showTransparencyBackground) {\n\t\t\tctx.globalCompositeOperation = 'source-in';\n\t\t\t// Now we can scale our image and display the drawing canvas\n\t\t\tctx.drawImage(transparencyCanvas, 0, 0, canvas.width, canvas.height);\n\t\t\tctx.globalCompositeOperation = 'source-over';\n\n\t\t}\n\n\t\t// Now we can scale our image and display the drawing canvas\n\t\tctx.drawImage(drawCanvas, offset.x, offset.y, width * pixelSize, height * pixelSize);\n\n\t\tif (showGrid && pixelSize > 4) {\n\t\t\tctx.globalCompositeOperation = 'source-atop';\n\t\t\t// Now we can scale our image and display the drawing canvas\n\t\t\tctx.drawImage(gridCanvas, offset.x % pixelSize, offset.y % pixelSize, canvas.width + 2 * pixelSize, canvas.height + 2 * pixelSize);\n\t\t\tctx.globalCompositeOperation = 'source-over';\n\t\t}\n\n\t\t// Draw the scrollbars\n\t\tctx.fillStyle = \"rgba(150,150,150,1)\";\n\t\tvar horizontal = horizontalScrollbarPos();\n\t\tvar vertical = verticalScrollbarPos();\n\t\tctx.fillRect(horizontal[0], horizontal[1], scrollBarWidth, scrollBarHeight); // Horizontal\n\t\tctx.fillRect(vertical[0], vertical[1], scrollBarHeight, scrollBarWidth); // Veritcal\n\n\t\t// Request next animation frame\n\t\twindow.requestAnimationFrame(render);\n\t}",
"draw()\n {\n var canvas = document.getElementById(\"CANVAS\");\n var ctx = canvas.getContext(\"2d\");\n var cVehicles = this.getVehicleCount();\n\n ctx.save();\n ctx.scale(def.scale, def.scale);\n\n this._drawRoute(ctx);\n for (let iVehicle = 0; iVehicle < cVehicles; iVehicle ++)\n this._drawVehicle(ctx, route.getVehicle(iVehicle));\n\n ctx.restore();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
next flareon function begins here spawns the next sprite once one sprite has reached an end point + decreases number of lives when player is in enemy collision and water danger zone | function nextFlareon() { //* need to fix this function so that it doesn't decrease life when reaching end points and respawning!!!!!!!
flareonPosition = startingPosition //* takes player back to starting position
if (!playerWinFlag) {
playerLives-- //* so player lives will decrease when you "die"
playerScore -= 20
scoreDisplay.textContent = playerScore
}
playerWinFlag = false
remainingLives.textContent = playerLives //* prints number of lives remaining here
if (playerLives === 0) { //* if plyaer loses all lives
setTimeout(theGameOver, 500)
} else {
addPlayer('flareonIdle')
}
} | [
"nextLevel() {\n // show all the stars again\n this.stars.children.iterate(\n /**\n * Make each star visible again\n * @param {Phaser.Physics.Arcade.Image} star \n */\n function (star) {\n star.enableBody(true, star.x, 0, true, true);\n }\n );\n\n // add a new bomb\n var x;\n if (this.player.x < 400) {\n x = Phaser.Math.Between(400, 800);\n } else {\n x = Phaser.Math.Between(0, 400);\n }\n\n var bomb = this.physics.add.image(x, 0, \"bomb\");\n this.bombs.add(bomb);\n bomb.setBounce(1);\n bomb.setCollideWorldBounds(true);\n bomb.setVelocity(Phaser.Math.Between(-200, 200), 20);\n }",
"function BoostLife()\n{\n\tif(frameCount%1000 === 0)\t{\n\t\tlifeBoost=createSprite(0,40,10,10);\t\n\t\tlifeBoost.addImage(lifeboostImg);\n\t\tlifeBoost.scale=0.5\n\t\tlifeBoostn.velocityX=2;\t\t\n\t\tlifeBoost.y=random(20,height-20);\n\t\tlifeBoost.lifetime=1000;\t\n\t\tlifeBoostgroup.add(lifeBoost);\n\t\t\n\t}\n\n\n\n\n}",
"function CreateSprite(paths, size_factor, size_min,\n\t\t speed_factor, speed_min, left, right){\n\n // Make the mesh \n var size = Math.random()*size_factor + size_min;\n var trand = Math.floor(Math.random()*paths.length);\n var texture= THREE.ImageUtils.loadTexture(paths[trand]);\n var material = new THREE.SpriteMaterial( { map: texture, fog: true, } );\n var sprite = new THREE.Sprite( material );\n sprite.scale.set(size, size, size);\n var speed = Math.random() *speed_factor + speed_min;\n\n // Initial placement\n x = (Math.random()*(right-left))-((right-left)/2);\n y = (Math.random()*3000)-1000;\n sprite = new FallingObject(sprite, speed, x, y, -1000, 0, -1, 0);\n sprite.set_box_rules(2000, -1000, left, right);\n\n \n //sprite.place();\n\n return sprite;\n}",
"function createFish(fishSpeed)\n{\n //create temporary magikarp\n var magik = new createjs.Sprite(magikarpSheet,'moveLeft');\n \n if(fishSpeed == \"WALL\")\n {\n magik.addEventListener(\"change\", swimLeftSlow);\n magik.scaleX = magik.scaleY = 0.75;\n }\n else // \"NORMAL\"\n {\n var speed = Math.random() * 3;\n if(speed < 1) //Flag //Doesn't make sense?\n {\n magik.addEventListener(\"change\", swimLeft);\n }\n else if(speed < 2)\n {\n magik.addEventListener(\"change\", swimLeftFast);\n magik.scaleX = magik.scaleY = 1.5;\n }\n else\n {\n magik.addEventListener(\"change\", swimLeftSlow);\n magik.scaleX = magik.scaleY = 0.75;\n }\n }\n\n //magik.addEventListener(\"change\", swimLeft);\n magik.x = 1320;\n magik.y = 50 + Math.floor(Math.random() * 505);\n\n //add temp magikarp to fish container\n fish.addChild(magik);\n stage.update();\n}",
"generateEnemies() {\n // Run the spawn timer\n this.timer++;\n if (this.enemies.length == 0) {\n this.timer += 2;\n } else if (this.enemies.length == 1) {\n this.timer += 1;\n }\n\n if (\n this.timer >= this.spawnDelay &&\n this.enemies.length < MAX_ENEMIES.value\n ) {\n this.createEnemy(this.x, this.y);\n this.resetTimer();\n }\n }",
"spawnOne(i){\n\n // pick which enemy to spawn:\n // shooting enemies appear starting at difficulty level 2,\n // and are more likely to appear at difficulty level 3\n\n let choice='fighter'\n if(levelData.difficulty>1){\n if(levelData.difficulty>2&&Math.random()>0.3) choice='shooter';\n else if(Math.random()>0.6) choice='shooter';\n }\n\n if(i==undefined) i=0;\n enemies.push(new Enemy(\n this.x - 50 + randInt(50) + i*50,\n this.y-80,\n choice\n ));\n }",
"function createNextWave () {\r\n\tcreateEnemies();\r\n waveTimer = game.time.now + 5000;\r\n}",
"function spawnEnemy() {\n // If there are still enemies left in this combat phase. \n if (remainingEnemies > 0) {\n // Spawn a regular enemy. \n enemies.push(new component(80, 80, \"images/placeholder/enemy.gif\", \n 480, 190, \"combat\", enemySpeedX,enemyMaxHP));\n remainingEnemies --; \n // Otherwise, if a boss hasn't been spawned yet... \n } else if (bossChar == null) {\n // IF this is the last boss in the level...\n if (remainingBosses == 1) {\n // Spawn the last boss in this level. \n bossChar = new component(80, 80, \"images/placeholder/final.gif\", \n 480, 190, \"boss\", enemySpeedX); \n } else {\n // Otherwise, spawn a miniboss. \n bossChar = new component(80, 80, \"images/placeholder/potato.gif\", \n 480, 190, \"boss\", enemySpeedX); \n } \n remainingBosses--; \n }\n}",
"function player_init() {\r\n\tplayer.vx = 0;\r\n\tplayer.vy = 0;\r\n\tplayer.x = 0;\r\n\tplayer.y = 360;\r\n\r\n\tplayer.width_min = 24; //slightly smaller than actual img width to account for player not actually appearing to \"collide\" with enemy \r\n\tplayer.height = 40;\r\n\t\r\n\tplayer.img = new Image();\r\n\tplayer.img.src = \"megaman_run.png\";\r\n\t\r\n\tplayer.ri = 0; //running index to determine which sprite is drawn in movement\r\n\tplayer.rright = 5; //right movements are sprites 0-5\r\n\tplayer.rleft = 11; //left movements are sprites 6-11\r\n\tplayer.rdelay = 0; //determines when next sprite is drawn\r\n\tplayer.rdelay_max = 5; //delays sprite image change so movement looks less choppy. TODO: make this a function of velocity\t\r\n\t//source img x, y coordinates and width/height\r\n\tplayer.rx = [0,160,360,480,360,160, 480,290,160,0,160,290];\r\n\tplayer.ry = [0, 180];\r\n\tplayer.rWidth = [150,180,110,150,120,190, 150,180,110,150,110,180];\r\n\tplayer.rHeight = [170, 170];\r\n\t\r\n\tplayer.i = 0;\r\n}",
"function renderNPCSprites(aDev,aGame)\n{\n ////this makes a temp object of the image we want to use\n //this is so the image holder does not have to keep finding image\n tempImage1 = aDev.images.getImage(\"orb\")\n tempImage2 = aDev.images.getImage(\"fireAmmo\")\t\n for (var i = 0; i < aGame.gameSprites.getSize(); i++)\n {\t\n ////this is to make a temp object for easier code to write and understand\n tempObj = aGame.gameSprites.getIndex(i); \n switch(tempObj.name)\n {\n case \"orb\":\n aDev.renderImage(tempImage1,tempObj.posX,tempObj.posY);\n break;\n case \"fireAmmo\":\n aDev.renderImage(tempImage2,tempObj.posX,tempObj.posY);\n break;\n } \n }\n}",
"function waterDangerZone() {\n //* selects all indexes ranging from 9 - 44 for danger zone/water\n if (flareonPosition >= 9 && flareonPosition <= 44 && (!cells[flareonPosition].classList.contains('floatAndFlareonLeft') && !cells[flareonPosition].classList.contains('floatAndFlareonRight'))) {\n cells[flareonPosition].classList.add('splash')\n gameSounds.playSplashSound() //* splash sound!\n removeFlareon()\n splashPosition = flareonPosition //* splash position is now equal to the flareon position so that the splash will be removed and not just flareon\n setTimeout(function () { \n cells[splashPosition].classList.remove('splash')\n }, 250)\n nextFlareon()\n }\n }",
"spawnMore(){\n this.hitPoints =0;\n for(let i=0; i<levelData.sections+1; i++)\n this.spawnOne(i);\n }",
"function render() {\n background.removeAllChildren();\n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFill = draw.rect(canvasWidth, groundY, '#5d43a3');\n background.addChild(backgroundFill);\n \n // TODO: 3 - Add a moon and starfield //+cloud buddy\n \n var circle;\n for(var i = 0; i < 700; i++) {\n circle = draw.circle(1, '#faf67d', '#dec14e', 1);\n circle.x = canvasWidth * Math.random();\n circle.y = groundY * Math.random();\n background.addChild(circle);\n }\n \n var cursedMoon = draw.bitmap('img/cursedmoon.png');\n cursedMoon.x = 500;\n cursedMoon.y = 0;\n cursedMoon.scaleX = 0.4;\n cursedMoon.scaleY = 0.3;\n background.addChild(cursedMoon);\n \n var happyCloud = draw.bitmap('img/happycloudfriend.png');\n happyCloud.x = 0;\n happyCloud.y = 0; \n happyCloud.scaleX = 0.3;\n happyCloud.scaleY = 0.3;\n background.addChild(happyCloud);\n \n // TODO: 5 - Add buildings! Q: This is before TODO 4 for a reason! Why?\n //I added some other stuff besides the required buildings.\n \n ufo = draw.bitmap('img/pinkufo.png');\n ufo.x = 150;\n ufo.y = -100;\n ufo.scaleX = 0.8; \n ufo.scaleY = 0.8; \n background.addChild(ufo);\n \n for(var fNum = 0; fNum < 150; fNum++) {\n fish = draw.bitmap('img/flyingfish.png');\n fish.scaleX = 0.05;\n fish.scaleY = 0.05; //am very tired type type toopity toop toop tip\n fish.x = canvasWidth * Math.random(); //(translation: figure out how you're going to put this fishys in)\n fish.y = groundY * Math.random();\n background.addChild(fish);\n }\n\n //Required buildings below >>>\n for(var i = 0; i < 8; i++) {\n var buildingHeights = [300, 130, 190, 175, 250, 300, 190, 250];\n var buildingColors = ['Purple', 'Indigo', 'DarkBlue', 'Teal', 'Pink', 'Red', 'Purple', 'Indigo', 'DarkBlue', 'Teal'];\n var building = draw.rect(75, buildingHeights[i], buildingColors[i], 'LightGray', 1);\n building.x = 200 * i;\n building.y = groundY - buildingHeights[i];\n background.addChild(building);\n buildings.push(building);\n }\n //Required buildings above <<<\n \n alienHouse = draw.bitmap('img/alienhouse.png');\n alienHouse.x = 1100;\n alienHouse.y = groundY - 296;\n alienHouse.scaleX = 0.6; \n alienHouse.scaleY = 0.6;\n background.addChild(alienHouse);\n \n // TODO 4: Part 1 - Add a tree //+something else\n tree = draw.bitmap('img/weirdtree.png');\n tree.x = 930;\n tree.y = groundY - 265;\n tree.scaleX = 0.2;\n tree.scaleY = 0.2;\n background.addChild(tree);\n \n sign = draw.bitmap('img/pinkwoodsign.png');\n sign.x = 1450;\n sign.y = groundY - 395;\n sign.scaleX = 0.3;\n sign.scaleY = 0.3;\n background.addChild(sign);\n \n /*blueDuck = draw.bitmap('img/bigblueduck.png');\n blueDuck.x = 300;\n blueDuck.y = 265;\n blueDuck.scaleX = 0.4;\n blueDuck.scaleY = 0.4;\n background.addChild(blueDuck);*/\n \n } // end of render function - DO NOT DELETE",
"function weaponHit(e, m, ei, mi) {\n\n if(m.x <= (e.x + e.w) && (m.x + m.w) >= e.x && m.y <= (e.y + e.h) && (m.y + m.h) >= e.y) {\n enemyArray.splice(ei,1)\n weaponArray.splice(mi,1)\n new enemyExplosion(\"./sfx/enemyExplosion.wav\")\n score += 100\n\n for(let d=0; d < 15; d++) {\n let size = Math.floor(Math.random() * 3) + 1\n let dx = (Math.random() - 0.5) * 20;\n let dy = (Math.random() - 0.5) * 20;\n let color = colorArray[Math.floor(Math.random()*colorArray.length)]\n debrisArray.push(new enemyDestroyed(e.x, e.y , size, dx, dy, color))\n }\n \n for(let d=0; d < 15; d++) {\n let size = Math.floor(Math.random() * 1) + 1\n let dx = (Math.random() - 0.5) * 30;\n let dy = (Math.random() - 0.5) * 30;\n let color = colorArray2[Math.floor(Math.random()*colorArray.length)]\n debrisArray.push(new enemyDestroyed(e.x, e.y , size, dx, dy, color))\n }\n }\n}",
"function hunterOne (){\n if (targetShip[0] < width - 1){\n nextShot.push(targetShip[0] - 1)\n nextShot.push(targetShip[0] + width)\n nextShot.push(targetShip[0] + 1)\n } if (targetShip[0] % width === 0){\n nextShot.push(targetShip[0] - width)\n nextShot.push(targetShip[0] + width)\n nextShot.push(targetShip[0] + 1)\n } if (targetShip[0] % width === width - 1){\n nextShot.push(targetShip[0] - 1)\n nextShot.push(targetShip[0] - width)\n nextShot.push(targetShip[0] + width)\n } if (targetShip[0] > cellCount - width){\n nextShot.push(targetShip[0] - 1)\n nextShot.push(targetShip[0] - width)\n nextShot.push(targetShip[0] + 1)\n } else {\n nextShot.push(targetShip[0] - 1)\n nextShot.push(targetShip[0] - width)\n nextShot.push(targetShip[0] + width)\n nextShot.push(targetShip[0] + 1)\n }\n }",
"createInitialEnemies() {\n this.enemies = [];\n this.checkEnemyCreation(1000);\n for (let i = 0; i < this.level.numEnemyRows - 1; ++i) this.checkEnemyCreation(2);\n }",
"arrangeNextObstacle() {\n const now = new Date().getTime();\n const next = Math.floor((now - this.startTime)/60);\n this.nextObstacle -= (1 + (next * 0.001));\n\n if (this.nextObstacle < 0) {\n this.entities.push(new Obstacle(\n this.drawContext,\n Physics.getRandomFromRange(600, 7500),\n Physics.getRandomFromRange(70, 500),\n this.worldConfig)\n );\n\n this.nextObstacle = (Math.random() * 80) + 30 - (next * 0.01);\n this.terrain.scrollSpeed += 0.05;\n }\n }",
"spawnEnemy() {\n // Pick a random x coordinate without set bounds\n // x will be between 25 and 425\n const x = (Math.random() * 360) + 40;\n\n // Casting X as a whole number to be used to pick a random enemy design\n let num = Math.round(x)\n\n // Creates the actual enemy object at the given position\n this.createEnemy(x, 0, num);\n\n // Set the spawn timer and time between spawns\n this.lastSpawned = this.now();\n\n if (this.score % 5 == 0)\n {\n this.spawnTime *= 0.95;\n }\n\n // Puts a hard limit on how small spawn time can get\n if (this.spawnTime < this.minSpawnTime) {\n this.spawnTime = this.minSpawnTime;\n }\n }",
"function loopAnim() {\n // flake.animate({\n // top: 0,\n // left: thisLeft + Math.floor(Math.random() * (max - min + 1)) + min\n // }, 0)\n // .animate({\n // top: '100%',\n // left: thisLeft + Math.floor(Math.random() * (max - min + 1)) + min\n // }, thisSpeed, 'linear', function() {\n // loopAnim();\n // });\n // console.log(1111);\n flake.css({ \"transform\": \"translate(\" + (thisLeft + Math.floor(Math.random() * (max - min + 1)) + min) + \"px,\" + 0 + \"px)\", \"transition-duration\": \"0ms\", \"transition-timing-function\": \"linear\" });\n flake.timer = setTimeout(function() {\n loopAnim2();\n }, 16)\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function creates 10 differernt patreon factories the consolelog is explored to see that state is properly getting filled. omly on last test, as array will be full | function loop10Creations(i) {
it(`Contract creator is correctly stored for #${i} contract. Creator is ${accounts[i]}`, function () {
return PatreonFactorySolFile.deployed().then(function (instance) {
patreonFactoryInstance = instance;
return patreonFactoryInstance.createContract(`Contract ${i}`, { from: accounts[i] });
}).then(function () {
return patreonFactoryInstance.getOriginalCreator.call(0);
}).then(function (creator) {
assert.equal(creator, accounts[0], "The contract wasn't created");
return patreonFactoryInstance.getNameArray.call();
}).then(function (nameArray) {
if (i == numberOfTests) console.log(nameArray)
return patreonFactoryInstance.getContractAddressArray.call();
}).then(function (addressArray) {
if (i == numberOfTests) {
console.log(addressArray);
lastDeployedContractAddress = addressArray[i]; //always grab last contract
}
return patreonFactoryInstance.getOriginalCreatorArray.call();
}).then(function (creatorArray) {
if (i == numberOfTests) console.log(creatorArray);
});
});
} | [
"function preCreateWidgets(numberOfWidgets) {\r\n console.log(\"Creating test widgets...\");\r\n\r\n const widgets = [];\r\n for( i=0; i<numberOfWidgets; i+=1 ) {\r\n const newWidget = createRandomWidget();\r\n widgets.push( newWidget );\r\n }//for\r\n\r\n console.log(`Created ${widgets.length} test widgets`);\r\n return widgets;\r\n}",
"generateRandomAppointments(day){\n for (let i = -15; i < 15; i++) {\n const time = day.timestamp + i * 24 * 60 * 60 * 1000;\n const strTime = this.timeToString(time);\n if (!this.state.items[strTime]) {\n this.state.items[strTime] = [];\n const numItems = Math.floor(Math.random() * 2);\n for (let j = 0; j < numItems; j++) {\n this.state.items[strTime].push({\n name: 'Randomly generated appointment for ' + strTime,\n height: Math.max(50, Math.floor(Math.random() * 100)),\n type: \"appointment\"\n });\n }\n }\n }\n }",
"function pizzaFactory() {\n let randomSizeIdx = Math.floor(Math.random() * 3)\n let randomAmtOfToppings = Math.floor(Math.random() * 2) + 1\n let toppings = []\n if(randomAmtOfToppings === 1) {\n let randomToppingIdx = Math.floor(Math.random() * 4)\n toppings.push(toppingAndMutiplier[randomToppingIdx])\n } else {\n let randomToppingIdx1 = Math.floor(Math.random() * 4)\n let randomToppingIdx2 = Math.floor(Math.random() * 4)\n while(randomToppingIdx2 === randomToppingIdx1) {\n randomToppingIdx2 = Math.floor(Math.random() * 4)\n }\n toppings.push(toppingAndMutiplier[randomToppingIdx1], toppingAndMutiplier[randomToppingIdx2])\n }\n \n\n let pizza = sizesAndPrices[randomSizeIdx]\n pizza.toppings = toppings\n\n return pizza\n}",
"static createDeck() {\n for (let i = 0; i < 4; i++) {\n for (let j = 1; j <= 7; j++) {\n let obj = { suit: i, value: j };\n deck.push(obj);\n }\n }\n }",
"function setupAllSusu() {\n //set for loop for susuwataris\n for (let i = 0; i < NUMSUZU; i++) {\n nextSusu = {\n x: randomInt(25, WIDTH - 25),\n y: randomInt(25, HEIGHT - 200),\n d: 50,\n color: 'black',\n vx: randomInt(-5, 5),\n };\n groupOfSusus.push(nextSusu);\n }\n}",
"function create(n){\n var n;\n var arr = [];\n for (i=1; i<=n; i++){\n if (i%2==0 && i%3==0 && i%5==0){\n arr.push(\"yu-gi-oh\");\n }else if (i%2==0 && i%3==0){\n arr.push(\"yu-gi\");\n }else if (i%2==0 && i%5==0){\n arr.push(\"yu-oh\");\n } else if (i%3==0 && i%5==0){\n arr.push(\"gi-oh\");\n } else if (i%5==0){\n arr.push(\"oh\");\n } else if (i%3==0){\n arr.push(\"gi\");\n } else if (i%2==0){\n arr.push(\"yu\");\n } \n else{\n arr.push(i);\n }\n console.log(arr);\n }\n return arr;\n }",
"function create(ids,names,gameid){\r\n var ng = new Game(gameid);\r\n if (ids.length < 12){\r\n var roles=[\"WW\",\"WW\",\"Seer\",\"Witch\",\"Hunter\",\"Cupid\"];\r\n for (i = 0; i < (ids.length - 6); i++) {\r\n roles.push(\"Villager\");\r\n }\r\n }else if((ids.length > 11 && ids.length < 18)){\r\n var roles=[\"WW\",\"WW\",\"WW\",\"Seer\",\"Witch\",\"Hunter\",\"Cupid\"];\r\n for (i = 0; i < (ids.length - 7); i++) {\r\n roles.push(\"Villager\");\r\n }\r\n }else if((ids.length > 17 )){\r\n var roles=[\"WW\",\"WW\",\"WW\", \"WW\",\"Seer\",\"Witch\",\"Hunter\",\"Cupid\"];\r\n for (i = 0; i < (ids.length - 8); i++) {\r\n roles.push(\"Villager\");\r\n }\r\n }\r\n shuffled=shuffle(roles);\r\n for (i = 0; i < (ids.length); i++){\r\n var np = new GamePlayer(ids[i], names[i], shuffled[i]);\r\n np.checkwitch();\r\n final_players.push(np)\r\n console.log(\"np.id display role \");\r\n ng.addplayer(np);\r\n ng.Roles.push(np.role);\r\n ////////\r\n }\r\n return ng;\r\n\r\n }",
"function agregarPedidoRandom(){\n for (let i = 0; i < 3 ; i++){\n let productoRandom = generarProducto();\n let cantidadRandom = generarCantidad(productoRandom);\n let precio = calcularValor(productoRandom,cantidadRandom);\n let items = \n { \"producto\": productoRandom, \n \"cantidad\": cantidadRandom, \n \"precio\": precio}; \n agregarAlHeruku(items);\n } \n}",
"function createCards(){\n //this shuffles the card faces\n //the cardFace array produces different cards as the i first cards\n //every time the game is reloaded\n cardFace = shuffle(cardFaceOrdered);\n //creates the card objects\n preCard = [];\n for (var i = 0; i < cardNb; i++){\n if(i < cardNb/2){\n preCard.push(new Card(cardFace[i],i));\n }\n //this allocates the same images and values so that each image appears twice\n else{\n preCard.push(new Card(cardFace[i-(cardNb/2)],i-cardNb/2));\n }\n }\n //shuffles preCard so that the cards are distributed randomly\n card = shuffle(preCard);\n //allocates positions to cards\n for (var i = 0; i < cardNb; i++){\n card[i].givePosition(position[i]);\n }\n}",
"GenerateBoardTiles() { for(let iterator = 0; iterator < this.number_of_riverbank_instances; iterator++) { this.GenerateTile(false); this.GenerateTile(true);} }",
"function seedRestaurantData(){\n console.info(\"seeding restaurant db with 10 objects\");\n const seedData = [];\n for (let i=1; i<=10; i++){\n seedData.push(generateRestaurantData());\n }\n return Restaurant.insertMany(seedData);\n\n}",
"crotonTrips(state) {\n var trips = [];\n for (var i = 0; i < state.recordsList.length; i++) {\n if (state.recordsList[i].reservoir === \"Croton\") {\n var crotonTrip = {\n id: state.recordsList[i].key,\n angler: state.recordsList[i].angler,\n comment: state.recordsList[i].comment,\n reservoir: state.recordsList[i].reservoir,\n species: state.recordsList[i].species,\n timestamp: state.recordsList[i].timestamp,\n weight: state.recordsList[i].weight,\n };\n trips.push(crotonTrip);\n }\n }\n return trips;\n }",
"function genData(init) {\n const tempData = init ? [] : data;\n let i = 10;\n while (i--) {\n tempData.push({ a: `a${i}`, b: `b${i}谁发的都是`, c: `c${i}`, d: `d${i}` })\n }\n return tempData;\n }",
"function light_array_creator(light_constructor){\n arr = [];\n for(i = 0; i < 1000; i++){\n arr.push([])\n for(j = 0; j < 1000; j++){\n arr[i].push(new light_constructor);\n }\n }\n return arr;\n}",
"function createRandomCatalog(num) {\n let catalog = [];\n for(let i = 0; i < num; i++) {\n let item = createRandomObject();\n let product = {id: i+1, price: item.price, type: item.type};\n \n catalog.push(product);\n }\n return catalog;\n }",
"function spawn(rat) {\n for (var i = ratsPerLitter; i > 0; i--) {\n var baby = new Rat();\n var r = Math.random();\n if (r > .5) {\n baby.female = true;\n }\n else {\n baby.female = false;\n }\n baby.birth = currentWeek;\n baby.generation = rat.generation + 1\n rat.descendents.push(baby);\n ratCount += 1;\n log[currentWeek][baby.generation] += 1;\n newlog[currentWeek][baby.generation] += 1;\n };\n}",
"function towerBuilder(nFloors) {\n // build here\n var lineOfStars = []\n // Creating an empy array to store our result\n for (var i = 0; i < nFloors; i++) {\n lineOfStars.push(\" \".repeat(nFloors-i-1) + \"*\"+\"*\".repeat(i*2) + \" \".repeat(nFloors-i-1))\n \n }\n console.log(lineOfStars);\n return lineOfStars\n }",
"function create_dummy_array(n){\n var arr = [];\n for(var i = 0; i < n; i++){\n arr.push(Math.floor(Math.random() * 10));\n }\n return arr;\n}",
"createSquads(numberOfUnits) {\n for (let i = 0; i < this.numberOfSquads; i++) {\n console.log(`Created squad ${i}`);\n this.squads.push(new Squad(numberOfUnits));\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Print the best result | function printTheBestResult(){
var edgesMap = new Object();
$.map(edges, function(value, key){
edgesMap[value.id] = value;
});
for(var i in bestPath){
var key = bestPath[i]['id'];
edgesMap[key]['color'] = '#006400';
}
edges = [];
for(var key in edgesMap){
edges.push(edgesMap[key]);
}
plotGraph(nodes, edges, document.getElementById('mygraph'));
} | [
"displayTopEightMatchedRespondents() {\n console.log(\"\\nTop 8 matches- by matching scores:\");\n console.log(\"===================================\\n\");\n\n for (let i = 0; i < 8; i++) {\n const curr = this.results[this.results.length - 1 - i];\n console.log(i);\n console.log(\n `Name: ${curr.name.slice(0, 1).toUpperCase()}${curr.name.slice(\n 1\n )}`\n );\n console.log(\n `Distance to closest available city: ${curr.closestAvailableCity.distance}km`\n );\n console.log(`Matching Score: ${curr.score}`);\n console.log(\"-------------------------------\");\n }\n }",
"function printBestStudents(students) {\n var bestScores = {};\n\n for (var i = 0; i < students.length; i++) {\n var student = students[i];\n\n for(var j = 0; j < student.grades.length; j ++){\n var grade = student.grades[j];\n\n if(bestScores[grade.id] === undefined){\n bestScores[grade.id] = {name: student.name, score: grade.score};\n }\n else if (bestScores[grade.id].score < grade.score) {\n bestScores[grade.id] = {name: student.name, score: grade.score};\n }\n }\n }\n\n for(var id in bestScores){\n console.log(\"Test\", id, \":\", bestScores[id].name);\n }\n}",
"function generatePick(ranking = 1) {\n let num = Math.floor(Math.random() * 1000);\n// let ranking = document.querySelector(\"#firstRanking\").value\n\n//if finish with the worst record\n\n if (ranking == 1) {\n if (num >= 0 && num < 141) {\n return \"<strong>1</strong>\";\n }\n if (num > 140 && num < 274) {\n return 2;\n }\n if (num > 273 && num < 401) {\n return 3;\n }\n if (num > 400 && num < 521) {\n return 4;\n }\n if (num > 520 && num < 1000) {\n return 5;\n }\n\n }\n\n//if finish with the 2nd-worst record\n\n if (ranking == 2) {\n if (num >= 0 && num < 141) {\n return \"<strong>1</strong>\";\n }\n if (num > 140 && num < 274) {\n return 2;\n }\n if (num > 273 && num < 401) {\n return 3;\n }\n if (num > 400 && num < 521) {\n return 4;\n }\n if (num > 520 && num < 799) {\n return 5;\n }\n if (num > 798 && num < 1000) {\n return 6;\n }\n\n }\n\n//if finish with the 3rd-worst record\n if (ranking == 3) {\n if (num >= 0 && num < 141) {\n return \"<strong>1</strong>\";\n }\n if (num > 140 && num < 274) {\n return \"<strong>2</strong>\";\n }\n if (num > 273 && num < 401) {\n return 3;\n }\n if (num > 400 && num < 521) {\n return 4;\n }\n if (num > 520 && num < 669) {\n return 5;\n }\n if (num > 668 && num < 929) {\n return 6;\n }\n if (num > 928 && num < 1000) {\n return 7;\n }\n\n }\n\n//4th\n if (ranking == 4) {\n if (num >= 0 && num < 125) {\n return \"<strong>1</strong>\";\n }\n if (num > 124 && num < 247) {\n return \"<strong>2</strong>\";\n }\n if (num > 246 && num < 366) {\n return \"<strong>3</strong>\";\n }\n if (num > 365 && num < 481) {\n return 4;\n }\n if (num > 480 && num < 553) {\n return 5;\n }\n if (num > 552 && num < 810) {\n return 6;\n }\n if (num > 809 && num < 977) {\n return 7;\n }\n if (num > 976 && num < 1000) {\n return 8;\n }\n\n }\n\n\n//5th\n if (ranking == 5) {\n if (num >= 0 && num < 105) {\n return \"<strong>1</strong>\";\n }\n if (num > 104 && num < 210) {\n return \"<strong>2</strong>\";\n }\n if (num > 209 && num < 316) {\n return \"<strong>3</strong>\";\n }\n if (num > 315 && num < 421) {\n return \"<strong>4</strong>\";\n }\n if (num > 420 && num < 443) {\n return 5;\n }\n if (num > 442 && num < 639) {\n return 6;\n }\n if (num > 638 && num < 906) {\n return 7;\n }\n if (num > 905 && num < 993) {\n return 8;\n }\n if (num > 992 && num < 1000) {\n return 9;\n }\n\n }\n\n\n//6th\n if (ranking == 6) {\n if (num >= 0 && num < 90) {\n return \"<strong>1</strong>\";\n }\n if (num > 89 && num < 182) {\n return \"<strong>2</strong>\";\n }\n if (num > 181 && num < 276) {\n return \"<strong>3</strong>\";\n }\n if (num > 275 && num < 372) {\n return \"<strong>4</strong>\";\n }\n if (num > 371 && num < 458) {\n return 6;\n }\n if (num > 457 && num < 756) {\n return 7;\n }\n if (num > 755 && num < 961) {\n return 8;\n }\n if (num > 960 && num < 998) {\n return 9;\n }\n if (num > 997 && num < 1000) {\n return 10;\n }\n\n }\n\n\n\n//7th\n if (ranking == 7) {\n if (num >= 0 && num < 75) {\n return \"<strong>1</strong>\";\n }\n if (num > 74 && num < 153) {\n return \"<strong>2</strong>\";\n }\n if (num > 152 && num < 234) {\n return \"<strong>3</strong>\";\n }\n if (num > 233 && num < 319) {\n return \"<strong>4</strong>\";\n }\n if (num > 318 && num < 516) {\n return 7;\n }\n if (num > 515 && num < 857) {\n return 8;\n }\n if (num > 856 && num < 986) {\n return 9;\n }\n if (num > 985 && num < 1000) {\n return 10;\n }\n\n }\n\n\n\n// 8th\n if (ranking == 8) {\n if (num >= 0 && num < 60) {\n return \"<strong>1</strong>\";\n }\n if (num > 59 && num < 123) {\n return \"<strong>2</strong>\";\n }\n if (num > 122 && num < 190) {\n return \"<strong>3</strong>\";\n }\n if (num > 189 && num < 262) {\n return \"<strong>4</strong>\";\n }\n if (num > 261 && num < 607) {\n return 8;\n }\n if (num > 606 && num < 928) {\n return 9;\n }\n if (num > 927 && num < 995) {\n return 10;\n }\n if (num > 994 && num < 1000) {\n return 11;\n }\n\n }\n\n\n//fix 9th\n if (ranking == 9) {\n if (num >= 0 && num < 45) {\n return \"<strong>1</strong>\";\n }\n if (num > 44 && num < 93) {\n return \"<strong>2</strong>\";\n }\n if (num > 92 && num < 145) {\n return \"<strong>3</strong>\";\n }\n if (num > 144 && num < 202) {\n return \"<strong>4</strong>\";\n }\n if (num > 201 && num < 709) {\n return 9;\n }\n if (num > 708 && num < 968) {\n return 10;\n }\n if (num > 967 && num < 998) {\n return 11;\n }\n if (num > 997 && num < 1000) {\n return 12;\n }\n\n }\n\n\n//fix 10th\n if (ranking == 10) {\n if (num >= 0 && num < 30) {\n return \"<strong>1</strong>\";\n }\n if (num > 29 && num < 63) {\n return \"<strong>2</strong>\";\n }\n if (num > 62 && num < 99) {\n return \"<strong>3</strong>\";\n }\n if (num > 98 && num < 139) {\n return \"<strong>4</strong>\";\n }\n if (num > 138 && num < 798) {\n return 10;\n }\n if (num > 797 && num < 988) {\n return 11;\n }\n if (num > 987 && num < 1000) {\n return 12;\n }\n }\n\n\n//11th\n if (ranking == 11) {\n if (num >= 0 && num < 20) {\n return \"<strong>1</strong>\";\n }\n if (num > 19 && num < 42) {\n return \"<strong>2</strong>\";\n }\n if (num > 41 && num < 66) {\n return \"<strong>3</strong>\";\n }\n if (num > 65 && num < 94) {\n return \"<strong>4</strong>\";\n }\n if (num > 93 && num < 870) {\n return 11;\n }\n if (num > 869 && num < 996) {\n return 12;\n }\n if (num > 995 && num < 1000) {\n return 13;\n }\n }\n\n\n//12th\n if (ranking == 12) {\n if (num >= 0 && num < 15) {\n return \"<strong>1</strong>\";\n }\n if (num > 14 && num < 32) {\n return \"<strong>2</strong>\";\n }\n if (num > 31 && num < 51) {\n return \"<strong>3</strong>\";\n }\n if (num > 50 && num < 72) {\n return \"<strong>4</strong>\";\n }\n if (num > 71 && num < 933) {\n return 12;\n }\n if (num > 932 && num < 999) {\n return 13;\n }\n if (num > 998 && num < 1000) {\n return 14;\n }\n }\n\n\n//13th\n if (ranking == 13) {\n if (num >= 0 && num < 10) {\n return \"<strong>1</strong>\";\n }\n if (num > 9 && num < 21) {\n return \"<strong>2</strong>\";\n }\n if (num > 20 && num < 33) {\n return \"<strong>3</strong>\";\n }\n if (num > 32 && num < 47) {\n return \"<strong>4</strong>\";\n }\n if (num > 46 && num < 976) {\n return 13;\n }\n if (num > 975 && num < 1000) {\n return 14;\n }\n }\n \n\n//14th \nif (ranking == 14) {\n if (num >= 0 && num < 5) {\n return \"<strong>1</strong>\";\n }\n if (num > 4 && num < 11) {\n return \"<strong>2</strong>\";\n }\n if (num > 10 && num < 17) {\n return \"<strong>3</strong>\";\n }\n if (num > 16 && num < 24) {\n return \"<strong>4</strong>\";\n }\n if (num > 23 && num < 1000) {\n return 14;\n }\n }\n}",
"function mostFavorableGrid(){\r\n var bestGrid = 0;\r\n var index = 0;\r\n for(var i = 0; i < fitness.length; i++){\r\n if(fitness[i] > bestGrid){\r\n bestGrid = fitness[i];\r\n index = i;\r\n }\r\n }\r\n //console.log(\"Most favorable grid is grid:\" + index);\r\n\tdocument.getElementById(\"favGrid\").innerHTML = \"Grid #\" + index;\r\n return index;\r\n}",
"function printBestGrade(students) {\n //your code here...\n for (let i = 0; i < students.length; i++) { //iterates through students\n // console.log(students[i][\"name\"],students[i][\"grades\"] );\n let student = students[i];\n let grades = student.grades;\n let bestGrade = grades[0].score;\n // console.log(bestGrade); //This is how we index down to one specific grade, in this case it ill be the first one\n //so we then need to compare all the grades in that array\n\n for (let j = 0; j < grades.length; j++) { //iterates through grades\n let score = grades[j].score;\n //now check and see if bestGrade < score\n //if yes then bestGrade = score\n if (bestGrade < score) {\n bestGrade = score;\n }\n\n }\n console.log(student.name, bestGrade);\n }\n}",
"function checkForLocalBest() {\n // retrieve best result of this level from local storage to compare against\n const localBestScoreKey = getLocalBestScoreKey();\n const localBestMovesKey = getLocalBestMovesKey();\n let localBestScore = +getFromLocalStorage(localBestScoreKey,\n Number.NEGATIVE_INFINITY);\n let localBestMoves = +getFromLocalStorage(localBestMovesKey,\n Number.POSITIVE_INFINITY);\n\n // replace best result with new result if latter is better\n if (thisGame.score > localBestScore) {\n localBestScore = thisGame.score;\n localBestMoves = thisGame.nMoves;\n setToLocalStorage(localBestScoreKey, localBestScore);\n setToLocalStorage(localBestMovesKey, localBestMoves);\n updateLocalBestDisplay(localBestScore, localBestMoves);\n showPlayer(thisGame.coords[thisGame.iMoveCur]);\n } else if (\n thisGame.score == localBestScore && thisGame.nMoves < localBestMoves\n ) {\n localBestMoves = thisGame.nMoves;\n setToLocalStorage(localBestMovesKey, localBestMoves);\n updateLocalBestDisplay(localBestScore, localBestMoves);\n showPlayer(thisGame.coords[thisGame.iMoveCur]);\n }\n\n if (gridSize >= leaderboardGridSize && thisGame.score >= leaderboardMin)\n showLeaderboardPost();\n}",
"function printSolution(analysis) {\n\n function printOneStep(step) {\n var type = step.step.type;\n step.name = type;\n if (type === 'line') { step.name += Ln++; }\n else { step.name += Cn++; }\n var _p, p1_str, p2_str;\n if (step.p1_idx !== -1) { p1_str = analysis.points[step.p1_idx].name; }\n else {\n _p = step.step[type === 'line' ? 'p1' : 'c'];\n p1_str = '(x: ' + _p.x + ', y: ' + _p.y + ')';\n }\n if (step.p2_idx !== -1) { p2_str = analysis.points[step.p2_idx].name; }\n else {\n _p = step.step[type === 'line' ? 'p2' : 'p'];\n p2_str = '(x: ' + _p.x + ', y: ' + _p.y + ')';\n }\n console.log(step_no++ + ': ' + step.name + ' [' + p1_str + ' ---> ' + p2_str + ']');\n }\n\n function printUsedIntersects(idx) {\n for (var j = 0; j < analysis.points.length; j++) {\n var _p = analysis.points[j];\n if (_p.s2_idx === idx) {\n _p.name = 'point' + Pn++;\n console.log(' ... ' + _p.name + ' = ' + analysis.steps[_p.s1_idx].name\n + ' x ' + analysis.steps[idx].name\n + ' (x: ' + _p.p.x + ' , y: ' + _p.p.y + ')');\n }\n }\n }\n\n var i, step_no = 1, Pn = 1, Ln = 1, Cn = 1;\n console.log('\\n\\nSolution found!\\n-----');\n console.log('Initial set of points:\\n-----');\n for (i = 0; i < pointsLength0; i++) {\n var p = analysis.points[i];\n p.name = 'point' + Pn++;\n console.log('# ' + p.name + ' (x: ' + p.p.x + ', y: ' + p.p.y + ')');\n }\n if (stepsLength0) {\n console.log('-----\\nInitial construction:\\n-----');\n for (i = 0; i < stepsLength0; i++) {\n printOneStep(analysis.steps[i]);\n printUsedIntersects(i);\n }\n }\n console.log('-----\\nConstruction:\\n-----');\n for (i = stepsLength0; i < analysis.steps.length; i++) {\n printOneStep(analysis.steps[i]);\n printUsedIntersects(i);\n }\n console.log('-----\\nGoals:\\n-----');\n for (i = 0; i < analysis.goals.length; i++) {\n var _g = analysis.goals[i];\n console.log('# (x: ' + _g.p.x + ', y: ' + _g.p.y + ') === '\n + analysis.steps[_g.s1_idx].name + ' x '\n + analysis.steps[_g.s2_idx].name);\n }\n console.log();\n}",
"function showResults() {\n\t\n\t/* Print execution times for each function */\n\t/* Compute hot path */\t\n\tfuncTree = getCleanedTree(funcTree);\n\tcomputeSelfTime(funcTree);\n\ttreeTopDownList = [];\n\tprintTreeTopDown(funcTree, 0);\n\t\n\tfor(var i = 0; i<funcTree.child.length; i++)\n\t{\n\t\tpathTreeString = [];\n\t\tvar tempTime = computeHotPaths(funcTree.child[i]);\n\t\tvar top = pathTreeString.pop();\n\t\tif(!top)\n\t\t{\n\t\t\tpathTreeString.push({ \"name\": funcTree.child[i].name,\n\t\t\t\t\t\t\t\t \"level\": 0} );\n\t\t}\n\t\telse\n\t\t{\n\t\t\tpathTreeString.push(top);\n\t\t}\n\t\tif(tempTime > globalMaxExecTime)\n\t\t{\n\t\t\tglobalHotPath = pathTreeString;\n\t\t\tglobalMaxExecTime = tempTime;\n\t\t}\n\t}\n\t\n\tdebugLog(\"Execution times for individual functions:\");\n\tfor (var key in functionStats) {\n\t\tif (functionStats.hasOwnProperty(key)){\n\t\t\tdebugLog(\"ExecTime: \" + functionStats[key].timeOfExec + \"ms for \" +\n\t\t\t\tfunctionStats[key].name+\"()\");\n\t\t}\n\t}\n\n\ttreeTopDownList = [];\n\tprintTreeTopDown(funcTree, 0);\n\t//console.log(treeTopDownList);\n\tprintTable();\n\t\n\t/* Frequency of calls for each function*/\n\tdebugLog(\"<br>Frequency of calls for each function\");\n\tfor (var key in functionStats){\n\t\tif (functionStats.hasOwnProperty(key)){\n\t\t\tdebugLog(\"Hits: \" + functionStats[key].hits +\n\t\t\t\t\" for \" + functionStats[key].name+\"()\");\n\t\t}\t\n\t}\n\n\t/* Print all functions pairs and number of their hits */\n\tdebugLog(\"<br>Edges between caller and callee functions and frequency of calls:\")\n\tfor (var key in functionStats){\n\t\tif (functionStats.hasOwnProperty(key)){\n\t\t\tfor (var key2 in functionStats[key].callers) {\n\t\t\t\tif (functionStats[key].callers.hasOwnProperty(key2)){\n\t\t\t\t\tdebugLog(\"Calls: \" + functionStats[key].callers[key2].hits + \n\t\t\t\t\t\t\" from \"+ functionStats[key].callers[key2].name + \"()-->\" + \n\t\t\t\t\t\tfunctionStats[key].name + \"()\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdebugLog(\"Max executionTime: \" + globalMaxExecTime);\n\tconsole.log(\"Max executionTime: \" + globalMaxExecTime);\n\tdebugLog(\"Path is \");\n\tfor(var x=0 ; x<globalHotPath.length; x++)\n\t{\t\t\n\t\tconsole.log(\" \" + globalHotPath[x].name + \" \");\n\t\tdebugLog(\" \" + globalHotPath[x].name + \"->\");\n\t}\n}",
"function displayResult() {}",
"function printBestStudent(students) {\n //your code here...\n for (let i = 0; i < students.length; i++) { //iterates through students\n // console.log(students[i][\"name\"],students[i][\"grades\"] );\n let student = students[i];\n let grades = student.grades;\n // let bestGrade = grades[0].score;\n // console.log(bestGrade); //This is how we index down to one specific grade, in this case it ill be the first one\n //so we then need to compare all the grades in that array\n let sum = 0;\n for (let j = 0; j < grades.length; j++) { //iterates through grades\n sum += grades[j].score;\n\n }\n let avgScore = sum / grades.length;\n console.log(\"Test \"+ student.id+\": \"+student.name);\n }\n}",
"highestScoringWord() {\n let example = Scrabble.highestScoreFrom(this.plays);\n return example;\n }",
"highestWordScore() {\n let highestWord = this.highestScoringWord();\n return Scrabble.score(highestWord);\n }",
"async updateBestSolutionAndFitness() {\n this.bestSolution = this.population[0];\n this.bestFitness = this.fitness_values[0];\n }",
"function bestvalue(data, num_value, num_points){\r\n var l=[];\r\n //sort by highest value\r\n data.sort(function(a,b) {\r\n return parseFloat(b.value) - parseFloat(a.value);\r\n });\r\n for (var i = 0; i < num_value; i++){\r\n l.push(data[i]);\r\n }\r\n //now sort by highest projected points \r\n data.sort(function(a,b){\r\n return parseFloat(b.points) - parseFloat(a.points);\r\n });\r\n var y = 0;\r\n var c = 0;\r\n outerloop:\r\n while (y < num_points){\r\n for(var i = 0; i < l.length; i++){\r\n if (l[i].player == data[c].player){\r\n c++;\r\n continue outerloop;\r\n }\r\n }\r\n l.push(data[c]);\r\n c++;\r\n y++;\r\n }\r\n //make sure everything is returned by highest projected points\r\n l.sort(function(a,b){\r\n return parseFloat(b.points) - parseFloat(a.points);\r\n });\r\n return l;\r\n}",
"function outputDealerPlayerValues(){\n // Get best dealer and player values\n let pT = playerValue();\n let dT = dealerValue();\n console.log(\"Dealer Value : \"+dT+\" Player Value : \"+pT);\n}",
"function printHint(distance){\n let result = ''\n distance < 20? result = \"Yeeeah!\" : distance < 60?\n result = \"Extremely hot\": distance < 80?\n result = \"Hot\": distance < 160?\n result = \"Cold\": distance < 320?\n result = \"Very cold\": result = \"Just give up! You have no chances...\"\n return result\n}",
"function FindMostHelpfulReview(gameReviews){\n if(gameReviews == undefined)\n return;\n if(gameReviews.reviews[0] == undefined)\n return;\n let currentScore = gameReviews.reviews[0].votes_up;\n let MostHelpfulReview = gameReviews.reviews[0];\n for (let i = 0; i < gameReviews.reviews.length; i++) {\n //gameReviews.reviews[i].review +\n //console.log(\" \" + gameReviews.reviews[i].votes_up + \" \" + gameReviews.reviews[i].votes_funny);\n if(currentScore <= gameReviews.reviews[i].votes_up){\n MostHelpfulReview = gameReviews.reviews[i];\n currentScore = gameReviews.reviews[i].votes_up;\n\n }\n }\n //console.log(gameReviews.reviews.length + \" Number of reviews2222\");\n //console.log(\"Resulting Highest Review: \" + MostHelpfulReview.review + \" Score\" + MostHelpfulReview.votes_up + \" Voted Up: \" + MostHelpfulReview.voted_up);\n if(MostHelpfulReview.votes_up == undefined)\n return undefined;\n return MostHelpfulReview;\n}",
"function decide(state) {\n const plans = generatePlans(state).map(plan => [plan, scorePlan(state, plan)])\n const sorted = plans.sort((p1, p2) => {\n const s1 = p1[1]\n const s2 = p2[1]\n return s1 < s2 ? 1 : s2 < s1 ? -1 : 0\n })\n console.log(plans\n .filter((p, i) => i < 3)\n .map(([plan, score]) => `score: ${score} - ${plan.type.toString()}: ${JSON.stringify(plan.data)}`).join('\\n'))\n return sorted[0][0]\n}",
"function runProgram() {\n let word = initialPrompt();\n let scorer = scorerPrompt();\n\n //calls scoring function on word depending on which score method was selected\n if (scorer === \"0\") {\n console.log(`Score for ${word}: ${scoringAlgorithms[0].scoringFunction(word)}`);\n } else if (scorer === \"1\") {\n console.log(`Score for ${word}: ${scoringAlgorithms[1].scoringFunction(word)}`);\n } else if (scorer === \"2\") {\n console.log(`Score for ${word}: ${scoringAlgorithms[2].scoringFunction(word)}`);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Turns the page. direction: Direction to move the page, 1 or 1 | turnPage(direction) {
let nextPage = (this.state.currentPage + direction) % rules.length;
if(nextPage < 0) nextPage = rules.length - 1;
this.setState({currentPage: nextPage});
} | [
"function go(direction) {\n\t\n\t\tif (Array.isArray(direction)){\n\t\n\t\t\t// If the array has length of 1, the player didn't specify a direction\n\t\t\tif (direction.length == 1) {\n\t\t\t\toutput.before(\"Which direction?<br /><br />\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgo(direction[1]);\n\t\t\t}\n\t\t}\n\t\n\t\telse {\n\n\t\t\tif (room[direction] === undefined) {\n\t\t\t\toutput.before(\"You can't go that way.<br /><br />\");\n\t\t\t}\n\t\n\t\t\telse {\n\t\t\t\tplayer.location = room[direction];\n\t\t\t\tplayer.stringLocation = player.location.var_name;\n\t\t\t\troom = player.location;\n\t\t\t\troomView.text(player.location.name);\n\t\n\t\t\t\tif (!verbose){\n\t\t\t\t\tif (room.visited) {\n\t\t\t\t\t\toutput.before(\"<strong>\" + room.name + \"</strong><br /><br />\");\n\t\t\t\t\t\tshowItems();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tlook();\n\t\t\t\t\t\troom.visited = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\telse {\n\t\t\t\t\tlook();\n\t\t\t\t\troom.visited = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\tscrollDown();\n\t\n\t}",
"changeDirection (direction) {\n let newState = Object.assign({}, this.state);\n newState.snake.direction = direction;\n this.setState(newState);\n this.canvasMoveSnake();\n }",
"function movePageLeft () {\n document.body.style.backgroundColor = 'ghostwhite'\n document.getElementById('left').style.display = 'none'\n document.getElementById('area-page-title').style.display = 'none'\n document.getElementById('right').style.display = 'block'\n document.getElementById('circumference-page-title').style.display = 'block'\n document.getElementById('page').innerHTML = 'Area'\n document.getElementById('formula-image1').style.display = 'block'\n document.getElementById('formula-image2').style.display = 'none'\n document.getElementById('circle-diagram').style.display = 'block'\n document.getElementById('circle-diagram2').style.display = 'none'\n document.getElementById('result-section').style.display = 'none'\n document.getElementById('radius').style.display = 'none'\n document.getElementById('d-input').value = ''\n page = page - 1\n}",
"function movePageRight () {\n document.body.style.backgroundColor = '#ffbc42'\n document.getElementById('left').style.display = 'block'\n document.getElementById('area-page-title').style.display = 'block'\n document.getElementById('right').style.display = 'none'\n document.getElementById('circumference-page-title').style.display = 'none'\n document.getElementById('page').innerHTML = 'Circumference'\n document.getElementById('formula-image1').style.display = 'none'\n document.getElementById('formula-image2').style.display = 'block'\n document.getElementById('circle-diagram').style.display = 'none'\n document.getElementById('circle-diagram2').style.display = 'block'\n document.getElementById('result-section').style.display = 'none'\n document.getElementById('radius').style.display = 'none'\n document.getElementById('d-input').value = ''\n page = page + 1\n}",
"function goToPage(page) {\n\tpage = Number(page);\n\tconsole.log('going to page', page);\n\tif (page < 1) return false;\n\n\tif (isEasternBook()) {\n\t\tgallery.goToPage(book.pages - page);\n\t}\n\telse {\n\t\tgallery.goToPage(page - 1);\n\t}\n\n\tstaggerImages(page);\n}",
"function setTextDirection(direction) {\n document.body.setAttribute('dir', direction);\n}",
"function movePage() {\r\n var moveAfterPageId = $(\"#moveAfterPageId\").val();\r\n var args = { pageId: $(\"#currentPageId\").val(),\r\n successCallback: function(result) { rave.viewPage(result.result.entityId); }\r\n };\r\n\r\n if (moveAfterPageId != MOVE_PAGE_DEFAULT_POSITION_IDX) {\r\n args[\"moveAfterPageId\"] = moveAfterPageId;\r\n }\r\n\r\n // send the rpc request to move the new page\r\n rave.api.rpc.movePage(args);\r\n }",
"move(direction) {\r\n\t\tlet somethingChanged = this.moveMap(direction);\r\n\t\tif (somethingChanged) {\r\n\t\t\tthis.spawnNew();\r\n\t\t}\r\n\t}",
"function goToPage(pageNr){\r\n\r\n}",
"function changeItem(direction){\n\t\t\n\t\tg_parent.switchSlideNums(direction);\n\t\tg_parent.placeNabourItems();\n\n\t}",
"drawPage(page){\n\t\tthis.cleanOldPage();\n\t\tthis.activePage = page;\n\t\tthis.initAndDrawActivePage();\n\t}",
"function doFlip(dir) {\n if (!container.querySelector(\".animate\")) {\n slider.classList.add(\"animate\");\n\n if (dir == -1) {\n slider.classList.add(\"animateL\");\n }\n\n frontSlide = slider.querySelector(\".front\");\n backSlide = findBack(dir);\n\n backSlide.classList.add(\"back\");\n\n\n timeout = setTimeout(function() {\n resetSlides();\n clearTimeout(timeout);\n }, options.timeout);\n }\n }",
"function setDirection(){\n // set arrow\n let direction = document.getElementById('windDegrees');\n\n // may not have degree data, so reset every time and check for existence\n direction.innerText = \"\";\n\n if (data.wind.deg) {\n direction.innerText = \"↑\";\n\n // rotate\n let degreeContainer = document.getElementById(\"degreeContainer\");\n degreeContainer.style.transform=`rotate(${data.wind.deg}deg)`;\n degreeContainer.style.transition=\"1s ease-in-out\";\n }\n}",
"function moveAt(pageX, pageY) {\n ball.style.left = pageX - ball.offsetWidth / 2 + 'px';\n ball.style.top = pageY - ball.offsetHeight / 2 + 'px';\n }",
"ghostChangeDirection() {\n let direction = random(4);\n switch(int(direction)) {\n case 0:\n this.currentDirection = \"up\";\n break;\n case 1:\n this.currentDirection = \"down\";\n break;\n case 2:\n this.currentDirection = \"left\";\n break;\n case 3:\n this.currentDirection = \"right\";\n break;\n }\n }",
"function nextSlide(step) {\n pos = Math.min(pos + step, 0);\n setTransform();\n }",
"function moveAt(pageX, pageY) {\n ball.style.left = pageX - ball.offsetWidth / 2 + 'px';\n ball.style.top = pageY - ball.offsetHeight / 2 + 'px';\n }",
"function setNextDirection(event) {\n let keyPressed = event.which;\n\n /* only set the next direction if it is perpendicular to the current direction */\n if (snake.head.direction !== \"left\" && snake.head.direction !== \"right\") {\n if (keyPressed === KEY.LEFT) { snake.head.nextDirection = \"left\"; }\n if (keyPressed === KEY.RIGHT) { snake.head.nextDirection = \"right\"; }\n }\n \n if (snake.head.direction !== \"up\" && snake.head.direction !== \"down\") {\n if (keyPressed === KEY.UP) { snake.head.nextDirection = \"up\"; }\n if (keyPressed === KEY.DOWN) { snake.head.nextDirection = \"down\"; }\n }\n}",
"function change(direction) {\r\n if (direction === 'prev') {\r\n if (counter === 0) {\r\n counter = customers.length;\r\n };\r\n counter--;\r\n } else {\r\n counter++;\r\n if (counter === customers.length) {\r\n counter = 0;\r\n };\r\n }\r\n\r\n setCurrent(counter)\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OSTAJE MI JOS DA DEFINISEM attributesChangedCallback AKO SE PODSETIM, SETICU SE DA SAM DODELU STILOVA (ZA INSTANCE DivRipple KLASE) DEFINISAO U POSEBNOJ METODI, KOJU SAM ONDA POZVAO U OBIMU attributesChangedCallback, KLASE DivRipple REC JE O METODI whenAttributeChange | attributeChangedCallback(name, oldval, newval){
//E PA POMENUTU METODU I OVDE POZVATI
this.whenAttributeChange(name, oldval, newval);
//ALI POZVACU I NOVU METODU, KOJU SAM DEFINISAO ISPOD OVOG LIFECYCLE CALLBACK-A
//JASNO MI JE DA CODE TE METODE DEFINISE DODELU STILOVA, U RELACIJI SA shadow ATRIBUTOM
// INSTANCE
this.whenShadowChange(name, oldval);
} | [
"attributeChangedCallback(name) {\n // Because both `checked` and `disabled` are booleans, the callback\n // determines their values by checking to see if the attributes are\n // present.\n const value = this.hasAttribute(name);\n if (this[name] !== value) this[name] = value;\n }",
"__i18nChanged() {\n this.__updateDrawerAriaAttributes();\n }",
"attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"description\") {\n const descElem = this.shadowRoot.querySelector(\".post__description\");\n if (descElem) {\n descElem.textContent = newValue;\n }\n }\n }",
"_updateAttributes() {\n const attributeManager = this.getAttributeManager();\n\n if (!attributeManager) {\n return;\n }\n\n const props = this.props; // Figure out data length\n\n const numInstances = this.getNumInstances();\n const startIndices = this.getStartIndices();\n attributeManager.update({\n data: props.data,\n numInstances,\n startIndices,\n props,\n transitions: props.transitions,\n // @ts-ignore (TS2339) property attribute is not present on some acceptable data types\n buffers: props.data.attributes,\n context: this\n });\n const changedAttributes = attributeManager.getChangedAttributes({\n clearChangedFlags: true\n });\n this.updateAttributes(changedAttributes);\n }",
"attributeChangedCallback(name) {\n // `expanded` is a boolean attribute it is either set or not set. The\n // actual value is irrelevant.\n const value = this.hasAttribute('expanded');\n this._shadowButton.setAttribute('aria-expanded', value);\n }",
"_updateAttributeTransition() {\n const attributeManager = this.getAttributeManager();\n\n if (attributeManager) {\n attributeManager.updateTransition();\n }\n }",
"_listenMaintainAspectChanged():void {\n var self = this;\n self.m_maintainAspectHandler = function (e) {\n if (!self.m_selected)\n return;\n var mode = $(e.target).prop('checked') == true ? 1 : 0;\n var domPlayerData = self._getBlockPlayerData();\n var xSnippet = $(domPlayerData).find('XmlItem');\n $(xSnippet).attr('maintainAspectRatio', mode);\n self._setBlockPlayerData(domPlayerData, BB.CONSTS.NO_NOTIFICATION);\n };\n $(Elements.JSON_ITEM_MAINTAIN_ASPECT_RATIO).on(\"change\", self.m_maintainAspectHandler);\n}",
"function attrFunction() {\n\t var x = value.apply(this, arguments);\n\t if (x == null) this.removeAttribute(name);\n\t else this.setAttribute(name, x);\n\t }",
"function clientAttributeUpdateListener (e) {\n // If the client is now ready (i.e., the \"status\" attribute's value is\n // now \"ready\"), add the client to the game simulation\n if (e.getChangedAttr().name == ClientAttributes.STATUS\n\t&& e.getChangedAttr().scope == Settings.GAME_ROOMID\n\t&& e.getChangedAttr().value == PongClient.STATUS_READY) {\n addPlayer(PongClient(e.getClient()));\n }\n}",
"function roomAttributeUpdateListener (e) {\n var scores;\n \n switch (e.getChangedAttr().name) {\n // When the \"ball\" attribute changes, synchronize the ball\n case RoomAttributes.BALL:\n\tdeserializeBall(e.getChangedAttr().value);\n\tbreak;\n \n // When the \"score\" attribute changes, update player scores\n case RoomAttributes.SCORE:\n\tscores = e.getChangedAttr().value.split(\",\");\n\thud.setLeftPlayerScore(scores[0]);\n\thud.setRightPlayerScore(scores[1]);\n\tbreak;\n }\n}",
"function createAttributeSelect() {\n var attrSelect = $(\"#attr-select\");\n var prevDatasetId = queryParameters.dataset;\n if(attrSelect.length > 0 && attrSelect.data(\"datasetid\") !== prevDatasetId){\n attrSelect.parent().remove();\n attrSelect = $(\"#attr-select\");\n }\n if (attrSelect.length <= 0) {\n var builder = [\"<span> Attribute: \"];\n builder.push(\"<select id='attr-select'>\");\n var arr = getAttributes();\n for (var i = arr.length - 1; i >= 0; i--) {\n var x = arr[i];\n var selected = Powerset.colorByAttribute === x.name;\n builder.push(\"<option value='\" + x.name + \"' + selected='\" + selected + \"'>\" + x.name + \" </option>\");\n }\n builder.push(\"</select>\");\n builder.push(\"</span>\");\n $(\".header-container\").append(builder.join(\"\"));\n var sel = $(\"#attr-select\");\n sel.data(\"datasetid\",queryParameters.dataset);\n sel.on(\"change\",setColorByAttribute);\n }\n }",
"redrawInputAttributes () {\n const inputAttributes = this.get( 'inputAttributes' );\n const control = this._domControl;\n for ( const property in inputAttributes ) {\n control.set( property, inputAttributes[ property ] );\n }\n }",
"function notifyChange(attrHolder, key, newValue, oldValue) {\n var listeners = attrHolder.changeListeners;\n for (var i=0, len=listeners.length; i<len; i++) {\n listeners[i].call(attrHolder, key, newValue, oldValue);\n }\n }",
"function changeTextBarChart(Seq){\r\n\t//5.1 Variable to store the values from getInfo\r\n\tvar values = getInfo(Seq); \r\n\r\n\t//5.2 Get the returned value of the function getInfo & store the value in local variable\r\n\tvar atInput = (values.AT) , gcInput = (values.GC);\r\n\r\n\t//5.3 Pass value to SVG (refer to implementation page file 4.4) to change the text value\r\n\tdocument.getElementById(\"atBar\").setAttribute(\"data-tooltip-text\", atInput);\r\n\tdocument.getElementById(\"gcBar\").setAttribute(\"data-tooltip-text\", gcInput);\r\n\r\n}",
"calculatePickingColors(attribute) {\n attribute.value = this.state.polygonTesselator.pickingColors();\n }",
"readAttributes() {\n this._previousValueState.state = this.getAttribute('value-state')\n ? this.getAttribute('value-state')\n : 'None';\n\n // save the original attribute for later usages, we do this, because some components reflect\n Object.keys(this._privilegedAttributes).forEach(attr => {\n if (this.getAttribute(attr) !== null) {\n this._privilegedAttributes[attr] = this.getAttribute(attr);\n }\n });\n }",
"function changeSlicerAttrib(id, attrib, value) {\n\t$('.' + id + '-volume-x').attr(attrib, value);\n\t$('.' + id + '-volume-y').attr(attrib, value);\n\t$('.' + id + '-volume-z').attr(attrib, value);\n}",
"visitAlter_attribute_definition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"_setAttributes(elem, dict) {\n for (const [key, value] of Object.entries(dict)) {\n console.log(key, value);\n elem.setAttribute(key, value);\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get the quick order modal handle for the selected coffee | get quickOrderModal() {
return 'div#modal'
} | [
"function popupFindItem(ui) {\n\n v_global.event.type = ui.type;\n v_global.event.object = ui.object;\n v_global.event.row = ui.row;\n v_global.event.element = ui.element;\n\n switch (ui.element) {\n case \"emp_nm\":\n case \"manager1_nm\":\n case \"manager2_nm\":\n case \"manager3_nm\":\n case \"manager4_nm\": \n {\n var args = { type: \"PAGE\", page: \"DLG_EMPLOYEE\", title: \"사원 선택\"\n \t, width: 700, height: 450, locate: [\"center\", \"top\"], open: true\n };\n if (gw_com_module.dialoguePrepare(args) == false) {\n var args = { page: \"DLG_EMPLOYEE\",\n param: { ID: gw_com_api.v_Stream.msg_selectEmployee }\n };\n gw_com_module.dialogueOpen(args);\n }\n } break;\n case \"dept_nm\":\n {\n var args = { type: \"PAGE\", page: \"DLG_TEAM\", title: \"부서 선택\", width: 500, height: 450, open: true };\n if (gw_com_module.dialoguePrepare(args) == false) {\n var args = { page: \"DLG_TEAM\",\n param: { ID: gw_com_api.v_Stream.msg_selectTeam }\n };\n gw_com_module.dialogueOpen(args);\n }\n } break;\n case \"supp_nm\":\n {\n var args = { type: \"PAGE\", page: \"w_find_supplier\", title: \"협력사 선택\", width: 500, height: 450, open: true };\n if (gw_com_module.dialoguePrepare(args) == false) {\n var args = { page: \"w_find_supplier\",\n param: { ID: gw_com_api.v_Stream.msg_selectedSupplier }\n };\n gw_com_module.dialogueOpen(args);\n }\n } break;\n default: return;\n }\n}",
"function get_selected_piece()\n{\n\tvar index = editor_menu.selectedIndex;\n\treturn piece_set[index];\n}",
"modal(modalId) {\r\n return this.modals.get(modalId);\r\n }",
"_order_accepted(event) {\n const order = event.detail;\n if (order.pcode == this.pcode)\n return;\n\n this.$.modal.modal_text = `Do you want to ${order.is_bid ? 'sell' : 'buy'} for ${order.price}?`\n this.$.modal.on_close_callback = (accepted) => {\n if (!accepted)\n return;\n\n this.$.trader_state.accept_order(order);\n };\n this.$.modal.show();\n }",
"function setCustomer(e) {\n\n $($gel(\"display-customers-modal\")).modal('hide');\n $gel(\"customer-id\").value = e.value;\n getCustomer();\n}",
"function gettingCardInfoForModal(e) {\n const cardId = e.target.closest('.card').getAttribute('data-id');\n const listId = e.target.closest('.oneLists').getAttribute('data-id');\n const cardContent = MODEL.returnCardReference(cardId, listId)\n\n const inputInModalContent = document.querySelector('#card-text');\n inputInModalContent.textContent = cardContent.text;\n\n }",
"get lowestPricedItem1() {return $('#inventory_container > div > div:nth-child(6) > div.pricebar > button');}",
"function gettingCardInfoForModal(e) {\n // const cardContent = e.target.closest('.card').querySelector('.cardInnerText').textContent;\n const cardId = e.target.closest('.card').getAttribute('data-id');\n const listId = e.target.closest('.oneLists').getAttribute('data-id');\n const cardContent =returnCardReference(cardId, listId)\n\n const inputInModalContent =document.querySelector('#card-text');\n inputInModalContent.textContent = cardContent.text;\n\n}",
"selectionItem() {\n if (this.__symbolInstance) {\n return this.__symbolInstance.sketchObject.selectionItemForOverridePoint(\n this.sketchObject\n )\n }\n if (this.__symbolMaster) {\n return this.__symbolMaster.sketchObject.selectionItemForOverridePoint(\n this.sketchObject\n )\n }\n return null\n }",
"function hideOrderMinimumPriceModal() {\n return { type: types.CART_TOTAL_IS_ABOVE_MIN_PRICE };\n}",
"getPaneToOpenItem () {\n const pane = this.getPane()\n const paneForUi = this.ui.getPane()\n\n if (pane && pane !== paneForUi) {\n return pane\n } else {\n return (\n getPreviousAdjacentPaneForPane(paneForUi) ||\n getNextAdjacentPaneForPane(paneForUi) ||\n splitPane(paneForUi, {split: this.ui.split})\n )\n }\n }",
"function show_supplier_selector(product_id)\n{\n\n\n}",
"function showPointSaleClosedModal() {\n return { type: types.SHOW_POINT_SALE_CLOSED_MODAL };\n}",
"function orderDetail(){\n\tsetTimeout(\n\t\tfunction(){\n\t\t\t$(function(){\n getOrderDetailToShow_wait_confirm();\n\t\t\t\tgetOrderDetailToShow_confirmed();\n });\n }, 1000);\n\t\trefreshAuto();\n}",
"function displayDelete() {\n $('#modalDelete').modal('show');\n}",
"async getPizzaQuantity(stepContext) {\n // prompt user for order type\n return await stepContext.prompt(QUANTITY_PROMPT, {\n prompt: \"How many pizzas would you like to order?\",\n retryPrompt: \"I can't figure out the amount you want. Please try again\"\n });\n }",
"function CtrlExpandCoupon() {\n var cpnClickedId;\n if(event.target.classList.contains('coupon')){ // check if the clicked element is indeed a coupon.\n cpnClickedId = event.target.id;\n UICtrl.expandCoupon(cpnClickedId);\n\n //decide what value we give to checkedFields\n if(jackpotCtrl.hasCoupon(cpnClickedId)){ checkedFields = 4; UICtrl.showNextCouponButton(); decrementTotalFlag = 1;} // if the coupon is saved. then it is already filled.\n else { checkedFields = 0; UICtrl.fieldsClickable(); } //if the coupon is not filled, we make the fields clickable. so we can check them. \n UICtrl.CouponUnclickable(); //Either way , whenever we expand a coupon. we always make the coupon unclickable.\n \n //show and hide buttons\n UICtrl.showGobackButton();\n UICtrl.changeNameOfDeleteAllBtn(); // changes from deleting the coupons , to deleting the fields of the expanded coupon.\n }\n }",
"displayRecipeSelection(e) {\n e.preventDefault();\n\n ApiLoadRecipes(recipes => {\n\n let options = [];\n recipes.forEach(recipe => {\n if (!recipe.Selectable) return; // skip any inactive recipes\n\n let lastUsedDate = \"Never Used\";\n if (recipe.LastUsed) {\n lastUsedDate = \"Last Used \" + moment(recipe.LastUsed).format(\"MMM Do, YYYY\");\n }\n let className = \"\";\n if (recipe.RecipeId === StateManager.GetFeedRecorderData().SelectedRecipeId) className = \"selected\";\n options.push(\n <button\n key={\"recipe-\" + recipe.RecipeId}\n className={FormatCssClass(className)}\n data-recipe-id={recipe.RecipeId}\n onClick={this.changeRecipeSelection}\n >{recipe.Name}<small data-recipe-id={recipe.RecipeId}>{lastUsedDate}</small></button>\n );\n });\n options.push(\n <div className={FormatCssClass(\"recipe-add-area\")} key={\"recipe-add\"}>\n <button onClick={this.addRecipe}>Add New Recipe</button>\n </div>\n );\n\n let modalContent = (\n <div className={FormatCssClass(\"options-recipe\")}>\n {options}\n </div>\n );\n\n StateManager.UpdateValue(\n \"UI.SelectedModalData\",\n {\n AllowDismiss: true,\n Content: modalContent\n }\n );\n\n });\n\n }",
"function myOrderHtml(){\r\n\t//view my orders as well, so he can confirm\r\n\tvar myHtmlOrder = document.querySelector('.checkOutHeaderTitle');\t//get title info:\r\n\t\t\tmyHtmlOrder += document.querySelector('.tableCheckOrder');\t//get order info\r\n\t\t\tmyHtmlOrder += document.querySelector('.checkOutBottomTitle');\t//get bottom tax/total info\r\n\treturn myHtmlOrder;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FRAME TAG UTILS Sets the html content of a Frame tag | function setFrameContent(frameClass, content) {
$('.' + frameClass + '.' + FRAME_SELECTOR + ' .' + FRAME_CONTENT_SELECTOR).html(content);
} | [
"function loadFrameFromHTML(src, frame, callback) {\n var fn = function () {\n Monocle.Events.deafen(frame, 'load', fn);\n frame.whenDocumentReady();\n Monocle.defer(callback);\n }\n Monocle.Events.listen(frame, 'load', fn);\n if (Monocle.Browser.env.loadHTMLWithDocWrite) {\n frame.contentDocument.open('text/html', 'replace');\n frame.contentDocument.write(src);\n frame.contentDocument.close();\n } else {\n frame.contentWindow['monCmptData'] = src;\n frame.src = \"javascript:window['monCmptData'];\"\n }\n }",
"function setFrameTitle(frameClass, title) {\n\n $('.' + frameClass + '.' + FRAME_SELECTOR + ' .' + FRAME_TITLE_SELECTOR).html(title);\n}",
"function createFrameUi(frameStyle, text, sequenceNo, data) {\n var $frame = $(\"<span></span>\");\n $frame.addClass(\"frame\");\n $frame.addClass(frameStyle);\n $frame.text(text);\n $frame.attr(\"id\", sequenceNo);\n $frame.attr(\"name\", data);\n return $frame;\n}",
"function HtmlDisplayFrameList(displayFrameList) {\n this.displayFrameList = displayFrameList;\n var displayFrames = displayFrameList.getFrames();\n this.HTML = \"\";\n \n var blank = \" \";\n \n // process the display frames submitted into an HTML representation\n var tplFrame = \"<div class='frame'>{0}</div>\";\n var tplFrameNumber = \"<div class='frameNumber'><span>{0}</span></div>\"\n var tplSlot = \"<div class='slot{3}{2}'>{1}{0}</span></div>\";\n var tplScore = \"<div class='score'><span>{0}</span></div>\"\n \n for (var i = 0; i < displayFrames.length; i++) {\n var df = displayFrames[i];\n var isLastFrame = (i == displayFrames.length - 1);\n \n var markClass1 = df.slot1 == df.strikeDisplay ? \"strike\" : \"\";\n var markClass2 = df.slot2 == df.strikeDisplay ? \"strike\"\n : df.slot2 == df.spareDisplay ? \"spare\"\n : \"\";\n var markClass3 = df.slot3 == df.strikeDisplay ? \"strike\"\n : df.slot3 == df.spareDisplay ? \"spare\"\n : \"\";\n \n var spanSlot1 = markClass1 == \"\" ? \"<span>\" : \"<span class='\" + markClass1 + \"'>\";\n var spanSlot2 = markClass2 == \"\" ? \"<span>\" : \"<span class='\" + markClass2 + \"'>\";\n var spanSlot3 = markClass3 == \"\" ? \"<span>\" : \"<span class='\" + markClass3 + \"'>\";\n \n var fn = tplFrameNumber.replace(\"{0}\", (i+1)); \n var slot1 = tplSlot.replace(\"{0}\", df.slot1 == \"\" ? blank : df.slot1);\n var slot2 = tplSlot.replace(\"{0}\", df.slot2 == \"\" ? blank : df.slot2);\n var slot3 = isLastFrame ? tplSlot.replace(\"{0}\", df.slot3 == \"\" ? blank : df.slot3) : \"\";\n \n slot1 = slot1.replace(\"{1}\", spanSlot1);\n slot2 = slot2.replace(\"{1}\", spanSlot2);\n slot3 = slot3.replace(\"{1}\", spanSlot3);\n \n slot1 = slot1.replace(\"{2}\", markClass1 == \"\" ? \"\" : \" \" + markClass1 )\n slot2 = slot2.replace(\"{2}\", markClass2 == \"\" ? \"\" : \" \" + markClass2 )\n slot3 = slot3.replace(\"{2}\", markClass3 == \"\" ? \"\" : \" \" + markClass3 )\n \n slot1 = slot1.replace(\"{3}\", isLastFrame ? \"box\" : \"\"); // class will just be \"slot\" for normal frames and \"slotbox\" for the last frame\n slot2 = slot2.replace(\"{3}\", \"box\"); // class will be \"slotbox\"\n slot3 = slot3.replace(\"{3}\", \"box\"); // class will be \"slotbox\"\n \n var score = tplScore.replace(\"{0}\", df.score == \"\" ? blank : df.score);\n \n var f = tplFrame.replace(\"{0}\", fn + slot1 + slot2 + slot3 + score);\n this.HTML += f;\n } \n \n // method: getHTML(): get the HTML representation of the display frame list\n this.getHTML = function() { return this.HTML; };\n \n }",
"function transmitFrame(frame, topPos, leftPos) {\n //Put frame into medium\n frame.css({\n top: topPos,\n left: leftPos,\n position: \"absolute\"\n });\n $(\"#medium\").append(frame);\n}",
"function getQFrameHtml() {\n var jsUrl = qlikServerBaseUrl + qlikServerPrefix + 'resources';\n\n return '<html>'\n + '<head>'\n + '<script src=\"' + jsUrl + '/assets/external/requirejs/require.js\"></script>'\n + '</head>'\n + '<body><p>Isolated iframe to load Qlik.js </p>'\n + '<script>'\n + 'try {'\n + 'require.config({ baseUrl: \"' + jsUrl + '\" });'\n + 'require([\"js/qlik\"], function(q) { parent.qlikIsolated._qFrameLoadSuccess(q); });'\n + '} catch(e) { parent.qlikIsolated._qFrameLoadFailure(e); }'\n + '</script>'\n + '</body>'\n + '</html>';\n }",
"setHtml(element, html){\n element.html(html);\n }",
"build_content_warning_frame() {\n let frame = {};\n frame.template = CW_FRAME_TEMPLATE;\n frame.title = CW_TITLE;\n frame.instruction = CW_TEXT;\n frame.questions = [];\n frame.response_name = RESPONSE_GENERIC;\n let ret = new FormFrame(frame, this.logger);\n return ret;\n }",
"async createIframeURL(fid) {\n this.setOrgID(fid);\n // var iframe_url = this.state.iframe_url + \"?orgID=\" + this.state.oid;\n // console.log(iframe_url);\n // var iframe_copy_text =\n // '<iframe src=\"' + iframe_url + '\" width=\"100%\" height=\"450\"></iframe>';\n //this.setState({ iframe_url });\n //this.setState({ iframe_copy_text });\n }",
"function frameIn(frame){\n // curatam clasa active din meniu daca exista\n cleanActiveFrame();\n\n // element activ in meniu\n var element = document.getElementById(frame);\n element.classList.add(\"active\");\n}",
"function getInnerContent() {\n if (curOpt.url) {\n return '<iframe src=\\'' + curOpt.url + '\\' horizontalscrolling=\\'no\\' verticalscrolling=\\'no\\' width=\\'' + curOpt.width + '\\' height=\\'' + curOpt.height + '\\' frameBorder=\\'0\\'></iframe>';\n } else if (curOpt.selector) {\n var html = $(curOpt.selector).html();\n return html;\n }\n }",
"static build(frame, logger) {\n if(frame.template === INTRO_FRAME_TEMPLATE) {\n return new IntroFrame(frame, logger);\n } else if(frame.template === STATEMENTS_FRAME_TEMPLATE) {\n return new StatementsBodyFrame(frame, logger);\n } else if(frame.template === SUMMARY_COUNT_FRAME_TEMPLATE) {\n return new SummaryFrameCount(frame, logger);\n } else if(frame.template === LIKERT_FRAME_TEMPLATE) {\n return new LikertFrame(frame, logger);\n } else if(frame.template === SELF_REPORT_FRAME_TEMPLATE) {\n return new SelfReportFrame(frame, logger);\n } else if(frame.template === CONSENT_FRAME_TEMPLATE) {\n return new ConsentDisclosureFrame(frame, logger);\n } else if (frame.template === END_FRAME_TEMPLATE) {\n return new EndFrame(frame, logger);\n } else {\n throw new Error('Frame template not recognized ' + frame.template);\n }\n }",
"async getFrame(page, name) {\n return await this.getEvalFrame(page.mainFrame(), { frame: name });\n }",
"function block( html ) {\n\tthis.html \t= html;\n}",
"initFrame() {\n const l10n = window._wpMediaViewsL10n || {}\n const labels = this.model.get('labels')\n\n this.frame = wp.media({\n button: {\n text: l10n.select,\n close: false\n },\n states: [\n new wp.media.controller.Library({\n title: labels.frame_title,\n library: wp.media.query({ type: 'image' }),\n multiple: false,\n date: false,\n priority: 20,\n suggestedWidth: this.model.get('width'),\n suggestedHeight: this.model.get('height')\n }),\n new wp.media.controller.Cropper({\n imgSelectOptions: this.calculateImageSelectOptions,\n control: this\n })\n ]\n })\n\n this.frame.on('select', this.onSelect, this)\n this.frame.on('cropped', this.onCropped, this)\n this.frame.on('skippedcrop', this.onSkippedCrop, this)\n }",
"function toggleFrames(imgName) {\n\n\t//Show home page if img name is empty\n\tif(imgName === '')\n\t{\n\t\tparent.frame2.location=urls[\"home\"];\n\t\treturn;\n\t}\n\t\n\t//Update frame source if empty\n\tif(imgName !== 'frame2' && imgName !== 'settings')\n\t{\n\t\tvar frameSrc = parent.document.getElementById(imgName + 'Frame').src;\n\t\tif(frameSrc == 'undefined' || frameSrc === '' || frameSrc === window.location.origin + \"/frame.html\")\n\t\t\tparent.document.getElementById(imgName + 'Frame').src = urls[imgName];\n\t}\n\t\n\t//Get the content frameset\n var frameset = parent.document.getElementById(\"content\");\n\tvar count=0;\n\tframeSetCols = \"\";\n\tvar frameIndex = -1;\n\t\n\t//Update the frameset cols, to make the frame corresponding to this imgName visible\n\tfor(i=1;i<frameset.children.length - 1;i++)\n\t{\n\t var frame = frameset.children[i];\n\t\tif(frameSetCols !== '')\n\t\t{\n\t\t\tframeSetCols += \",\"\n\t\t\tframeIndex = i;\n\t\t}\n\t\tif(frame.id === imgName + 'Frame' || frame.id === imgName)\n\t\t{\n\t\t\tframeSetCols += \"*\";\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tframeSetCols += \"0%\";\n\t\t}\n\t\t\n\t}\n\tframeset.cols= \"5%,\" + frameSetCols + \",5%\";\n}",
"function widgetFrameLoaded(id) {\n\n //iframe DOM object\n var frameObj = document.getElementById(\"customFieldFrame_\" + id);\n\n // flag to show or hide console logs\n var enableLog = false;\n\n // if the iframe not full rendered don't do anything at it first\n if ( !frameObj.hasClassName('custom-field-frame-rendered') ) {\n enableLog && console.log('Not rendered yet for', id);\n return;\n }\n\n //register widget to JCFServerCommon object\n //useful while debugging forms with widgets\n JCFServerCommon.frames[id] = {};\n JCFServerCommon.frames[id].obj = frameObj;\n var src = frameObj.src;\n\n JCFServerCommon.frames[id].src = src;\n JCFServerCommon.submitFrames = [];\n\n //to determine whether submit message passed form submit or next page\n var nextPage = true;\n //to determine which section is open actually\n var section = false;\n\n //we are changing iframe src dynamically\n //at first load iframe does not have src attribute that is why it behaves like it has form's URL\n //to prevent dublicate events if it is form url return\n // if(src.match('/form/')) {\n // console.log(\"returning from here\");\n // return;\n // }\n\n var referer = src;\n //form DOM object\n var thisForm = (JotForm.forms[0] == undefined || typeof JotForm.forms[0] == \"undefined\") ? $($$('.jotform-form')[0].id) : JotForm.forms[0];\n\n //detect IE version\n function getIEVersion() {\n var match = navigator.userAgent.match(/(?:MSIE |Trident\\/.*; rv:)(\\d+)/);\n return match ? parseInt(match[1]) : undefined;\n }\n\n // check a valid json string\n function IsValidJsonString(str) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n }\n\n //send message to widget iframe\n function sendMessage(msg, id, to) {\n\n var ref = referer;\n if(to !== undefined) { //to option is necesaary for messaging between widgets and themes page\n ref = to;\n }\n\n if (document.getElementById('customFieldFrame_' + id) === null) {\n return;\n }\n if (navigator.userAgent.indexOf(\"Firefox\") != -1) {\n XD.postMessage(msg, ref, getIframeWindow(window.frames[\"customFieldFrame_\" + id]));\n } else {\n if (getIEVersion() !== undefined) { //if IE\n XD.postMessage(msg, ref, window.frames[\"customFieldFrame_\" + id]);\n } else {\n XD.postMessage(msg, ref, getIframeWindow(window.frames[\"customFieldFrame_\" + id]));\n }\n }\n }\n\n window.sendMessage2Widget = sendMessage;\n\n //function that gets the widget settings from data-settings attribute of the iframe\n function getWidgetSettings() {\n var el = document.getElementById('widget_settings_' + id);\n return (el) ? el.value : null;\n }\n\n // function to check if a widget is required\n function isWidgetRequired(id) {\n var classNames = document.getElementById('id_' + id).className;\n return classNames.indexOf('jf-required') > -1;\n }\n\n //send message to widget iframe and change data-status to ready\n function sendReadyMessage(id) {\n\n var background = navigator.userAgent.indexOf(\"Firefox\") != -1 ? window.getComputedStyle(document.querySelector('.form-all'), null).getPropertyValue(\"background-color\") : getStyle(document.querySelector('.form-all'), \"background\");\n var fontFamily = navigator.userAgent.indexOf(\"Firefox\") != -1 ? window.getComputedStyle(document.querySelector('.form-all'), null).getPropertyValue(\"font-family\") : getStyle(document.querySelector('.form-all'), \"font-family\");\n //send ready message to widget\n //including background-color, formId, questionID and value if it is edit mode (through submissions page)\n\n var msg = {\n type: \"ready\",\n qid: id + \"\",\n formID: document.getElementsByName('formID')[0].value,\n required: isWidgetRequired(id),\n background: background,\n fontFamily: fontFamily\n };\n\n // if settings not null, include it\n var _settings = getWidgetSettings();\n if ( _settings && decodeURIComponent(_settings) !== '[]' ) {\n msg.settings = _settings;\n }\n\n // data-value attribute is set if form is in editMode.\n var wframe = document.getElementById('customFieldFrame_' + id);\n\n // helper function\n function _sendReadyMessage(id, msg) {\n // put a custom class when ready\n $(document.getElementById('customFieldFrame_' + id)).addClassName('frame-ready');\n\n // send ready message\n sendMessage(JSON.stringify(msg), id);\n }\n\n // make sure we get the data first before sending ready message, only when msg.value undefined\n var isEditMode = ((document.get.mode == \"edit\" || document.get.mode == \"inlineEdit\" || document.get.mode == 'submissionToPDF') && document.get.sid);\n if ( isEditMode ) {\n // if edit mode do some polling with timeout\n // interval number for each check in ms\n var interval = 50;\n // lets give the check interval a timeout in ms\n var timeout = 5000;\n // will determine the timeout value\n var currentTime = 0;\n\n var editCheckInterval = setInterval(function(){\n // clear interval when data-value attribute is set on the iframe\n // that means the 'getSubmissionResults' request has now the question data\n if ( wframe.hasAttribute('data-value') || (currentTime >= timeout) ) {\n // clear interval\n clearInterval(editCheckInterval);\n\n // renew value, whether its empty\n msg.value = wframe.getAttribute(\"data-value\");\n\n // send message\n enableLog && console.log('Ready message sent in', currentTime, msg);\n _sendReadyMessage(id, msg);\n }\n\n currentTime += interval;\n }, interval);\n } else {\n // set value\n msg.value = wframe.getAttribute(\"data-value\");\n\n // send message\n enableLog && console.log('Sending normal ready message', msg);\n _sendReadyMessage(id, msg);\n }\n }\n\n // expose ready message function\n window.JCFServerCommon.frames[id]['sendReadyMessage'] = sendReadyMessage;\n\n //bind receive message event\n //a message comes from form\n XD.receiveMessage(function(message) {\n\n // don't parse some unknown text from third party api of widgets like google recapthca\n if ( !IsValidJsonString(message.data) ) {\n return;\n }\n\n //parse message\n var data = JSON.parse(message.data);\n\n // filter out events from other frames which cause form hang up\n // specially if there are multiple widgets on 1 form\n if ( parseInt(id) !== parseInt(data.qid) ) {\n return;\n }\n\n //sendSubmit\n if (data.type === \"submit\") {\n enableLog && console.log('widget submit', document.getElementById(\"input_\" + data.qid));\n // make sure thats its not an oEmbed widget\n // oEmbed widgets has no hidden input to read\n if ( document.getElementById(\"input_\" + data.qid) )\n {\n if (typeof data.value === 'number') {\n data.value = data.value + \"\";\n }\n var required = $(document.getElementById(\"input_\" + data.qid)).hasClassName('widget-required') || $(document.getElementById(\"input_\" + data.qid)).hasClassName('validate[required]');\n var input_id_elem = document.getElementById(\"input_\" + data.qid);\n\n // if the element/question was set to required, we do some necessary validation to display and error or not\n if (required) {\n if ( (data.hasOwnProperty('valid') && data.valid === false) && JotForm.isVisible(document.getElementById(\"input_\" + data.qid))) {\n input_id_elem.value = \"\";\n\n // put a custom error msg if necessary, only if error object is present\n var req_errormsg = \"This field is required\";\n if ( typeof data.error !== 'undefined' && data.error !== false ) {\n req_errormsg = ( data.error.hasOwnProperty('msg') ) ? data.error.msg : req_errormsg;\n }\n\n JotForm.errored(input_id_elem, req_errormsg);\n //return;\n } else {\n JotForm.corrected(input_id_elem);\n if (data.value !== undefined) {\n input_id_elem.value = data.value;\n } else {\n input_id_elem.value = \"\";\n }\n }\n } else {\n\n // if not required and value property has a value set\n // make it as the hidden input value\n if (data && data.hasOwnProperty('value') && data.value !== false) {\n input_id_elem.value = data.value;\n } else {\n input_id_elem.value = '';\n input_id_elem.removeAttribute('name');\n }\n }\n }\n\n // flag the iframe widget/oEmbed widget already submitted\n if ( JCFServerCommon.submitFrames.indexOf(parseInt(data.qid)) < 0 ) {\n JCFServerCommon.submitFrames.push(parseInt(data.qid));\n }\n\n // check for widget required/errors and prevent submission\n var allInputs = $$('.widget-required, .widget-errored');\n var sendSubmit = true;\n for (var i = 0; i < allInputs.length; i++) {\n if (allInputs[i].value.length === 0 && JotForm.isVisible(allInputs[i])) {\n sendSubmit = false;\n }\n }\n //if widget is made required by condition\n // var requiredByConditionInputs = document.getElementsByClassName(\"form-widget validate[required]\");\n // console.log(\"requiredByConditionInputs\". requiredByConditionInputs.length);\n\n // for(var i=0; i<requiredByConditionInputs.length; i++) {\n // if(requiredByConditionInputs[i].value.length === 0 && JotForm.isVisible(requiredByConditionInputs[i])) {\n // sendSubmit = false;\n // }\n // }\n\n if (!nextPage) {\n enableLog && console.log('next page', nextPage);\n if (JotForm.validateAll() && sendSubmit) {\n enableLog && console.log('sendSubmit', nextPage, sendSubmit);\n var tf = (JotForm.forms[0] == undefined || typeof JotForm.forms[0] == \"undefined\") ? $($$('.jotform-form')[0].id) : JotForm.forms[0];\n // Don't submit if form has Stripe. Stripe submits the form automatically after credit card is tokenized\n var isEditMode = [\"edit\", \"inlineEdit\", \"submissionToPDF\"].indexOf(document.get.mode) > -1;\n if (!(typeof Stripe === \"function\" && JotForm.isPaymentSelected() && !isEditMode)) {\n // we will submit the form if all widgets already submitted\n // because some widgets need to do their own processes before sending submit\n // check if all frames submitted a message, thats the time we fire a form submit\n if ( $$('.custom-field-frame').length === JCFServerCommon.submitFrames.length ) {\n enableLog && console.log('All frames submitted', JCFServerCommon.submitFrames);\n _submitLast.submit(tf, 50); //submit form with 50 ms delay, submitting only the last call\n } else {\n enableLog && console.log('Not all frames submitted', JCFServerCommon.submitFrames);\n }\n }\n }\n } else {\n\n // var proceedSection = true;\n // section.select(\".widget-required\").each(function(inp) {\n // if (inp.value.length === 0) {\n // proceedSection = false;\n // }\n // });\n\n // //@diki\n // //validate current section\n // var sectionValidated = true;\n // section.select('*[class*=\"validate\"]').each(function(inp) {\n // if (inp.validateInput === undefined) {\n // return; /* continue; */\n // }\n // if (!( !! inp.validateInput && inp.validateInput())) {\n // sectionValidated = JotForm.hasHiddenValidationConflicts(inp);\n // }\n // });\n\n // if (proceedSection && sectionValidated) {\n // if (window.parent && window.parent != window) {\n // window.parent.postMessage('scrollIntoView', '*');\n // }\n // if (JotForm.nextPage) {\n // JotForm.backStack.push(section.hide()); // Hide current\n // JotForm.currentSection = JotForm.nextPage.show();\n // //Emre: to prevent page to jump to the top (55389)\n // if (typeof $this !== \"undefined\" && !$this.noJump) {\n // JotForm.currentSection.scrollIntoView(true);\n // }\n // JotForm.enableDisableButtonsInMultiForms();\n // } else if (section.next()) { // If there is a next page\n // if(section.select(\".widget-required\").length > 0) {\n // JotForm.backStack.push(section.hide()); // Hide current\n // // This code will be replaced with condition selector\n // JotForm.currentSection = section.next().show();\n // JotForm.enableDisableButtonsInMultiForms();\n // }\n // }\n // JotForm.nextPage = false;\n // }\n }\n }\n\n //sendData\n if (data.type === \"data\") {\n document.getElementById(\"input_\" + data.qid).value = data.value;\n JotForm.triggerWidgetCondition(data.qid);\n JotForm.triggerWidgetCalculation(data.qid);\n }\n\n //show/hide form errors\n if ( data.type === \"errors\" ) {\n var inputElem = document.getElementById(\"input_\" + data.qid);\n // check the action\n if ( data.action === 'show' ) {\n // show error\n if ( JotForm.isVisible(inputElem) ) {\n JotForm.corrected(inputElem);\n inputElem.value = '';\n inputElem.addClassName('widget-errored');\n JotForm.errored(inputElem, data.msg);\n }\n } else if ( data.action === 'hide' ) {\n // hide error\n inputElem.removeClassName('widget-errored');\n JotForm.corrected(inputElem);\n }\n }\n\n //requestFrameSize\n if (data.type === \"size\") {\n var width = data.width,\n height = data.height;\n\n if (width !== undefined && width !== null) {\n if (width === 0 || width === \"0\") {\n width = \"auto\";\n } else {\n width = width + \"px\";\n }\n document.getElementById('customFieldFrame_' + data.qid).style.width = width;\n }\n if (height !== undefined && height !== null) {\n document.getElementById('customFieldFrame_' + data.qid).style.height = height + \"px\";\n //for IE8 : also update height of li element\n if ( getIEVersion() !== undefined ) {\n document.getElementById('cid_' + data.qid).style.height = height + \"px\";\n }\n }\n }\n\n //replaceWidget\n if (data.type === \"replace\") {\n var inputType = data.inputType,\n isMobile = data.isMobile;\n\n var parentDiv = $(\"customFieldFrame_\" + data.qid).up(),\n inputName = $(\"input_\" + data.qid).readAttribute(\"name\");\n\n //remove frame\n $(\"customFieldFrame_\" + data.qid).remove();\n $(\"input_\" + data.qid).up().remove();\n var newInput = \"\";\n switch (inputType) {\n case \"control_fileupload\":\n var tf = (JotForm.forms[0] == undefined || typeof JotForm.forms[0] == \"undefined\") ? $($$('.jotform-form')[0].id) : JotForm.forms[0];\n tf.setAttribute('enctype', 'multipart/form-data');\n\n if (!isMobile) {\n newInput = '<input class=\"form-upload validate[upload]\" type=\"file\" id=\"input_' + data.qid +\n '\" name=\"' + inputName + '\" file-accept=\"pdf, doc, docx, xls, xlsx, csv, txt, rtf, html, zip, mp3, wma, mpg, flv, avi, jpg, jpeg, png, gif\"' +\n 'file-maxsize=\"10240\">';\n }\n // console.log(\"widget is mobile\", widget.isMobile);\n parentDiv.insert(newInput);\n break;\n case \"control_textbox\":\n newInput = '<input class=\"form-textbox\" type=\"text\" data-type-\"input-textbox\" id=\"input_' + data.qid +\n '\" name=\"' + inputName + '\">';\n parentDiv.insert(newInput);\n break;\n case \"control_textarea\":\n newInput = '<textarea class=\"form-textarea\" type=\"text\" id=\"input_' + data.qid +\n '\" name=\"' + inputName + '\" cols=\"40\" rows=\"6\"></textarea>';\n parentDiv.insert(newInput);\n break;\n default:\n break;\n }\n }\n\n }, document.location.protocol + '//' + frameObj.src.match(/^(ftp:\\/\\/|https?:\\/\\/)?(.+@)?([a-zA-Z0-9\\.\\-]+).*$/)[3]);\n\n // immediately send the settings to widget\n enableLog && console.log('sending settings', getWidgetSettings(), (new Date()).getTime());\n sendMessage(JSON.stringify({\n type: \"settings\",\n settings: getWidgetSettings()\n }), id);\n\n //if widget is not visible do not send ready message (it may be on next page)\n //instead send ready message on next page click\n var widgetSection = JotForm.getSection(frameObj);\n\n if (frameObj && JotForm.isVisible(widgetSection) && JotForm.isVisible(frameObj) && typeof frameObj.up('.form-section-closed') === 'undefined') {\n sendReadyMessage(id);\n }\n\n //on form submit\n Event.observe(thisForm, 'submit', function(e) {\n if (document.getElementById('customFieldFrame_' + id) === null) {\n return;\n }\n Event.stop(e);\n nextPage = false;\n sendMessage(JSON.stringify({\n type: \"submit\",\n qid: id + \"\"\n }), id + \"\");\n });\n\n //on pagebreak click\n $$(\".form-pagebreak-next\").each(function(b, i) {\n\n $(b).observe('click', function(e) {\n\n //get the section where the button is clicked\n //this is to identify what section we were previously in\n //so that we only need to send the submit message to that previous widget from the previous page\n section = this.up('.form-section');\n nextPage = true;\n if (section.select(\"#customFieldFrame_\" + id).length > 0) {\n enableLog && console.log('Sending submit message for iframe id', id, \"from section\", this.up('.form-section'), \"and iframe\", frameObj);\n sendMessage(JSON.stringify({\n type: \"submit\",\n qid: id + \"\"\n }), id + \"\");\n Event.stop(e);\n }\n\n //send ready message to the next widget of the page only if the section is fully visible\n //we need to get the actual frameobj and section of the next widget on the next page\n //for us to send the ready for that widget\n var checkIntevarl = setInterval(function(){\n\n // get the actual widget attach to this event\n frameObj = document.getElementById(\"customFieldFrame_\" + id);\n if ( frameObj ) {\n // get its form section\n section = $(frameObj).up('.form-section');\n\n if (frameObj && JotForm.isVisible(section) && JotForm.isVisible(frameObj)) {\n // if fframe and section is visible\n // throw ready message to every widget that was inside of it\n clearInterval(checkIntevarl);\n enableLog && console.log('Sending ready message for iframe id', id, \"from section\", section);\n sendReadyMessage(id);\n }\n } else {\n // missing iframe - it was replace by a normal question field\n // usually happens on ie8 browsers - for widgets that using JFCustomWidget.replaceWidget method\n clearInterval(checkIntevarl);\n }\n }, 100);\n });\n });\n}",
"function updateIFrame(value) {\n iDoc().open();\n iDoc().close();\n iDoc().location.hash = value;\n }",
"function frame(){\n\t//FRAME DEBUG\n\t\t// noFill();\n\t\t// stroke(0)\n\t\t// strokeWeight(1);\n\t\n\t//Frame Appearance\n\tnoStroke();\n\tfill(0);\n\t\n\t//Frame Render\n\trect(0, 0, canvasWidth, frameThickness);\n\trect(0, canvasWidth-frameThickness, canvasWidth, frameThickness);\n\trect(0, 0, frameThickness, canvasWidth);\n\trect(canvasWidth-frameThickness, 0, frameThickness, canvasWidth);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a time value from the given string in the QLC+ format. Time example: 2h34m12s870ms Beats example: 5 1/4 Returns 2 on infinite time string | function qlcStringToTime(str, type)
{
if (str === "" || str === "0") {
return 0;
} else if (str === "∞") {
return -2;
}
var finalTime = 0;
var currStr = "";
if (type === 0 /*Function.Time */)
{
for (var i = 0; i < str.length; i++)
{
if (str[i] >= "0" && str[i] <= "9")
{
currStr += str[i];
}
else if (str[i] === "h")
{
console.log("Hours: " + currStr);
finalTime += parseInt(currStr) * 1000 * 60 * 60;
currStr = "";
}
else if (str[i] === "m" && str[i + 1] === "s")
{
console.log("Millisecs: " + currStr);
finalTime += parseInt(currStr);
break;
}
else if (str[i] === "m")
{
console.log("minutes: " + currStr);
finalTime += parseInt(currStr) * 1000 * 60;
currStr = "";
}
else if (str[i] === "s")
{
console.log("seconds: " + currStr);
finalTime += parseInt(currStr) * 1000;
currStr = "";
}
}
if (finalTime === 0) {
finalTime += parseInt(currStr);
}
}
else if (type === 1 /* Function.Beats */)
{
var tokens = str.split(" ");
finalTime = parseInt(tokens[0]) * 1000;
if (tokens.length > 1)
{
if (tokens[0] === " 1/8") { finalTime += 125; }
else if (tokens[0] === " 1/4") { finalTime += 250; }
else if (tokens[0] === " 3/8") { finalTime += 375; }
else if (tokens[0] === " 1/2") { finalTime += 500; }
else if (tokens[0] === " 5/8") { finalTime += 625; }
else if (tokens[0] === " 3/4") { finalTime += 750; }
else if (tokens[0] === " 7/8") { finalTime += 875; }
}
}
return finalTime;
} | [
"function parseTime(str) {\n\t if (!str) {\n\t return 0;\n\t }\n\t\n\t var strings = str.split(\":\");\n\t var l = strings.length, i = l;\n\t var ms = 0, parsed;\n\t\n\t if (l > 3 || !/^(\\d\\d:){0,2}\\d\\d?$/.test(str)) {\n\t throw new Error(\"tick only understands numbers, 'm:s' and 'h:m:s'. Each part must be two digits\");\n\t }\n\t\n\t while (i--) {\n\t parsed = parseInt(strings[i], 10);\n\t\n\t if (parsed >= 60) {\n\t throw new Error(\"Invalid time \" + str);\n\t }\n\t\n\t ms += parsed * Math.pow(60, (l - i - 1));\n\t }\n\t\n\t return ms * 1000;\n\t }",
"function getTime(time) {\n var tempTime;\n tempTime = replaceAt(time, 2, \"h\");\n tempTime = replaceAt(tempTime, 5, \"m\");\n tempTime += \"s\";\n return tempTime;\n }",
"function parseTime(str) {\n let segments = str.split(':');\n let hour = parseInt(segments[0]) % 12;\n let min = parseInt(segments[1].substr(0, 2));\n let suf = segments[1].substr(2, 2);\n if (suf === 'pm') hour += 12;\n\n let date = new Date(1970, 1, 1, hour, min, 0);\n return date;\n}",
"function getMinutes(s) {\n var results = s.split(':');\n return results[0]*60 + results[1];\n\n}",
"function utilFromCssTime(cssTime) {\n\t\tconst\n\t\t\tre = /^([+-]?(?:\\d*\\.)?\\d+)([Mm]?[Ss])$/,\n\t\t\tmatch = re.exec(String(cssTime));\n\n\t\tif (match === null) {\n\t\t\tthrow new SyntaxError(`invalid time value syntax: \"${cssTime}\"`);\n\t\t}\n\n\t\tlet msec = Number(match[1]);\n\n\t\tif (/^[Ss]$/.test(match[2])) {\n\t\t\tmsec *= 1000;\n\t\t}\n\n\t\tif (Number.isNaN(msec) || !Number.isFinite(msec)) {\n\t\t\tthrow new RangeError(`invalid time value: \"${cssTime}\"`);\n\t\t}\n\n\t\treturn msec;\n\t}",
"function timeInput(id) {\n\tconst input = /** @type {HTMLInputElement} */ ele(id);\n\tif (supportsNumber(input)) return input.valueAsNumber;\n\treturn parseTime(input.value);\n}",
"function timeAmpmAdd30(timeString){\n\tvar min = parseInt(timeString.substring(timeString.length-2,timeString.length));\n\tvar hour = parseInt(timeString.substring(0,timeString.length-3));\n\t\tif(min+30>=60){\n\t\t\thour ++;\n\t\t\tmin = min-30;\n\t\t}else{\n\t\t\tmin = min+30;\n\t\t}\n\n\t\tif(hour<10){\n \tif(min<10){\n \tresult = \"0\"+hour+\":\"+\"0\"+min; \n \t}else{\n \tresult = \"0\"+hour+\":\"+min; \n \t}\n \t}else{\n \tif(min<10){\n \tresult = hour+\":\"+\"0\"+min; \n \t}else{\n \tresult = hour+\":\"+min; \n \t}\n\t\t}\n\t\n\t// console.log(result);\n\treturn result;\n}",
"function time_convert(num) {\n if (parseInt(num) > 60) return `${Math.floor(parseInt(num) / 60)}h ${parseInt(num) % 60}min`;\n else return num; \n}",
"function timeAmpmSubtract30(timeString){\n\tvar min = parseInt(timeString.substring(timeString.length-2,timeString.length));\n\tvar hour = parseInt(timeString.substring(0,timeString.length-3));\n\n\t//calc\n\t\tif(min==0){\n\t\t\tconsole.log(\"yes\");\n\t\t\tconsole.log(\"hour = \"+hour+\"; min =\"+ min);\n\t\t\thour --;\n\t\t\tmin = 30;\n\t\t} else if (min-30<=0){\n\t\t\thour --;\n\t\t\tmin = min+30;\n\t\t}else{\n\t\t\tmin = min-30;\n\t\t}\n\n\t\tif(hour<10){\n \tif(min<10){\n result = \"0\"+hour+\":\"+\"0\"+min; \n \t}else{\n result = \"0\"+hour+\":\"+min; \n } \n }else{\n \t\tif(min<10){\n \t\t\tresult = hour+\":\"+\"0\"+min;\n \t\t}else{\n \t\t\tresult = hour+\":\"+min;\n \t\t}\n\t\t}\n\t\n\treturn result;\n}",
"function VideoLengthInSeconds(string) {\n var Minutes = \"\";\n for (var i = 0; i < string.length; i++) {\n Minutes += string.charAt(i);\n if (string.charAt(i) == \":\")\n break;\n }\n Seconds = `${string.charAt(string.length-2)}${string.charAt(string.length-1)}`;\n if (parseInt(Minutes) < 0 || parseInt(Seconds) > 60) {\n return false;\n } else {\n return parseInt(Minutes) * 60 + parseInt(Seconds)\n }\n}",
"function timeDurationAdd30(timeString){\t\n\tvar min = parseInt(timeString.substring(timeString.length-3,timeString.length-1));\n\tvar hour = parseInt(timeString.substring(0,timeString.length-4));\n\t\tif(min==30){\n\t\t\thour = hour+1;\n\t\t\tmin = \"00\"\n\t\t}else{\n\t\t\tmin = min + 30;\n\t\t}\n\tresult = hour+\":\"+min+\"h\";\t\n\treturn result;\n}",
"function tryToParse(txt) {\r\n\r\n // The listing of all possible formats that can reasonably be parsed, listed\r\n // in order from shortest to longest string.\r\n var formatArray = [ \"H\",\r\n \"HH\",\r\n \"HHm\",\r\n \"HHmm\",\r\n \"H:\",\r\n \"HH:\",\r\n \"H:m\",\r\n \"HH:m\",\r\n \"H:mm\",\r\n \"HH:mm\",\r\n \"H:mt\",\r\n \"HH:mt\",\r\n \"H:mmt\",\r\n \"HH:mmt\",\r\n \"H:mtt\",\r\n \"HH:mtt\",\r\n \"H:mmtt\",\r\n \"HH:mmtt\" ];\r\n\r\n // An index to be used for iterating through the format array\r\n var formatIdx = null;\r\n\r\n // Get rid of any spaces\r\n var hourText = txt.replace(/\\s/g, \"\");\r\n\r\n // Iterate through every format, and attempt to parse using that format.\r\n for (formatIdx in formatArray) {\r\n var cTime = Date.parseExact(hourText, formatArray[formatIdx]);\r\n if (cTime) {\r\n return cTime;\r\n }\r\n }\r\n\r\n // If not a single format matches, then return null\r\n return null;\r\n}",
"function timeDurationSubtract30(timeString){\t\n\tvar min = parseInt(timeString.substring(timeString.length-3,timeString.length-1));\n\tvar hour = parseInt(timeString.substring(0,timeString.length-4));\n\n\t\tif(!(min==0&hour==0)){\n\t\t\tif(min==0){\n\t\t\t\thour --;\n\t\t\t\tmin = 30;\n\t\t\t} else if (min==30){\n\t\t\t\tmin = \"00\"\n\t\t\t}else{\n\t\t\t\t\n\t\t\t\tif(hour!=0){\n\t\t\t\t\thour = hour - 1;\n\t\t\t\t\tmin = min + 30;\n\t\t\t\t}\n\t\t\t\tmin = \"00\";\n\t\t\t}\n\t\t}\n\n\t\tif(min==0){\n\t\t\tresult = hour+\":00h\";\n\t\t}else {\n\t\t\tresult = hour+\":\"+min+\"h\";\t\n\t\t}\n\treturn result;\n}",
"function _parseDuration(timestampText) {\n var a = timestampText.split(/\\s+/);\n var lastword = a[a.length - 1]; // ex: Duration: 2:27, Kesto: 1.07.54\n // replace all non :, non digits and non .\n\n var timestamp = lastword.replace(/[^:.\\d]/g, '');\n if (!timestamp) return {\n toString: function toString() {\n return a[0];\n },\n seconds: 0,\n timestamp: 0\n }; // remove trailing junk that are not digits\n\n while (timestamp[timestamp.length - 1].match(/\\D/)) {\n timestamp = timestamp.slice(0, -1);\n } // replaces all dots with nice ':'\n\n\n timestamp = timestamp.replace(/\\./g, ':');\n var t = timestamp.split(/[:.]/);\n var seconds = 0;\n var exp = 0;\n\n for (var i = t.length - 1; i >= 0; i--) {\n if (t[i].length <= 0) continue;\n var number = t[i].replace(/\\D/g, ''); // var exp = (t.length - 1) - i;\n\n seconds += parseInt(number) * (exp > 0 ? Math.pow(60, exp) : 1);\n exp++;\n if (exp > 2) break;\n }\n\n ;\n return {\n toString: function toString() {\n return seconds + ' seconds (' + timestamp + ')';\n },\n seconds: seconds,\n timestamp: timestamp\n };\n}",
"function parseTime(timesum){\n\t\n\t//since we are building very basic, short routines, we are only dealing with minutes and seconds\n\tvar min = String(Math.floor(timesum)); \n\tvar sec = String(timesum).substring(String(timesum).indexOf('.')+1) //everything after decimal point \n\tsec = (parseInt(sec)*6/10.0) * 10; //round 3-digit number to nearest tenth \n\tsec = String(sec).substring(0,2) //first two digits, since it will be placed after a decimal \n\n\treturn (min + ':' + sec);\n}",
"function getDuration(time) {\n var minutes = Math.floor(time / 60000);\n var seconds = ((time % 60000) / 1000).toFixed(0);\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n return minutes + \":\" + seconds;\n}",
"function WhatIsTheTime(timeInMirror){\n\n let mir = timeInMirror.split(':')\n let hour = parseFloat(mir[0])\n let min = parseFloat(mir[1])\n let realHour = 11 - hour\n let realMin = 60 - min\n let realTime\n\n //conditionals if mirrored time hour is 11 or 12 because formula doesn't apply\n if (hour ===12){\n realHour = 11\n }\n else if (hour ===11){\n realHour = 12\n }\n\n //for x:00 times, display mirrored hour rather than i.e 7:60\n if(realMin === 60){\n realHour += 1\n realMin = 0\n }\n\n //single digit times need to concatonate 0 when converted back to string\n if(realHour.toString().length===1){\n realHour = '0'+realHour\n }\n if(realMin.toString().length===1){\n realMin = '0'+realMin\n }\n\n //if 6PM, or 12PM -> realTime is the same, else realTime = realHour + realMin based on calculations\n if (timeInMirror===\"06:00\" || timeInMirror===\"12:00\"){\n realTime = timeInMirror\n } else {\n realTime = realHour + ':' + realMin\n }\n\n return realTime\n}",
"function MakeMilitary(time) {\n\tvar number = parseInt(time.substring(0,2));\n\tvar minuteRegex = /[:][0-9][0-9]/g\n\tvar minutes = time.match(minuteRegex).toString().substring(1);\n\tif(time.includes(\"p\")) {\n\t\tif(number == 12) {\n\t\t\tvar num = \"12\";\n\t\t\treturn num + minutes;\n\t\t} \n\t\telse {\n\t\t\tnumber += 12; \n\t\t}\n\t}\n\telse { \n\t\tif(number == 12) {\n\t\t\tvar num = \"00\";\n\t\t\treturn num + minutes; \n\t\t}\n\t\tnumber = number.toString().padStart(2,'0');\n\t}\n\tvar time = number + minutes;\n\treturn time.toString();\n}",
"function SGTimeToString(theTime) {\n var theHours, theMinutes, theSeconds;\n if (theTime == null || theTime == \"\" || !(theTime instanceof Date))\n return \"\";\n theHours = theTime.getHours();\n if (theHours >= 22) { //we have an under par SG to par score between -0:01 and -59:59...\n theSeconds = theTime.getSeconds();\n if (theSeconds > 0) {\n theMinutes = (theHours == 23 ? 60 - theTime.getMinutes() - 1 : 120 - theTime.getMinutes() - 1);\n theSeconds = 60 - theSeconds;\n } else {\n theMinutes = (theHours == 23 ? 60 - theTime.getMinutes() : 120 - theTime.getMinutes());\n }\n return \"-\" + theMinutes + \":\" + zeroPad(theSeconds);\n } else { //assume above par\n theMinutes = theTime.getMinutes() + (theHours * 60);\n theSeconds = theTime.getSeconds();\n return theMinutes + \":\" + zeroPad(theSeconds);\n } \n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GESTION DES DATES ze_Date_to_timestamp_v1 ze_Date_to_timestamp_v2 ze_Timestamp_input ze_Secondes_date ze_Generation_date_v1 ze_Generation_date_precise / Transforme une date au format JJ/MM/AA HH:MM en un timestamp str > int | function ze_Date_to_timestamp_v1(date) {
if(date.match(new RegExp('([0-9]{2})\/([0-9]{2})\/([0-9]{2,4})(( | | à |)([0-9]{2})(h|:)([0-9]{2})(:([0-9]{2})|)|)'))) {
var donnees = new RegExp('([0-9]{2})\/([0-9]{2})\/([0-9]{2,4})(( | | à |)([0-9]{2})(h|:)([0-9]{2})(:([0-9]{2})|)|)').exec(date);
if(typeof donnees[6] == 'undefined') {
return Math.round(new Date(2000 + parseInt(donnees[3])%2000, parseInt(donnees[2])-1, parseInt(donnees[1]), 0, 0, 0) / 1000);
}
else {
return Math.round(new Date(2000 + parseInt(donnees[3])%2000, parseInt(donnees[2])-1, parseInt(donnees[1]), parseInt(donnees[6]), parseInt(donnees[8]), ((typeof donnees[10] == 'undefined') ? 0 : parseInt(donnees[10]))) / 1000);
}
}
else {
return 0;
}
} | [
"function toTimeStamp(date) {\n\t\t\ttry {\n\t\t\t\tvar x=\"\";\n\t\t\t\tif(date!=\"\"){\n\t\t\t\t\tx= new Date(date).getTime()/1000;\n\t\t\t\t}\n\n\t\t\t\t// console.log('try'+x +' '+date);\n\t\t\t\treturn x;\n\t\t\t} catch (e) {\n\t\t\t\t// console.log(e);\n\t\t\t\tvar x= new Date().getTime()/1000;\n\t\t\t\t// console.log('catch '+x);\n\t\t\t\treturn x;\n\t\t\t}\n\t\t}",
"function unixTimestampToDate(timestamp) {\n return new Date(timestamp * 1000);\n}",
"function toJalali() {\n\n const DATE_REGEX = /^((19)\\d{2}|(2)\\d{3})-(([1-9])|((1)[0-2]))-([1-9]|[1-2][0-9]|(3)[0-1])$/;\n\n if (DATE_REGEX.test(mDate)) {\n\n let dt = mDate.split('-');\n let ld;\n\n let mYear = parseInt(dt[0]);\n let mMonth = parseInt(dt[1]);\n let mDay = parseInt(dt[2]);\n\n let buf1 = [12];\n let buf2 = [12];\n\n buf1[0] = 0;\n buf1[1] = 31;\n buf1[2] = 59;\n buf1[3] = 90;\n buf1[4] = 120;\n buf1[5] = 151;\n buf1[6] = 181;\n buf1[7] = 212;\n buf1[8] = 243;\n buf1[9] = 273;\n buf1[10] = 304;\n buf1[11] = 334;\n\n buf2[0] = 0;\n buf2[1] = 31;\n buf2[2] = 60;\n buf2[3] = 91;\n buf2[4] = 121;\n buf2[5] = 152;\n buf2[6] = 182;\n buf2[7] = 213;\n buf2[8] = 244;\n buf2[9] = 274;\n buf2[10] = 305;\n buf2[11] = 335;\n\n if ((mYear % 4) !== 0) {\n day = buf1[mMonth - 1] + mDay;\n\n if (day > 79) {\n day = day - 79;\n if (day <= 186) {\n switch (day % 31) {\n case 0:\n month = day / 31;\n day = 31;\n break;\n default:\n month = (day / 31) + 1;\n day = (day % 31);\n break;\n }\n year = mYear - 621;\n } else {\n day = day - 186;\n\n switch (day % 30) {\n case 0:\n month = (day / 30) + 6;\n day = 30;\n break;\n default:\n month = (day / 30) + 7;\n day = (day % 30);\n break;\n }\n year = mYear - 621;\n }\n } else {\n if ((mYear > 1996) && (mYear % 4) === 1) {\n ld = 11;\n } else {\n ld = 10;\n }\n day = day + ld;\n\n switch (day % 30) {\n case 0:\n month = (day / 30) + 9;\n day = 30;\n break;\n default:\n month = (day / 30) + 10;\n day = (day % 30);\n break;\n }\n year = mYear - 622;\n }\n } else {\n day = buf2[mMonth - 1] + mDay;\n\n if (mYear >= 1996) {\n ld = 79;\n } else {\n ld = 80;\n }\n if (day > ld) {\n day = day - ld;\n\n if (day <= 186) {\n switch (day % 31) {\n case 0:\n month = (day / 31);\n day = 31;\n break;\n default:\n month = (day / 31) + 1;\n day = (day % 31);\n break;\n }\n year = mYear - 621;\n } else {\n day = day - 186;\n\n switch (day % 30) {\n case 0:\n month = (day / 30) + 6;\n day = 30;\n break;\n default:\n month = (day / 30) + 7;\n day = (day % 30);\n break;\n }\n year = mYear - 621;\n }\n } else {\n day = day + 10;\n\n switch (day % 30) {\n case 0:\n month = (day / 30) + 9;\n day = 30;\n break;\n default:\n month = (day / 30) + 10;\n day = (day % 30);\n break;\n }\n year = mYear - 622;\n }\n\n }\n\n return year.toString() + \"-\" + Math.floor(month).toString() + \"-\" + day.toString();\n }\n}",
"function fromUnixToNatural(timestamp){\n var naturalDate = new Date(timestamp*1000).toString();\n naturalDate = naturalDate.split(\" \");\n naturalDate = months[naturalDate[1]] +\" \"+naturalDate[2]+ \", \"+ naturalDate[3];\n return naturalDate;\n}",
"function formatdate(timestamp) {\n let thisdate = new Date(timestamp * 1000)\n return `${weekdays[thisdate.getDay()]} ${months[thisdate.getMonth()]} ${thisdate.getDate()}, ${thisdate.getFullYear()}`\n}",
"function toJsTimestamp(str = Date.now()) {\n try {\n //unix timestamp\n if(typeof str === 'number' && String(str).length === 10) {\n return str * 1000;\n }\n return + new Date(str);\n } catch(err) {\n throw new Error(`Can not transform ${str} to timestamp`);\n }\n}",
"function extractStamp(date) {\r\n\treturn Math.round(date.getTime() / 1000);\r\n}",
"function dateToUnix(inputDate){\r\n\tvar unixDate = new Date(inputDate);\r\n\tconsole.log('date is '+unixDate);\r\n\t// console.log('unix time is '+(unixDate.getTime()/1000));\r\n\treturn (unixDate.getTime()/1000);\r\n}",
"function formatTS(timeStamp) {\n var ts = timeStamp;\n var dt = ts.slice(6, 8);\n var mt = ts.slice(4, 6);\n var yr = ts.slice(0, 4);\n var date = dt + '/' + mt + '/' + yr;\n var time = ts.slice(9, 11) + \".\" + ts.slice(11, 13);\n\n return date + \" \" + time;\n }",
"toDateString() {\n return `${this.nepaliYear.toString()}/${this.nepaliMonth}/${\n this.nepaliDay\n }`;\n }",
"function timestampToDateTimeLocal (timestamp) {\r\n\tvar date = new Date(timestamp*1000);\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth() + 1;\r\n\tmonth = (month<10) ? '0' + month : month;\r\n\tvar day = date.getDate();\r\n\tday = (day<10) ? '0' + day : day;\r\n\tvar hours = date.getHours();\r\n\thours = (hours<10) ? '0' + hours : hours;\r\n\tvar minutes = date.getMinutes();\r\n\tminutes = (minutes<10) ? '0' + minutes : minutes;\r\n\tvar seconds = date.getSeconds();\r\n\tseconds = (seconds<10) ? '0' + seconds : seconds;\r\n\treturn year + \"-\" + month + \"-\" + day + \"T\" + hours + \":\" + minutes + \":\" + seconds;\r\n}",
"function fun_arma_fecha_sql(arg_dia,arg_mes,arg_anio){ //los numeros pueden venir en STRING o enteros\r\n\r\nvar _dia=parseFloat(arg_dia);\r\nvar _mes=parseFloat(arg_mes);\r\nvar _anio=parseFloat(arg_anio);\r\n\r\nvar fecha=_anio;\r\n\r\nif(_mes<10){\r\nfecha=fecha+\"-0\"+_mes;\t\r\n}\r\nelse{\t\r\nfecha=fecha+\"-\"+_mes;\r\n}\r\n\r\nif(_dia<10){\t\r\nfecha=fecha+\"-0\"+_dia;\r\n}\r\nelse{\r\n\t\r\nfecha=fecha+\"-\"+_dia;\r\n}\r\nreturn fecha; //LA FECHA ES DEVUELTA EN FORMATO ANIO-MES-DIA\r\n}",
"function getTimestampString(timestamp) {\n\n // use JSON data as it is\n return timestamp;\n\n var date = new Date(timestamp);\n // These methods are return local time\n var YYYY = date.getFullYear();\n // make zero-padding string\n var MM = ('0' + (date.getMonth() + 1)).slice(-2);\n var DD = ('0' + date.getDate()).slice(-2);\n var hh = ('0' + date.getHours()).slice(-2);\n var mm = ('0' + date.getMinutes()).slice(-2);\n var ss = ('0' + date.getSeconds()).slice(-2);\n var milli = date.getMilliseconds();\n\n return YYYY + '-' + MM + '-' + DD + 'T' + hh + ':' + mm + ':' + ss + '.' + milli;\n}",
"jd2unix (t) {\n return (t - 2440587.5) * 86400 * 1000\n }",
"function getTimeStamp() {\r\n\treturn extractStamp(new Date());\r\n}",
"function PARSEDATE(val) {\n\n /* *******************\n Extracted from Social Calc\n convert_date_julian_to_gregorian(juliandate)\n ymd->{}\n .year\n .month\n .day\n From: http://aa.usno.navy.mil/faq/docs/JD_Formula.html\n Uses: Fliegel, H. F. and van Flandern, T. C. (1968). Communications of the ACM, Vol. 11, No. 10 (October, 1968).\n Translated from the FORTRAN\n ************************* */\n function convert_date_julian_to_gregorian(juliandate) {\n\n var L, N, I, J, K;\n\n L = juliandate + 68569;\n N = Math.floor(4 * L / 146097);\n L = L - Math.floor((146097 * N + 3) / 4);\n I = Math.floor(4000 * (L + 1) / 1461001);\n L = L - Math.floor(1461 * I / 4) + 31;\n J = Math.floor(80 * L / 2447);\n K = L - Math.floor(2447 * J / 80);\n L = Math.floor(J / 11);\n J = J + 2 - 12 * L;\n I = 100 * (N - 49) + I + L;\n\n return new Date(I, J - 1, K);\n }\n\n if (val instanceof Error) {\n return val;\n } else if (typeof val === 'number') {\n // val is assumed to be serial number.\n return convert_date_julian_to_gregorian(Math.floor(val + JulianOffset));\n } else if (typeof val === 'string') {\n var timestamp = Date.parse(val);\n if (isNaN(timestamp)) {\n return error$2.value;\n }\n return new Date(timestamp);\n }\n\n return error$2.value;\n}",
"function transformDate(d) {\n return d.substr(6) + '-' + d.substr(3, 2) + '-' + d.substr(0, 2);\n }",
"function transform_date(obj)\r\n {\r\n var hint,foo,num,i,jsDate\r\n if (obj && typeof obj === 'object')\r\n {\r\n hint = obj.hasOwnProperty('javaClass');\r\n foo = hint ? obj.javaClass === 'java.util.Date' : obj.hasOwnProperty('time');\r\n num = 0;\r\n // if there is no class hint but the object has 'time' property, count its properties\r\n if (!hint && foo)\r\n {\r\n for (i in obj)\r\n {\r\n if (obj.hasOwnProperty(i))\r\n {\r\n num++;\r\n }\r\n }\r\n }\r\n // if class hint is java.util.Date or no class hint set, but the only property is named 'time', we create jsdate\r\n if (hint && foo || foo && num === 1)\r\n {\r\n jsDate = new Date(obj.time);\r\n return jsDate;\r\n }\r\n else\r\n {\r\n for (i in obj)\r\n {\r\n if (obj.hasOwnProperty(i))\r\n {\r\n obj[i] = transform_date(obj[i]);\r\n }\r\n }\r\n return obj;\r\n }\r\n }\r\n else\r\n {\r\n return obj;\r\n }\r\n }",
"function post_laikas( post_milisec ) {\r\n var post_data='';\r\n var y,mn,d,h,m;\r\n var h1,m1;\r\n var monthNames = [\"Sausio\", \"Vasario\",\"Kovo\",\"Balandžio\",\"Gegužės\",\"Birželio\",\r\n \"Liepos\",\"Rugpjūčio\", \"Rugsėjo\",\"Spalio\", \"Lapkričio\",\"Gruodžio\"];\r\n var post_str=new Date(post_milisec); \r\n var dabar_str=new Date();\r\n var dabar_milisec=dabar_str.getTime();\r\n var post_min=Math.round(post_milisec/(1000 * 60));\r\n var dabar_min=Math.round(dabar_milisec/(1000 * 60));\r\n\r\n var skirt=dabar_min - post_min; //minuciu sk\r\n\r\n y = post_str.getFullYear();\r\n mn= monthNames[post_str.getMonth()];\r\n d = post_str.getDate();\r\n h = ('0' + post_str.getHours()).slice(-2);\r\n m = ('0' + post_str.getMinutes()).slice(-2);\r\n \r\n post_data= y +\" m. \" + mn + \r\n \" \" + d + \" d. \" + h + \":\" + m ;\r\n\r\n //console.log(post_str);\r\n //console.log(dabar_str);\r\n //console.log(post_milisec);\r\n //console.log(dabar_milisec);\r\n //console.log(skirt);\r\n\r\n /* maziau uz 24 val */\r\n if (skirt < (60*24) && skirt>0) {\r\n post_data='Šiandien ' + h + ':' + m + ' ....prieš ';\r\n\r\n /* jei maziau nei valanda */\r\n if (skirt < 60) {\r\n post_data+= skirt.toString() + ' min.';\r\n }\r\n /* jei daugiau nei valanda */\r\n else { \r\n h1 = Math.trunc(skirt / 60);\r\n post_data+= h1.toString() + ' val. ';\r\n\r\n /* ar liko minuciu virs valandos ? */\r\n if (skirt % 60 >0){\r\n m1 = skirt % 60;\r\n post_data+=m1.toString() + ' min.';\r\n }\r\n }\r\n \r\n }\r\n\r\n //console.log(post_data );\r\n\r\n return post_data; \r\n\r\n \r\n}",
"function dateConvert(unixDate){\r\n var dateStr = new Date(unixDate * 1000)\r\n var n = dateStr.toDateString()\r\n var displayStr = n.substring(4, n.length)\r\n return \"(\" + displayStr + \")\"\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the last column in a group | getLastColumn(){
if(!this.isGroup){
return this;
}else{
if(this.columns.length){
return this.columns[this.columns.length -1].getLastColumn();
}else{
return false;
}
}
} | [
"isLastColumn(): boolean {\n return this.getColumnIndex() === this.getWidth() - 1;\n }",
"getTopColumn(){\n\t\tif(this.parent.isGroup){\n\t\t\treturn this.parent.getTopColumn();\n\t\t}else{\n\t\t\treturn this;\n\t\t}\n\t}",
"function getSheetEndColumn() {\r\n\t\r\n\tif(sheetEndColumns.length==0){\r\n\t\t//Here, I have to define which is the last valid column for each spreadsheet\r\n\t\t//The second sheet contains the data, here the nr of columns is always 4 + nr of data elements:\r\n\t\t//Update the column index if the layout of the template changes!\r\n\t\tcolumnIndex=4+dataElementIDs.size;\t\r\n\t\tvar div = Math.floor(columnIndex/26);\r\n\t\tvar rem = columnIndex % 26;\t\r\n\t\tvar lastColumn = \"\";\r\n\t\t\r\n\t\tif(div==0){\r\n\t\t\tlastColumn=letters[rem];\r\n\t\t}else{\r\n\t\t\tlastColumn=letters[div].concat(letters[rem])\r\n\t\t}\t\t\r\n\t\tconsole.log(\"div: \"+ div +\"rem: \"+ rem ,\"letter:\"+ lastColumn)\r\n\t\t\r\n\t\tsheetEndColumns.push(lastColumn);\r\n\t\t//The second sheet always contains a legend with two columns.\r\n\t\t//sheetEndColumns.push('B');\r\n\t\t//The third sheet always contains a legend with two columns.\r\n\t\t//sheetEndColumns.push(letter[div].concat(letter[rem]));\r\n\t}\r\n\treturn lastColumn\r\n}",
"function findLastEmptyCell(incoming_col){\n const container = document.querySelector('#connect4');\n const containerRow = container.querySelectorAll('.row');\n cellsArr = [];\n containerRow.forEach(function(row){\n cells = row.querySelector('[data-col=\"'+ incoming_col +'\"]');\n cellsArr.push(cells);\n });\n\n // Looping through array of each column to find the last empty spot\n for(let i = cellsArr.length-1; i>=0; i--){\n const classes = cellsArr[i].classList\n if(classes == 'col empty'){\n console.log(classes)\n return cellsArr[i];\n }\n }\n return null;\n }",
"getFirstColumn(){\n\t\tif(!this.isGroup){\n\t\t\treturn this;\n\t\t}else{\n\t\t\tif(this.columns.length){\n\t\t\t\treturn this.columns[0].getFirstColumn();\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"rightMostColumn(){\n let headers = this.props.tableData.headers\n if(headers.fixedLeft<headers.headers.length){\n let windowSize=headers.columns-1-headers.fixedLeft\n return headers.currentLeft+windowSize-1\n }else{\n return headers.headers.length-1\n }\n }",
"function getLastChunk(chunks) {\n return chunks[chunks.length - 1];\n}",
"function lastElement(array){\n if (array.length > 0){\n return array[array.length-1];\n }\n return null;\n}",
"function getLastBox(bed) {\n\tif (isEmpty(bed))\n\t\treturn undefined;\n\telse {\n\t\treturn bed.boxes.slice(-1).pop();\n\t}\n}",
"function getLastKey(data) {\r\n let keys = Object.keys(data[0]);\r\n let lastKey = keys[keys.length -1];\r\n return lastKey;\r\n}",
"function lastImageSelector(){\n return $('div img:last')\n}",
"_lastHeading() {\n const headings = this._allHeadings();\n return headings[headings.length - 1];\n }",
"function getLast() {\n return lastRemoved;\n}",
"get goalColumn() {\n let value = this.flags >> 5 /* RangeFlag.GoalColumnOffset */\n return value == 33554431 /* RangeFlag.NoGoalColumn */\n ? undefined\n : value\n }",
"function last(input) {\n var stringLength = input.length;\n return input.charAt(stringLength - 1);\n}",
"function last(arr, cb) {\n return cb(items[items.length - 1]);\n}",
"getLastFour() {\n return this.lastFour;\n }",
"isLastRow(): boolean {\n return this.getRowIndex() === this.getHeight() - 1;\n }",
"function getLastPath() {\n if (url.path.components.length > 0) {\n return url.path.components[url.path.components.length - 1];\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles grid transitions (and drawing new state) based on key presses. If the key pressed was the left or right arrow, repeatedly calls previous or next step, respectively, for as long as the key is down. If the key pressed was the space button, either pauses or unpauses the grid. | function keydownHandler(event) {
const key = event.code;
if (key === 'ArrowLeft') {
event.preventDefault(); // Prevents key from executing its default action.
clickAndHold(document, [pause], [boundPreviousStep, boundDrawPreviousGrid], 'keyup');
} else if (key === 'ArrowRight') {
event.preventDefault();
clickAndHold(document, [pause], [boundNextStep, boundDrawNextGrid], 'keyup');
} else if (key === 'Space') {
event.preventDefault();
drawing.togglePause();
}
} | [
"function redrawAfterKey() {\r\n\r\n var sO = CurStepObj;\r\n\r\n if (sO.focusBoxId == CodeBoxId.Index) \r\n\tredrawGridIndexExpr(sO); // redraw the index *cell*\r\n else\r\n\tdrawCodeWindow(sO); // redraw code window\r\n\r\n}",
"function keyPressed() {\n\tif (keyCode == 32) {\n\t\t// reset canvas\n\t\tclear();\n\t\tcount = 0;\n\t\tbutton.hide(); \n\t\tparticleCount = 0;\n\t\t// load next image in paintings array\n\t\tpainting = loadImage(paintings[paintingCount]);\n\t\t// move on to next painting. Go back to first one if the last one is complete\n\t\tif (paintingCount == 4) {\n\t\t\tpaintingCount = 0;\n\t\t} else {\n\t\t\tpaintingCount++;\n\t\t}\n\t\t// fix the position\n\t\tif(isTranslate == true) {\n\t\t\ttranslate(0, 50);\n\t\t\tisTranslate = false;\n\t\t}\n\t\t// reload background and frame (because of the reset)\n\t\tbackground(bg);\n\t\timage(frame, 55, -65);\n\t\t// start next painting \n\t\tstart = true;\n\t}\n}",
"function handleKeyDownEvent(){\n if(d3.event.keyCode == 49){\n // Number 1: Set start point\n } else if(d3.event.keyCode == 50){\n // Number 2: Set end point\n } else if(d3.event.keyCode == 83){\n // Character S: Start search\n startSearch();\n } else if(d3.event.keyCode == 82){\n // Character R: Reset search\n resetSearch();\n } else if(d3.event.keyCode == 67){\n // Character C: Clear walls\n clearWalls();\n }\n}",
"function keyPressed() {\n changeSnakeDir(keyCode);\n}",
"function keyPressed() {\n if(keyCode === 37 && currentCardIndex > 0) {\n pressedLeft = true;\n }\n\n if(keyCode === 39 && currentCardIndex < amountOfCards - 1) {\n pressedRight = true;\n }\n redraw();\n}",
"function keyPressed() {\n if (keyCode == 32) {\n if (strokeToggle) {\n stroke(0);\n } else {\n noStroke();\n }\n strokeToggle = !strokeToggle;\n }\n if (keyCode == LEFT_ARROW) {\n circleSize = circleSize - 10;\n }\n if (keyCode == RIGHT_ARROW) {\n circleSize = circleSize + 10;\n }\n if (keyCode == UP_ARROW) {\n toggle++;\n toggle = toggle % 3;\n }\n if (keyCode == DOWN_ARROW) {\n toggle++;\n toggle = toggle % 3;\n }\n}",
"onKeyPress(str, key) {\n switch (key.name) {\n case wordsearchConstants.KEY_UP:\n if (this.cursorPos.row > 0) {\n this.cursorPos.row--;\n } else {\n return;\n }\n break;\n case wordsearchConstants.KEY_DOWN:\n if (this.cursorPos.row < this.gridSize - 1) {\n this.cursorPos.row++;\n } else {\n return;\n }\n break;\n case wordsearchConstants.KEY_LEFT:\n if (this.cursorPos.col > 0) {\n this.cursorPos.col -= 2;\n } else {\n return;\n }\n break;\n case wordsearchConstants.KEY_RIGHT:\n if (this.cursorPos.col < (this.gridSize - 1) * 2) {\n this.cursorPos.col += 2;\n } else {\n return;\n }\n break;\n case wordsearchConstants.KEY_SPACE: {\n this.onSpaceKeyPressed();\n break;\n }\n default:\n // if user enters any other key they will be writing over the grid so we need to redraw it\n if (!(key.ctrl && key.name === 'c')) {\n this.drawGrid();\n }\n }\n\n this.setCursorPos();\n }",
"function keyPressed() {\n\tif (keyCode === UP_ARROW) {\n \tpaddle.direction = -1;\n \t} \n \telse if (keyCode === DOWN_ARROW) {\n \tpaddle.direction = +1;\n \t}\n}",
"function keyPressed() {\n switch (key) {\n case 'C':\n drawCos = !drawCos;\n break;\n case 'S':\n drawSin = !drawSin;\n break;\n case 'T':\n drawTan = !drawTan;\n break;\n }\n}",
"function initKeyboard(){\n\tkeyStates = {\n\t\t'Left': false,\n\t\t'Right': false,\n\t\t'Up': false,\n\t\t'Down': false,\n\t\t'Shift': false,\n\t\t'Control': false,\n\t\t'Space': false,\n\t\t'E': false,\n\t}\n\n\tconsole.log(\"Now listening for keyboard presses...\");\n\tdocument.addEventListener('keydown', function(event) {\n\t\tlet keyPressed = event.code;\n\t\tif (event.repeat){\n\t\t\t// ignore repeat (held down) key presses\n\t\t\treturn;\n\t\t}\n\t\tif (keyPressed === 'KeyA' || keyPressed === 'ArrowLeft'){\n\t\t\tkeyStates['Left'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyW' || keyPressed === 'ArrowUp'){\n\t\t\tkeyStates['Up'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyD' || keyPressed === 'ArrowRight'){\n\t\t\tkeyStates['Right'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyS' || keyPressed === 'ArrowDown'){\n\t\t\tkeyStates['Down'] = true;\n\t\t}\n\t\telse if (keyPressed === 'ShiftLeft' || keyPressed === 'ShiftRight'){\n\t\t\tkeyStates['Shift'] = true;\n\t\t}\n\t\telse if (keyPressed === 'ControlLeft' || keyPressed === 'ControlRight'){\n\t\t\tkeyStates['Control'] = true;\n\t\t}\n\t\telse if (keyPressed === \"KeyR\" ){\n\t\t\tresetFunction();\n\t\t}\n\n\t\t// note space is queued up and only unset by the player and not keyup event\n\t\telse if (keyPressed === \"Space\" ){\n\t\t\tkeyStates['Space'] = true;\n\t\t}\n\n\t\telse if (keyPressed === \"KeyE\"){\n\t\t\tkeyStates['E'] = true;\n\t\t\tendGame()\n\t\t}\n\n\t})\n\t/* when a key is realeased, remove it from the keystates list */\n\tdocument.addEventListener('keyup', function(event) {\n\t\tlet keyReleased = event.code;\n\n\t\tif (keyReleased === 'KeyA' || keyReleased === 'ArrowLeft'){\n\t\t\tkeyStates['Left'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyW' || keyReleased === 'ArrowUp'){\n\t\t\tkeyStates['Up'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyD' || keyReleased === 'ArrowRight'){\n\t\t\tkeyStates['Right'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyS' || keyReleased === 'ArrowDown'){\n\t\t\tkeyStates['Down'] = false;\n\t\t}\n\t\telse if (keyReleased === 'ShiftLeft' || keyReleased === 'ShiftRight'){\n\t\t\tkeyStates['Shift'] = false;\n\t\t}\n\t})\n}",
"function keyPress(evt) {\n if (current_cell == null)\n return;\n var key, key1;\n if (evt) {\n // firefox or chrome\n key = evt.key;\n key1 = evt.keyCode;\n }\n else {\n // IE\n key = String.fromCharCode(event.keyCode);\n }\n if (key1 == 8 || key1 == 46) {\n VerificarBorrar();\n current_cell.innerHTML = '';\n }\n\n else if (key1 >= 49 && key1 <= 57) {\n scoreT++;\n VerificarFila(key);\n VerificarColumna(key);\n VerificarSubTabla(key);\n current_cell.innerHTML = key;\n document.getElementById(\"score\").innerHTML = scoreT;\n }\n else if (key1 == 67) {\n borrarTodo();\n }\n\n\n}",
"function movePageKeys(e) {\n var key = e.keyCode;\n e.preventDefault();\n\n if (key == \"38\") {\n movePage(\"up\");\n } else if (key == \"40\") {\n movePage(\"down\");\n }\n }",
"function keyPressed () {\nif (keyCode === 32) {\nretro = !retro;\n}\n}",
"function navigateCells(e) {\n if($(\"div.griderEditor[style*=block]\").length > 0)\n return false;\n\n var $td = $table.find('.' + defaults.selectedCellClass);\n var col = $td.attr(\"col\");\n switch(e.keyCode) {\n case $.ui.keyCode.DOWN:\n //console.log($td);\n setSelectedCell($td.parent(\"tr:first\").next().find('td[col=' + col + ']') );\n break;\n case $.ui.keyCode.UP:\n setSelectedCell($td.parent(\"tr\").previous().find('td[col=' + col + ']') );\n break;\n case $.ui.keyCode.LEFT:\n //console.log(\"left\");\n break;\n case $.ui.keyCode.RIGHT:\n //console.log(\"right\");\n break;\n }\n }",
"function keyReleased() { \r\n if (key != ' ') {\r\n ship.setDir(0);\r\n }\r\n}",
"function handleKeys() {\n if (currentlyPressedKeys[33]) {\n // Page Up\n pitchRate = 0.1;\n } else if (currentlyPressedKeys[34]) {\n // Page Down\n pitchRate = -0.1;\n } else {\n pitchRate = 0;\n }\n\n if (currentlyPressedKeys[37] || currentlyPressedKeys[65]) {\n // Left cursor key or A\n yawRate = 0.1;\n } else if (currentlyPressedKeys[39] || currentlyPressedKeys[68]) {\n // Right cursor key or D\n yawRate = -0.1;\n } else {\n yawRate = 0;\n }\n\n if (currentlyPressedKeys[38] || currentlyPressedKeys[87]) {\n // Up cursor key or W\n speed = 0.003;\n } else if (currentlyPressedKeys[40] || currentlyPressedKeys[83]) {\n // Down cursor key\n speed = -0.003;\n } else {\n speed = 0;\n }\n}",
"function spacebar(e) {\n if (e.keyCode === 32) {\n jumping()\n }\n}",
"function handle_key(e){\n if(mode == \"r\"){\n if(e.keyCode == 32){\n readTime = getMS();\n RT = readTime - startTime;\n dataSet.push({\"train\":train, \"sent_num\":sent+1, \"word_num\":position+1, \"word\": word, \"RT\": RT, \"sentence\":sents[sent].sent, 'corr':corr});\n nextWord();\n }\n }\n\n\n if(mode == \"q\"){\n if(e.keyCode == 89){\n readTime = getMS();\n RT = readTime - startTime;\n resp = \"y\";\n evalQuestion()\n dataSet.push({\"train\":train, \"sent_num\":sent+1, \"word_num\":\"q\", \"word\":\"NA\", \"RT\": RT, \"sentence\":sents[sent].question, 'corr':corr})\n sent += 1;\n position = 0;\n stage.removeChild(text)\n mode = \"r\";\n handleSent();\n }\n\n if(e.keyCode == 78){\n readTime = getMS();\n RT = readTime - startTime;\n resp = \"n\";\n evalQuestion();\n dataSet.push({\"train\":train, \"sent_num\":sent+1, \"word_num\":\"q\", \"word\":\"NA\", \"RT\": RT, \"sentence\":sents[sent].question, 'corr':corr})\n sent += 1;\n position = 0;\n stage.removeChild(text);\n mode = \"r\";\n handleSent();\n }\n }\n}",
"handleBoardKeyPress(e) {\n if (!this.state.helpModalOpen && !this.state.winModalOpen) {\n if (49 <= e.charCode && e.charCode <= 57) {\n this.handleNumberRowClick((e.charCode - 48).toString());\n // undo\n } else if (e.key === \"r\") {\n this.handleUndoClick();\n // redo\n } else if (e.key === \"t\") {\n this.handleRedoClick();\n // erase/delete\n } else if (e.key === \"y\") {\n this.handleEraseClick();\n // notes\n } else if (e.key === \"u\") {\n this.handleNotesClick();\n }\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a pdf through given Data | function pdfMaker(listData, topic, level){
let pdfDoc = new PDFDocument({
size: "A4",
margin: 40,
});
// generateTable(pdfDoc, listData);
generateDoc(pdfDoc, listData);
pdfDoc.end();
if(level!=undefined){
topic =topic+level;
}
pdfDoc.pipe(fs.createWriteStream(`./${topic}.pdf`));
function generateDoc(doc, arr) {
const chunkSize = 24;
const groups = arr
.map((e, i) => {
return i % chunkSize === 0 ? arr.slice(i, i + chunkSize) : null;
})
.filter((e) => {
return e;
});
let i = 0;
for (let group of groups) {
if (i) {
doc.addPage();
}
generateTable(doc, group, i, chunkSize);
i++;
}
}
function generateTable(doc, data, itr, chunkSize) {
let i = 0;
var dataTableTop = 30;
generateTableRow(doc, dataTableTop, "Index", "Name", "Link","Difficulty" ,1);
for (let l of data) {
const position = dataTableTop + (i + 1) * 30;
generateTableRow(doc, position, chunkSize * itr + i + 1, l.name, l.Qlink, l.Difficulty);
i++;
}
}
function generateTableRow(doc, y, index, name, Qlink, Difficulty, type) {
doc
.fontSize(type ? 14 : 10)
.fillColor("black")
.text(index, 50, y, { underline: type ? true : false })
.fillColor("black")
.text(name, 160, y, { width: 154, underline: type ? true : false })
.fillColor(type ? "black" : "blue")
.text(Qlink, 300, y, {
link: Qlink,
underline: true,
})
.fillColor("black")
.text(Difficulty, 100, y, { width: 120, underline: type ? true : false })
;
}
} | [
"function createPDF(body) {\n var doc = new PDFDocument;\n doc.pipe(fs.createWriteStream('ticket.pdf'));\n\n var text = 'Hi, ' + body.name + ' Ticket has been booked from ' + body.location.from.name + ' to ' +\n body.location.to.name + ', Enjoy your flight';\n console.log('text',text);\n\n doc.fillColor('black');\n doc.text(text, {\n paragraphGap: 10,\n indent: 20,\n align: 'justify',\n columns: 1\n });\n doc.end('ticket.pdf');\n}",
"listToPDF() {\n const doc = new jsPDF()\n const { articles } = this.props.articleData\n doc.setFontSize(10)\n // write articles\n articles.forEach((article, i) => {\n const startY = 3 * i * 8 + 10\n const authors = article.authors.join()\n const conferences = article.conferences.join()\n doc.setFontStyle('bold')\n doc.text(`${i + 1}. ${article.title}`, 10, startY)\n doc.setFontStyle('normal')\n doc.text(`Authors: ${authors}`, 10, startY + 8)\n doc.text(`Conferences: ${conferences}`, 10, startY + 16)\n })\n doc.save('article-list.pdf')\n }",
"function makeHTML() {\n profileData = {\n name: profileName,\n color: themeColor,\n imageURL: userInfo.avatar_url,\n username: userInfo.login,\n location: userInfo.location,\n profileLink: userInfo.html_url,\n blog: userInfo.blog,\n bio: userInfo.bio,\n repos: userInfo.public_repos,\n followers: userInfo.followers,\n stars: numStars,\n following: userInfo.following\n }\n\n // deconstruct profileData object\n const { name, color, imageURL, username, location, profileLink, blog, bio, repos, followers, stars, following } = profileData;\n\n // HTML to write to PDF\n profileHTML = \n `<!DOCTYPE html>\n <html lang=\"en\">\n <head><meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Developer Profile</title>\n\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\" integrity=\"sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO\" crossorigin=\"anonymous\">\n \n <style>\n img { \n height: 200px;\n width: 200px;\n }\n </style>\n </head>\n\n <body>\n <div class=\"jumbotron jumbotron-fluid bg-white pt-5 pb-2\">\n <div class=\"container text-center\">\n <h1 class=\"display-4\">${name}</h1>\n <p class=\"lead\">GitHub username: ${username}</p>\n <img src=\"${imageURL}\" alt=\"GitHub profile image\" class=\"border border-${color} rounded\">\n </div>\n </div>\n\n <div class=\"container text-center\">\n <div class=\"row py-2\">\n <div class=\"col\">\n Location: \n <a href=https://www.google.com/maps/place/${location}>${location}</a>\n </div>\n </div>\n <div class=\"row py-2\">\n <div class=\"col\">\n GitHub profile:\n <a href=${profileLink}>${profileLink}</a>\n </div>\n <div class=\"col\">\n Blog:\n <a href=https://${blog}>https://${blog}</a>\n </div>\n </div>\n </div>\n\n <div class=\"container\">\n <div class=\"row\">\n <div class=\"col-12\">\n <div class=\"card my-4\">\n <div class=\"card-body\">\n <h4 class=\"card-title\">Bio:</h4>\n <p class=\"card-text\">${bio}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"container text-center\">\n <div class=\"row\">\n <div class=\"col-6\">\n <div class=\"card text-white bg-${color} mb-3\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Public repositories:</h5>\n <p class=\"card-text\">${repos}</p>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <div class=\"card text-white bg-${color} mb-3\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">GitHub stars:</h5>\n <p class=\"card-text\">${stars}</p>\n </div>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-6\">\n <div class=\"card text-white bg-${color} mb-3\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Followers:</h5>\n <p class=\"card-text\">${followers}</p>\n </div>\n </div>\n </div>\n <div class=\"col-6\">\n <div class=\"card text-white bg-${color} mb-3\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Following:</h5>\n <p class=\"card-text\">${following}</p>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <script src='index.js'></script>\n </body>\n \n </html>`;\n}",
"function generateResume() {\n html2pdf(areaCv, opt);\n}",
"function htmlToPDF(args, cb) {\n\tvar pdfFilePath = args.pdfFilePath;\n\tvar rawHTML = args.rawHTML;\n\tvar timeout = _.isNumber(args.timeout) ? args.timeout : DEFAULT_TIMEOUT;\n\tcb = _.once(cb); // ensure the callback is only called once\n\n\tjsreport.render({\n\t\ttemplate: {\n\t\t\tcontent: rawHTML,\n\t\t\tengine: 'handlebars',\n\t\t\trecipe: 'phantom-pdf',\n\t\t\t'phantom': {\n\t\t\t\tformat: 'A4',\n\t\t\t\tmargin: '0px',\n\t\t\t\tprintDelay: timeout\n\t\t\t}\n\t\t}\n\t})\n\t.then(out => {\n\t\tif (!pdfFilePath) {\n\t\t\t// if no file path to save the pdf was given, return the raw stream for the pdf\n\t\t\treturn cb(null, out.result);\n\t\t}\n\n\t\tvar stream = out.result.pipe(fs.createWriteStream(pdfFilePath));\n\n\t\tstream.on('finish', () => cb(null, pdfFilePath));\n\t\tstream.on('error', err => cb(err));\n\t})\n\t.catch(err => {\n\t\tcb(err);\n\t});\n}",
"function renderPage(text){\n //Convert data to table\n var data = textToMatrix(text);\n //Draw teh chart with this data\n drawChart(data);\n \n}",
"function genPdf(order,tranId){ \n\n\tvar tcType = order.getFieldValue('custbody_celigo_tc_type');\n\tvar recType = order.getRecordType();\n\n\tvar recTypeId = txTypeIdMap[recType];\n\n\tif (recTypeId == null) {\n\t\treturn;\n\t}\n\n\tvar searchFilters = []; // filter by tx type get the template file \n\tvar filterIdx = 0;\n\tsearchFilters[filterIdx++] = new nlobjSearchFilter('custrecord_splunk_pdf_tx_type', null, 'anyof', [recTypeId]);\n\t/* Celigo - csnelson 5/9/2013 added default value for tcType Start*/\n\tif(!tcType)\n\t\ttcType = 2;\n\t/* Celigo - csnelson 5/9/2013 added default value for tcType End*/\n\tsearchFilters[filterIdx++] = new nlobjSearchFilter('custrecord_splunk_tc_type', null, 'anyof', [tcType]);\n\n\tvar searchColumns = [];\n\tvar columnIdx = 0;\n\tsearchColumns[columnIdx++] = new nlobjSearchColumn('custrecord_splunk_pdf_tx_type');\n\tsearchColumns[columnIdx++] = new nlobjSearchColumn('custrecord_splunk_pdf_template');\n\tsearchColumns[columnIdx++] = new nlobjSearchColumn('custrecord_splunk_tc_type');\n\tvar searchResults = nlapiSearchRecord('customrecord_splunk_pdf_config', null, searchFilters, searchColumns);\n\n\tif (searchResults == null) {\n nlapiLogExecution('ERROR', 'onAfterSubmit_bfo', 'PDF Configuration record not found for selected T&C Type');\n\t\tthrow \"PDF Configuration record not found for selected T&C Type\";// error\n\t}\n\tif (searchResults.length > 1) {\n\t\tnlapiLogExecution('ERROR', \"Mutiple PDF configuration record not found for selected T&C Type, only one may be defined\");// error\n\t\tthrow \"Mutiple PDF configuration record not found for selected T&C Type, only one may be defined\";// error\n\t}\n\tvar bfoFileId = searchResults[0].getValue('custrecord_splunk_pdf_template');\n\t\n\tvar tcType = searchResults[0].getValue('custrecord_splunk_tc_type');\n\t\n\t\n var tcRec = nlapiLoadRecord('customrecord_splunk_tandc_type', tcType);\n\n\tvar repName = '';\n\tvar repEmail = '';\n\tvar repPhone = '';\n\n\tif (order.getFieldValue('salesrep') != null && order.getFieldValue('salesrep') != '') {\n\t\tvar repRec = nlapiLoadRecord('employee', order.getFieldValue('salesrep'));\n\t\trepName = repRec.getFieldValue('firstname');\n\t\tif (repName != null) {\n\t\t\trepName = '' + repName + ' ';\n\t\t}\n\t\telse {\n\t\t\trepName = '';\n\t\t}\n\t\tvar repLastName = repRec.getFieldValue('lastname');\n\t\tif (repLastName != null) {\n\t\t\trepName = '' + repName + repLastName;\n\t\t}\n\n\t\trepEmail = repRec.getFieldValue('email');\n\t\tif (repEmail == null) {\n\t\t\trepEmail = '';\n\t\t}\n\t\trepPhone = repRec.getFieldValue('phone');\n\t\tif (repPhone == null) {\n\t\t\trepPhone = '';\n\t\t}\n\t}\n\n\tvar lines = [];\n\t/* Splunk - pliu 09/01/2010 Bundle variables Start */\n\tvar bundle = {};\n\tvar amount = 0;\n\tvar licensedesc = '';\n\t/* Splunk - pliu 09/01/2010 Bundle variables End */\n\t\n\t/* Celigo - csnelson 04/04/2013 Bundle variable start */\n\tvar isCeligoBundle = false;\n\tvar pdfLineNum = 0;\n\tvar pdfItems = [];\n\t/* Celigo - csnelson 04/04/2013 Bundle variable end */\n\tvar lineIdx = 1;\n\t/* Splunk - adeshpande 10/15/2013 isNodeLicense? */\n\tvar containsNodesLicense = false;\n\tvar containsVolLicense = false;\n /*Splunk - jbalaji 09/16/2014 isMintLicense */\n var containsMintSKU = false;\n\tvar baseItem ='';\n\tvar basedesc = '';\n\tvar basememo = '';\n\tvar basequantity ='';\n\tvar totalrates =0.00;\n\tvar totalamounts =0.00;\n\tvar number =0;\n\tvar baseamount=0;\n\tvar baseItem = new Array();\n\tvar flag =false;\n\tvar baseItemId ='';\n\tvar basedesc ='';\n\tvar basememos ='';\n\t \n\tfor (var linecount =1 ;linecount <= order.getLineItemCount('item'); linecount++) // If Only Normal item on invoice record and push the baseitem if there.\n\t{\n\t\t\tvar normalItem = {};\n\t\t\tvar item = order.getLineItemValue('item', 'custcol_ava_item', linecount);\n\t\t\tvar itemid = order.getLineItemValue('item', 'item', linecount); \n\t\t\tvar baseproduct = order.getLineItemValue('item', 'custcol_spk_baseproduct', linecount); \n\t\t\tvar amount = excapeXML(order.getLineItemValue('item', 'amount', linecount));\n\t\t\tvar desc = excapeXML(order.getLineItemValue('item', 'description', linecount));\n\t\t\tvar memos = excapeXML(order.getLineItemValue('item', 'custcol_memo', linecount));\n\t\t\tvar quantity = order.getLineItemValue('item', 'quantity', linecount);\n\t\t\tvar rate = excapeXML(order.getLineItemValue('item', 'rate', linecount));\n\t\t\tvar amount = excapeXML(order.getLineItemValue('item', 'amount', linecount));\n\n\t\t\tif(amount =='0.00')\n\t\t\t{\n\t\t\t baseItem.push(itemid);\n\t\t\t}\n\t\t\telse if((!baseproduct || baseproduct=='null') && amount !='0.00' && !baseItem[0])\n\t\t\t{\n\t\t\t\tnormalItem.sku = item;\n\t\t\t\tnormalItem.desc = desc;\n\t\t\t\tnormalItem.memo =memos;\n\t\t\t\tnormalItem.qty = quantity;\n\t\t\t\tnormalItem.rate = rate;\n\t\t\t\tnormalItem.amount = amount;\n\t\t\t}\n\t\t\tlines[number] = normalItem;\n\t\t\tnumber++;\t\n \n\t}\n\t \n\tfor (var j=0;j<baseItem.length;j++) // based on based item we search the child item (bundle items)\n\t{\n\t var baseId =baseItem[j];\n\t\t if(baseId)\n\t\t{\n\t\t\tfor (lineIdx = 1; lineIdx <=order.getLineItemCount('item'); lineIdx++) \n\t\t\t{\n\t\t\t\t\tvar line = {};\n\t\t\t\t\tvar test={};\n\t\t\t\t\tvar quantity = order.getLineItemValue('item', 'quantity', lineIdx);\n\t\t\t\t\tvar item = order.getLineItemValue('item', 'custcol_ava_item', lineIdx);\n\t\t\t\t\tvar itemid = order.getLineItemValue('item', 'item', lineIdx); \n\t\t\t\t\tvar baseproduct = order.getLineItemValue('item', 'custcol_spk_baseproduct', lineIdx); \n\t\t\t\t\tvar desc = excapeXML(order.getLineItemValue('item', 'description', lineIdx));\n\t\t\t\t\tvar memos = excapeXML(order.getLineItemValue('item', 'custcol_memo', lineIdx))\n\t\t\t\t\tvar rate = excapeXML(order.getLineItemValue('item', 'rate', lineIdx));\n\t\t\t\t\tvar amount = excapeXML(order.getLineItemValue('item', 'amount', lineIdx));\n\t\t\t\t\tvar startdate = excapeXML(order.getLineItemValue('item', 'custcol_license_start_date', lineIdx));\n\t\t\t\t\tvar enddate = excapeXML(order.getLineItemValue('item', 'custcol_license_end_date', lineIdx));\n\t\t\t\t\tif(order.getLineItemValue('item', 'custcol_peak_daily_vol_gb', lineIdx))\n\t\t\t\t\tvar gb = CommaFormatted(excapeXML(order.getLineItemValue('item', 'custcol_peak_daily_vol_gb', lineIdx)));\t\n\t\t\t\t\tvar retdays = excapeXML(order.getLineItemValue('item', 'custcol_retention_days', lineIdx));\n\t\t\t\t\tif(baseId == baseproduct)\n\t\t\t\t\t{\n\t\t\t\t\t\t totalrates = parseFloat(totalrates) + parseFloat(rate);\n\t\t\t\t\t\t totalamounts = parseFloat(totalamounts) + parseFloat(amount);\n\t\t\t\t\t}\n\t\t\t\t\telse if(amount =='0.00')\n\t\t\t\t\t{\n\t\t\t\t\t\tbaseItemId = item;\n\t\t\t\t\t\tbasedesc= desc;\n\t\t\t\t\t\tbasememos =memos;\n\t\t\t\t\t}\n\t\t\t\t\telse ((!baseproduct || baseproduct=='null') && amount !='0.00')\n\t\t\t\t\t{\n\t\t\t\t\t\ttest.sku = item;\n\t\t\t\t\t\ttest.desc = desc;\n\t\t\t\t\t\ttest.memo =memos;\n\t\t\t\t\t\ttest.qty = quantity;\n\t\t\t\t\t\ttest.rate = rate;\n\t\t\t\t\t\ttest.amount = amount;\n\t\t\t\t\t\t\t \n\t\t\t\t\t \n\t\t\t\t\t}\n\t\t\t\t if(lineIdx == order.getLineItemCount('item') )\t // push the data into array \n\t\t\t\t {\n\t\t\t\t\tline.sku = baseItemId;\n\t\t\t\t\tline.desc = basedesc;\n\t\t\t\t\tline.memo = basememos;\n\t\t\t\t\tline.qty = 1;\n\t\t\t\t\tline.rate = totalamounts.toFixed(2);\n\t\t\t\t\tline.amount = totalamounts.toFixed(2);\n\t\t\t\t\t\n\t\t\t\t }\n\t\t\t}\n\t\t\t\n\t\t} \n\t\tlines[number] = line; \n\t\tnumber++;\n lines[number] = test;\n number++;\t\t\n\t\t \n\t}\n\t\n\n var obj = {};\n obj.lines = lines;\n obj.containsNodesLicense = containsNodesLicense;\n obj.containsVolLicense = containsVolLicense;\n obj.tranId = tranId//excapeXML(order.getFieldValue('tranid'));\n\tnlapiLogExecution('DEBUG', \"TranId:: \",tranId);\n obj.tranDate = excapeXML(order.getFieldValue('trandate'));\n obj.dueDate = excapeXML(order.getFieldValue('duedate'));\n obj.repName = excapeXML(repName);\n obj.repEmail = repEmail;\n obj.repPhone = repPhone;\n obj.type = order.getRecordType();\n if(obj.type == 'invoice') {\n obj.terms = excapeXML(order.getFieldText('terms')); // terms\n if(obj.terms == null) {\n obj.terms = '';\n }\n obj.poNumber = excapeXML(order.getFieldValue('otherrefnum'));\n if(obj.poNumber == null) {\n obj.poNumber = '';\n }\n\n }\n\n obj.message = excapeXML(order.getFieldValue('message'));\n\n var billAddress = order.getFieldValue('billaddress');\n var billAddressLines = [\"\"];\n if(billAddress != null) {\n billAddressLines = billAddress.split(\"\\n\");\n }\n for(var i = 0; i < 7; i++) {\n if(i < billAddressLines.length) {\n obj['billAddr'+(i+1)] = excapeXML(billAddressLines[i]);\n }\n }\n var shipAddress = order.getFieldValue('shipaddress');\n var shipAddressLines = [\"\"];\n if(shipAddress != null) {\n shipAddressLines = shipAddress.split(\"\\n\");\n }\n for(var i = 0; i < 7; i++) {\n if(i < shipAddressLines.length) {\n obj['shipAddr'+(i+1)] = excapeXML(shipAddressLines[i]);\n }\n }\n\n var orderTotal = parseFloat(order.getFieldValue('total'));\n if(!isNaN(orderTotal)) {\n\t\tobj.total = CommaFormatted(nlapiFormatCurrency(orderTotal));\n } else {\n obj.total = '';\n }\n\n var subTotal = parseFloat(order.getFieldValue('subtotal'));\n if(!isNaN(subTotal)) {\n obj.subTotal = CommaFormatted(nlapiFormatCurrency(subTotal));\n } else {\n obj.subTotal = '';\n }\n\n var taxTotal = parseFloat(order.getFieldValue('taxtotal'));\n if(!isNaN(subTotal)) {\n obj.taxTotal = CommaFormatted(nlapiFormatCurrency(taxTotal));\n } else {\n obj.taxTotal = '';\n }\n\n var discountTotal = parseFloat(order.getFieldValue('discounttotal'));\n if(!isNaN(discountTotal)) {\n obj.discountTotal = nlapiFormatCurrency(discountTotal);\n } else {\n obj.discountTotal = '';\n }\n\n var handlingCost = parseFloat(order.getFieldValue('althandlingcost'));\n if(!isNaN(discountTotal)) {\n obj.handlingCost = nlapiFormatCurrency(handlingCost);\n } else {\n obj.handlingCost = '';\n }\n var shippingCost = parseFloat(order.getFieldValue('altshippingcost'));\n if(!isNaN(discountTotal)) {\n obj.shippingCost = nlapiFormatCurrency(shippingCost);\n } else {\n obj.shippingCost = '';\n }\n\n if(obj.type == 'invoice') {\n obj.licAggreement = '';\n } else {\n obj.licAggreement = formatTandC(tcRec.getFieldValue('custrecord_celigo_tc_desc'));\n }\n \n \n if (tcType == '5') {\n \tobj.licAggreement = obj.licAggreement.split(\"<columnbreak />\");\n \tif (obj.licAggreement.length > 2) {\n \t\t\n \tobj.licAggreement[0] = obj.licAggreement[0] + \"</p>\";\n \tobj.licAggreement[1] = \"<p>\" + obj.licAggreement[1] + \"</p>\";\n \tobj.licAggreement[2] = \"<p>\" + obj.licAggreement[2];\n \t\n \tobj.columnFormat = true;\n \t}\n }\n \n var data = {};\n data.order = obj;\n\n var file = nlapiLoadFile(bfoFileId); // Load the Xml file \n var template = file.getValue();\n var xmlResult = template.process(data); // process the data using library file\n\n return nlapiXMLToPDF( xmlResult );\n}",
"function createPdfs() {\n\n var ui = SpreadsheetApp.getUi()\n\n if (TEMPLATE_ID === '') { \n ui.alert('TEMPLATE_ID needs to be defined in code.gs')\n return\n }\n\n // Set up the docs and the spreadsheet access\n\n var templateFile = DriveApp.getFileById(TEMPLATE_ID)\n var activeSheet = SpreadsheetApp.getActiveSheet()\n var allRows = activeSheet.getDataRange().getValues()\n var headerRow = allRows.shift()\n\n // Create a PDF for each row\n\n allRows.forEach(function(row) {\n \n createPdf(templateFile, headerRow, row)\n \n // Private Function\n // ----------------\n \n /**\n * Create a PDF\n *\n * @param {File} templateFile\n * @param {Array} headerRow\n * @param {Array} activeRow\n */\n \n function createPdf(templateFile, headerRow, activeRow) {\n \n var headerValue\n var activeCell\n var ID = null\n var recipient = null\n var copyFile\n var numberOfColumns = headerRow.length\n var copyFile = templateFile.makeCopy() \n var copyId = copyFile.getId()\n var copyDoc = DocumentApp.openById(copyId)\n var copyBody = copyDoc.getActiveSection()\n \n // Replace the keys with the spreadsheet values and look for a couple\n // of specific values\n \n for (var columnIndex = 0; columnIndex < numberOfColumns; columnIndex++) {\n \n headerValue = headerRow[columnIndex]\n activeCell = activeRow[columnIndex]\n activeCell = formatCell(activeCell);\n \n copyBody.replaceText('%' + headerValue + '%', activeCell)\n \n if (headerValue === FILE_NAME_COLUMN_NAME) {\n \n ID = activeCell\n \n } else if (headerValue === EMAIL_COLUMN_NAME) {\n \n recipient = activeCell\n }\n }\n \n // Create the PDF file\n \n copyDoc.saveAndClose()\n var newFile = DriveApp.createFile(copyFile.getAs('application/pdf')) \n copyFile.setTrashed(true)\n \n // Rename the new PDF file\n \n if (PDF_FILE_NAME !== '') {\n \n newFile.setName(PDF_FILE_NAME)\n \n } else if (ID !== null){\n \n newFile.setName(ID)\n }\n \n // Put the new PDF file into the results folder\n \n if (RESULTS_FOLDER_ID !== '') {\n \n DriveApp.getFolderById(RESULTS_FOLDER_ID).addFile(newFile)\n DriveApp.removeFile(newFile)\n }\n\n // Email the new PDF\n\n if (recipient !== null) {\n \n MailApp.sendEmail(\n recipient, \n EMAIL_SUBJECT, \n EMAIL_BODY,\n {attachments: [newFile]})\n }\n \n } // createPdfs.createPdf()\n\n })\n\n ui.alert('New PDF files created')\n\n return\n \n // Private Functions\n // -----------------\n \n /**\n * Format the cell's value\n *\n * @param {Object} value\n *\n * @return {Object} value\n */\n \n function formatCell(value) {\n \n var newValue = value;\n \n if (newValue instanceof Date) {\n \n newValue = Utilities.formatDate(\n value, \n Session.getScriptTimeZone(), \n DATE_FORMAT);\n \n } else if (typeof value === 'number') {\n \n newValue = Math.round(value * 100) / 100\n }\n \n return newValue;\n \n } // createPdf.formatCell()\n \n} // createPdfs()",
"function generationFicheDApdf(values, commentaire) {\n var copyFile, copyId, copyDoc, copyBody, copyHeader, copyFooter;\n var pdfFile,pdfBDC;\n var prxunitachat='';\n var prxunitvendu='';\n var marge='';\n var idfile;\n var dt = new Date();\n var dtGeneration='';\n // EVO-10\n var txTVA;\n // EVO-10\n \n try {\n // Generation d'une copie a partir du template du DA SQLi dans le root du Drive de l'utilisateur courant\n copyFile = DriveApp.getFileById(TEMPLATE_DA_ID).makeCopy();\n // Recuperation du contenu du template du BDC SQLi\n copyId = copyFile.getId();\n copyDoc = DocumentApp.openById(copyId);\n copyBody = copyDoc.getBody();\n copyHeader = copyDoc.getHeader();\n copyFooter = copyDoc.getFooter();\n //*********************************************************************************\n // BODY\n //*********************************************************************************\n // Remplace les tags du template du BDC SQLi avec les donnees de la demande d'achat\n if (values.prixtjmachat != '') {\n prxunitachat = Utilities.formatString(\"%.2f\", values.prixtjmachat);\n }\n if (values.prixtjmvendu != '') {\n prxunitvendu = Utilities.formatString(\"%.2f\", values.prixtjmvendu);\n }\n if (values.marge != '') {\n marge = Utilities.formatString(\"%.2f\", values.marge);\n }\n dtGeneration += (\"0\" + String(dt.getDate())).slice(-2);\n dtGeneration += \"/\"\n dtGeneration += (\"0\"+ String(dt.getMonth()+1)).slice(-2);\n dtGeneration += \"/\"\n dtGeneration += (String(dt.getFullYear())).slice(-2);\n dtGeneration += \" à \"\n dtGeneration += (\"0\"+String(dt.getHours())).slice(-2)\n dtGeneration += \"h\"\n dtGeneration += (\"0\"+ String(dt.getMinutes()+1)).slice(-2)\n dtGeneration += \"m\"\n dtGeneration += (\"0\" + String(dt.getSeconds())).slice(-2);\n dtGeneration += \"s\"\n \n copyBody.replaceText('%%TAG_NUMDA%%',values.id);\n copyBody.replaceText('%%TAG_STATUT%%',values.statut);\n copyBody.replaceText('%%TAG_DTGENERATION%%',dtGeneration);\n \n \n copyBody.replaceText('%%TAG_DEMANDEUR%%',values.emetteur);\n copyBody.replaceText('%%TAG_TYPEDEMANDE%%',values.typedemande);\n copyBody.replaceText('%%TAG_NATURE%%',values.nature);\n\n copyBody.replaceText('%%TAG_NOMFOURNISSEUR%%',values.fournisseur);\n copyBody.replaceText('%%TAG_INTERLOCUTEURFOURNISSEUR%%',values.contactfournisseur);\n \n copyBody.replaceText('%%TAG_BU%%',values.buimputation);\n copyBody.replaceText('%%TAG_CODEPROJET%%',values.codeprojet);\n copyBody.replaceText('%%TAG_NOMPROJET%%',values.nomprojet);\n \n copyBody.replaceText('%%TAG_QTE%%',values.quantite);\n copyBody.replaceText('%%TAG_TJMPXACHAT%%', prxunitachat + \" €\");\n copyBody.replaceText('%%TAG_TJMPXVENDU%%',prxunitvendu+\" €\");\n copyBody.replaceText('%%TAG_MARGE%%',marge+\" %\");\n // EVO-10\n txTVA = values.tva;\n if (txTVA == '') {\n var dataInfoGenerationBDC = GetInfoGenerationBDC().split(\",\");\n txTVA = dataInfoGenerationBDC[1];\n } else {\n txTVA = String(txTVA).replace(\",\",\".\");\n }\n if (IsNumeric(txTVA)) {\n copyBody.replaceText('%%TAG_TVA%%',txTVA+\" %\");\n } else {\n copyBody.replaceText('%%TAG_TVA%%',LIB_BDC_PASDETVA);\n }\n // EVO-10\n // EVO-23\n copyBody.replaceText('%%TAG_CONDREG%%',values.conditionreglement);\n // EVO-23\n\n copyBody.replaceText('%%TAG_IDTCOLLAB%%', values.collaborateur);\n \n copyBody.replaceText('%%TAG_DTDEBLIV%%', values.datedebutlivraison);\n copyBody.replaceText('%%TAG_DTFINLIV%%', values.datefinlivraison);\n copyBody.replaceText('%%TAG_ADRESSELIVRAISON%%',values.adresselivraison);\n \n //copyBody.replaceText('%%TAG_COMMENTAIRE%%',commentaire);\n \n //*********************************************************************************\n // HEADER\n //*********************************************************************************\n copyHeader.replaceText('%%TAG_NUMDA%%',values.id);\n \n //*********************************************************************************\n // FOOTER\n //*********************************************************************************\n copyFooter.replaceText('%%TAG_DTGENERATION%%',dtGeneration);\n \n // Creation du PDF, nommage du fichier DA PDF avec l'id de la demande d'achat\n // et copie du PDF dans le repertoire du Google Drive Process Achat\n copyDoc.saveAndClose();\n pdfFile = DriveApp.createFile(copyFile.getAs(\"application/pdf\"));\n pdfBDC = pdfFile.makeCopy(\"Fiche\"+values.id,DriveApp.getFoldersByName(values.id).next());\n // Purge des fichiers temporaires\n copyFile.setTrashed(true);\n pdfFile.setTrashed(true);\n idfile = getIdFromUrl(pdfBDC.getUrl());\n return getDownloadLink(idfile);\n } catch(e){\n e = (typeof e === 'string') ? new Error(e) : e;\n Log_Severe(\"generationFicheDApdf\", Utilities.formatString(\"%s %s (line %s, file '%s'). Stack: '%s' . While processing %s.\",e.name||'',e.message||'',e.lineNumber||'',e.fileName||'', e.stack||'', e.processMessage||''));\n throw e;\n }\n}",
"function export_pdf()\n\t{\n\t\tdata = get_dat_sort();\n\t\tvar sortfield = $(\"#rpt_nav_sort\").val();\n\t\tdata[\"sortfield\"] = sortfield;\n\t\t\t\n\t\t$.ajax({\n\t\t\turl : urlexportpdf,\n\t\t\tdata : data,\n\t\t\ttype : 'GET',\n\t\t\tsuccess :function(result, textStatus, jqXHR)\n\t\t\t{\n\t\t\t\tif (result.success)\n\t\t\t\t{\n\t\t\t\t\t$(\"#rpt_dialog\").dialog(\"open\");\n\t\t\t\t\t$(\"#rpt_path_download\").val(result.success);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\talert(result.error);\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t});\n\t}",
"function Write()\n{\n /* prirazeni weboveho prvku dropdown list ktery obsahuje stroje do promenne DropDownMachines */\n var DropDownMachines = document.getElementById(\"3\");\n /* prirazeni hodnoty VALUE zvoleneho stroje do promenne SelectedMachine */\n var SelectedMachine = DropDownMachines.options[DropDownMachines.selectedIndex].value;\n\n /* pokud SelectedMachine (hodnota VALUE zvoleneho stroje) neni \"0\" (\"Vyberte stroj\") */\n if (SelectedMachine != \"0\")\n {\n /* prirazeni hodnoty TEXT zvoleneho stroje do promenne Text */\n var Text = DropDownMachines.options[DropDownMachines.selectedIndex].text;\n\n /* prepsani html kodu uvnitr weboveho prvku ID=\"3\" na ODKAZ, ktery obsahuje Text (hodnota TEXT zvoleneho stroje) tak, aby odkazoval na konkretni pdf */\n document.getElementById(\"pdf\").innerHTML = \"<a id='odkaz' target='_blank' href='dokumentace/pdf/\" + Text + \".pdf'><i class=\\\"fa fa-file-pdf\\\"></i>\" + Text + \"</a>\";\n }\n}",
"function loadAndCachePdf(url, canvas, context){\n PDFJS.getDocument(url).then(function getPdfHelloWorld(_pdf) {\n debugger;\n pdf = _pdf;\n //Render all the pages on a single canvas\n for (var pNum = 1; pNum <= pdf.numPages; pNum++) {\n pdf.getPage(pNum).then(function getPage(page) {\n var viewport = page.getViewport(DigiMag.scale);\n canvas.width = viewport.width;\n canvas.height = viewport.height;\n page.render({ canvasContext: context, viewport: viewport });\n pages[pageIndex] = context.getImageData(0, 0, canvas.width, canvas.height);\n pageIndex++;\n \n });\n }//end for\n\n console.log(\"page 0 image data: \", pages[0]);\n // show first page on canvas\n context.putImageData(pages[0], 0, 0);\n });//getDocument\n }",
"function refreshFrame(index) {\r\n var container = $(\"#page-\" + index);\r\n var templateName = $(\"#page-template-\" + index).val();\r\n var color = $(\"input[name='page-color-\" + index + \"']:checked\").val();\r\n var seed = $(\"#seed\").val();\r\n var fileName = getFileName(index);\r\n\r\n if (pdfMode) { \r\n // Output to blob.\r\n var stream = blobStream();\r\n \r\n // Eventually output the blob into given container.\r\n stream.on('finish', function() {\r\n // Get & remember blob object.\r\n var blob = stream.toBlob('application/pdf');\r\n $(container).data(\"blob\", blob);\r\n \r\n // Clear previous blob URL and remember new one.\r\n var url = $(container).data(\"blobUrl\");\r\n if (url) {\r\n window.URL.revokeObjectURL(url);\r\n }\r\n url = window.URL.createObjectURL(blob);\r\n $(container).data(\"blobUrl\", url);\r\n\r\n // Render blob URL into container.\r\n renderPDF(url, container);\r\n \r\n // Set link attributes.\r\n var index = $(container).data(\"index\");\r\n $(\"#page-download-\" + index)\r\n .attr('href', url)\r\n .attr('target', '_blank')\r\n .attr('download', fileName + '.pdf');\r\n });\r\n\r\n // Generate the PDF.\r\n generatePDF(stream, templates[templateName], scrapedTexts, scrapedImages, {color: color});\r\n \r\n } else {\r\n\r\n // Generate SVG download link URL.\r\n var images = [];\r\n for (var i in scrapedImages) {\r\n images.push(scrapedImages[i].url);\r\n }\r\n var parameters = {\r\n seed: seed,\r\n fields: scrapedTexts,\r\n images: images,\r\n options: {color: color}\r\n };\r\n var url = 'templates/' + templateName + '.pdf'\r\n + \"?parameters=\" + encodeURIComponent(JSON.stringify(parameters));\r\n\r\n // Generate the SVG.\r\n var svg = generateSVG(templates[templateName], scrapedTexts, scrapedImages, {color: color});\r\n\r\n // Render SVG into container.\r\n renderSVG(svg, container);\r\n \r\n // Set link attributes.\r\n var index = $(container).data(\"index\");\r\n $(\"#page-download-\" + index)\r\n .attr('href', url)\r\n .attr('target', '_blank')\r\n .attr('download', fileName + '.pdf');\r\n }\r\n\r\n}",
"function onPDFRender(err, newMediaId) {\n if (err) {\n Y.log('Problem rendering PDF: ' + JSON.stringify(err), 'debug', NAME);\n return;\n }\n\n if( Y.config.debug ) {\n Y.log('Created PDF: ' + JSON.stringify(newMediaId), 'debug', NAME);\n }\n\n processNextActivity();\n }",
"function printDocument() {\n let pdf = new jsPDF();\n // Set page size to a standard 8.5\" x 11\" sheet\n pdf.canvas.height = 72 * 11;\n pdf.canvas.width = 72 * 8.5;\n pdf.fromHTML(document.getElementById(\"print-top-block\"), 20, 5);\n if (!document.getElementById(\"recipe-image\").hidden) {\n pdf.addImage(document.getElementById(\"recipe-image\"), 20, 40);\n pdf.fromHTML(document.getElementById(\"print-bottom-block\"), 20, 140);\n } else {\n pdf.fromHTML(document.getElementById(\"print-bottom-block\"), 20, 40);\n }\n // Sleep for 2 seconds, which is necessary to utilize jsPDF with React\n setTimeout(function () {\n // Download the document\n pdf.save(\"recipe.pdf\");\n }, 2000);\n}",
"async function createPdf(htmlContent, options = { path: 'Output.pdf', format: 'A4' }) {\n\t// launchs a puppeteer browser instance and opens a new page\n\tconst browser = await puppeteer.launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'], headless: true });\n\tconst context = await browser.createIncognitoBrowserContext();\n\tconst page = await context.newPage();\n\n\t// wait until everything is loaded before rendering the PDF\n\tawait page.goto(`data: text/html, ${htmlContent}`, { waitUntil: 'networkidle0' });\n\n\t// sets the html of the page to htmlContent argument\n\tawait page.setContent(htmlContent);\n\n\t// Prints the html page to pdf document and saves it to given outputPath\n\tawait page.emulateMediaType('screen');\n\tconst file = await page.pdf({ ...options, printBackground: true });\n\n\t// Closing the puppeteer browser instance\n\tawait browser.close();\n\n\treturn file;\n}",
"function loadPdf(url){\n console.log(\"Load pdf document: \", url);\n // Asynchronously downloads PDF. \n PDFJS.getDocument(url).then(function (pdfDoc_) {\n pdfDoc = pdfDoc_;\n console.log(\"PDF \", url, \" is ready to be rendered\"); \n console.log(\"Render page: \", DigiMag.currentBucketPageNum); \n renderPage(DigiMag.currentBucketPageNum); \n }); \n }",
"function pdfDownload(){ \n\tvar url = \"https://\"+CURRENT_IP+\"/cgi-bin/NFast_3-0/CGI/RESERVATIONMANAGER/FastConsoleCgi.py?action=configdlpdf&query={'QUERY':[{'username':'\"+globalUserName+\"'}]}\";\n \n\t\twindow.location.href = url + query ;\n}",
"function writeHomepage(length, data) {\n\n var gotoURL = \"/makememe/\"\n\n // var html = '<!DOCTYPE html><html><head><link rel=\"stylesheet\" href=\"homepage.css\"><script>src=\"index.js\"</script><meta charset=\"utf-8\"/></head><body><table class = \"grid\" id = \"table\"><h1 class = \"title\">Meme Maker</h1><tr>'; //head of html file\n var pugtxt = \"doctype html\\nhtml\\n\\thead\\n\\t\\tstyle\\n\\t\\t\\tinclude homepage.css\\n\\t\\tscript.\\n\\t\\t\\tsrc=\\\"index.js\\\"\\n\\tbody\\n\\t\\tdiv.header\\n\\t\\t\\th1.title Meme Maker\\n\\t\\th2.text To get started, select an image from the gallery below!\\n\\t\\ttable#table.grid\\n\\t\\t\\ttbody\\n\\t\\t\\t\\ttr\";\n for(var i = 0; i < length; i++) {\n if(i%4 === 0 && i!=0){ // Makes a row of 4, replace 4 with anything you want \n //html += '</tr><tr>'; \n pugtxt += \"\\n\\t\\t\\t\\ttr\"\n }\n //html += '<td class = \"meme_box\"><img src=\"' + data[i].url + '\"></td>';\n // pugtxt += \"\\n\\t\\t\\t\\t\\ttd.meme_box a(href =\\\"\" + gotoURL + data[i].template_id + \"\\\")\";\n \n pugtxt += \"\\n\\t\\t\\t\\t\\ttd.meme_box\"\n //pugtxt += \"\\n\\t\\t\\t\\t\\t\\ta(href ='\" + gotoURL + data[i].template_id + \"')\";\n pugtxt += \"\\n\\t\\t\\t\\t\\t\\timg(src=\\\"\" + data[i].url + \"\\\")\";\n }\n //html += '</tr>';\n //html += '</table>'; \n //html += '</body></html>';\n //console.log(html); // just for testing if you want to \n //write pugtxt to the index.pug file, it will overwrite the previous html on each run\n fs.writeFile(path.join(__dirname + 'views/index.pug'), pugtxt, err => {\n if(err) {\n console.error(err);\n return; \n }\n })\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsersynonym_name. | visitSynonym_name(ctx) {
return this.visitChildren(ctx);
} | [
"visitCreate_synonym(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSchema_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitQuery_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitProcedure_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitRecord_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSchema_object_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitPackage_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitGrantee_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitLink_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDatabase_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitGrant_object_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSavepoint_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitLabel_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDotted_as_name(ctx) {\r\n console.log(\"visitDotted_as_name\");\r\n if (ctx.NAME() !== null) {\r\n return {\r\n type: \"Imported\",\r\n name: this.visit(ctx.dotted_name()),\r\n alias: ctx.NAME().getText(),\r\n };\r\n } else {\r\n return {\r\n type: \"Imported\",\r\n name: this.visit(ctx.dotted_name()),\r\n alias: null,\r\n };\r\n }\r\n }",
"function mangleNode(node, o)\n{\n\t// Don't mangle nodes more than once\n\tif (o.alreadyMangledNodes.has(node))\n\t\treturn;\n\t\n\tnode.name = mangleName(node.name, o);\n\to.alreadyMangledNodes.add(node);\n}",
"function _processNameScope() {\n processedGraph.root = {id: '', children: [], stacked: false};\n const {nodeMap, root} = processedGraph;\n\n for (const id of nameScopeIds) {\n const nameScope = _createNameScope(id);\n nodeMap[id] = nameScope;\n const parent = nameScope.parent ? nodeMap[nameScope.parent] : root;\n parent.children.push(id);\n }\n}",
"visitOracle_namespace(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDirectory_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitColumn_name(ctx) {\n\t return this.visitChildren(ctx);\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
eveIntercept Sent by either Alice or Bob, the message being intercepted by Eve. Eve will add the message to her list of intercepted messages, waiting to intercept. | function eveIntercept(message, to) {
messageList.names.push(to);
messageList.messages.push(message);
addToTable(to, message);
} | [
"function sendAlice() {\n let message = document.getElementById(\"aliceMessage\").value;\n document.getElementById(\"bobMessage\").value = message;\n document.getElementById(\"aliceMessage\").value = \"\";\n eveIntercept(message, \"Bob\");\n }",
"function sendBob() {\n let message = document.getElementById(\"bobMessage\").value;\n document.getElementById(\"aliceMessage\").value = message;\n document.getElementById(\"bobMessage\").value = \"\";\n eveIntercept(message, \"Alice\");\n }",
"function normalMessageHandler(message) {\n\n\t\tif(establisher.isMyCircuit(readOps.getCircuit(message))) {\n\t\t\t// This is a response on one of establisher's circuits\n\t\t\t// Send to establisher\n\t\t\testablisher.handleResponse(message);\n\t\t} else {\n\t\t\t// This isn't one of the circuits we're actively managing,\n\t\t\t// send to relayer\n\t\t\trelayer.handleMessage(message);\n\t\t}\n\n\t}",
"function eveCrack() {\n\n let keyBob = document.getElementById(\"eveBPriv\").innerHTML.split(\" \");\n let keyAlice = document.getElementById(\"eveAPriv\").innerHTML.split(\" \");\n\n let form = /^[0-9 ]+$/;\n for (let i = 0; i < messageList.names.length; i++) {\n let name = messageList.names[i];\n let message = messageList.messages[i];\n\n // if the input isn't a number, don't bother decrypting\n if (!form.exec(message)) {\n messageList.messages[i] = message;\n continue;\n }\n\n if (name === \"Bob\") {\n if (bobKey) {\n getMessage(message, keyBob[1], keyBob[0], \"Bob\", i);\n } else {\n messageList.messages[i] = message;\n }\n } else if (name === \"Alice\") {\n if (aliceKey) {\n getMessage(message, keyAlice[1], keyAlice[0], \"Alice\", i);\n } else {\n messageList.messages[i] = message;\n }\n } else {\n messageList.messages[i] = message;\n }\n }\n }",
"function handleMsg (eventHandlers, msg) {\n var e;\n for (e in msg) {\n if (msg.hasOwnProperty(e)) { \n\thandle(eventHandlers, e, msg[e]);\n }\n }\n }",
"function poopMike(message) {\n\n\tconst addChance = 2;\n\tconst randomNum = (Math.random() * 100);\n\n\t// Determine whether to poop Mike or not\n\tif (randomNum >= addChance) {\n\t\t// If result is greater than likelihood, end.\n\t\tconsole.info('Mike has narrowly escaped pooping');\n\t\treturn;\n\t}\n\t// poop on Mike\n\tmessage.react('💩');\n\tconsole.info(\"Mike's been pooped\");\n\t\n}",
"function interceptor(buffer) {\n\n // Do nothing if the response isn't html.\n if(buffer.headers['content-type'] !== 'text/html') return\n\n // Parse the page.\n $ = cheerio.load(buffer.getData())\n var root = $('body').length ? $('body') : $.root\n\n root.append('<script src=\"/socket.io/socket.io.js\"></script>\\n')\n root.append('<script>\\n' + listenAndReloadScript + '\\n</script>\\n')\n\n // overwrite data in the request\n buffer.setData($.html())\n}",
"function PrisonBecomeBadGirl() {\n\tLogAdd(\"Joined\", \"BadGirl\");\n}",
"async listen() {\n const contract = await this.getContract();\n contract.on('Claimed', async (vendor, phone, amount) => {\n try {\n const otp = Math.floor(1000 + Math.random() * 9000);\n const data = await this.setHashToChain(contract, vendor, phone.toString(), otp.toString());\n\n const message = `A vendor is requesting ${amount} token from your account. If you agree, please provide this OTP to vendor: ${otp}`;\n // eslint-disable-next-line global-require\n const sms = require(`./plugins/sms/${config.get('plugins.sms.service')}`);\n\n // call SMS function from plugins to send SMS to beneficiary\n sms(phone.toString(), message);\n } catch (e) {\n console.log(e);\n }\n });\n console.log('--- Listening to Blockchain Events ----');\n }",
"static retransmitMessage(message){\n MetaManager.getEntity(message.entity).executeCommand({ command: message.cmd, value: message.arg}, true);\n }",
"handleExplosion() {\n this.handleHitAnimation();\n this.handleExplodeSelf();\n }",
"static function sendClaimChanges(messageContext : MessageContext, claim : Claim)\n {\n var useNewService : boolean = useNewService(claim.LossType);\n for (exposure in claim.Exposures)\n {\n if (!exposure.New && exposure.State != \"draft\" && anyFieldChanged(exposure))\n {\n if (exposure.LegalExpenseExt && useNewService){\n for(assignment in claim.Matters*.MatterAssignmentsExt){\n if (assignment.AssignmentExposuresExt*.Exposure.contains(exposure)){\n sendNewMatter( messageContext, assignment );\n }\n }\n } else if (exposure.ex_InSuit) {\n send(messageContext, exposure);\n }\n }\n }\n }",
"function OnReceiveDamage(){}",
"onMessage(message) {\n if (isXVIZMessage(message.data)) {\n // Since this is the server we assume the message\n // we get is simple and instantiate the message immediately\n // We also need to do this to get the \"type()\"\n const xvizData = new XVIZData(message.data);\n this.callMiddleware(xvizData.type, xvizData);\n return true;\n }\n\n return false;\n }",
"visitAlter_identified_by(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"attack( target )\n {\n if ( target.living )\n {\n target.takeDamage( this.damage );\n this.scene.events.emit( \"Message\", this.type + \" attacks \" + target.type + \" for \" + this.damage + \" damage\" );\n }\n }",
"sendSplitMsgs(msg) {\n let msgs = createSplitMsgs(msg);\n let nextMsg = (msgs, index) => {\n if(msgs.length > index) {\n console.log('send split msg '+index);\n this.send(msgs[index]);\n lisener = (msg, senderInfo) => {\n console.log('\\t inside lisener splitMsg')\n if(isReciveSpliteMsg(msg)) {\n console.log('\\t >> recived Recived Split Msg '+index);\n nextMsg(msgs, index+1); \n }\n };\n }\n }\n nextMsg(msgs,0);\n }",
"function pipeMessage(client, inputName, msg) {\n client.complete(msg, printResultFor(\"Receiving message\"))\n\n if (inputName === \"input1\") {\n const message = msg.getBytes().toString(\"utf8\")\n if (message) {\n const outputMsg = new Message(message)\n client.sendOutputEvent(\n \"output1\",\n outputMsg,\n printResultFor(`Piping message ${JSON.stringify(outputMsg)}`),\n )\n }\n }\n}",
"static log(message) {\n MessageService.add(`HeroService: ${message}`);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This code adds a buttons to collapse or expand all elements and to sort items. | function addButtons() {
const buttonFrame = document.createElement("DIV");
buttonFrame.classList.add("buttonFrame");
detailButton = document.createElement("P");
detailButton.textContent = "Show Details";
detailButton.classList.add("detailButton");
sortButton = document.createElement("P");
sortButton.textContent = "Sort Items";
sortButton.classList.add("sortButton");
componentElement.insertBefore(buttonFrame, listElement);
buttonFrame.appendChild(detailButton);
buttonFrame.appendChild(sortButton);
detailButton = componentElement.querySelector(".detailButton");
detailButton.addEventListener("click", expandAllItems);
sortButton = componentElement.querySelector(".sortButton");
sortButton.addEventListener("click", sortItems);
} | [
"addToolBarItems() {\n // Ignore if the buttons are already there\n if (document.getElementsByClassName('rvt-tools').length !== 0) {\n return;\n }\n\n let btnGroup = `<div class=\"BtnGroup rvt-tools\">\n <a id=\"${Constants.SHOW_ALL_BUTTON_ID}\" class=\"${Constants.TOOL_BUTTON_CLASS}\" href=\"#\" aria-label=\"Show All\">Show All Files</a>\n <a id=\"${Constants.COLLAPSE_ALL_BUTTON_ID}\" class=\"${Constants.TOOL_BUTTON_CLASS}\" href=\"#\" aria-label=\"Collapse All\">Collapse All Files</a>\n </div>`;\n\n document.querySelector(Constants.DIFF_BAR_SELECTOR).insertAdjacentHTML('afterBegin', btnGroup);\n\n document.getElementById(Constants.COLLAPSE_ALL_BUTTON_ID).addEventListener('click', this.hideAllBodies);\n document.getElementById(Constants.SHOW_ALL_BUTTON_ID).addEventListener('click', this.showAllBodies);\n }",
"switchSortButtons(selected) {\n for(let button of $(\"#btn-sort button\")) {\n if(button === selected[0]) {\n let icon = button.children[0];\n let font = icon.getAttribute(\"class\");\n let sort = button.getAttribute(\"value\").split('-');\n this.sortKey = sort[0];\n this.sortOrder = sort[1] === \"ascending\";\n // click the same button\n if(button.getAttribute(\"class\") === \"btn btn-info\") {\n // reverse icon\n icon.setAttribute(\"class\", font.indexOf(\"-alt\") > 0 ? font.replace(\"-alt\", \"\") : font + \"-alt\");\n // reverse sort order\n this.sortOrder = !this.sortOrder;\n if(this.sortOrder)\n button.setAttribute(\"value\", button.getAttribute(\"value\").replace(\"descending\", \"ascending\"));\n else\n button.setAttribute(\"value\", button.getAttribute(\"value\").replace(\"ascending\", \"descending\"));\n } else {\n button.setAttribute(\"class\", \"btn btn-info\");\n }\n } else {\n button.setAttribute(\"class\", \"btn btn-secondary\");\n }\n }\n }",
"#addDivControls() {\n var colExp = '<button onclick=\"collapseDiv('+this.id+')\" class=\"col_exp_btn\">Collapse</button>';\n var closeBtn = '<button onclick=\"closeDiv('+this.id+')\" class=\"closebtn\">x</button>';\n var divControls = '<span style=\"float:right;\">'+colExp+closeBtn+'</span>';\n\n this.#addToDiv(divControls);\n }",
"function _toggleExpanded(e) {\n $(\"#categories\").toggleClass(\"expanded\")\n\n if ($(\"#categories\").hasClass(\"expanded\")) {\n $(e.target).text(\"Collapse All\")\n $(\".checkbox\").removeClass(\"hide\")\n } else {\n $(e.target).text(\"Expand All\")\n $(\".checkbox\").not(\".depth0\").not((i, el) => {\n var checkbox_input = $(el).children(\"input\")\n var sibling_checkboxes = $(el).parent().parent().children(\"ul li input\")\n return checkbox_input.prop(\"checked\") || sibling_checkboxes.prop(\"checked\")\n }).addClass(\"hide\")\n }\n }",
"function enableSortingBtn(){\r\n document.querySelector(\".bubsort\").disabled = false;\r\n document.querySelector(\".insertionsort\").disabled = false;\r\n document.querySelector(\".mergesort\").disabled = false;\r\n document.querySelector(\".quicksort\").disabled = false;\r\n document.querySelector(\".selectionsort\").disabled = false;\r\n}",
"function tree_collapse() {\n let $allPanels = $('.nested').hide();\n let $elements = $('.treeview-animated-element');\n\n $('.closed').click(function () {\n \n $this = $(this);\n $target = $this.siblings('.nested');\n $pointer = $this.children('.fa-angle-right');\n\n $this.toggleClass('open')\n $pointer.toggleClass('down');\n\n !$target.hasClass('active') ? $target.addClass('active').slideDown() : \n $target.removeClass('active').slideUp();\n \n return false;\n });\n\n $elements.click(function () {\n \n $this = $(this);\n \n if ($this.hasClass('opened')) {\n ($this.removeClass('opened'));\n } else {\n ($elements.removeClass('opened'), $this.addClass('opened'));\n }\n\n })\n }",
"function actionCollapseAll() {\n $('tr[name=action_entry_referer_header]').hide();\n $('tr[name=action_entry_referer]').hide();\n $('tr[name=action_entry_edit_header]').hide();\n $('tr[name=action_entry_edit]').hide();\n}",
"addNavigationToChildrenButtons() {\n const buttons = this.el.querySelectorAll('button')\n for (let entry of buttons) {\n $(entry).click(function () {\n // console.log(\"CLICKED \" + entry.textContent)\n $('html, body').animate({\n scrollTop: $('#' + entry.textContent.toLowerCase()).offset().top\n }, 1000);\n });\n }\n }",
"function displayAggregateTagWorkspaceButtons() {\n if($('ul#tagButtonList li').length > 0)\n\t$('div#aggregateTagButtons').show();\n else\n\t$('div#aggregateTagButtons').hide();\n}",
"function hsCollapseAllVisible() {\n $('#content .hsExpanded:visible').each(function() {\n hsCollapse($(this).children(':header'));\n });\n}",
"function pageCollapseAll() {\n for (var i = 0; i < vm.objPage.versions.length; i += 1) {\n vm.objPage.versions[i].open = false;\n }\n }",
"listClicked(evt) {\n const target = evt.target;\n\n //Make sure it's not the question, want to ignore this\n if ( target.getAttribute('class') != 'answer') {\n const parentQuestion = target.closest('.qa');\n\n // first, find the target question\n let clickedQuestion;\n\n // First, collapse anything that is expanded \n for( let question of this.questions) {\n if (question.equals(parentQuestion)) {\n clickedQuestion = question;\n } \n }\n\n if ( clickedQuestion ) {\n //If it's already expanded, close it\n if ( clickedQuestion.isExpanded() ) {\n clickedQuestion.toggleExpanded();\n }\n else {\n //Close all the others, and open this one\n for(let question of this.questions) {\n if (question.isExpanded()) {\n question.toggleExpanded();\n break;\n }\n }\n \n clickedQuestion.toggleExpanded();\n }\n } \n\n }\n \n }",
"function addEventListenersToButtons() {\n // Filter knapper\n document\n .querySelector(\"[data-filter=cat]\")\n .addEventListener(\"click\", filterByCats);\n document\n .querySelector(\"[data-filter=dog]\")\n .addEventListener(\"click\", filterByDogs);\n document\n .querySelector(\"[data-filter=all]\")\n .addEventListener(\"click\", filterByAll);\n\n // Sortering knapper\n document\n .querySelector(\"[data-sort=name]\")\n .addEventListener(\"click\", sortByName);\n\n document\n .querySelector(\"[data-sort=desc]\")\n .addEventListener(\"click\", sortByDesc);\n\n document\n .querySelector(\"[data-sort=type]\")\n .addEventListener(\"click\", sortByType);\n\n document\n .querySelector(\"[data-sort=age]\")\n .addEventListener(\"click\", sortByAge);\n}",
"function switchExpand(){\n // Variables. Get expand button and image\n let desc = document.getElementsByClassName(\"multi-collapse\");\n let btn = document.getElementById(\"expandButton\");\n let expand = document.getElementsByClassName(\"expand\");\n\n // console.log(btn.textContent);\n // Changing text context of the expand button to Collapse or Expand\n // and the image icon depending of the state of the button.\n if(btn.textContent == \"Expand All Services\"){\n btn.textContent = \"Collapse All Services\";\n changePic(expand, \"images/expand.png\", desc, \"collapse in multi-collapse\");\n } else{\n btn.textContent = \"Expand All Services\";\n changePic(expand, \"images/unexpanded.png\");\n }\n\n}",
"function i2uiExpandContainer(id)\r\n{\r\n var nest = 1;\r\n var obj;\r\n\r\n obj = document.getElementById(id+\"_toggler\");\r\n if (obj != null)\r\n {\r\n var i2action = obj.getAttribute(\"onclick\")+\" \";\r\n if (i2action != null) \r\n {\r\n var at = i2action.indexOf(\"this,\");\r\n if (at != -1)\r\n nest = i2action.substring(at+5,at+6);\r\n }\r\n\r\n if (obj.tagName == 'IMG' &&\r\n obj.src.indexOf(\"container_expand.gif\") != -1)\r\n {\r\n // toggle the container\r\n i2uiToggleContent(obj, nest);\r\n\r\n // now change the expand/collapse icon\r\n obj.src = i2uiImageDirectory+\"/container_collapse.gif\";\r\n }\r\n else\r\n {\r\n if (obj.tagName == 'A')\r\n {\r\n var len2 = obj.childNodes.length;\r\n for (var j=0; j<len2; j++)\r\n {\r\n if (obj.childNodes[j].tagName == 'IMG' &&\r\n obj.childNodes[j].src.indexOf(\"container_expand.gif\") != -1)\r\n {\r\n // toggle the container\r\n i2uiToggleContent(obj, nest);\r\n\r\n // now change the expand/collapse icon\r\n obj.childNodes[j].src = i2uiImageDirectory+\"/container_collapse.gif\";\r\n }\r\n }\r\n }\r\n }\r\n return;\r\n }\r\n obj = document.getElementById(id);\r\n //i2uitrace(1,'i2uiCollapseContainer obj='+obj);\r\n if (obj != null)\r\n {\r\n // IE allows onlick for IMGs while Netscape 6 does not.\r\n // therefore look for IMG directly in cell or as a child of\r\n // an A tag\r\n var len = obj.rows[0].cells[0].childNodes.length;\r\n\r\n // handle complex header in container\r\n if (len == 1 && obj.tagName == \"TABLE\")\r\n {\r\n obj = obj.rows[0].cells[0].childNodes[0];\r\n nest = 2;\r\n len = obj.rows[0].cells[0].childNodes.length;\r\n }\r\n\r\n for (var i=0; i<len; i++)\r\n {\r\n if (obj.rows[0].cells[0].childNodes[i].tagName == 'IMG' &&\r\n obj.rows[0].cells[0].childNodes[i].src.indexOf(\"container_expand.gif\") != -1)\r\n {\r\n // toggle the container\r\n i2uiToggleContent(obj.rows[0].cells[0].childNodes[i], nest);\r\n\r\n // now change the expand/collapse icon\r\n obj.rows[0].cells[0].childNodes[i].src = i2uiImageDirectory+\"/container_collapse.gif\";\r\n break;\r\n }\r\n else\r\n {\r\n if (obj.rows[0].cells[0].childNodes[i].tagName == 'A')\r\n {\r\n var len2 = obj.rows[0].cells[0].childNodes[i].childNodes.length;\r\n for (var j=0; j<len2; j++)\r\n {\r\n if (obj.rows[0].cells[0].childNodes[i].childNodes[j].tagName == 'IMG' &&\r\n obj.rows[0].cells[0].childNodes[i].childNodes[j].src.indexOf(\"container_expand.gif\") != -1)\r\n {\r\n // toggle the container\r\n i2uiToggleContent(obj.rows[0].cells[0].childNodes[i], nest);\r\n\r\n // now change the expand/collapse icon\r\n obj.rows[0].cells[0].childNodes[i].childNodes[j].src = i2uiImageDirectory+\"/container_collapse.gif\";\r\n break;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n}",
"function itemTree() {\n return col('col-12 col-xl-3', \n div('itemTree', itemTreeTitle() + '<hr>' + itemTreeChange() + '<hr>' + itemTreeTree() + '<hr>' + itemTreeAdd())\n )\n}",
"function addDropDowns(){ \n //Fuction to collapse the previous element\n function collapsePrevious(){\n //Get the previous element of the element clicked on\n let previous = this.previousElementSibling\n\n //Check if the previous elements maxHeight is the same as its' contents\n if (previous.style.maxHeight != previous.scrollHeight + 'px' || previous.style.maxHeight == ''){\n //Set maxHeight of previous element to height of contents\n previous.style.maxHeight = previous.scrollHeight + 'px';\n\n //rotate the dropdown arrow\n this.querySelector('.drop').classList.add('rotate');\n }\n else { \n //Set height of previous element to 0\n previous.style.maxHeight = '0px';\n\n //remove rotaion from dropdown arrow\n this.querySelector('.drop').classList.remove('rotate');\n }\n }\n \n //Get a list of all dropdowns\n let drops = document.querySelectorAll('.collapseButton .drop'); \n \n //Assign functionality\n drops.forEach(x => x.parentElement.addEventListener('click', collapsePrevious))\n}",
"displayAdmin() {\n let add_form = document.getElementById(\"add_form\");\n add_form.classList.toggle(\"hidden\");\n \n let delete_btns = document.querySelectorAll(\".delete_btn\");\n delete_btns.forEach(function(item){\n item.classList.toggle(\"hidden\");\n })\n\n let edit_btns = document.querySelectorAll(\".edit_btn\");\n edit_btns.forEach(function(item){\n item.classList.toggle(\"hidden\");\n }) \n //disable sort function when inside admin, to avoid bugg.\n this.sort_btn.disabled = !this.sort_btn.disabled; \n }",
"function pageExpandAll() {\n for (var i = 0; i < vm.objPage.versions.length; i += 1) {\n vm.objPage.versions[i].open = true;\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by Java9ParserunannClassType_lfno_unannClassOrInterfaceType. | enterUnannClassType_lfno_unannClassOrInterfaceType(ctx) {
} | [
"enterUnannClassType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"enterUnannInterfaceType_lfno_unannClassOrInterfaceType(ctx) {\n\t}",
"enterUnannInterfaceType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"enterClassType_lfno_classOrInterfaceType(ctx) {\n\t}",
"exitUnannClassType_lfno_unannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannClassType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannInterfaceType_lfno_unannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannInterfaceType_lf_unannClassOrInterfaceType(ctx) {\n\t}",
"enterClassType_lf_classOrInterfaceType(ctx) {\n\t}",
"exitClassType_lfno_classOrInterfaceType(ctx) {\n\t}",
"exitInterfaceType_lfno_classOrInterfaceType(ctx) {\n\t}",
"exitClassType_lf_classOrInterfaceType(ctx) {\n\t}",
"exitInterfaceType_lf_classOrInterfaceType(ctx) {\n\t}",
"exitUnannClassOrInterfaceType(ctx) {\n\t}",
"exitUnannInterfaceType(ctx) {\n\t}",
"enterNormalClassDeclaration(ctx) {\n\t}",
"exitNormalClassDeclaration(ctx) {\n\t}",
"exitNormalInterfaceDeclaration(ctx) {\n\t}",
"enterNormalInterfaceDeclaration(ctx) {\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the point on the segment (vx,vy)(wx,wy) closest to (px,py). | function projectPointOntoSegment(px, py, vx, vy, wx, wy) {
var l2 = dist2(vx, vy, wx, wy);
if (l2 === 0) return new Point(vx, vy);
var t = ((px - vx) * (wx - vx) + (py - vy) * (wy - vy)) / l2;
if (t < 0) return new Point(vx, vy);
if (t > 1) return new Point(wx, wy);
return new Point( vx + t * (wx - vx),
vy + t * (wy - vy));
} | [
"function nearestPointOnLine(px,py,x1,y1,x2,y2){\n\n\tvar lx = x2 - x1;\n var ly = y2 - y1;\n\t\n if ( lx == 0 && ly == 0 ) {//If the vector is of length 0,\n\t\t//the two endpoints have the same position, so the nearest point is at that position\n return {\n\t\t\tx: x1,\n\t\t\ty: y1\n\t\t};\n } else {\n\t\t//Find the factor for how far along the line, from <x1,y1>, the nearest point is\n var g = ((px - x1) * lx + (py - y1) * ly) / (lx * lx + ly * ly);\n\t\tif( g < 0 ) g = 0;\n\t\telse if( g > 1 ) g = 1;\n\t\t//And calculate the nearest point\n\t\treturn new Point(x1 + g * lx, y1 + g * ly);\n }\n}",
"static getFurthestOffScreenPoint(currPoint){\n\t\tconst midPoint = [window.innerWidth >> 1, window.innerHeight >> 1];\n\t\tif((currPoint[0] < midPoint[0]) && (currPoint[1] < midPoint[1])){\n\t\t\treturn [window.innerWidth + 200, window.innerHeight + 200];\n\t\t} \n\t\telse if((currPoint[0] < midPoint[0]) && (currPoint[1] > midPoint[1])){\n\t\t\treturn [window.innerWidth + 200, - 200];\n\t\t} \n\t\telse if((currPoint[0] > midPoint[0]) && (currPoint[1] > midPoint[1])){\n\t\t\treturn [-200, -200];\n\t\t} \n\t\treturn \t[-200, window.innerHeight + 200]\n\t}",
"function getNearestGridPoint(x1, y1) {\n var current_x = parseInt(x1, 10);\n var current_y = parseInt(y1, 10);\n var i = 0;\n var minDist = Math.sqrt(Math.pow(points[i].x - current_x, 2) + Math.pow(points[i].y-current_y, 2));\n var ans = points[0];\n for(var i = 0 ; i < points.length; i ++) {\n var dist = Math.sqrt(Math.pow(points[i].x - current_x, 2) + Math.pow(points[i].y-current_y, 2));\n if(dist < minDist) {\n minDist = dist;\n ans = points[i];\n }\n }\n return ans;\n}",
"point(param) {\n return this._edgeSegment.point(param);\n }",
"function rayVsUnitSphereClosestPoint(p, r)\n {\n var p_len2 = jsgl.dotProduct(p, p);\n if (p_len2 < 1)\n {\n // Ray is inside sphere, no exterior hit.\n return null;\n }\n\n var along_ray = -jsgl.dotProduct(p, r);\n if (along_ray < 0)\n {\n // Behind ray start-point.\n return null;\n }\n\n var perp = jsgl.vectorAdd(p, jsgl.vectorScale(r, along_ray));\n var perp_len2 = jsgl.dotProduct(perp, perp);\n if (perp_len2 >= 0.999999)\n {\n // Return the closest point.\n return jsgl.vectorNormalize(perp);\n }\n\n // Compute intersection.\n var e = Math.sqrt(1 - jsgl.dotProduct(perp, perp));\n var hit = jsgl.vectorAdd(p, jsgl.vectorScale(r, (along_ray - e)));\n return jsgl.vectorNormalize(hit);\n }",
"function findXY(event) {\n x = event.clientX;\n y = event.clientY;\n}",
"function calculateCoordinates(o)\n{\n if (o.x >= virtual.viewx && o.x < virtual.viewx + width &&\n o.y >= virtual.viewy && o.y < virtual.viewy + height)\n {\n return { x : o.x - virtual.viewx, y : o.y - virtual.viewy }\n }\n \n return null;\n}",
"function closestSafeZone(personLong, personLat){\r\n var targetPoint = turf.point([personLat, personLong])\r\n var points;\r\n var poly = turf.polygon(zones[0])\r\n var line = turf.polygonToLine(poly)\r\n return turf.nearestPointOnLine(line, targetPoint)\r\n}",
"closestObject( type, x )\n {\n let index = 0, dist = 10 ** 6, objX = undefined;\n\n // find the closest building to guard\n for( index = 0;index < this.objects.length;index++ )\n {\n let o = this.objects[ index ];\n\n const d = Math.abs( o.p.x - x );\n\n if( ( o.oType == type ) && ( d < dist ) )\n {\n dist = d;\n objX = o.p.x;\n }\n }\n\n return objX;\n }",
"getDistance(x, y) {\n return Math.sqrt(Math.pow(this.x - x, 2) + Math.pow(this.y - y, 2));\n }",
"function getClosestPosition(P, A, B, target) {\n subtract$2(P, A, tmpVectorAP);\n subtract$2(B, A, tmpVectorAB);\n const lengthSquaredAB = lengthSquared(tmpVectorAB);\n const dotProductAPAB = dot(tmpVectorAP, tmpVectorAB);\n const distanceRatioAX = dotProductAPAB / lengthSquaredAB;\n if (distanceRatioAX <= 0) return A;\n if (distanceRatioAX >= 1) return B;\n const vectorAX = multiply$1(tmpVectorAB, distanceRatioAX);\n add$3(A, vectorAX, target);\n return target;\n }",
"function getTestPoint(ring) {\n // Use the point halfway along first segment rather than an endpoint\n // (because ring might still be enclosed if a segment endpoint touches an indexed ring.)\n // The returned point should work for point-in-polygon testing if two rings do not\n // share any common segments (which should be true for topological datasets)\n // TODO: consider alternative of finding an internal point of @ring (slower but\n // potentially more reliable).\n var arcId = ring[0],\n p0 = arcs.getVertex(arcId, 0),\n p1 = arcs.getVertex(arcId, 1);\n return [(p0.x + p1.x) / 2, (p0.y + p1.y) / 2];\n }",
"getPointerXY(e) {\n const boundingBox = this.getBoundingBox();\n let clientX = 0;\n let clientY = 0;\n if (e.clientX && e.clientY) {\n clientX = e.clientX;\n clientY = e.clientY;\n } else if (e.touches && e.touches.length > 0 && e.touches[0].clientX &&\n e.touches[0].clientY) {\n clientX = e.touches[0].clientX;\n clientY = e.touches[0].clientY;\n }\n\n //SVG scaling: usually not an issue.\n const sizeRatioX = 1;\n const sizeRatioY = 1;\n\n const inputX = (clientX - boundingBox.left) * sizeRatioX;\n const inputY = (clientY - boundingBox.top) * sizeRatioY;\n\n return { x: inputX, y: inputY };\n }",
"function findCrossIntersection(ax, ay, bx, by, cx, cy, dx, dy, eps) {\n if (!segmentHit(ax, ay, bx, by, cx, cy, dx, dy)) return null;\n var den = determinant2D(bx - ax, by - ay, dx - cx, dy - cy);\n var m = orient2D(cx, cy, dx, dy, ax, ay) / den;\n var p = [ax + m * (bx - ax), ay + m * (by - ay)];\n if (Math.abs(den) < 1e-18) {\n // assume that collinear and near-collinear segment intersections have been\n // accounted for already.\n // TODO: is this a valid assumption?\n return null;\n }\n\n // Snap p to a vertex if very close to one\n // This avoids tiny segments caused by T-intersection overshoots and prevents\n // pathfinder errors related to f-p rounding.\n // (NOTE: this may no longer be needed, since T-intersections are now detected\n // first)\n if (eps > 0) {\n snapIntersectionPoint(p, ax, ay, bx, by, cx, cy, dx, dy, eps);\n }\n // Clamp point to x range and y range of both segments\n // (This may occur due to fp rounding, if one segment is vertical or horizontal)\n clampIntersectionPoint(p, ax, ay, bx, by, cx, cy, dx, dy);\n return p;\n}",
"function makeVisualPoint(point, w, h, scale, cameraPos) {\n return {\n x: point.x + ((w * scale) / 2) - cameraPos.x,\n y: point.y + ((h * scale) / 2) - cameraPos.y\n };\n}",
"dotCoordinate(point) {\n return (this.normal.x * point.x +\n this.normal.y * point.y +\n this.normal.z * point.z +\n this.d);\n }",
"function virtualTrackballLocation(event)\n{\n\tvar width = canvas.width, height = canvas.height;\n\tvar x = (event.clientX - canvas.offsetLeft);\n\tvar y = (event.clientY - canvas.offsetTop);\n\t\n\tx = (2 * x - width) / width;\n\ty = -(2 * y - height) / height;\n\t\n\tvar v = new Vector3D(x, y, 0);\n\tvar d = Math.min(1, v.squaredMagnitude());\n\tv.z = Math.sqrt(1.0001 - d);\n\t\n\treturn v.direction();\n}",
"neighboringPoint (sourceX, sourceY, towards) {\n if (towards === North) return [sourceX, sourceY + this.ySpacing()]\n if (towards === South) return [sourceX, sourceY - this.ySpacing()]\n if (towards === East) return [sourceX + this.xSpacing(), sourceY]\n if (towards === West) return [sourceX - this.xSpacing(), sourceY]\n if (towards === NorthEast) return [sourceX + this.xSpacing(), sourceY + this.ySpacing()]\n if (towards === SouthEast) return [sourceX + this.xSpacing(), sourceY - this.ySpacing()]\n if (towards === NorthWest) return [sourceX - this.xSpacing(), sourceY + this.ySpacing()]\n if (towards === SouthWest) return [sourceX - this.xSpacing(), sourceY - this.ySpacing()]\n }",
"function getPhysicsCoord(mouseEvent){\n var rect = canvas.getBoundingClientRect();\n var x = mouseEvent.clientX - rect.left;\n var y = mouseEvent.clientY - rect.top;\n\n x = (x - w / 2) / scaleX;\n y = (y - h / 2) / scaleY;\n\n return [x, y];\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enables and disables recommender engine | function recommenderEnablerListener() {
var checkboxRecommendations = document.getElementById("checkboxRecommendations");
// Get the setting if it has already been set
chrome.storage.local.get(function(storage) {
var settings = storage["settings"];
if (!settings) {
settings = initialSettings;
}
chrome.storage.local.set({ "settings": settings });
var recommendationsEnabled = settings["recommendationsEnabled"];
var sensitivity = document.getElementById("recommenderSensitivity");
checkboxRecommendations.checked = recommendationsEnabled;
if (recommendationsEnabled) {
sensitivity.disabled = false;
} else {
sensitivity.disabled = true;
}
});
var recommendationsEnabled = document.getElementById("recommendationsEnabled");
recommendationsEnabled.addEventListener("click", function() {
toggleRecommendations();
});
} | [
"function toggleRecommendations() {\n chrome.storage.local.get(function(storage) {\n var cachedSettings = storage[\"cachedSettings\"];\n if (!cachedSettings) {\n var settings = storage[\"settings\"];\n if (!settings) {\n settings = initialSettings;\n chrome.storage.local.set({ \"settings\": settings });\n }\n cachedSettings = settings;\n chrome.storage.local.set({ \"cachedSettings\": cachedSettings });\n }\n var recommendationsEnabled = cachedSettings[\"recommendationsEnabled\"];\n var sensitivity = document.getElementById(\"recommenderSensitivity\");\n\n if (!recommendationsEnabled) {\n cachedSettings[\"recommendationsEnabled\"] = 1;\n sensitivity.disabled = false;\n chrome.storage.local.set({ \"cachedSettings\": cachedSettings });\n } else {\n cachedSettings[\"recommendationsEnabled\"] = 0;\n sensitivity.disabled = true;\n chrome.storage.local.set({ \"cachedSettings\": cachedSettings });\n }\n });\n}",
"_toggleRecognizer(name, enabled) {\n const {\n manager\n } = this;\n\n if (!manager) {\n return;\n }\n\n const recognizer = manager.get(name); // @ts-ignore\n\n if (recognizer && recognizer.options.enable !== enabled) {\n recognizer.set({\n enable: enabled\n });\n const fallbackRecognizers = _constants__WEBPACK_IMPORTED_MODULE_6__[\"RECOGNIZER_FALLBACK_MAP\"][name];\n\n if (fallbackRecognizers && !this.options.recognizers) {\n // Set default require failures\n // http://hammerjs.github.io/require-failure/\n fallbackRecognizers.forEach(otherName => {\n const otherRecognizer = manager.get(otherName);\n\n if (enabled) {\n // Wait for this recognizer to fail\n otherRecognizer.requireFailure(name);\n /**\n * This seems to be a bug in hammerjs:\n * requireFailure() adds both ways\n * dropRequireFailure() only drops one way\n * https://github.com/hammerjs/hammer.js/blob/master/src/recognizerjs/\n recognizer-constructor.js#L136\n */\n\n recognizer.dropRequireFailure(otherName);\n } else {\n // Do not wait for this recognizer to fail\n otherRecognizer.dropRequireFailure(name);\n }\n });\n }\n }\n\n this.wheelInput.enableEventType(name, enabled);\n this.moveInput.enableEventType(name, enabled);\n this.keyInput.enableEventType(name, enabled);\n this.contextmenuInput.enableEventType(name, enabled);\n }",
"function setEnabled(){\n\t'use strict';\n\tif($('input:radio[name=cats]:checked').val()===\"opt1\"){\n\t\t$(\"#category\").removeAttr(\"disabled\");\n\t\t$(\"#oldlabel\").css('color', '#000000');\n\n\t\t$(\"#category1\").attr(\"disabled\",\"disabled\");\n\t\t$(\"#newlabel\").css('color', '#808080');\n\n\t}else{\n\t\t$(\"#category1\").removeAttr(\"disabled\");\n\t\t$(\"#newlabel\").css('color', '#000000');\n\n\t\t\n\t\t$(\"#category\").attr(\"disabled\",\"disabled\");\n\t\t$(\"#oldlabel\").css('color', '#808080');\n\n\t}\n}",
"function enableDrinkOptions() {\r\n // Enable the 'take a sip' button.\r\n let drink = document.getElementById(\"drink\");\r\n drink.disabled = false;\r\n drink.onclick = drinkCoffee;\r\n\r\n // Enable 'cream','sugar', 'submit' buttons.\r\n let cream = document.getElementById(\"addcream\");\r\n let sugar = document.getElementById(\"addsugar\");\r\n let post = document.getElementById(\"submitcombination\");\r\n\r\n cream.disabled = false;\r\n cream.onclick = addCream;\r\n\r\n sugar.disabled = false;\r\n sugar.onclick = addSugar;\r\n\r\n post.disabled = false;\r\n post.onclick = postCoffee;\r\n }",
"enable() {\n const eqs = this.equations;\n for (let i = 0; i < eqs.length; i++) {\n eqs[i].enabled = true;\n }\n }",
"function OnEnable () { \n gameObject.transform.root.gameObject.GetComponent(FPSInputController).enabled = false;\n gameObject.transform.root.gameObject.GetComponent(MouseLook).enabled = false;\n gameObject.transform.root.gameObject.GetComponent(CharacterMotor).enabled = false;\n transform.root.FindChild(playerCameraPrefab).gameObject.SetActive(false);\n \n}",
"enable() {\n this._enabled = true;\n this._model = new SelectionModel(this._bufferService);\n }",
"enable_disableMutation(){\n\t\tvar i = Math.floor(Math.random() * this.genes.length)\n\n\t\t//we can only use an available gene\n\t\tif (this.genes[i] != null) {\n\t\t\tthis.genes[i].enabled = !this.genes[i].enabled\n\t\t} else {\n\t\t\tthis.enable_disableMutation()\n\t\t}\n\t}",
"function refreshPasscodeQueryEditability() {\n $(\".passcode-query-edit\").prop(\"disabled\", passcodeQueryIndex >= 0);\n }",
"async enable (app, statsdiv = null) {\n this.app = app\n this.config = this.app.config\n\n this.detector = await getPitchDetector(this.comparePitch)\n\n if (statsdiv) {\n this.stats = new AudioStatsDisplay(statsdiv)\n this.stats.setup() // reveal stats page\n }\n\n // Get the audio context or resume if it already exists\n if (this.context === null) {\n let input = await getAudioInput()\n this.context = input.audioContext\n this.mic = input.mic\n this.media = input.media\n\n this.scriptNode = setupAudioProcess(this.context, this.mic, this.detector)\n\n } else if (this.context.state === 'suspended') {\n await this.context.resume()\n }\n\n this.isActive = true\n console.log('Audio Detection Enabled')\n\n }",
"function enableVQH() {\n enableCheckBox({\n enableCheckBox: 'edit_hasvoicemail',\n enableList: ['edit_vmsecret']\n }, doc);\n enableCheckBox({\n enableCheckBox: 'edit_enable_qualify',\n enableList: ['edit_qualifyfreq']\n }, doc);\n disableCheckBox({\n enableCheckBox: 'edit_enablehotdesk',\n enableList: ['edit_authid']\n }, doc);\n enableCheckBox({\n enableCheckBox: 'edit_en_ringboth',\n enableList: ['edit_external_number', 'edit_ringboth_timetype']\n }, doc);\n enableCheckBox({\n enableCheckBox: 'edit_en_hotline',\n enableList: ['edit_hotline_number', 'edit_hotline_type']\n }, doc);\n enableCheckBox({\n enableCheckBox: 'edit_dnd',\n enableList: ['edit_dnd_timetype']\n }, doc);\n}",
"function enableAudioControls() {\n\t//console.log('enableAudioControls');\n\t$(shell.audio.play).removeClass('dim');\n\t$(shell.audio.play).removeAttr('disabled');\n\t//$(shell.audio.pause).removeClass('dim');\n\t$(shell.audio.rewind).removeClass('dim');\n\t$(shell.audio.play).css('cursor','pointer');\n\t//$(shell.audio.pause).css('cursor','pointer');\n\t$(shell.audio.rewind).css('cursor','pointer');\n\t$(shell.audio.play).attr('title','Click to pause the audio');\n\t//$(shell.audio.pause).css('title','Pause');\n\t$(shell.audio.rewind).attr('title','Click to replay the audio');\n\tif (shell.audio.volume != '') {\n\t\t$(shell.audio.volume).removeClass('dim');\n\t\t$(shell.audio.volume).css('cursor','pointer');\n\t\t$(shell.audio.volume).removeAttr('disabled');\n\t\t$(shell.audio.volume).attr('title','Click to mute the audio');\n\t}\n\taudioIsDim = false;\n}",
"function setButtons() {\n hitButton.disabled = false;\n standButton.disabled = false;\n continueButton.disabled = true;\n }",
"function enableButtons()\n{\n\tg_Options[g_TabCategorySelected].options.forEach((option, i) => {\n\n\t\tlet enabled =\n\t\t\t!option.dependencies ||\n\t\t\toption.dependencies.every(config => Engine.ConfigDB_GetValue(\"user\", config) == \"true\");\n\n\t\tEngine.GetGUIObjectByName(\"option_label[\" + i + \"]\").enabled = enabled;\n\t\tEngine.GetGUIObjectByName(\"option_control_\" + option.type + \"[\" + i + \"]\").enabled = enabled;\n\t});\n\n\tlet hasChanges = Engine.ConfigDB_HasChanges(\"user\");\n\tEngine.GetGUIObjectByName(\"revertChanges\").enabled = hasChanges;\n\tEngine.GetGUIObjectByName(\"saveChanges\").enabled = hasChanges;\n}",
"function recommenderSensitivityValueListener() {\n var recommenderSensitivity = document.getElementById(\"recommenderSensitivity\");\n recommenderSensitivity.addEventListener(\"input\", function() {\n var newVal = recommenderSensitivity.value;\n chrome.storage.local.get(function(storage) {\n var cachedSettings = storage[\"cachedSettings\"];\n var oldSettings = storage[\"settings\"];\n if (!cachedSettings) {\n if (!oldSettings) {\n // Use default settings\n oldSettings = initialSettings;\n }\n cachedSettings = oldSettings;\n }\n\n cachedSettings[\"recommenderSensitivity\"] = newVal;\n var recommenderSensitivityVal = document.getElementById(\"recommenderSensitivityVal\");\n recommenderSensitivityVal.innerHTML = newVal;\n chrome.storage.local.set({ \"cachedSettings\": cachedSettings });\n });\n });\n}",
"function enableControls() {\n $(\"button.play\").attr('disabled', false);\n $(\"select\").attr('disabled', false);\n $(\"button.stop\").attr('disabled', true);\n }",
"deactivateSpellchecker () {\n this.enabled = false\n this.isProviderAvailable = false\n ipcRenderer.invoke('mt::spellchecker-set-enabled', false)\n }",
"function enablePlay() {\n\t$(shell.audio.play).removeClass('dim');\n\t$(shell.audio.play).removeAttr('disabled');\n\t$(shell.audio.play).css('cursor','pointer');\n\t$(shell.audio.play).attr('title','Click to pause the audio');\n\taudioIsDim = false;\n}",
"function Enable_Word_Count_Button()\n{\n var enabled = (stop_words_text.length>0 && book_text.length>0);\n document.getElementById('perform_word_count').disabled = !enabled;\n\t$(\"#results\").fadeOut( \"slow\", function() {});\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate a random hexadecimal value pair as a string: | function rdm_hex_pair(){
var pair = Math.floor(Math.random() * 256).toString(16);
if (pair.length < 2){
pair = "0" + pair
}
return pair;
} | [
"function randomHexNumberGenerator() {\n return '#' + Math.random().toString(16).substr(2, 6).toUpperCase();\n}",
"function generateHex() {\n return chroma.random();\n\n}",
"function generateGuid() {\n var buf = new Uint16Array(8);\n buf = crypto.randomBytes(8);\n var S4 = function(num) {\n var ret = num.toString(16);\n while(ret.length < 4){\n ret = \"0\"+ret;\n }\n return ret;\n };\n\n return (\n S4(buf[0])+S4(buf[1])+\"-\"+S4(buf[2])+\"-\"+S4(buf[3])+\"-\"+\n S4(buf[4])+\"-\"+S4(buf[5])+S4(buf[6])+S4(buf[7])\n );\n}",
"function makeTuid() {\n return crypto.randomBytes(16).toString('hex')\n}",
"generatePrivateKey() {\n // Generates 64 hexadecimal values then concatenates all 64 values\n let r = [];\n for (let i = 0; i < 64; i++) {\n r.push(this.random.integer(0, 15).toString(16));\n }\n return r.join('');\n }",
"function createToken(){\n\t\t\treturn crypto.randomBytes(16).toString(\"hex\");\n\t\t}",
"generateCode() {\n return (Math.random().toString(16).substr(2, 4) + \"-\" \n + Math.random().toString(16).substr(2, 4) + \"-\" \n + Math.random().toString(16).substr(2, 4)).toUpperCase();\n }",
"function random128() {\n var result = \"\";\n for (var i = 0; i < 8; i++)\n result += String.fromCharCode(Math.random() * 0x10000);\n return result;\n}",
"function uuid() {\n // get sixteen unsigned 8 bit random values\n const u = crypto.getRandomValues(new Uint8Array(16))\n\n // set the version bit to v4\n u[6] = (u[6] & 0x0f) | 0x40\n\n // set the variant bit to \"don't care\" (yes, the RFC\n // calls it that)\n u[8] = (u[8] & 0xbf) | 0x80\n\n // hex encode them and add the dashes\n let uid = ''\n uid += u[0].toString(16)\n uid += u[1].toString(16)\n uid += u[2].toString(16)\n uid += u[3].toString(16)\n uid += '-'\n\n uid += u[4].toString(16)\n uid += u[5].toString(16)\n uid += '-'\n\n uid += u[6].toString(16)\n uid += u[7].toString(16)\n uid += '-'\n\n uid += u[8].toString(16)\n uid += u[9].toString(16)\n uid += '-'\n\n uid += u[10].toString(16)\n uid += u[11].toString(16)\n uid += u[12].toString(16)\n uid += u[13].toString(16)\n uid += u[14].toString(16)\n uid += u[15].toString(16)\n\n return uid\n}",
"function getHexColor() {\n if (Math.round(Math.random())) {\n return \"ff\";\n } else {\n return \"00\";\n }\n}",
"function makeInviteCode() {\n const random = crypto.randomBytes(5).toString('hex');\n return base32.encode(random);\n}",
"static generateConfirmationCode() {\n\t\treturn Math.floor(0xFFFFFF * Math.random()).toString(16).padStart(6, '0'); \n\t}",
"function getRandomShortString() {\n return Math.random().toString(36).slice(-11);\n}",
"function generateHexTime() {\r\n let time = new Date().toTimeString().substring(0, 8).replace(/:/g, '');\r\n let hexTime = `#${!isInverted ? time : time.split('').reverse().join('')}`;\r\n return hexTime;\r\n}",
"GenerateInstanceID() {\n var text = \"\";\n\n for (var i = 0; i < 16; i++)\n text += this.ValidIDChars.charAt(Math.floor(Math.random() * this.ValidIDChars.length));\n\n return text;\n }",
"function generateSignature() {\n let sig = \"\";\n\n for (let i = 0; i < 16; i++) {\n let c = Math.floor(Math.random() * 3);\n sig += whitespace_chars[c];\n }\n return nms + sig + nms;\n}",
"function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 1000; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }\n }",
"function generateUID() {\n return String(~~(Math.random()*Math.pow(10,8)))\n}",
"function generateRandomString() {\n const arrayOfAlphaNum = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n let outputString = \"\";\n\n for (var x = 0; x < 6; x++) {\n let index = Math.round(Math.random() * 61);\n outputString += arrayOfAlphaNum[index];\n }\n\n return outputString;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes a list of drums and returns an independant copy of the list | function copyDrumsList(drumList) {
var drumListCopy = [];
var drumCopy;
for (var i = 0; i < drumList.length; i++) {
drumCopy = new Drum(drumList[i].name, drumList[i].sample);
drumCopy.playTriggers = drumList[i].playTriggers.slice();
drumListCopy.push(drumCopy);
}
return drumListCopy;
} | [
"setItems(items){\n const currentFiller = this.numberLeftWithOddEnding()\n /**\n * Will return the indexes (from the old array) of items that were removed\n * @param oldArray\n * @param newArray\n */\n const removedIndexes = (oldArray, newArray) => {\n let rawArray = oldArray.map((oldItem, index) => {\n if(!newArray.some(newItem => newItem === oldItem)){\n return index;\n }\n })\n\n return rawArray.filter( index => (index || index === 0) );\n }\n\n\n /**\n * Will return the indexes (from the new array) of items that were added\n * @param oldArray\n * @param newArray\n */\n const addedIndexes = (oldArray, newArray) => {\n let rawArray = newArray.map((newItem, index) => {\n if(!oldArray.some(oldItem => oldItem === newItem)){\n return index;\n }\n })\n\n return rawArray.filter( index => (index || index === 0) );\n }\n\n\n this.previousItems = this.items.slice();\n this.items = items.slice();\n\n let indexesToRemove = removedIndexes(this.previousItems, this.items);\n let indexesToAdd = addedIndexes(this.previousItems, this.items);\n\n // console.log('add:', indexesToAdd, 'remove:', indexesToRemove)\n\n if(indexesToRemove.length > 0) {\n indexesToRemove.forEach(index => {\n this.removeLastItem(index);\n })\n }\n\n if(indexesToAdd.length > 0) {\n indexesToAdd.forEach(index => {\n this.addItemAtIndex(index);\n })\n }\n\n // When adding we have to update the index every time\n const realElements = Array.from(document.querySelectorAll(`.budgie-item-${this.budgieId}:not(.budgie-item-${this.budgieId}--duplicate)`));\n realElements.forEach((element, index) => {\n let className = Array.from(element.classList).filter(_className => _className.match(new RegExp(`budgie-${this.budgieId}-\\\\d`)));\n if(className !== `budgie-${this.budgieId}-${index}`) {\n element.classList.remove(className);\n element.classList.add(`budgie-${this.budgieId}-${index}`);\n }\n })\n\n // remove duplicate elements\n const dupedElements = Array.from(document.querySelectorAll(`.budgie-item-${this.budgieId}.budgie-item-${this.budgieId}--duplicate`));\n dupedElements.forEach(element => {\n element.parentNode.removeChild(element);\n })\n\n // remove filler elements\n const fillerElements = Array.from(document.querySelectorAll(`.budgie-item-${this.budgieId}--filler`));\n fillerElements.forEach(element => {\n element.parentNode.removeChild(element);\n })\n\n // Insert duplicated elements anew, if this is an infinite scroll\n if(this.options.infiniteScroll) {\n this.prependStartingItems();\n this.appendEndingItems();\n }\n\n // Add filler items to the end if needed\n if(this.numberLeftWithOddEnding() > 0) {\n realElements[realElements.length - this.numberLeftWithOddEnding()]\n .insertAdjacentElement('beforebegin', BudgieDom.createBudgieFillerElement(this))\n\n realElements[realElements.length - 1]\n .insertAdjacentElement('afterend', BudgieDom.createBudgieFillerElement(this))\n }\n\n this.clearMeasurements();\n this.budgieAnimate();\n }",
"shuffleGuessList() {\r\n this.mixedGuessList = super.shuffle(this.guessList.slice());\r\n }",
"function getJurors(jurorList) {\n const shuffleList = jurorList;\n const displaySize = 4; // number of jurors to display\n\n /* randomize list */\n for (let i = jurorList.length - 1; i > 0; i -= 1) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = jurorList[i];\n shuffleList[i] = shuffleList[j];\n shuffleList[j] = temp;\n }\n\n /* remove extra elements */\n const spliceStart = displaySize - 1;\n const spliceNumber = jurorList.length - displaySize;\n shuffleList.splice(spliceStart, spliceNumber);\n return shuffleList;\n}",
"function setDailyDouble() {\n let randomIndex = Math.floor(Math.random() * clueIds.length);\n let randomClue = clueIds[randomIndex];\n return randomClue;\n }",
"updateListStart() {\n let numberAtTop;\n if (this.hasOddEnding()) {\n numberAtTop = this.numberLeftWithOddEnding();\n } else {\n numberAtTop = this.isHorizontal() ? this.options.numberHigh : this.options.numberWide;\n }\n\n let realElements = Array.from(document.querySelectorAll(`.budgie-item-${this.budgieId}:not(.budgie-item-${this.budgieId}--duplicate)`));\n\n // Trim the number of elements across one row to get rid of the bottom dupes\n let dupedElements = Array.from(document.querySelectorAll(`.budgie-item-${this.budgieId}.budgie-item-${this.budgieId}--duplicate`));\n let topOfDupedElements = dupedElements.slice(0, dupedElements.length - this.elementsOnScreen());\n\n // These elements should become the new duped top row\n let lastRowOfRealElements = realElements.slice(realElements.length - numberAtTop, realElements.length);\n\n const firstRealElement = realElements[0];\n\n // If there are more existing elements than we need, then trim that list\n if(topOfDupedElements.length > lastRowOfRealElements.length) {\n let numberOff = topOfDupedElements.length - lastRowOfRealElements.length\n\n for(let i = 0; i < numberOff; i += 1) {\n topOfDupedElements[i].parentNode.removeChild(topOfDupedElements[i]);\n topOfDupedElements.shift();\n }\n }\n\n // Exit early if the list is not long enough to scroll\n if(this.fitsInContainer()){ return; }\n\n // Update the existing elements, and add new if needed\n lastRowOfRealElements.forEach((element, index) => {\n let ele = element.cloneNode(true);\n ele.classList.add(`budgie-item-${this.budgieId}--duplicate`);\n if(topOfDupedElements[index]){\n topOfDupedElements[index].outerHTML = ele.outerHTML\n } else {\n firstRealElement.parentNode.insertBefore(ele, firstRealElement);\n }\n })\n }",
"generateSideDishes(state, dishCount) {\n let dishesArray = []\n for (let i = 0; i < dishCount; i++) {\n if (typeof state.selectedDishes[i] === 'undefined') {\n dishesArray[i] = [[], []]\n } else {\n dishesArray[i] = state.selectedDishes[i]\n }\n }\n\n state.selectedDishes = dishesArray\n }",
"function loadDrumSetup(drumList) {\n var table = document.getElementById('grid-beat');\n // table.textContent = '';\n var newTable = document.createElement('table');\n newTable.id = 'grid-beat';\n table.parentElement.replaceChild(newTable, table);\n\n allDrums = [];\n\n allDrums = copyDrumsList(drumList);\n generateTable(allDrums);\n\n resetExportCode();\n}",
"function tail(list) { return clone(list).slice(1); }",
"function getRandomFrom(list, exclude) {\n\tlet item;\n\t\n\t// DEBUG\n\tif (exclude.length >= list.length) {\n\t\tconsole.log(\"Warning: given list is not smaller than the exclusion\");\n\t\tconsole.log(list);\n\t\tconsole.log(exclude);\n\t}\n\t\n\tdo {\n\t\titem = list[randInt(0, list.length)];\n\t} while (exclude.includes(item));\n\t\n\treturn item;\n}",
"function dupelements(arr,a,b){\n\tvar dup = []; \n for(var i=a+1;i<b;i++){\n\tdup.push(arr[i]);\n}\nreturn dup;}",
"function duplicate(arr){\n arr.forEach(item => arr.push(item))\n return arr;\n}",
"createTargetInArray(nums, indexs) {\n let arr = [];\n for (const i in nums) {\n const before = arr.slice(0, indexs[i]);\n before[indexs[i]] = nums[i];\n arr = before.concat(...arr.slice(indexs[i]));\n }\n return arr;\n }",
"function divide_in_random_groups(list, n=1) {\n let new_list = [...Array(n)].map(i=>[])\n let aux_list = [...list]\n let idx = 0\n while (aux_list.length!==0) {\n new_list[idx].push(remove_random_element(aux_list))\n idx = (idx + 1)%n\n }\n new_list = reorder_list(new_list).map(i => sort_by_list(i, list))\n\n return new_list\n}",
"function makeUnique(dupes){\n var result = [];\n for(var i = 0; i<dupes.length;i++){\n var dupe = dupes[i];\n var furn = new Furniture(dupe.name, dupe.space, dupe.onTop, dupe.inside)\n result.push(furn)\n };\n return result\n}",
"function nth(list, num) {\n let placeHolder = [];\n placeHolder = listToArray(list);\n return placeHolder[num];\n}",
"swap() {\n return new Range(this.dims.map((d) => d.clone()).reverse());\n }",
"function unique(animals) {//Pass in animals arr\n var result = [];//store dedup arr\n $.each(animals, function(i, e) {//for each animal index, element\n if ($.inArray(e, result) == -1) result.push(e);//if any element returns -1 push to result arr\n });\n return result;\n }",
"toStore() {\n let dataset = new DStar();\n \n for (const quad of this.quads) {\n dataset.add(quad);\n }\n\n return dataset;\n }",
"function newListSetter (newListToArray) {\r\n // Limpiamos la lista de títulos vacíos y nulos\r\n newListToArray = newListToArray.filter(element => element)\r\n // Limpiamos la lista de posibles elementos repetidos\r\n newListToArray = [...new Set(newListToArray)]\r\n // Recorremos todos los títulos de la nueva lista\r\n for (let i = 0; i < newListToArray.length; i++) {\r\n // 1.1) Llamamos a la función 'newListCleaner' pasándole el título pertinente. Almacenamos su respuesta\r\n let cleanTitle = newListCleaner(newListToArray[i])\r\n // Añadimos los siguientes valores a la variable global ('newList') que representará la solicitud de películas a añadir en la lista general \r\n newList.push({\r\n // El título \r\n title: cleanTitle,\r\n // La puntuación. Se puntúa de manera automática por posición\r\n value: (newListToArray.length - i),\r\n // Los títulos alternativos. De momento, un array vacío\r\n alternativeTitle: []\r\n })\r\n }\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verify Post token from any client CORS () kiem tra du lieu kieu JSON.stringify | tokenPostCheck(req, res, next) {
let postDataString = '';
// Get all post data when receive data event.
req.on('data', (chunk) => {
postDataString += chunk;
});
// When all request post data has been received.
req.on('end', () => {
//chuyen doi Object JSON tu chuoi data nhan duoc
let postDataObject = JSON.parse(postDataString);
//console.log(postDataObject);
if (postDataObject && postDataObject.Authorization) {
let token = postDataObject.Authorization;
//da lay duoc token qua json
//gan cho req de xu ly token
req.token=token;
if (verifyToken(req,res)){
next();
}else{
res.writeHead(403, { 'Content-Type': 'application/json; charset=utf-8' });
res.end(JSON.stringify({
success: false,
message: 'Auth token is not supplied'
}));
}
} else {
//khong truyen
res.writeHead(403, { 'Content-Type': 'application/json; charset=utf-8' });
return res.end(JSON.stringify({
success: false,
message: 'Auth token is not supplied ANY!'
}));
}
});
} | [
"_postWithToken(url, token) {\n return fetch(url, {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({token: token})\n });\n }",
"function tokenFunc() {\n\tlet data = {username : process.env.WORDPRESS_USER, password : process.env.WORDPRESS_PASS};\n\treturn new Promise(function(resolve, reject) {\n\t\trequest({\n\t\t\turl: process.env.WORDPRESS_ROOT_PATH + \"/wp-json/jwt-auth/v1/token\",\n\t\t\tContentType : 'application/x-www-form-urlencoded',\n\t\t\tmethod: \"POST\",\n\t\t\tform: data\n\t\t}, function(error, response, body) {\n\t\t\tif(error) {\n\t\t\t\treject(error)\n\t\t\t} else {\n\t\t\t\tlet info = body.substring(body.indexOf(\"{\"));\n\t\t\t\tinfo = JSON.parse(info);\n\t\t\t\tinfo = info.token;\n\t\t\t\tresolve(info);\n\t\t\t\t/*\n\t\t\t\trequest({\n\t\t\t\t\turl: process.env.WORDPRESS_ROOT_PATH + '/wp-json/jwt-auth/v1/token/validate',\n\t\t\t\t\tContentType: 'application/json',\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tauth: {'bearer' : info},\n\t\t\t\t\tjson: true\n\t\t\t\t}, function(error, response, body) {\n\t\t\t\t\tif(error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t\tif(body == undefined) {\n\t\t\t\t\t\treject(\"Not a real postID\");\n\t\t\t\t\t}\n\t\t\t\t\tbody = body.substring(body.indexOf(\"{\"));\n\t\t\t\t\tbody = JSON.parse(body);\n\t\t\t\t\tconsole.log(body);\n\t\t\t\t\tif(body.code == \"jwt_auth_valid_token\") {\n\t\t\t\t\t\tresolve(info);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t*/\n\t\t\t}\n\t\t});\n\t});\n}",
"function is_accepted(response) {\n if (response.token !== undefined) {\n return true;\n }\n\n if (response.success !== undefined && response.success == true) {\n return true;\n }\n return false;\n}",
"function cors(opts) {\n assert.optionalObject(opts, 'options');\n opts = opts || {};\n assert.optionalArrayOfString(opts.origins, 'options.origins');\n assert.optionalBool(opts.credentials, 'options.credentials');\n assert.optionalArrayOfString(opts.headers, 'options.headers');\n\n var headers = (opts.headers || []).slice(0);\n// var origins = opts.origins || ['*'];\n\n EXPOSE_HEADERS.forEach(function (h) {\n if (headers.indexOf(h) === -1)\n headers.push(h);\n });\n\n // Handler for simple requests\n function restifyCORSSimple(req, res, next) {\n var origin;\n var origins;\n if(req.customer) {\n console.log('==============req.customer.origins: ', req.customer.origins)\n origins = req.customer.origins || [''];\n if(_.isString(origins)){\n origins = origins.replace(/\\s+/g, '');\n console.log('==========origins after replace: ', origins);\n origins = origins.split(';').toString().split(',');\n console.log('==========origins post processing: ', origins);\n }\n }\n else\n origins = ['']\n\n if (!(origin = matchOrigin(req, origins))) {\n console.log('==============matchOrigin req.badCors: ', req.badCors)\n console.log(\"==============req.headers['origin']: \", req.headers['origin'])\n\n var regexp = /http[s]?:\\/\\//;\n var isAjax = regexp.test(req.headers['origin']);\n\n if(isAjax) {\n console.log('isAjax: ', isAjax);\n req.badCors = true;\n }\n else {\n console.log('isAjax: ', isAjax);\n }\n\n///--- Alternative check isAjax\n\n// if( !_.isUndefined(req.headers['origin']) ) {\n// console.log('isAjax: ', isAjax);\n// req.badCors = true;\n// }\n// else {\n// console.log('isAjax: ', isAjax);\n// }\n\n\n next();\n return;\n }\n\n function corsOnHeader() {\n origin = req.headers['origin'];\n if (opts.credentials) {\n res.setHeader(AC_ALLOW_ORIGIN, origin);\n res.setHeader(AC_ALLOW_CREDS, 'true');\n } else {\n res.setHeader(AC_ALLOW_ORIGIN, origin);\n }\n\n res.setHeader(AC_EXPOSE_HEADERS, headers.join(', '));\n }\n\n res.once('header', corsOnHeader);\n next();\n }\n\n return (restifyCORSSimple);\n}",
"function stripeCheckoutSubmitIntercept() {\n window.addEventListener('beforeunload', () => {\n let token = null;\n let $tokenIdField = document.querySelector('input[name=stripeToken]');\n if($tokenIdField) {\n // build token obj to send via postMessage\n token = {};\n // for each hidden input, grab value we need for token,\n // and then remove it so not detected more than once\n $tokenIdField.parentNode.querySelectorAll('input[type=hidden]').forEach((input) => {\n token[input.getAttribute(\"name\")] = input.value;\n input.parentNode.removeChild(input);\n });\n }\n // only send message if received token\n if(token) {\n window.postMessage({\n \"message\": \"STRIPE_CARD_TOKENIZED\",\n \"token\": token\n }, \"*\");\n }\n });\n }",
"async function verify( token ) {\n const ticket = await client.verifyIdToken({\n idToken: token,\n audience: CLIENT_ID, \n });\n //En el payload vamos a tener toda la informacion del usuario\n const payload = ticket.getPayload();\n // const userid = payload['sub'];\n // If request specified a G Suite domain:\n //const domain = payload['hd'];\n return {\n nombre: payload.name,\n email:payload.email,\n img: payload.picture,\n google: true \n }\n}",
"AddCORSSupportOnYourContainer(origin) {\n let url = `/me/document/cors`;\n return this.client.request('POST', url, { origin });\n }",
"function tokenAuthentication(token, callback) {\n if (token === CAM_MOCKS.validToken) {\n callback(true);\n } else {\n callback(false);\n }\n}",
"function _send(method, params) {\n console.log({\n \"method\" : method,\n \"params\" : params\n });\n\n // Get JSON Web token test in private functions\n // res: is object that contains the token\n return $http.post(SERVER + method , params ,{ headers : {}}).then(\n function(res){\n if(service.debug)\n console.log({\n \"method\" : method,\n \"params\" : params,\n \"result\" : res.data\n });\n return handleSuccess(res);\n },\n function(res){\n return handleError(res);\n });\n } // end _send",
"deleteCORS(callback) {\n return this.deleteCORSRequest().sign().send(callback);\n }",
"async function validateReCaptchaToken(token) {\n if (process.env.NODE_ENV === 'test') {\n return true;\n }\n let googleUrl = `https://www.google.com/recaptcha/api/siteverify?secret=${process.env.GOOGLE_CAPTCHA_KEY}&response=${token}`;\n return (async () => {\n try {\n const res = await superagent.post(googleUrl);\n console.log(res.body);\n return res.body.success;\n } catch (err) {\n return false;\n }\n })();\n}",
"function validateToken(){\n\tvar data = {\n 'token': gActiveToken\n };\n $.ajax({\n url: baseUrl + 'validateToken',\n type: \"GET\",\n data: data,\n dataType: 'json',\n success: function(result){\n \tif(result.status === 'valid'){\n \t\twindow.location = 'html/order.html';\n \t} else {\n \t\talert(result.message);\n \t}\n },\n error: function(){\n alert('failure');\n } \n });\n}",
"isTokenExpired(token){\n try {\n const decoded = decode(token);\n return (decoded.exp < Date.now() / 1000);\n } catch (err) {\n console.log(\"expired check failed!\");\n return true;\n }\n }",
"function validateAndFormatTokenFromServer(result) {\n logger.debug('Executing validateAndFormatTokenFromServer for result ' + JSON.stringify(result));\n if (Object.prototype.toString.call(result) === \"[object String]\") {\n var objects = result.split(\"&\");\n var newResult = {};\n for (var i = 0; i < objects.length; i++) {\n var tmpObj = objects[i].split(\"=\");\n newResult[tmpObj[0]] = tmpObj[1];\n }\n\n result = newResult;\n }\n\n if (result && result.hasOwnProperty(\"access_token\") && result.access_token.length > 5) {\n logger.debug('Validation complete, token ' + result.access_token + ' is good');\n } else {\n logger.error('Token did no pass validation ' + result.access_token);\n result = null;\n }\n\n return result;\n }",
"function isActiveToken () {\n const url = `${baseURl}/api/user/verifyToken`\n return localforage.getItem('token').then((jwt) => {\n return axios.post(url, { params: jwt })\n })\n}",
"async hacerFetch (metodo, ruta, data, token) {\n const url = this.url + '/' + ruta; //Concatenamos la ruta dada como parametro con la url\n let config = {\n method: `${metodo}`,\n mode: 'cors',\n cache: 'no-cache',\n credentials: 'same-origin',\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${token}` \n },\n redirect: 'follow',\n referrerPolicy: 'no-referrer'\n }\n\n metodo == 'POST' || metodo == 'PUT' ? Object.defineProperty(config, 'body', {value: JSON.stringify(data)}) : ''; // Si el metodo put o post removemos 'data' ya que no se necesita.\n token === '' ? delete config.headers.Authorization : ''; // Si no existe token removemos el campo autorizathion.\n const response = await fetch(url, config );\n return response;\n }",
"function createJWTForAPIsAccess(phoneNo, apiKey){\n return fetch((\"https://app.aibers.health/createJWTForAPIsAccess\"), {\n method: \"POST\",\n headers: {Accept: 'application/json','Content-Type': 'application/json'},\n body: JSON.stringify({\n pno: phoneNo,\n apiKey: apiKey\n})\n }).then(response => response.json());\n}",
"function sdkResponseHandler(status, response) {\n\n if (status != 200 && status != 201) {\n \n alert(\"Verify the data\");\n \n }else{\n \n var form = document.querySelector('#pay');\n\n var card = document.createElement('input');\n card.setAttribute('name',\"card\");\n card.setAttribute('type',\"hidden\");\n card.setAttribute('value',response.id);\n\n form.appendChild(card);\n \n doSubmit=true;\n \n alert(\"card token: \"+response.id);\n \n form.submit();\n }\n }",
"function checkToken(_token, currentUserId) {\n try {\n //ayth6) server decodes token and compares the user's userid with the token's decoded userid\n //ayth6a) if good then can continue with action\n //ayth6b) else ??? return u failed\n const token = _token;\n // next will keep any fields created\n const decodedToken = jwt.verify(token, \"my super duper secret code\");\n if (currentUserId == decodedToken.userId) {\n return true;\n } else {\n return false;\n }\n } catch (error) {\n console.log(error)\n // res.status(401).json({ message: \"You are not authenticated!\" });\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to get parked slots from color | getSlotNoFromColor(color) {
try {
const slots = this.parkingManager.getSlotNoFromColor(color);
if(slots.length === 0)
console.log('Not Found');
else {
console.log(slots.join(","));
}
} catch(e) {
throw new Exception(errorMessage.PROCESSING_ERROR, e);
}
} | [
"function createPallet(){\n\tfor(let i = 0; i < numColor; i++){\n\t\tswatches.push(new ColorSwatch(\t((i*colorSwatchRadius)+colorSwatchRadius/2), \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorSwatchRadius/2, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorSwatchRadius/2, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t colorArray[i]));\n\t}\n\tfillIcon = new FillIcon(canvasWidth-frameThickness*.75, canvasWidth/40, canvasWidth/20);\n}",
"function renderPallet(){\n\tfor(let i = 0; i < numColor; i++){\n\t\tswatches[i].display();\n\t}\n\tfillIcon.display();\n}",
"function startColor () {\n\t\treturn {\n\t\t\tr: 255,\n\t\t\tg: 255 * Math.random(),\n\t\t\tb: 75\n\t\t};\n\t}",
"function nextColor() {\n c = colors[ count % color.length]\n count = count + 1\n return c\n}",
"function get_colors(triangles){\n\tconst probs = [0.5,0.2,0.1,0.1,0.1];\n\tvar color_assignments = [];\n\tvar used_colors,new_probs;\n\tfor(var i=0;i<triangles.length;i++){\n\t\tused_colors = []\n\t\tfor(var j=0;j<color_assignments.length;j++){\n\t\t\tif(is_neighbor(triangles[i], triangles[j])){\n\t\t\t\tused_colors.push(color_assignments[j]);\n\t\t\t}\n\t\t}\n\t\tconsole.log(used_colors);\n\t\tnew_probs = [];\n\t\tfor(var j=0;j<5;j++){\n\t\t\tif(!used_colors.includes(j)){\n\t\t\t\tnew_probs.push(probs[j]);\n\t\t\t} else {\n\t\t\t\tnew_probs.push(0);\n\t\t\t}\n\t\t}\n\t\tconsole.log(new_probs);\n\t\tcolor_assignments.push(random_choice(new_probs));\n\t}\n\treturn(color_assignments);\n}",
"function getRoomByColor(colorArr) {\n return arrayOfRooms[rgbToDecimal(colorArr)];\n}",
"getSurroundingColors(coord) {\n var colors = [];\n for (var x = coord.x - 1; x <= coord.x + 1; x++) {\n for (var y = coord.y - 1; y <= coord.y + 1; y++) {\n var color = this.getColor(new Coord(x, y));\n if (color !== null) {\n colors.push(color);\n }\n }\n }\n return colors;\n }",
"function colorTextOfSlots() {\r\n let currentIndex = 0;\r\n for (var value of slotValues) {\r\n if (value > 0) { // if its a positive number\r\n document.getElementById(slotIds[currentIndex].toString()).className = 'positiveSlot';\r\n currentIndex++;\r\n } else if (value < 0) {\r\n document.getElementById(slotIds[currentIndex].toString()).className = 'negativeSlot';\r\n currentIndex++;\r\n } else {\r\n currentIndex++;\r\n }\r\n }\r\n}",
"function colorGameCells(coords, color) {\n colorCells(coords, color, 'cell');\n}",
"function colorHoldCells(coords, color) {\n colorCells(coords, color, 'hold');\n}",
"function colorPlates(feature){\n return{\n color: \"#FFA500\",\n fillOpacity: 0.05\n };\n}",
"function getLikeColor(a_color) {\n let its_red = p5.red(a_color);\n let its_green = p5.green(a_color);\n let its_blue = p5.blue(a_color);\n let total_colors = its_red + its_green + its_blue;\n if (total_colors == 0) {\n //if it's black, need to set so that total isn't zero\n its_red = 10;\n its_green = 10;\n its_blue = 10;\n total_colors = its_red + its_green + its_blue;\n }\n //if it's a light color, get a like color that's darker\n let new_total_colors = p5.int(p5.random(0, 255 * 3));\n //set same proportions of each color in the old color for the new color\n let new_color = p5.color(\n (its_red * new_total_colors) / total_colors,\n (its_green * new_total_colors) / total_colors,\n (its_blue * new_total_colors) / total_colors\n );\n return new_color;\n }",
"function get_swatch_colour() {\n chrome.storage.sync.get('daysago_swatch', function(item) {\n start_colour = item.daysago_swatch;\n trigger_draw_grid()\n });\n}",
"function getColors(){\n var rgb = mixerBottle.attr('style').replace('background-color: rgb(', '').replace(')', '').split(',');\n return rgb.map(x => parseInt(x));\n }",
"function paintBlock(){\n\tfor(var i = 0; i < 4; i++){\n\t\tif(currentBlock[i].x < 0 || currentBlock[i].x > 19 || currentBlock[i].y < 0 || currentBlock[i].y > 9){\n\t\t\tcontinue;\n\t\t}\n\t\tboardGui.rows[currentBlock[i].x].cells[currentBlock[i].y].style.backgroundColor = \"rgba(255,0,0,0.3)\"; \n\t}\n}",
"function chooseAvailableColor() {\n // Count how many times each color is used\n var colorUsage = {};\n colorNames.forEach(function(color) {colorUsage[color] = 0; })\n dataLayers.forEach(function(layer) {\n var color = layer.color;\n if (color in colorUsage)\n colorUsage[color] = colorUsage[color] + 1;\n else\n colorUsage[color] = 1;\n });\n // Convert to array and sort by usage\n colorUsage = Object.entries(colorUsage).sort(function(a,b) {return a[1] - b[1]});\n // Return the first color (the one with the least usage)\n return colorUsage[0][0];\n}",
"function parseRGB(digits) {\n\n var current_triplet = \"\";\n var start_position = 0;\n\n var red = 0;\n var green = 0;\n var blue = 0;\n\n var triplet = [];\n var triplets = [];\n\n for(var count = 0; count < (dimension * dimension); count ++) {\n\n start_position = count * 9;\n current_triplet = digits.substring(start_position, start_position + 9);\n\n red = parseInt(current_triplet.substring(0, 3)) % 255;\n green = parseInt(current_triplet.substring(3, 6)) % 255;\n blue = parseInt(current_triplet.substring(6, 9)) % 255;\n\n triplet = [red, green, blue];\n triplets[ count ] = triplet;\n }\n\n return triplets;\n }",
"function flag_color(flag_index, i){\n return colors[flag_index][i % colors[flag_index].length]\n}",
"function biplotColor() {\n console.log('empty space where site comparison coloring should be')\n // console.log('coloring by biplot')\n\n // // for every legend item\n // for(let i = 0; i < $('g.legendpoints path.scatterpts').length; i++) {\n\n // // get text of legend entry\n // var legend_text = $('g .legendtext')[i].innerHTML.split(\" - \")\n\n // for(let x = 0; i < $('.rank-list-item').length; x++) {\n\n // // check against text of rank items\n // var rank_index = x + 1;\n // var bucket_item = '.rank-list-item:nth-child(' + rank_index + ')';\n // var bucket_text = $(bucket_item).text().split(\":\")\n\n // if(legend_text[0].trim() == bucket_text[0].trim()) {\n // console.log(\"matched domain\");\n\n // if(legend_text[1].trim() == bucket_text[1].trim()) {\n // console.log(\"matched site! coloring item\")\n\n // var scatter_color = $('g.legendpoints path.scatterpts')[i].style.fill;\n // var bucket_style = 'border: 3px solid ' + scatter_color + ' !important';\n // $(bucket_item).attr('style', bucket_style)\n // }\n // }\n\n // }\n // };\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs additional search against acitity and transaction records to find latestdate/latesttype/latestid to use | function getLatestTrxAndActivityDate(jsonClient, arClientIds) {
//3. Search for Latest Transaction Date of any kind for all client
//order the search in trandate Latest.
//array to keep track of already used client id
var arTrx = new Array();
var tflt = [new nlobjSearchFilter('entity', null, 'anyof', arClientIds),
new nlobjSearchFilter('mainline', null, 'is', 'T')];
var tcol = [new nlobjSearchColumn('trandate').setSort(true),
new nlobjSearchColumn('entity'),
new nlobjSearchColumn('internalid'),
new nlobjSearchColumn('type')];
var trslt = nlapiSearchRecord('transaction', null, tflt, tcol);
for (var t=0; trslt && t < trslt.length; t++) {
if (!arTrx.contains(trslt[t].getValue('entity'))) {
arTrx.push(trslt[t].getValue('entity'));
jsonClient[trslt[t].getValue('entity')]['lasttrxdate'] = new Date(trslt[t].getValue('trandate'));
jsonClient[trslt[t].getValue('entity')]['lasttrxtype'] = trslt[t].getText('type');
jsonClient[trslt[t].getValue('entity')]['lasttrxid'] = trslt[t].getValue('internalid');
}
}
//4. Search for Latest Activities Events, Phone calls, Tasks
var arAct = new Array();
var acflt = [new nlobjSearchFilter('company', null, 'anyof', arClientIds)];
var accol = [new nlobjSearchColumn('startdate').setSort(true),
new nlobjSearchColumn('type'),
new nlobjSearchColumn('internalid','company')];
var acrslt = nlapiSearchRecord('activity', null, acflt, accol);
for (var ac=0; acrslt && ac < acrslt.length; ac++) {
log('debug','activity company',acrslt[ac].getValue('internalid','company'));
if (!arAct.contains(acrslt[ac].getValue('internalid','company'))) {
arAct.push(acrslt[ac].getValue('internalid','company'));
jsonClient[acrslt[ac].getValue('internalid','company')]['lastactivitydate'] = new Date(acrslt[ac].getValue('startdate'));
jsonClient[acrslt[ac].getValue('internalid','company')]['lastactivitytype'] = acrslt[ac].getText('type');
jsonClient[acrslt[ac].getValue('internalid','company')]['lastactivityid'] = acrslt[ac].getId();
}
}
log('debug','set latestdate','');
//5. Loop through customer element and set latest date to use
//jsonClient[crslt[c].getId()]['latestdate'] = '';
//jsonClient[crslt[c].getId()]['latesttype'] = '';
//jsonClient[crslt[c].getId()]['latestid'] = '';
for (var jc in jsonClient) {
if (jsonClient[jc].lasttrxdate && jsonClient[jc].lastactivitydate) {
//compare both to see which one to use
if (jsonClient[jc].lasttrxdate.getTime() > jsonClient[jc].lastactivitydate.getTime()) {
jsonClient[jc]['latestdate'] = jsonClient[jc].lasttrxdate;
jsonClient[jc]['latesttype'] = jsonClient[jc].lasttrxtype;
jsonClient[jc]['latestid'] = jsonClient[jc].lasttrxid;
} else if (jsonClient[jc].lasttrxdate.getTime() < jsonClient[jc].lastactivitydate.getTime()) {
jsonClient[jc]['latestdate'] = jsonClient[jc].lastactivitydate;
jsonClient[jc]['latesttype'] = jsonClient[jc].lastactivitytype;
jsonClient[jc]['latestid'] = jsonClient[jc].lastactivityid;
}
} else if ((!jsonClient[jc].lasttrxdate && jsonClient[jc].lastactivitydate) || (jsonClient[jc].lasttrxdate && !jsonClient[jc].lastactivitydate)) {
jsonClient[jc]['latestdate'] = (jsonClient[jc].lasttrxdate)?jsonClient[jc].lasttrxdate:jsonClient[jc].lastactivitydate;
jsonClient[jc]['latesttype'] = (jsonClient[jc].lasttrxdate)?jsonClient[jc].lasttrxtype:jsonClient[jc].lastactivitytype;
jsonClient[jc]['latestid'] = (jsonClient[jc].lasttrxdate)?jsonClient[jc].lasttrxid:jsonClient[jc].lastactivityid;
}
}
log('debug','Run logic','');
} | [
"async function current_latestamounttoday_await() \n{\n\tlet today = new Date();\n\tlet year = today.getFullYear();\n\tlet month = today.getMonth(); \n\tlet date = today.getDate();\n\n return await CurrentModel.\n\t\tfindOne().\n\t\twhere(\"time\").gte(new Date(year, month, date)).\n sort({time: -1}).\n exec(function(err, res) {\n\t\t\t// jump away if error found\n\t\t\tif (err) { return next(err); }\n\t\t\telse { return res }\t\t\n\t});\n}",
"function perform_search() {\n if (lastSearchType == \"D\") {\n searchHistory();\n } else if (lastSearchType == \"E\") {\n searchEpg();\n }\n }",
"function getLatest(req, res)\n {\n // Find all SearchQuery objects\n var query = SearchQuery.find({});\n \n // Sort by date\n query.sort( [['_id', -1]] );\n // Limit to 10 searches\n query.limit(10);\n \n query.exec(function(err, obj){\n if(err){\n res.send(err);\n } \n else{\n res.send(obj.map(limitHistory));\n }\n });\n }",
"function IBCMatching() {\r\n var asoFilters = new Array();\r\n aSOFilters = ibcCriteria(idrrm, salesOrderCompare);\r\n var aSearchResults = findMatchingRecord(aSOFilters);\r\n if (aSearchResults != null && aSearchResults != '') {\r\n idrrm = aSearchResults[0].getId();\r\n revRec = true;\r\n } else {\r\n revRec = false;\r\n // return;\r\n }\r\n }",
"function getSalesforceAccounts(res, accountProvisioningConditions, utcDate, previousDate, callback) {\n var results = [];\n\n var query = \"\";\n var dynamicQuery = \"\";\n var conditions = accountProvisioningConditions.condition;\n var mapping = accountProvisioningConditions.mapping;\n var mappedFields = \"\";\n\n if (conditions.length) {\n\n if (accountProvisioningConditions.filterLogic != \"\") {\n\n for(var k = 0 ; k < conditions.length ; k++)\n {\n var x = k+1;\n var y = \" \" + conditions[k].field + \" \" + conditions[k].operator + \" '\" + conditions[k].value + \"' \";\n dynamicQuery = accountProvisioningConditions.filterLogic.replace(x,y);\n accountProvisioningConditions.filterLogic = dynamicQuery;\n }\n\n }\n else{\n\n query = \" \" +conditions[0].field + \" \" + conditions[0].operator + \" '\" + conditions[0].value + \"' \";\n\n }\n\n console.log(dynamicQuery);\n query = query + dynamicQuery;\n\n\n // for (var i = 0; i < conditions.length; i++) {\n // if (accountProvisioningConditions.filterLogic != \"\") {\n //\n //\n //\n //\n // if (i != conditions.length - 1) {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"' \" + filterLogic[i] + \" \";\n // }\n // else {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"'\";\n //\n // }\n // }\n // else {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"'\";\n //\n // }\n //\n // }\n\n }\n\n mapping.forEach(function (result) {\n if (mappedFields.indexOf(result.salesforceField) == -1) {\n if (result.salesforceField != \"Id\") {\n mappedFields = mappedFields + result.salesforceField + \" ,\";\n }\n\n }\n\n\n });\n mappedFields = mappedFields.substring(0, mappedFields.length - 1);\n\n\n if (query != \"\") {\n var accountQuery = \"select Id,\" + mappedFields + \" from Account where LastModifiedDate <= \" + utcDate;\n accountQuery += \" and LastModifiedDate >= \" + previousDate + \" and ( \" + query + \" )\" ;\n\n }\n else {\n var accountQuery = \"select Id,\" + mappedFields + \" from Account where LastModifiedDate <= \" + utcDate;\n accountQuery += \" and LastModifiedDate >= \" + previousDate;\n\n }\n conn.query(accountQuery, function (err, result) {\n if (err) {\n console.log(\"error\", err);\n res.send(\"some error occured\");\n }\n else {\n\n if (result.totalSize != 0) {\n\n console.log(result.records);\n accountProvisioningConditions.data = result.records;\n callback(null, accountProvisioningConditions);\n\n }\n else {\n res.send(\"no accounts matching\");\n }\n }\n\n });\n\n}",
"function GetLastActionData(req, callback) {\n\tcontractInfo.getContractInfo(req.params.contractAddress,(err,doc)=>{\n\t\tvar json = [];\n\t\tif(err){\n\t\t\tcallback(null,json);\n\t\t} else if (doc !== null) {\n trycatch(function() {\n var abiJson = JSON.parse(doc.abi);\n var Multiply7 = web3.eth.contract(abiJson);\n var multi = Multiply7.at(doc.contractAddress);\n if (req.session.address === multi.owner()) {\n var updateCount = multi.getstatusupdateCount();\n for (var i = 0; i < updateCount.toString(); i++) {\n var obj = {};\n obj.contractAddress = doc.contractAddress;\n obj.owner = multi.owner();\n var statusinfo = multi.getstatusupdate(i);\n if (statusinfo !== undefined && statusinfo !== null) {\n var splitArr = [];\n var arr = statusinfo.toString().split(\",\");\n for (var k = 0; k < arr.length; k++) {\n splitArr.push(arr[k]);\n }\n obj.ContractName = splitArr[0];\n obj.owner = splitArr[1];\n var unix_timestamp = splitArr[2].toString();\n var date = new Date(unix_timestamp * 1000);\n var cDate = dateFormat(date, \"mm/dd/yyyy HH:MM:ss\");\n obj.DateCreated = cDate;\n obj.status = common.getstatustext(splitArr[3]);\n var remark = splitArr[4];\n if (remark.indexOf(\"*\") != -1) {\n obj.remark = remark.replace(\"*\", \".\");\n } else {\n obj.remark = splitArr[4];\n }\n }\n json.push(obj);\n }\n }\n }, function(err) {\n callback(null,json);\n });\n } else {\n callback(null, json);\n }\n\t});\n}",
"function getSearchResult(tranId){\n return nlapiSearchRecord('transaction',null,\n [\n new nlobjSearchFilter('internalid',null,'is',tranId), \n new nlobjSearchFilter('mainline',null,'is','F')\n ],\n [\n new nlobjSearchColumn('item'),\n new nlobjSearchColumn('quantity'),\n new nlobjSearchColumn('quantitypicked')\n ]);\n}",
"function getTransactionsByAccount() {\n var account = document.getElementById(\"trxAccount\").value;\n var startBlockNumber = document.getElementById(\"startBlock\").value;\n var endBlockNumber = document.getElementById(\"endBlock\").value;\n \n if (endBlockNumber == \"\") {\n endBlockNumber = web3.eth.blockNumber;\n console.log(\"Using endBlockNumber: \" + endBlockNumber);\n }\n if (startBlockNumber == \"\") {\n startBlockNumber = endBlockNumber - 1000;\n console.log(\"Using startBlockNumber: \" + startBlockNumber);\n }\n console.log(\"Searching for transactions to & from account: \" + account + \" within blocks \" + startBlockNumber + \" & \" + endBlockNumber);\n \n for (var i = startBlockNumber; i <= endBlockNumber; i++) {\n if (i % 1000 == 0) {\n console.log(\"Searching block \" + i);\n }\n var block = web3.eth.getBlock(i, true);\n if (block != null && block.transactions != null) {\n block.transactions.forEach( function(e) {\n if (account == \"*\" || account == e.from || account == e.to) {\n console.log(\" tx hash : \" + e.hash + \"\\n\"\n + \" nonce : \" + e.nonce + \"\\n\"\n + \" blockHash : \" + e.blockHash + \"\\n\"\n + \" blockNumber : \" + e.blockNumber + \"\\n\"\n + \" transactionIndex: \" + e.transactionIndex + \"\\n\"\n + \" from : \" + e.from + \"\\n\" \n + \" to : \" + e.to + \"\\n\"\n + \" value : \" + e.value + \"\\n\"\n + \" time : \" + block.timestamp + \" \" + new Date(block.timestamp * 1000).toGMTString() + \"\\n\"\n + \" gasPrice : \" + e.gasPrice + \"\\n\"\n + \" gas : \" + e.gas + \"\\n\");\n // + \" input : \" + e.input);\n }\n })\n }\n }\n }",
"async function GetLatest() {\n try {\n const HistoricalQR = await getDB();\n return await HistoricalQR.findOne().sort({ _id: -1 });\n } catch (err) {}\n}",
"function findMatchingInvoice() {\r\n var idPayer = nlapiGetFieldValue(FLD_PAYER);\r\n var btOLI = nlapiGetFieldValue(FLD_OLI);\r\n var quadexTicket = nlapiGetFieldValue(FLD_QUADAX_TICKET_ID);\r\n\r\n\r\n var aSearchFilters = new Array();\r\n aSearchFilters.push(new nlobjSearchFilter('entity', null, 'is', idPayer));\r\n aSearchFilters.push(new nlobjSearchFilter(FLD_TRANS_OLI, null, 'is', btOLI));\r\n aSearchFilters.push(new nlobjSearchFilter(FLD_TRANS_CLAIM, null, 'is', quadexTicket));\r\n // aSearchFilters.push(new nlobjSearchFilter(FLD_BILLINGEVENTTYPE, null,\r\n // 'anyof', 1)); //either bill\r\n\r\n var aSearchColumns = new Array();\r\n aSearchColumns.push(new nlobjSearchColumn('internalid'));\r\n try {\r\n var aSearchResults = nlapiSearchRecord('transaction', null, aSearchFilters, aSearchColumns);\r\n return aSearchResults;\r\n } catch (e) {\r\n nlapiLogExecution('debug', 'search error', e.message)\r\n }\r\n}",
"async getRecords(fieldValuePairs){\n let {fields, fieldsVals} = this.inputHandler(fieldValuePairs);\n\n // Get the records\n let query = this.root+'table='+this.layerLayer+'&fields='+fields+'&fieldsVals='+fieldsVals+'&purpose=records';\n let records = Object.values(await fetchData(query));\n console.log('Operation : getRecordsP1, Query Sent : ', query, ', Server Returned :', records);\n\n // Handle returnsDistinct.\n let getData = false;\n if( this.returnDistinct ){\n if(records.length > 1){ records = records.filter( record => record.fields === fieldsVals ) }\n if(records.length == 1){ getData = true }\n else if (records.length == 0){ alert('Search must return no more than 1 address') }\n }\n else if(!this.returnDistinct && records.length >= 1){ getData = true }\n else{ alert('No Data Found') }\n\n // Retrieve Points / Geometries From the Record(s).\n let uniqueBlockLots = getData == true ? [...new Set(records.map(record => record['block_lot']))] : [];\n\n // Contruct a GeoJson Object. \n // 1) if (uniqueBlockLots.length == 0) - do nothin\n // 2) else if( this.returnParcel && this.layerLayer != 'property_details' ) - // Retrieve Esri Parcel Geometries\n // 3) else if( uniqueBlockLots.length ) -\n // 4) else - error\n\n fieldsVals = ''; query = ''; let coords = []; let returnThis = []; let firstItem = true;\n if (uniqueBlockLots.length == 0){ }\n else if( this.returnParcel && this.layerLayer != 'property_details' ){\n\n // Retrieve Esri Parcel Geometries\n uniqueBlockLots.map( (blocklot, i) => { \n if(i>=1){ fieldsVals += '+OR+' };\n let loc = blocklot.split(\" \")[0]; let lot = blocklot.split(\" \")[1]; let blockl = blocklot.replace(/ /g, \"+\")\n fieldsVals += 'Blocklot+%3D+%27'+blockl+'%27+'; // Blocklot = '012 0015'\n fieldsVals += 'OR+%28lot+%3D+%27'+lot+'%27+AND+Block+%3D+%27'+loc+'%27%29+' // OR (lot='0015' AND Block = '012')\n fieldsVals += 'OR+%28lot+%3D+%27'+loc+'%27+AND+Block+%3D+%27'+lot+'%27%29' // OR (lot = '012' AND Block ='0015')\n } )\n coords = await this.parcelGeometry( fieldsVals );\n coords = coords.features.map(attr => attr)\n \n // Insert Geometries into each Record\n returnThis = records.map( (record, i) => {\n\n // Get the Parcel at each Blocklot\n let parcel = coords.filter( uniqueParcel => {\n let flag = uniqueParcel.properties['Blocklot'] == record['block_lot'];\n flag = flag ? flag : uniqueParcel.properties['BLOCK'] == record['block']\n flag = flag ? flag : uniqueParcel.properties['LOT'] == record['lot']\n flag = flag ? flag : uniqueParcel.properties['LOT'] +\" \"+uniqueParcel.properties['BLOCK'] == record['block_lot']\n return flag\n } )[0]\n var outGeoJson = {}\n outGeoJson['properties'] = record;\n outGeoJson['type']= \"Feature\";\n\n // If coordinates are found insert them into the record \n if(parcel != []){\n if(parcel['geometry'] && parcel['geometry']['coordinates']){ outGeoJson['geometry']= parcel['geometry'] }\n else if(record && record['xcord']){ outGeoJson['geometry']= {\"type\": \"Point\", \"coordinates\": [record['ycord'], record['xcord']] } }\n else{ outGeoJson['geometry']= {\"type\": \"Point\", \"coordinates\": [undefined,undefined] } }\n } else{ alert('parcel could not be found'); }\n return outGeoJson\n } )\n\n console.log('Operation : getRecordsP1A, Query Sent : ', query, ', Server Returned :', returnThis);\n }\n else if( uniqueBlockLots.length ){ // Get Coords\n uniqueBlockLots.map( (blocklot,i) => {\n if(i>=1){ fieldsVals += '+' }\n fieldsVals += blocklot\n } )\n query = this.root+'&table=basic_prop_info&fields=block_lot&fieldsVals=InTheBody&purpose=coords';\n coords = await fetchData([query, fieldsVals])\n console.log('Operation : getCoordinates, Query Sent : ', ', Server Returned :', coords);\n\n // Stuff the coords you just got into each record. Start by maping through your records.\n returnThis = records.map( record => {\n // Find its Coordinates And insert it into the record\n let parcel = coords.filter( uniqueParcel => { return uniqueParcel['block_lot'] == record['block_lot']; } )\n let newRecord = Object.assign(record, parcel[0])\n return newRecord\n } )\n\n\n // Process BNIA Data into an array of Json Features.\n returnThis = returnThis.map( record => {\n var outGeoJson = {}\n outGeoJson['properties'] = record;\n outGeoJson['type']= \"Feature\";\n outGeoJson['geometry']= {\"type\": \"Point\", \"coordinates\": [record['xcord'], record['ycord']]}\n return outGeoJson\n } );\n\n //let notAllData = returnThis.filter( newrecord => { return !newrecord.xcord || !(newrecord.properties && newrecord.properties.xcord ) } )\n }\n else{ alert('Server Error. Please contact the administrator'); }\n\n // Data will either be returned wrapped in its Feature Object or as Key:Value pairs that will be translated into a Feature Object\n console.log('Operation : getRecordsP2, Query Sent : ', '', ', Server Returned :', returnThis);\n return returnThis;\n }",
"search(bucket, key, value) {\n const query = tagToQuery(bucket, key, value);\n // console.log(\"search: \" + query);\n // TODO: we will have to paginate when there are more than enough to fit on one page....\n return this.client.txSearch({query, per_page: 100}).catch(err => console.log(err));\n }",
"function searchEstablishments(searchParams) {\n\n return instance.get('/Establishments', {\n params: searchParams\n })\n .then(function (response) {\n return (response);\n })\n .catch(function (error) {\n return (error);\n });\n\n }",
"function getJournal() {\n\n var journal = Banana.document.journal(Banana.document.ORIGINTYPE_CURRENT, Banana.document.ACCOUNTTYPE_NORMAL);\n var len = journal.rowCount;\n var transactions = []; //Array that will contain all the lines of the transactions\n var requiredVersion = \"9.0.0\";\n \n for (var i = 0; i < len; i++) {\n\n var line = {}; \n var tRow = journal.row(i);\n\n if (tRow.value(\"JDate\") >= param.startDate && tRow.value(\"JDate\") <= param.endDate) {\n\n line.date = tRow.value(\"JDate\");\n line.account = tRow.value(\"JAccount\");\n line.vatcode = tRow.value(\"JVatCodeWithoutSign\");\n line.vattaxable = tRow.value(\"JVatTaxable\");\n line.vatamount = tRow.value(\"VatAmount\");\n line.vatposted = tRow.value(\"VatPosted\");\n line.amount = tRow.value(\"JAmount\");\n line.amountaccountcurrency = tRow.value(\"JAmountAccountCurrency\");\n line.transactioncurrencyconversionrate = tRow.value(\"JTransactionCurrencyConversionRate\");\n line.doc = tRow.value(\"Doc\");\n line.description = tRow.value(\"Description\");\n line.transactioncurrency = tRow.value(\"JTransactionCurrency\");\n line.isvatoperation = tRow.value(\"JVatIsVatOperation\");\n line.amounttransactioncurrency = tRow.value(\"JAmountTransactionCurrency\");\n \n //We take only the rows with a VAT code and then we convert values from base currency to CHF\n if (line.isvatoperation) {\n\n if (line.transactioncurrency === \"CHF\") {\n line.exchangerate = Banana.SDecimal.divide(1,line.transactioncurrencyconversionrate);\n }\n else {\n\n //Starting from the date of the line.date (ex. 2015-10-13)\n var date = line.date.split(\"-\"); //es. [2015,10,13]\n var year = date[0];\n var month = date[1];\n\n //We set the date as the 15 of the month\n var stringDate = year + \"-\" + month + \"-15\"; //es. 2015-10-15\n\n //Read from the ExchangeRates table and find the row with the date of 15th of the month\n var dateExchangeRates = \"\";\n try {\n dateExchangeRates = Banana.document.table(\"ExchangeRates\").findRowByValue(\"Date\", stringDate).value(\"Date\");\n } catch(e){\n //The row doesn't exists\n }\n\n if (dateExchangeRates === stringDate) { // there is the 15th of the month\n // should be 15 of the month\n if (Banana.compareVersion && Banana.compareVersion(Banana.application.version, requiredVersion) >= 0) {\n //Return Object with properties 'date' and 'exchangeRate'\n line.exchangerate = Banana.document.exchangeRate(\"CHF\", stringDate).exchangeRate;\n } else {\n //Return value\n line.exchangerate = Banana.document.exchangeRate(\"CHF\", stringDate);\n }\n //Banana.console.log(\"[Y] \" + line.date + \"; \" + stringDate + \"; \" + line.exchangerate);\n\n // /* possible future API then return the date */\n // if (typeof line.exchangerate === \"object\") {\n // line.exchangerate = line.exchangerate.exchangeRate;\n // line.exchangerateDate = line.exchangerate.date;\n // }\n\n }\n else { // there is not the 15th of the month\n // should be the previous? the transaction date?\n if (Banana.compareVersion && Banana.compareVersion(Banana.application.version, requiredVersion) >= 0) {\n //Return Object with properties 'date' and 'exchangeRate'\n line.exchangerate = Banana.document.exchangeRate(\"CHF\", line.date).exchangeRate;\n } else {\n //Return value\n line.exchangerate = Banana.document.exchangeRate(\"CHF\", line.date);\n }\n //Banana.console.log(\"[N] \" + line.date + \" : \" + line.exchangerate); \n }\n }\n\n line.vattaxableCHF = convertBaseCurrencyToCHF(line.vattaxable, line.exchangerate);\n line.vatamountCHF = convertBaseCurrencyToCHF(line.vatamount, line.exchangerate);\n line.vatpostedCHF = convertBaseCurrencyToCHF(line.vatposted, line.exchangerate);\n line.amountCHF = convertBaseCurrencyToCHF(line.amount, line.exchangerate);\n\n transactions.push(line); \n }\n }\n }\n return transactions;\n}",
"function findSalesOrder(extId) {\r\n\r\n var aSearchFilters = new Array();\r\n aSearchFilters.push(new nlobjSearchFilter('externalid', null, 'is', extId));\r\n aSearchFilters.push(new nlobjSearchFilter('type', null, 'is', 'SalesOrd'));\r\n aSearchFilters.push(new nlobjSearchFilter('mainline', null, 'is', 'T'));\r\n //aSearchFilters.push(new nlobjSearchFilter('internalid', 'item', 'is', prodId));\r\n\r\n var aSearchColumns = new Array();\r\n aSearchColumns.push(new nlobjSearchColumn('internalid'));\r\n aSearchColumns.push(new nlobjSearchColumn('type'));\r\n\r\n var aSearchResults = nlapiSearchRecord('transaction', null, aSearchFilters, aSearchColumns);\r\n if (aSearchResults) {\r\n return aSearchResults[0].getId();\r\n } else {\r\n return 0;\r\n }\r\n\r\n}",
"function printAccountHistoryWithFilter(accountNo, transactionType){\n console.log(\"Transaction history for account: \" + accountNo + \", Transaction type: \" + transactionType);\n arrOfTransacions.forEach(function(tran){\n if(tran.sourceAccount == accountNo && tran.tranType == transactionType){\n console.log(util.inspect(tran, false, null))\n }\n });\n}",
"async getApprovals(account, market_address) {\n const { options } = this.props;\n const weth_promise = await options.contracts.WETH.allowance(account, market_address);\n const dai_promise = await options.contracts.DAI.allowance(account, market_address);\n const sai_promise = await options.contracts.SAI.allowance(account, market_address);\n const mkr_promise = await options.contracts.MKR.allowance(account, market_address);\n return Promise.all([weth_promise, dai_promise, sai_promise, mkr_promise])\n }",
"async getLatest() {\n const result = await this.ctx.model.Coupon.findOne({\n order: [[\"CreateTime\", 'DESC']]\n });\n return result;\n }",
"function getLastRecordData() {\n\n var conn = new mssql.ConnectionPool(dbconfig);\n var result = [];\n var requst = new mssql.Request(conn);\n conn.connect(function (err) {\n if (err) {\n console.log(err);\n return;\n }\n requst.query(\"SELECT TOP 1 * FROM Suppliers ORDER BY SupplierID DESC\", function (err, records) {\n if (err) {\n console.log(err);\n return;\n }\n else {\n for (var id in records.recordset) {\n result.push({\n SupplierID: records.recordset[id].SupplierID,\n });\n\n }\n }\n conn.close();\n });\n });\n return result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get currency from the current tier, or fallback on collective currency | getCurrency() {
const tier = this.getTier();
return get(tier, 'currency', this.props.data.Collective.currency);
} | [
"function getCurrency(){\n //selected currencies\n fromCurr = selects[0].selectedOptions[0].textContent;\n toCurr = selects[1].selectedOptions[0].textContent;\n \n //get currency code according to currency name\n if(fromCurr !== ''){\n const index = currencies.findIndex((obj) => obj.currency_name == fromCurr);\n base = currencies[index].currency_code;\n }\n\n if(toCurr !== ''){\n const index = currencies.findIndex((obj) => obj.currency_name == toCurr);\n rateKey = currencies[index].currency_code;\n }\n}",
"function getCurrency(amount) {\n\tvar fmtAmount;\n\tvar opts = {MinimumFractionDigits: 2, maximumFractionDigits: 2};\n\tif (selectedCurrency === \"CAD\") {\n\t\tfmtAmount = \"CAD $\" + amount.toLocaleString(undefined, opts);\n\t} else if (selectedCurrency === \"USD\") {\n\t\tfmtAmount = \"USD $\" + (amount * currencyRates.USD).toLocaleString(undefined, opts);\n\t} else if (selectedCurrency === \"MXN\") {\n\t\tfmtAmount = \"MXN ₱\" + (amount * currencyRates.MXN).toLocaleString(undefined, opts);\n\t} else {\n\t\tthrow \"Unknown currency code: this shouldn't have happened.\";\n\t}\n\treturn fmtAmount;\n}",
"static getDecimalDigits(currency) {\n if (global.companyData.common.currencies != undefined) {\n let objCurrency = global.companyData.common.currencies.filter(currencyConfig => currencyConfig.code == currency);\n if (objCurrency.length > 0)\n return objCurrency[0].decimaldigits;\n }\n return 2;\n }",
"function GetRates(currency, value){\n\tvar valueRate;\n\tif(currency != \"COP\"){\n\t\tvar rates = dbRates.getAllRates();\n\t\tvar f1 = new Date();\n\t\tvar f2;\n\t\tf1.setHours(0,0,0,0);\n\t\tfor (var i = 0; i < rates.length;i++) {\n\t\t\tif(rates[i].nombre === currency){\n\t\t\t\tvar res = rates[i].fecha.split(\"-\");\n\t\t\t\tf2 = new Date(res[0], res[1]-1, res[2]);\n\t\t\t\tf2.setHours(0,0,0,0);\n\t\t\t\t//If the exchange rate is not updated, call the api and update\n\t\t\t\tif (f1.getTime() != f2.getTime()){\n\t\t\t\t\trates[i].fecha = \"\"+f1.getFullYear() + \"-\" + (f1.getMonth() +1) + \"-\" +f1.getDate();\n\t\t\t\t\trates[i] = updateRate(rates[i]);\n\t\t\t\t}\n\t\t\t\tvalueRate = rates[i].value * value;\n\t\t\t\treturn Number(valueRate).toFixed(3);\n\t\t\t}\n\t\t}\n \t\treturn valueRate.toFixed(3);\n\t}else{\n\t\treturn value;\n\t}\n}",
"function findCurrencyInfo (account: EdgeAccount, currencyCode: string): EdgeCurrencyInfo | void {\n for (const pluginName in account.currencyConfig) {\n const { currencyInfo } = account.currencyConfig[pluginName]\n if (currencyInfo.currencyCode.toUpperCase() === currencyCode) {\n return currencyInfo\n }\n }\n}",
"function getPay(isCustomer) {\n return isCustomer ? \"$5.0\" : \"$7.0\";\n}",
"function formatCurrency(value, options={}) {\n\n if (value == null) {\n return null;\n }\n\n let maxDigits = options.digits || global_settings.PRICING_DECIMAL_PLACES || 6;\n let minDigits = options.minDigits || global_settings.PRICING_DECIMAL_PLACES_MIN || 0;\n\n // Extract default currency information\n let currency = options.currency || global_settings.INVENTREE_DEFAULT_CURRENCY || 'USD';\n\n // Extract locale information\n let locale = options.locale || navigator.language || 'en-US';\n\n let formatter = new Intl.NumberFormat(\n locale,\n {\n style: 'currency',\n currency: currency,\n maximumFractionDigits: maxDigits,\n minimumFractionDigits: minDigits,\n }\n );\n\n return formatter.format(value);\n}",
"static getCurrencyName(code) {\n let currencyName = this.getPhrase(code, \"CurrencyCode\");\n if (currencyName != \"\" && currencyName.length > 0)\n return currencyName;\n else\n return code;\n }",
"function findCurrencyRate (currency, data) {\nconsole.log(currency)\nlet currencyDataList = data.bpi;\nconsole.log(currencyDataList);\nreturn currencyDataList[currency].rate; \n}",
"convert(money, currency) {\n if (money.currency === currency) {\n return new Money(money.amount, money.currency)\n }\n\n const key = money.currency + '->' + currency\n const rate = this.exchangeRates.get(key)\n\n if (rate == null) throw new Error(`Missing exchange rate: ${key}`)\n return new Money(money.amount * rate, currency)\n }",
"function currencyConversor(value, currency) {\n let upperCaseCurrency = `${currency}`.toUpperCase();\n console.log('Last value update: July 10th 2021');\n\n if (value != Number) {\n console.log('The value typped is not a number');\n return;\n }\n\n switch (upperCaseCurrency) {\n case 'AMERICAN DOLLARS':\n let americanDollarsExchangeRate = 5.26;\n let americanDollarsresult = value * americanDollarsExchangeRate;\n\n console.log(\n `Your value of ${value} ${currency} equals ${americanDollarsresult} Brazilian Real`\n );\n break;\n case 'HONG KONG DOLLARS':\n let hongKongDollarsexchangeRate = 0.68;\n let hongKongDollarsresult = value * hongKongDollarsexchangeRate;\n\n console.log(\n `Your value of ${value} ${currency} equals ${hongKongDollarsresult} Brazilian Real`\n );\n break;\n default:\n console.log(\n `Please type the correct currency to converter to Brazilian Real. Available currencies:\n Hong Kong Dollars, American Dollars\n `\n );\n break;\n }\n}",
"function getCurrencies () {\n if ( $( \"#currency_eur_to_usd\" ).length != 0 ) {\n $.getJSON('/admin.json?token=get_currencies', function(json){\n $currency_eur_to_usd = json['currency_eur_to_usd']\n $currency_usd_to_byn = json['currency_usd_to_byn']\n $( \"#currency_eur_to_usd\" ).val(json['currency_eur_to_usd']);\n $( \"#currency_usd_to_byn\" ).val(json['currency_usd_to_byn']);\n });\n }\n}",
"function GetTierForChannel(channel, ChSignalHigh) {\n\tfor (var i=0; i<ChSignalHigh.length; i++) {\n\t\tif (channel==ChSignalHigh[i][1]) {\n\t\t\treturn ChSignalHigh[i][0]\n\t\t}\n\t}\n\treturn null\n}",
"calculateTradeAmount(side, curAQuantity, usdtQuantity, price, initService){\n //Buy - we need to calculate how much token we can get for our USDT\n if(side == process.env.BUY){\n //Trade a little bit less than we currently hold to ensure valid transaction\n let amount = 1 / price * usdtQuantity * 1000 / 1001;\n\n //All binance transactions require a maximum precision level or fail\n amount = amount.toFixed(initService.precision);\n return amount;\n } else if(side == process.env.SELL){\n let amount = curAQuantity * 1000 / 1001;\n amount = amount.toFixed(initService.precision);\n return amount;\n }\n }",
"function getFirstTier2() {\n\t\tvar firstTier2Object;\n\t\tvar firstTier2Level = 100;\n\t\tif (parallelSealsUsed > 0) {\n\t\t\tfor (var i=0; i<parallelSeals.length; i++) {\n\t\t\t\tif (parallelSeals[i]) {\n\t\t\t\t\tvar templevel = parallelSeals[i]['level'];\n\t\t\t\t\tif (templevel > 20 && templevel < firstTier2Level) {\n\t\t\t\t\t\tfirstTier2Level = templevel;\n\t\t\t\t\t\tfirstTier2Object = parallelSeals[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn firstTier2Object;\n\t\t}\n\t\telse return null;\n\t}",
"function getCountryFromRegionsMap(country) {\n for (var r in regionsMap) {\n var region = regionsMap[r];\n\n var countryCurrency = getCountryFromRegion(region, country);\n\n if (countryCurrency) {\n return countryCurrency;\n }\n }\n\n return null;\n}",
"function init() {\n utilsService.addDropdownOptions('from-currency', availableCurrencies);\n document.getElementById('amount').value = defaultAmount;\n getRates(selectedBase);\n}",
"async queryAPIforRate(currency, cryptocurrency){\n\t\t// Query the endpoint\n\t\tconst endpoint = await fetch(`https://api.coinmarketcap.com/v1/ticker/${cryptocurrency}/?convert=${currency}`);\n\n\t\t// Return as json\n\t\tconst result = await endpoint.json();\n\n\t\t// Return the object\n\t\treturn {\n\t\t\tresult\n\t\t}\n\t}",
"function get_currency_name(str) {\n return str.replace(` (${get_currency_code(str)})`, '');\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if dino hits cactus | function checkColision(cactus){
const dinoY = dino.style.bottom.split('px')[0]
const cactusX = cactus.offsetLeft;
if(cactusX <= divSize && cactusX >= -divSize && dinoY<= divSize){
//log(true)
inGame = false;
}else{
//log(false);
}
} | [
"has_ace() {\n if (this.mycards.includes(1)) return true;\n return false;\n }",
"function checkUEC(targetBlock) {\n if (targetBlock.id.equals('mekanism:ultimate_energy_cube')) {\n if (!!targetBlock.entityData.EnergyContainers[0]) {\n if (!!targetBlock.entityData.EnergyContainers[0].stored) {\n if (targetBlock.entityData.EnergyContainers[0].stored == 4096000000) {\n return true\n }\n }\n }\n }\n return false\n }",
"function checkColision(){\n return obstacles.obstacles.some(obstacle => {\n if(obstacle.y + obstacle.height >= car.y && obstacle.y <= car.y + car.height){\n if(obstacle.x + obstacle.width >= car.x && obstacle.x <= car.x + car.width){\n console.log(\"colision\")\n return true;\n }\n }\n return false;\n });\n}",
"collision(dino){\n if (!this.img||!dino.img) return false; \n if(!((this.y>(dino.y+dino.h))||(!this.left&&((this.x>=dino.x+dino.w-25)||(this.x<=dino.x+25)))||(this.left&&((this.x<=dino.x+25)||(this.x>=dino.x+dino.w-25))))){\n if(dino.shield) {\n setTimeout(()=>{dino.shield=false},500); \n return false; \n }\n return true;\n }\n }",
"function can_city_build_unit_now(pcity, punittype)\n{ \n return (pcity != null && pcity['can_build_unit'] != null \n && pcity['can_build_unit'][punittype['id']] == \"1\"); \n}",
"function canHandleTrPxMan() {\n\t\tvar c, s1, s2;\n\t\tc = document.createElement(\"canvas\");\n\t\tc.width = 2;\n\t\tc.height = 1;\n\t\tc = c.getContext('2d');\n\t\tc.fillStyle = \"rgba(10,20,30,0.5)\";\n\t\tc.fillRect(0,0,1,1);\n\t\ts1 = c.getImageData(0,0,1,1);\n\t\tc.putImageData(s1, 1, 0);\n\t\ts2 = c.getImageData(1,0,1,1);\n\t\treturn (s2.data[0] === s1.data[0] && s2.data[1] === s1.data[1] && s2.data[2] === s1.data[2] && s2.data[3] === s1.data[3]);\n\t}",
"checkCollisions(unit, detectCollision) {\n // check neighborhood for collisions\n return this.searchNeighborhood(unit, (u) => {\n return u.id !== unit.id && detectCollision(unit, u);\n });\n }",
"enCours() {\n return !this.estGagne() && !this.estPerdu();\n }",
"function cannonInBarrierBoolean(cannonBall){\n for(let i = 0; i < barriers.length; i++){\n let barrier = barriers[i];\n\n //Work out barrier edges\n let leftEdge = stageX + (barrier.x * stageDivPathWidth);\n let width = (stageDivPathWidth ) * barrier.length;\n let topEdge = stageY + (barrier.y * stageDivPathHeight);\n let height = stageDivPathHeight + 1;\n //Distance between circle centre & rectangle centre\n var distX = Math.abs(cannonBall.x - leftEdge - width/2);\n var distY = Math.abs(cannonBall.y - topEdge - height/2);\n //Too far apart to be colliding\n if (distX > (width/2 + cannonBall.radius)) { continue; }\n if (distY > (height/2 + cannonBall.radius)) { continue; }\n // SIDE COLLISIONS\n if (distX <= (width/2)) { return true} \n if (distY <= (height/2)) { return true }\n \n // CORNER COLLISIONS\n var dx=distX-width/2;\n var dy=distY-height/2;\n if (dx*dx+dy*dy<=(cannonBall.radius*cannonBall.radius)){\n return true\n }\n }\n return false;\n}",
"isChomsky() {\n return this.classify().includes(CLASS_CHOMSKY);\n }",
"verifyPC(pc) {\n return (0 <= pc / 4 && pc % 4 == 0);\n }",
"function isGameAgainstComp() {\n return !!document.getElementById('computer');\n}",
"function findCadence(chords) {\n\tif (chords[chords.length - 2] === \"V\" && chords[chords.length - 1] === \"I\") {\n\t\treturn \"perfect\";\n\t} else if (chords[chords.length - 2] === \"IV\" && chords[chords.length - 1] === \"I\") {\n\t\treturn \"plagal\";\n\t} else if (chords[chords.length - 2] === \"V\" && chords[chords.length - 1] !== \"I\") {\n\t\treturn \"interrupted\";\n\t} else if (chords[chords.length - 1] === \"V\") {\n\t\treturn \"imperfect\";\n\t} else return \"no cadence\";\n}",
"function checkHit() {\r\n \"use strict\";\r\n // if torp left and top fall within the ufo image, its a hit!\r\n let ymin = ufo.y;\r\n let ymax = ufo.y + 65;\r\n let xmin = ufo.x;\r\n let xmax = ufo.x + 100;\r\n\r\n\r\n console.log(\"torp top and left \" + torpedo.y + \", \" + torpedo.x);\r\n console.log(\"ymin: \" + ymin + \"ymax: \" + ymax);\r\n console.log(\"xmin: \" + xmin + \"xmax: \" + xmax);\r\n console.log(ufo);\r\n\r\n if (!bUfoExplode) {\r\n // not exploded yet. Check for hit...\r\n if ((torpedo.y >= ymin && torpedo.y <= ymax) && (torpedo.x >= xmin && torpedo.x <= xmax)) {\r\n // we have a hit.\r\n console.log(\" hit is true\");\r\n\r\n bUfoExplode = true; // set flag to show we have exploded.\r\n }// end if we hit\r\n\r\n }// end if not exploded yet\r\n\r\n // reset fired torp flag\r\n bTorpFired = false;\r\n\r\n // call render to update.\r\n render();\r\n\r\n}// end check hit",
"function C006_Isolation_Yuki_CheckToEat() {\n\t\n\t// Yuki forces the player if she has the egg\n\tif (C006_Isolation_Yuki_EggInside) {\n\t\tOverridenIntroText = GetText(\"LickEgg\");\n\t\tGameLogAdd(\"Pleasure\");\n\t\tC006_Isolation_Yuki_CurrentStage = 200;\n\t}\n\n\t// Yuki forces the player if she's dominant\n\tif (ActorGetValue(ActorSubmission) <= -3) {\n\t\tOverridenIntroText = GetText(\"LickSub\");\n\t\tGameLogAdd(\"Pleasure\");\n\t\tC006_Isolation_Yuki_CurrentStage = 200;\n\t}\n\n}",
"function checkCid(cid){\r\n let len = cid.length, amount = 0, noCash = 0\r\n for (let i = 0; i < len; i++){\r\n if (cid[i][1] == 0){\r\n noCash += 1\r\n } else{\r\n amount += cid[i][1]\r\n }\r\n }\r\n if (noCash == len){\r\n return {cash: false, amount: amount}\r\n } else return {cash: true, amount: amount}\r\n}",
"function hasCEO () {\n for (const _id of Object.keys(DATABASE)) {\n if (CEORegex.test(DATABASE[_id].role)) return true;\n }\n return false;\n}",
"function chair(x, conf){\n\t\tfor (var i=0; i < x.committees.length; i++){\n\t\t\tvar committee = x.committees[i];\n\t\t\tif (!withinRange(committee)) continue;\n\t\t\tif (committee.conference.series == conf && x.committees[i].role.indexOf(\"Chair\") != -1){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"function massHysteria(c, d) {\n let c = cats;\n let d = dogs;\n\n if (d.raining === true && c.raining === true) {\n console.log ('DOGS AND CATS LIVING TOGETHER! MASS HYSTERIA!')\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Goes to the next icon | goToNextIcon() {
let current = this.currentIcon.name();
let next = this.nextIcon[current];
this.currentIcon = this.icons[next];
this.controlText(this.currentIcon.name().replace(/([A-Z])/g, '$1'));
this.changeContent(next);
return this.currentIcon;
} | [
"function nextClicked() {\n if (currentFeed && currentItemIndex < currentFeed.items.size - 1) {\n currentItemIndex++;\n displayCurrentItem();\n }\n }",
"function handleNextBtn() {\n // Move the pointer back\n util.movePtr(\"next\");\n\n // Extract the index and url at ptr using object deconstruction\n const { idx, url } = ptr.value;\n\n // Update the index\n util.updateIdx(idx);\n\n // Update the carousel's image\n util.updateImage(url);\n }",
"function goToNextImage() {\n clearInterval(automaticSlideInstance);\n var oldIndex = currentIndex;\n var oldDot = carouselNavigationContainer[oldIndex];\n\n currentIndex = (currentIndex + 1) % numberOfImages;\n var currentDot = carouselNavigationContainer[currentIndex];\n\n changeNavigationDot(oldDot, currentDot);\n\n animateSlide(oldIndex, currentIndex);\n\n setTimeout(automaticSlide, 0);\n\n}",
"function goNext( relatedToScreen ) {\n\tdisable();\n\tif(currentScreenNo < noOfScreens) {\n\t\tautobookmark();\n\t\tcurrentScreenNo++;\n\t\tvar contentFolder = ( typeof(relatedToScreen) != \"undefined\" && relatedToScreen )\n\t\t\t? ''\n\t\t\t: getContentFolderName() + '/';\n\t\tframes['myFrame'].location.href = contentFolder + currentScreenNo+ '.htm';\n\t\t//alert(\"going to screen no: \" + currentScreenNo);\n\t\tif(currentScreenNo == noOfScreens) {\n\t\t $('#next_link').attr( 'class', 'navigationButton buttonExit' );\n\t\t\tonLastScreen();\n\t\t\tsubmitCompletion();\n\t\t}\t\t\n\t} else {\n\t\t// send completion signal to LMS\n\t\ttop.close();\n\t}\n\trefreshCounter();\n}",
"function onNextButtonClick() {\n\t\tgotoNextSlide()\n\t}",
"selectNext () {\n // if current tab is the last tab\n if (this.currentTab === (this.tabs.length - 1)) {\n // select first\n this.currentTab = 0;\n } else {\n // select next\n this.currentTab += 1;\n }\n this.tabs[this.currentTab].focus();\n }",
"function CtrlGoToNextCoupon() {\n var nextCouponId , nextCoupon;\n //we get the id of the current coupon. so we can determine the next coupon.\n nextCoupon = UICtrl.getExpandedCoupon().nextElementSibling;\n nextCouponId = nextCoupon.id;\n \n CtrlShrinkCoupon();\n openNextCoupon(nextCouponId);\n updateTotal();\n\n if(jackpotCtrl.hasCoupon(nextCouponId)){\n checkedFields = 4;\n UICtrl.showNextCouponButton();\n UICtrl.showDeleteAllButton(); // we wanna be albe to uncheck all the fields , if there are checked.\n } \n else { checkedFields = 0; UICtrl.fieldsClickable(); }\n }",
"function setNextItemActive() {\n var items = getItems();\n\n var activeItem = document.getElementsByClassName(\"active\")[0];\n var nextElement = activeItem.nextElementSibling;\n\n if (!nextElement) {\n nextElement = items[0];\n }\n\n changeActiveState(activeItem, nextElement);\n}",
"function nextSlide(step) {\n pos = Math.min(pos + step, 0);\n setTransform();\n }",
"function showNext() {\n if (currentQuestion === TOTAL_QUESTIONS) {\n // Provide a function to call when the\n // fade animation is finished\n $(\"#scoreQuizButton\").fadeIn(scrollDown);\n } else {\n // Set up the next question\n currentQuestion++;\n // Provide a function to call when the\n // slide animation is finished\n $(\"#q\" + currentQuestion).slideToggle(scrollDown);\n }\n }",
"function rotate() {\n $('#next').click();\n }",
"function next () {\r\n return this.siblings()[this.position() + 1]\r\n}",
"function forceNext() {\n\tmarkPageComplete();\n\t$('#navNext').trigger('click');\t\n\treturn false;\n}",
"showNextCard(target, dataStorage, nodes) {\n if (target.id === 'modal-next') {\n counter++;\n if (counter >= dataStorage.length - 1) {\n target.style.display = 'none';\n } else {\n target.previousElementSibling.style.display = '';\n }\n this.updateModal(dataStorage[counter], nodes);\n } else if (target.id === 'modal-prev') {\n counter--;\n if (counter <= 0) {\n target.style.display = 'none';\n } else {\n target.nextElementSibling.style.display = '';\n }\n this.updateModal(dataStorage[counter], nodes);\n }\n }",
"function nextSlideOrElt()\n{\n /* Mark the current incremental element, if any, as visited. */\n if (incrementals.cur >= 0) {\n incrementals[incrementals.cur].classList.add(\"visited\");\n incrementals[incrementals.cur].classList.remove(\"active\");\n }\n\n if (incrementals.cur + 1 < incrementals.length) {\n /* There is a next incremental element. Make it active. */\n incrementals.cur++;\n incrementals[incrementals.cur].classList.add(\"active\");\n\n /* Make screen readers announce the newly displayed element */\n liveregion.innerHTML = \"\";\t\t// Make it empty\n liveregion.appendChild(cloneNodeWithoutID(incrementals[incrementals.cur]));\n\n } else {\n /* There is no next incremental element. So go to next slide. */\n nextSlide();\n }\n}",
"function privateNext() {\n\t \timageCurrent++;\n\t \tif (imageCurrent > image.length - 1) {\n\t \t\timageCurrent = 0;\n\t \t\tcontainer.animate({left: \"+=\" + (sliceWidth * image.length - sliceWidth)}, speedSlice);\n\t \t} else {\n\t \t\tcontainer.animate({left: \"-=\" + sliceWidth}, speedSlice);\n\t \t}\n\t }",
"function nextPhoto() {\n\tstoryIndex++; // <-- increase index\n\n\t// if we've reached the end of the array...\n\tif (storyIndex == storyParts.length) {\n\t\tstoryIndex--; // <-- decrement index to stay in-bounds\n\n\t\t// if another story-piece is available...\n\t} else {\n\t\ttextAreaEl.value = storyParts[storyIndex]; // <-- change textArea to\n\t\t\t\t\t\t\t\t\t\t\t\t\t// new dialogue\n\t\timgEl.src = \"pup_imgs/\" + imgParts[storyIndex] + \".jpg\"; // <--\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// update\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// image\n\t}\n}",
"function nextKnCell(e){\n\tvar previousKnCell = keynapse.currentKnCell;\n\tpreviousKnCell.knCellHint.removeClass('kn-cell-hint-current');\n\n\tvar currentKnCell;\n\tif (keynapse.currentKnCellIndex == keynapse.knCells.length - 1 ){\n\t\tkeynapse.currentKnCellIndex = 0;\n\t\tkeynapse.currentKnCell = keynapse.knCells[keynapse.currentKnCellIndex];\n\t\tcurrentKnCell = keynapse.currentKnCell;\n\t} else {\n\t\tkeynapse.currentKnCell = keynapse.knCells[++keynapse.currentKnCellIndex];\n\t\tcurrentKnCell = keynapse.currentKnCell;\n\t}\n\t\n\tcurrentKnCell.knCellHint.addClass('kn-cell-hint-current');\n}",
"function nextButton() {\n $('#next').click(function() {\n // increment current question number\n questionNumber++;\n //check if we are out of questions\n if (questionNumber<QUIZ.length) {\n //remove old question\n $('.question-page').empty();\n $('.question-result').empty();\n buildCurrentQuestion();\n askQuestion();\n } else {\n finalResults();\n }\n });\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sample custom transition using scrollUp effect inspired by Karl Swedberg's Scroll Up Headline Reader jQuery Tutorial[1] [1] | function transitionScrollUp( $from, $to ) {
var cheight = $from.outerHeight();
// hide scrollbar during animation
$( 'body' ).css( 'overflow-y', 'hidden' );
$to.css( 'top', cheight+'px' );
$to.show();
$from.animate( {top: -cheight}, 'slow' );
$to.animate( {top: 0}, 'slow', function() {
$from.hide().css( 'top', '0px');
// restore possible scrollbar
$( 'body' ).css( 'overflow-y', 'auto' );
});
} | [
"scrollUp() {\n let x = this.scrollElement.scrollLeft;\n let y = this.scrollElement.scrollTop - this.scrollElement.clientHeight;\n this._scrollTo(x, y);\n }",
"function scrollUp(){\n startY += 15;\n createSVGOutput();\n}",
"function scrollUp(amount) {\n moveTo(current + amount);\n scope.selected = item();\n }",
"function goUp() {\n if (currentSectionIndex > 0) {\n goToSection(currentSectionIndex - 1);\n }\n }",
"function SlideVerticallyTransition() {}",
"function headerNavScroll() {\n var scrollTop = $(window).scrollTop();\n var delta = scrollTop - prevScrollTop;\n\n if (scrollTop === 0) {\n $('.header-nav').removeClass('fixed');\n $('.header-nav').removeClass('slider-up');\n $('.header-nav').addClass('slider-down');\n } else {\n $('.header-nav').addClass('fixed');\n\n if (delta > 0) {\n if (Math.abs(delta) > 5) {\n $('.header-nav').removeClass('slider-down');\n $('.header-nav').addClass('slider-up');\n }\n } else {\n if (Math.abs(delta) > 5) {\n $('.header-nav').removeClass('slider-up');\n $('.header-nav').addClass('slider-down');\n }\n }\n }\n\n prevScrollTop = scrollTop;\n }",
"function imageCubePrev(scrollPos,apiSpritespin) {\n\tif(scrollPos < startAnimateCube.step) {\n\t\tapiSpritespin.prevFrame();\n\t\tstartAnimateCube.step -= 100;\n\t}\n} //end func",
"function scrollDown(){\n startY -= 15;\n createSVGOutput();\n}",
"function scrollUpViewport(event)\n{\n \tvar viewportHeight = window.innerHeight;\n \tvar heightOffset = window.pageYOffset;\n \tvar yCoord = event.clientY;\n \tvar xCoord = event.clientX;\n \tvar tolerance = 40;\n\n \tif (yCoord + tolerance > viewportHeight)\n \t{\n \t\tvar scrollTarget = yCoord + heightOffset - viewportHeight + tolerance;\n \t\tvar currentScrollPosition = yCoord + heightOffset - viewportHeight;\n \t\twhile (scrollTarget > currentScrollPosition)\n \t\t{\n \t\t\twindow.scrollTo(0, currentScrollPosition);\n \t\t\tcurrentScrollPosition += 2;\n \t\t}\n \t}\n}",
"function workAni() {\n workAnimation = true;\n t = 1200;\n\n if (scrollUp === true) {\n if (workNumber === 1) {\n endWork(); \n t = 800;\n } \n else {\n nextWorkNumber = workNumber - 1;\n prevWork(); \n } \n } else {\n if (workNumber === finalWorkNumber) {\n endWork(); \n t = 800;\n } \n else {\n nextWorkNumber = workNumber + 1;\n nextWork();\n }\n }\n\n //--- wait till ready for next input\n setTimeout(function(){\n workAnimation = false;\n }, t);\n }",
"function createInfiniteSections(v){// Scrolling down\nif(!v.isMovementUp){// Move all previous sections to after the active section\nafter($(SECTION_ACTIVE_SEL)[0],prevAll(v.activeSection,SECTION_SEL).reverse());}else{// Scrolling up\n// Move all next sections to before the active section\nbefore($(SECTION_ACTIVE_SEL)[0],nextAll(v.activeSection,SECTION_SEL));}// Maintain the displayed position (now that we changed the element order)\nsilentScroll($(SECTION_ACTIVE_SEL)[0].offsetTop);// Maintain the active slides visible in the viewport\nkeepSlidesPosition();// save for later the elements that still need to be reordered\nv.wrapAroundElements=v.activeSection;// Recalculate animation variables\nv.dtop=v.element.offsetTop;v.yMovement=getYmovement(v.element);return v;}",
"function SlideHorizontallyTransition() {}",
"function scrollearHero(){\r\n\t$(\"#logo path\").css(\"fill\",\"white\");\r\n\t$hero.css(\"height\", \"30vh\").css(\"marginTop\",\"100px\");\r\n\tvar altBegins = $(\".batmanBegins\").offset().top - $(\".mainHeader .mainNav\").height()-50;\r\n\t$(\"html,body\").animate({scrollTop:altBegins},1500);\r\n\t$(\".hero h1:nth-of-type(2)\").css(\"top\", \"57%\").css(\"font-size\",\"1.3rem\");\r\n\t$(\".hero h1:nth-of-type(1)\").css(\"top\", \"52%\").css(\"font-size\",\"1.2rem\");\r\n\t$icoArrow.css(\"display\", \"none\");\r\n\t$(\".hero div\").css(\"display\", \"block\").css(\"opacity\", \"1\");\r\n\t$(\".wrapperHero\").css(\"transform\", \"translateY(-80%)\")\r\n}",
"function mUnfadeAndScrollTo() {\n\tgetId('t' + currTact).classList.remove(\"faded\");\n\t$('html, body').animate({\n\t\tscrollTop: parseInt($('#t' + currTact).offset().top - 70)\n\t}, speed);\n}",
"function Pop_scroll_up()\r\n{\r\n pop_button_index = pop_button_index-pop_button_num_limit;\r\n drawControl();\r\n}",
"function learnMore() {\n $('html, body').animate({\n scrollTop: $('#ps-home-description').offset().top + 'px'\n }, 'slow');\n }",
"function topButtonClickListener() {\n\t\t$('#nav-up-button').on('click', () => {\n $('html, body').animate({ \n scrollTop: 0\n }, 'slow');\n\t\t});\n\t}",
"upSlider() {\n this.y -= this.sliderSpeed;\n this.y = (this.y < 0 ? 0 : this.y);\n }",
"function animateMexicanDude () {\n\t//console.log(\"Scroll Occured\");\n\t//console.log(mexicanDude.src);\n\n\tif (MDframe === 1) {\n\t\tmexicanDude.src = MDsrc2;\n\t} else {\n\t\tmexicanDude.src = MDsrc1;\n\t}\n\n\tMDframe = MDframe * -1;\n\t//console.log(\"Frame: \" + MDframe);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Ajax call for infoWindow's contents | function infoWindowContents(index, data) {
var restaurant = data.restaurants[index];
var mymap = data.restaurants[index].mymap;
$.ajax({
type: 'GET',
url: '/home/info_window',
data: {
id: restaurant.id,
mymap_id: mymap.id
}
});
} | [
"function showInfoWindow() {\n var marker = this;\n hotels.getDetails({placeId: marker.placeResult.place_id}, function(place, status) {\n if (status !== google.maps.places.PlacesServiceStatus.OK) {\n return;\n }\n hotelInfoWindow.open(hotelMap, marker);\n buildIWContent(place);\n });\n}",
"function showInfo(marker, content)\n{\n \n // start div\n var div = \"<div id='info'>\";\n if (typeof(content) === \"undefined\")\n {\n // http://www.ajaxload.info/\n div += \"<img alt='loading' src='img/ajax-loader.gif'/>\";\n }\n else\n {\n div += content;\n }\n\n // end div\n div += \"</div>\";\n\n // set info window's content\n info.setContent(div);\n\n // open info window (if not already open)\n info.open(map, marker);\n \n // if report error button is clicked, open error form\n $( \"#report-error\" ).button().on( \"click\", function() {\n displayForm();\n });\n \n}",
"function openMarkers(){\n infoWindow.setContent(info);\n animation();\n infoWindow.open(map,marker)\n }",
"function ajax_gethtml(){\r\n\tif(arguments.length == 0) return false;\r\n\tvar url = arguments.length > 0 ? arguments[0] : \"\";\r\n\tvar show = arguments.length > 1 ? arguments[1] : \"\";\r\n\tvar tip = arguments.length > 2 ? arguments[2] : \"\";\r\n\tvar loading = arguments.length > 3 ? arguments[3] : \"\";\r\n\tvar loaded = arguments.length > 4 ? arguments[4] : \"\";\r\n\tvar interactive = arguments.length > 5 ? arguments[5] : \"\";\r\n\tvar completed = arguments.length > 6 ? arguments[6] : \"\";\r\n\tvar ajax = new jieqi_ajax();\r\n\tajax.method = \"GET\";\r\n\tajax.requestFile = url;\r\n\tif(tip != \"\"){\r\n\t\t$(tip).innerHTML = \"\";\r\n\t\t$(tip).style.display = \"\";\r\n\t\tif(loading != \"\") ajax.onLoading = function(){$(tip).innerHTML = loading;};\r\n\t\tif(loaded != \"\") ajax.onLoaded = function(){$(tip).innerHTML = loaded;};\r\n\t\tif(interactive != \"\") ajax.onInteractive = function(){$(tip).innerHTML = interactive;};\r\n\t\tajax.onError = function() {$(tip).innerHTML = \"ERROR:\"+ajax.responseStatus[1]+\"(\"+ajax.responseStatus[0]+\")\";};\r\n\t\tajax.onFail = function() {$(tip).innerHTML = \"Your browser does not support AJAX!\";};\r\n\t}\r\n\tajax.onCompletion = function(){\r\n\t\tif(tip != \"\"){\r\n\t\t\tif(completed != \"\") $(tip).innerHTML = completed;\r\n\t\t\telse if(tip != show){\r\n\t\t\t\t$(tip).innerHTML = \"\";\r\n\t\t\t\t$(tip).style.display = \"none\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$(show).innerHTML = ajax.response;\r\n\t};\r\n\tajax.runAJAX();\r\n}",
"function show_issues(){\r\n\t\t\tvar xhttp = new XMLHttpRequest();\r\n\t\t\txhttp.onreadystatechange = function(){\r\n\t\t\t\tif(this.readyState == 4 && this.status == 200){\r\n\t\t\t\t\tdocument.getElementById('issues').innerHTML = this.responseText;\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\txhttp.open(\"POST\", \"getissues.php\", true);\r\n\t\t\txhttp.send();\r\n}",
"function displayDetailedInfo(info) {\n $('#info-title').html(info[0]);\n $('#infobox-detailed-content').html(info[1]);\n $('#infobox-detailed').show();\n}",
"function populateInfoWindow(marker, infowindow) {\n infowindow.marker = marker;\n infoWindowContent = \"<h1 class='header'>Popular in \" + marker.title + \"</h1></div>\";\n var infoWindowContent1 = \"\";\n var infoWindowContent2 = \"\";\n var url1 = \"https://openlibrary.org/search.json?q=\"+marker.book;\n var url2 = \"https://www.googleapis.com/books/v1/volumes?q=\"+marker.book;\n var ajax1 = $.ajax({ \n dataType: \"json\",\n url: url1\n }).done(function (response) {\n console.dir(response);\n var author = response.docs[0].author_name[0];\n var title = response.docs[0].title_suggest;\n console.log(author);\n\n infoWindowContent1 = infoWindowContent1.concat(\"<div><p class='content'>Book name: \"+title+\"</p>\");\n infoWindowContent1 = infoWindowContent1.concat(\"<p class='content'>Author: \"+author+\"</p>\");\n }).fail(function (jqXHR, textStatus) {\n console.log(jqXHR);\n console.log(textStatus);\n var content = \"<p>Error - Cannot connect to Google Books! Please check your connection or try again later</p></div></div>\";\n infoWindowContent1 = infoWindowContent1.concat(content);\n });\n \n var ajax2 = $.ajax({ \n dataType: \"json\",\n url: url2\n }).done(function (response) {\n console.dir(response);\n var imageUrl = response.items[0].volumeInfo.imageLinks.thumbnail;\n\n infoWindowContent2 = infoWindowContent2.concat(\"<img class='img' src=\\\"\"+imageUrl+\"\\\"></div>\");\n infoWindowContent2 = infoWindowContent2.concat(\"<p class='content'>Sources: <br><a href=\\\"https://books.google.com/\\\">books.google.com</a><br><a href=\\\"https://openlibrary.org/\\\">openlibrary.org</a></p>\"); \n }).fail(function (jqXHR, textStatus) {\n console.log(jqXHR);\n console.log(textStatus);\n var content = \"<p>Error - Cannot connect to OpenLibrary! Please check your connection or try again later</p></div></div>\";\n infoWindowContent2 = infoWindowContent2.concat(content);\n });\n\n $.when( ajax1 , ajax2 ).done(function( a1, a2 ) {\n infoWindowContent = infoWindowContent.concat(infoWindowContent1);\n infoWindowContent = infoWindowContent.concat(infoWindowContent2);\n infowindow.setContent(infoWindowContent);\n infowindowopen = infowindow;\n infowindow.open(map, marker);\n }); \n \n // Make sure the marker symbol is set to default if the infowindow is closed.\n infowindow.addListener('closeclick',function(){\n infowindowopen = null;\n marker.setAnimation(null);\n marker.setIcon(defaultIcon);\n infowindow.close();\n });\n }",
"function showCurrentInfoBox() {\n\n var desc = current.address + '<br>';\n\n desc += '<strong>' + current.phone + '</strong><br><br>';\n desc += '<img src=\"' + current.ratingimage + '\"> <small>Based on ' + current.reviews + ' reviews</small><br>';\n desc += '<a href=\"' + current.url + '\">Read Reviews on Yelp</a>';\n\n var html = '<table><tr><td valign=\"top\"><img src=\"' + current.photo + '\"></td><td valign=\"top\" style=\"padding-left: 5px\">' + desc + '</td></tr></table>';\n\n $('#name').html(current.title);\n\n $('#yelpLink').html('<a href=\"' + current.url + '\">Read Reviews on Yelp</a>');\n $('#bingLink').html('<a href=\"http://www.bing.com/maps/?v=2&where1=' + current.url_address + '\">Map it on Bing</a>');\n $('#address').html(current.address);\n\n createInfobox(current.latitude, current.longitude, current.title, html);\n }",
"function showMapDetails() {\n\tvar mapInfo = this.parentNode;\n\tvar id = mapInfo.getAttribute(\"data-id\");\n\tvar map = mapInfo.parentNode;\n\topenMap = map;\n\n\t// Create transparent overlay and append to page\n\tvar overlay = document.createElement(\"div\");\n\toverlay.id = \"overlay\";\n\tdocument.body.appendChild(overlay);\n\n\t// Create map details area and append to page\n\tvar overlayArea = document.createElement(\"div\");\n\toverlayArea.id = \"overlayArea\";\n\tdocument.body.appendChild(overlayArea);\n\n\t// User can press the escape key to close the details\n\tdocument.onkeydown = function(e) {\n\t\tif (e.keyCode == 27) { // 27 is the key code for the escape key\n\t\t\tcloseMapDetails();\n\t\t}\n\t};\n\n\t// AJAX stuff\n\tvar http = new XMLHttpRequest();\n\tvar url = \"//\" + hostname + \"/etc/fetchMap.php\";\n\thttp.open(\"GET\", url + \"?id=\" + id, true);\n\thttp.onreadystatechange = function() {\n\t\tif (http.readyState == 4) {\n\t\t\tif (http.status == 200) {\n\t\t\t\t// Create and append Close button\n\t\t\t\tvar closeButton = document.createElement(\"button\");\n\t\t\t\tcloseButton.className = \"close\";\n\t\t\t\tvar closeAriaSpan = document.createElement(\"span\");\n\t\t\t\tcloseAriaSpan.setAttribute(\"aria-hidden\", true);\n\t\t\t\tcloseAriaSpan.innerHTML = \"×\";\n\t\t\t\tcloseButton.appendChild(closeAriaSpan);\n\t\t\t\tvar srOnlySpan = document.createElement(\"span\");\n\t\t\t\tsrOnlySpan.className = \"sr-only\";\n\t\t\t\tsrOnlySpan.textContent = \"Close\";\n\t\t\t\tcloseButton.appendChild(srOnlySpan);\n\t\t\t\tcloseButton.onclick\t= closeMapDetails;\n\t\t\t\toverlayArea.appendChild(closeButton);\n\n\t\t\t\t// Create and append the Star button\n\t\t\t\tvar starButton = document.createElement(\"button\");\n\t\t\t\tstarButton.onclick = starMap;\n\t\t\t\tstarButton.id = \"starButton\";\n\t\t\t\tstarButton.value = id;\n\t\t\t\tstarButton.classList.add(\"btn\");\n\t\t\t\tstarButton.classList.add(\"btn-sm\");\n\t\t\t\tstarButton.textContent = \"Star \";\n\t\t\t\tvar starIcon = document.createElement(\"span\");\n\t\t\t\tstarIcon.id = \"starIcon\";\n\t\t\t\tstarIcon.classList.add(\"glyphicon\");\n\t\t\t\tif (checkStarred(id)) {\n\t\t\t\t\tstarIcon.classList.add(\"glyphicon-star\");\n\t\t\t\t\tstarButton.classList.add(\"btn-success\");\n\t\t\t\t} else {\n\t\t\t\t\tstarIcon.classList.add(\"glyphicon-star-empty\");\n\t\t\t\t\tstarButton.classList.add(\"btn-primary\");\n\t\t\t\t}\n\t\t\t\tstarButton.appendChild(starIcon);\n\t\t\t\toverlayArea.appendChild(starButton);\n\n\t\t\t\t// Creates the container for the map's details + image\n\t\t\t\tvar container = document.createElement(\"div\");\n\t\t\t\tcontainer.className = \"container-fluid\";\n\n\t\t\t\t// Gets the map details\n\t\t\t\tvar details = http.responseText.split(\"\\n\");\n\n\t\t\t\t// Appends the full map picture\n\t\t\t\tvar img = document.createElement(\"img\");\n\t\t\t\timg.className = \"img-rounded\";\n\t\t\t\timg.id = \"fullMapPic\";\n\t\t\t\tvar picSrc = \"//\" + hostname + \"/mapPics/\" + details[details.length - 1];\n\t\t\t\timg.src = picSrc;\n\t\t\t\timg.alt = \"Full map picture\";\n\t\t\t\tcontainer.appendChild(img);\n\n\t\t\t\t// Creates the container for the map's details\n\t\t\t\tvar detailsContainer = document.createElement(\"div\");\n\t\t\t\tdetailsContainer.className = \"container-fluid\";\n\t\t\t\tdetailsContainer.id = \"details\";\n\t\t\t\t// Because the picture is last, we go to one less than the length of the details array\n\t\t\t\tfor (var i = 0; i < details.length - 1; i++) {\n\t\t\t\t\t// Separate each line into its title and the detail itself\n\t\t\t\t\tvar rowTitle = details[i].split(\"|\")[0];\n\t\t\t\t\tvar detail = details[i].split(\"|\")[1];\n\t\t\t\t\tif (detail !== \"\") {\n\t\t\t\t\t\t// Create and append each row\n\t\t\t\t\t\tvar rowContainer = document.createElement(\"div\");\n\t\t\t\t\t\trowContainer.className = \"container-fluid\";\n\t\t\t\t\t\tvar row = document.createElement(\"div\");\n\t\t\t\t\t\trow.className = \"row\";\n\t\t\t\t\t\trowContainer.appendChild(row);\n\n\t\t\t\t\t\t// Create and append each label\n\t\t\t\t\t\tvar label = document.createElement(\"label\");\n\t\t\t\t\t\tlabel.className = \"col-sm-3\";\n\t\t\t\t\t\tlabel.textContent = \"Text on back\";\n\t\t\t\t\t\tlabel.textContent = rowTitle;\n\t\t\t\t\t\trow.appendChild(label);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create and append each detail\n\t\t\t\t\t\tvar item = document.createElement(\"div\");\n\t\t\t\t\t\titem.className = \"col-sm-9\";\n\t\t\t\t\t\tif (rowTitle == \"Year\" && detail == 0) {\n\t\t\t\t\t\t\titem.textContent = \"No year listed\";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\titem.textContent = detail;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (rowTitle == \"Width\" || rowTitle == \"Height\") {\n\t\t\t\t\t\t\titem.textContent += \" inches\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\trow.appendChild(item);\n\t\t\t\t\t\tdetailsContainer.appendChild(rowContainer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toverlayArea.appendChild(detailsContainer);\n\t\t\t\toverlayArea.appendChild(container);\n\t\t\t} else {\n\t\t\t\tcloseMapDetails();\n\t\t\t\talert(\"Failed to retrieve map details\");\n\t\t\t}\n\t\t}\n\t};\n\thttp.send(null);\n}",
"function ajaxChatContent() {\n $.ajax({\n url: CHAT_LIST_URL,\n data: \"chatversion=\" + chatVersion,\n dataType: 'json',\n timeout: 3000,\n success: function(data) {\n console.log(\"Server chat version: \" + data.version + \", Current chat version: \" + chatVersion);\n if (data.version !== chatVersion) {\n chatVersion = data.version;\n appendToChatArea(data.entries);\n }\n triggerAjaxChatContent();\n },\n error: function(error) {\n triggerAjaxChatContent();\n }\n });\n}",
"function LoadGymDetails(){\n\t\t$(loader).html('<i class=\"fa fa-spinner fa-4x fa-spin\">');\n\t\tvar id = $(DGYM_ID).attr( \"name\" );\n\t\t$.ajax({\n\t\t\turl: window.location.href,\n\t\t\ttype:'POST',\n\t\t\tdata:{autoloader:'true',action:'load_gym_details',type:'master',id:id},\n\t\t\tsuccess: function(data){\n\t\t\t\tdata = $.parseJSON(data);\n\t\t\t\tswitch(data){\n\t\t\t\t\tcase \"logout\":\n\t\t\t\t\t\tlogoutAdmin();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$(pf.gymoutDiv).html(data.htm);\n\t\t\t\t\t\t$(loader).hide();\n\t\t\t\t\t\t$(\".picedit_box\").picEdit({\n\t\t\t\t\t\t\timageUpdated: function(img){\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tformSubmitted: function(data){\n\t\t\t\t\t\t\t\twindow.setTimeout(function(){\n\t\t\t\t\t\t\t\t\t$('#myModal_Photo').modal('toggle');\n\t\t\t\t\t\t\t\t\tLoadGymDetails();\n\t\t\t\t\t\t\t\t},500);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tredirectUrl: false,\n\t\t\t\t\t\t\tdefaultImage: URL+ASSET_IMG+'No_image.png',\n\t\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t},\n\t\t\terror:function(){\n\t\t\t\talert(\"there was an error\");\n\t\t\t}\n\t\t});\t\n\t}",
"function getOutputDocument(out_doc_uid) {\r\n $.ajax({\r\n 'method': 'POST',\r\n 'url': '../psDevTools/controllers/devToolsAjax.php',\r\n 'data': {\r\n 'option': 'getOutputDocument',\r\n 'OUT_DOC_UID': out_doc_uid\r\n },\r\n success: function (response) {\r\n if (response.status == '1') {\r\n $(\"#titleModal\").append(response.data[0].OUT_DOC_TITLE);\r\n var detail = response.data[0].OUT_DOC_TEMPLATE;\r\n cmEditor.setOption('highlightSelectionMatches', { annotateScrollbar: true, searchInitalWord: 1, wordSearch: search })\r\n cmEditor.setOption('annotateScrollbar', true);\r\n cmEditor.setOption('mode', 'text/x-php');\r\n cmEditor.setSize('100%', '85%');\r\n cmEditor.setValue(detail);\r\n }\r\n }\r\n });\r\n}",
"function viewLatestAnn(){\n\tvar obj = {\"status\": \"active\"};\n\t$.ajax({\n\t\ttype: 'POST',\n\t\tdata: obj,\n\t\turl: 'process/viewLatestAnn.php',\n\t\tsuccess: function(data){\n\t\t\t$('.latest_announcemnt').html(data);\n\t\t},\n\t\terror: function(data){\n\t\t\talert(\"error in viewing latest announcements=>\"+data);\n\t\t}\n\t});\n}",
"function showPanelMembers() {\r\n xmlhttpPanel = createXMLHttpRequestHandler();\r\n xmlhttpPanel.onreadystatechange = function() {\r\n if (xmlhttpPanel.readyState == 4 && xmlhttpPanel.status == 200) {\r\n document.getElementById(\"panel_members\").innerHTML = \"\";\r\n $( \"#panel_members\" ).append(xmlhttpPanel.responseText);\r\n }\r\n };\r\n\r\n xmlhttpPanel.open(\"GET\",\"find_panel_members.php\", true);\r\n xmlhttpPanel.send();\r\n}",
"function waldoCarmen(){\n var request = xmlReq();\n request.open(\"GET\",\n \"http://messagehub.herokuapp.com/a3.json\",\n true);\n request.send();\n request.onreadystatechange = function(){\n if(request.readyState === 4 && request.status === 200){\n var locs = JSON.parse(request.responseText);\n for(var i = 0; i < 2; i++){\n if(typeof locs[i] != 'undefined'){\n var name = locs[i][\"name\"];\n WCpos[name] = new google.maps.LatLng(\n locs[i][\"loc\"][\"latitude\"],locs[i][\"loc\"][\"longitude\"]);\n var marker = new google.maps.Marker({\n position:WCpos[name],\n map:map});\n marker.setIcon(\"carmen.png\");\n marker.setTitle(name);\n if(name == \"Waldo\"){\n marker.setIcon(\"waldo.png\");\n }\n marker.setVisible(true);\n createWindow(marker,name);\n windows[name].setContent(locs[i][\"loc\"][\"note\"]);\n }\n }\n }\n }\n}",
"function initAlertsWindow(windowId){\r\n\tvar jqxhr = $.getJSON( \"nodes/getlocations.htm\", function(data, textStatus) {\r\n\t\tvar lastLat=0;\r\n\t\tvar lastLong=0;\r\n\t\t$('#'+windowId+'-mapcontainer').gmap({'zoom': 2, \"mapTypeId\": gMap.MapTypeId.HYBRID, 'callback': function() {\r\n\t\t\tvar self=this;\r\n\t\t\tvar locations=getResultsArray(data);\r\n\t\t\tvar first=true;\r\n\t\t\tvar str=\"\";\r\n\t\t\t$.each(locations, function(key, val) {\r\n\t\t\t\tlastLat=val.latitude;\r\n\t\t\t\tlastLong=val.longitude;\r\n\t\t\t\taddLocationMarker(self, val, windowId);\r\n\t\t\t\t//Adds the location to the list\r\n\t\t\t\tvar selected=\"\";\r\n\t\t\t\tif(first){\r\n\t\t\t\t\tselected=\"edgenode-click-selected\";\r\n\t\t\t\t\tfirst=false;\r\n\t\t\t\t}\r\n\t\t\t\tstr+='<span data-node-id=\"'+val.id+'\" class=\"edgenode-click '+selected+'\">- '+val.address+\" - \"+val.name+\"</span><br/>\";\r\n\t\t\t});\r\n\t\t\t$(\"#\"+windowId+\"-edgenodeslist\").html(str);\r\n\t\t}}).bind('init', function(evt, map) { \r\n\t\t\t$(\"#\"+windowId).dialogExtend(\"maximize\");\r\n\t\t\t$(\"#\"+windowId).on(\"dialogfocus\", function( event, ui ){\r\n\t\t\t\t//brings all the accessory dialogs to top\r\n\t\t\t\t$(\".\"+windowId+\"-children-dialog\").dialog(\"moveToTop\");\r\n\t\t\t});\r\n\t\t\t//Completes the loading phase with various loading\r\n\t\t\tcompleteLoading(windowId);\r\n\t\t\tgoogle.maps.event.addListener(map, 'zoom_changed', function() {\r\n\t\t\t\t//Hides/Shows locations and sensors based on zoom\r\n\t\t\t\tvar zoom=map.getZoom();\r\n\t\t\t\tvar showLocation=true;\r\n\t\t\t\tif(zoom>=14){\r\n\t\t\t\t\tshowLocation=false;\r\n\t\t\t\t}\r\n\t\t\t\t//Sets the sensors invisible \r\n\t\t\t\t$('#'+windowId+'-mapcontainer').gmap('find', 'markers', { 'property': 'type', 'value': \"location\" }, function(marker, found) {\r\n\t\t\t\t\tif(marker.type==\"sensor\"){\r\n\t\t\t\t\t\tmarker.setVisible(!showLocation);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t});\r\n\t\t});\r\n\t}).fail(function() {\r\n\t\twriteLog(\"There was an error trying to complete the request\", windowId, \"critical\");\r\n\t});\r\n}",
"function hardwareInfo(){\n\tvar info=\"\";\n\tif(globalInfoType == \"JSON\"){\n devicesArr = getDevicesNodeJSON();\n deviceArr = getDevicesNodeJSON();\n\t}\n\n\t$(\"#hardDivPopup\").dialog({\n\t\tmodal: true,\n\t\twidth: \"auto\",\n\t\tautoResize: true,\n\t\tmaxHeight: 500,\n\t\topen: function(event, ui){\n\t\t\t$(this).parent().css('position', 'fixed');\n\t\t}\n\t});\n\n\t$(\"#hardDivPopup\").empty().load(\"pages/ConfigEditor/hardwareInfor.html\", function(){\n\t\tfor(var a=0; a<devicesArr.length; a++){\n\t\t\tif(devicesArr[a].DeviceName != \"\"){\n\t\t\t\tvar host=devicesArr[a].DeviceName;}\n\t\t\telse{\n\t\t\t\tvar host=\"N/A\";}\n\t\t\tif(devicesArr[a].Model != \"\"){\n\t\t\t\tvar model = devicesArr[a].Model;}\n\t\t\telse{\n\t\t\t\tvar model=\"N/A\";}\n\t\t\tif(devicesArr[a].ConsoleIp != \"\"){\n\t\t\t\tvar console = devicesArr[a].ConsoleIp;}\n\t\t\telse{\n\t\t\t\tvar console = \"N/A\";}\n\t\t\tif(devicesArr[a].ManagementIp != \"\"){\n\t\t\t\tvar mngt = devicesArr[a].ManagementIp;}\n\t\t\telse{\n\t\t\t\tvar mngt = \"N/A\";}\n\t\t\tinfo += \"<tr><td><input type='checkbox' class='hardwareCheckbox' onclick='filterPopUp();'></td>\";\t\n\t\t\tinfo += \"<td>\"+host+\"</td>\";\n\t\t\tinfo += \"<td>\"+model+\"</td>\";\n\t\t\tinfo += \"<td>\"+console+\"</td>\";\n\t\t\tinfo += \"<td>\"+mngt+\"</td>\";\n\t\t}\n\t\t$(\"#hardwareBody\").html(info);\n\t\t$(\".ui-dialog\").position({\n\t\t my: \"center\",\n\t \tat: \"center\",\n\t \tof: window\n\t\t});\n\t});\n}",
"function ajaxInitInfo() {\n let url = \"pickerInfo.php\"; // MOD for local vs AWS\n fetch(url)\n .then(checkStatus)\n .then(function(responseText) {\n let initInfo = JSON.parse(responseText);\n today = initInfo.today.split(\"-\");\n normalHours = initInfo.default;\n specialHours = initInfo.specialHours;\n calendar(parseInt(today[1]) - 1, parseInt(today[0]));\n })\n .catch(function(error) {\n console.log(error);\n });\n }",
"function startInfoMode(data) {\n showAllInfo(data);\n \n addHiddenClass(\".search_section\");\n addHiddenClass(\"#map_container\");\n addHiddenClass(\".help_section\");\n removeHighlightedClass(\".search_button\");\n removeHiddenClass(\".info_section\");\n \n INFO_MODE = true;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transforms the tokens of the winning streak to uppercase in the field array and sets the winner to the current player if a player has won. If no player has won the winner will be set to 'true' for the program to notify that the game is over. Triggers the 'finish' function to update the Viewclass. | finishGame(streak){
let winner = this.currentPlayer;
if(streak){
for(let i=0; i<streak.length; i++){
this.field[streak[i][0]][streak[i][1]] = "<span class='winner'>"+winner.toUpperCase()+"</span>";
}
this.winningStreak = streak;
}
else winner = true;
this.winner = winner;
$(this).trigger('finish');
} | [
"checkFinished(row, col, player){\n let winningStreak = [];\n\n //Checking for a streak vertically in the column of the inserted token\n let streak = [];\n let streakReached = false;\n for(let i=0; i<this.rows; i++){\n if(this.field[i][col] == player){\n streak.push([i,col]);\n if(streak.length == this.toWin){\n streakReached = true;\n i=this.rows;\n }\n }\n else streak = [];\n }\n if(streakReached) winningStreak = winningStreak.concat(streak);\n\n //Checking for a streak horizontally in the row of the inserted token\n streakReached = false;\n streak = [];\n for(let i=0; i<this.cols; i++){\n if(this.field[row][i] == player){\n streak.push([row,i]);\n if(streak.length == this.toWin) streakReached = true;\n }\n else{\n if(!streakReached) streak = [];\n else i=this.cols;\n }\n }\n if(streakReached) winningStreak = winningStreak.concat(streak);\n\n //Checking for a streak diagonally from top left to bottom right in the\n //line of the inserted token and adding it to the winningStreak Array.\n let spots;\n if(this.rows >= this.cols) spots = this.rows;\n else spots = this.cols;\n winningStreak = winningStreak.concat(this.checkDiagonally(row,col,player,spots,1));\n\n //Checking for a streak diagonally from bottom left to top right in the\n //line of the inserted token and adding it to the winningStreak Array.\n winningStreak = winningStreak.concat(this.checkDiagonally(row,col,player,spots,-1));\n\n if(winningStreak.length >= this.toWin) return winningStreak;\n else if(this.freeLots == 0) return false;\n return null;\n }",
"function finishGame() {\n clearBoard();\n score += timePassed > score ? timePassed % score : score % timePassed;\n scoreText.innerText = `${score}`;\n showStats();\n updateScoreTable();\n saveGameData();\n setTimer(STOP_TIMER);\n document.getElementsByClassName('details')[0].style.display = 'none';\n getById('player-name').style.pointerEvents = 'all';\n}",
"updateWinners() {\n const winners = [...this.continuing]\n .filter(candidate => this.count[this.round][candidate] >= this.thresh[this.round]);\n if (!winners.length) return; // no winners\n\n const text = this.newWinners(winners);\n this.roundInfo[this.round].winners = text;\n }",
"gameOver(result) {\n document.getElementById('overlay').style.display = '';\n if (result === 'win') {\n document.getElementById('game-over-message').className = 'win';\n document.getElementById('game-over-message').innerHTML = `<br><i>Wow, you reached 88 miles per hour!</i> 🏎️💨 <p>Nailed it! The phrase was \"${this.activePhrase.phrase.toUpperCase()}\"!</p>`;\n document.getElementById('btn__reset').textContent = 'Go back to the future & try again?';\n } else {\n document.getElementById('game-over-message').className = 'lose';\n document.getElementById('game-over-message').innerHTML = `<br><i>Think, McFly, think!</i> 😖💭 <p>Better luck next time! The phrase was \"${this.activePhrase.phrase.toUpperCase()}\".</p>`;\n document.getElementById('btn__reset').textContent = 'Go back in time & try again?';\n }\n this.resetGame();\n }",
"function endGame(tie) {\n vm.currentGame.winner = tie ? \"Cat's game!\" : \n (vm.currentGame.turn ? $filter('firstName')(vm.currentGame.player1) + \" wins!\" : \n $filter('firstName')(vm.currentGame.player2) + \" wins!\");\n vm.currentGame.gameInProgress = false;\n vm.currentGame.postGame = true;\n }",
"function check_game_winner(state) {\n var winner;\n var patterns = winning_patterns;\n // loop over each of the winning patterns\n for (var pidx = 0; pidx < patterns.length; pidx++) {\n var pattern = patterns[pidx];\n // check if the red player has won thegame by completing the pattern\n if (match_pattern(state, pattern, 'red')) {\n // set the winner to red\n winner = 'red';\n // check if the yellow player has won the game by completing the pattern\n } else if (match_pattern(state, pattern, 'yellow')) {\n // set the winner to yellow\n winner = 'yellow';\n }\n // checks if a winner has been identified and sends returns the player\n if (winner) {\n return winner;\n }\n }\n\n /**\n * if a player hasn't won the game and there are no more positions that can\n * be played the game must have ended in a draw\n */\n var draw = true;\n for (var x = 0; x <= 7; x++) {\n for (var y = 0; y <= 6; y++) {\n if (!state[x][y]) {\n return undefined;\n }\n }\n }\n return '';\n }",
"function completeRevealPhase () {\n /* reveal everyone's hand */\n for (var i = 0; i < players.length; i++) {\n if (players[i] && !players[i].out) {\n determineHand(i);\n showHand(i);\n }\n }\n \n /* figure out who has the lowest hand */\n recentLoser = determineLowestHand();\n console.log(\"Player \"+recentLoser+\" is the loser.\");\n \n /* look for the unlikely case of an absolute tie */\n if (recentLoser == -1) {\n console.log(\"Fuck... there was an absolute tie\");\n /* inform the player */\n \n /* hide the dialogue bubbles */\n for (var i = 1; i < players.length; i++) {\n $gameDialogues[i-1].html(\"\");\n $gameAdvanceButtons[i-1].css({opacity : 0});\n $gameBubbles[i-1].hide();\n }\n \n /* reset the round */\n $mainButton.html(\"Deal\");\n $mainButton.attr('disabled', false);\n if (players[HUMAN_PLAYER].out && AUTO_FORFEIT) {\n setTimeout(advanceGame, FORFEIT_DELAY);\n }\n return;\n }\n \n /* update behaviour */\n\tvar clothes = playerMustStrip (recentLoser);\n updateAllGameVisuals();\n \n /* highlight the loser */\n for (var i = 0; i < players.length; i++) {\n if (recentLoser == i) {\n $gameLabels[i].css({\"background-color\" : loserColour});\n } else {\n $gameLabels[i].css({\"background-color\" : clearColour});\n }\n }\n \n /* set up the main button */\n\tif (recentLoser != HUMAN_PLAYER && clothes > 0) {\n\t\t$mainButton.html(\"Continue\");\n\t} else {\n\t\t$mainButton.html(\"Strip\");\n\t}\n if (players[HUMAN_PLAYER].out && AUTO_FORFEIT) {\n setTimeout(advanceGame,FORFEIT_DELAY);\n }\n}",
"function checkWin() {\n\n var winPattern = [board[0] + board[1] + board[2], board[3] + board[4] + board[5], board[6] + board[7] + board[8], // Horizontal 0,1,2\n board[0] + board[3] + board[6], board[1] + board[4] + board[7], board[2] + board[5] + board[8], // Vertical 3,4,5,\n board[0] + board[4] + board[8], board[2] + board[4] + board[6]\n ]; // Diagonal 6,7\n\n var USER_String = USER + USER + USER; // USER_String == \"111\"\n var AI_String = AI + AI + AI; // AI_String == \"222\"\n\n for (var i = 0; i < 8; i++) {\n if (winPattern[i] == USER_String) {\n $(\"#status\").text(\"YOU WON\")\n activateWinAnimation(i);\n return USER; // User wins\t\t\t\t\n } else if (winPattern[i] == AI_String) {\n $(\"#status\").text(\"AI WON\")\n activateWinAnimation(i);\n return AI; // AI wins\t\t\t\n }\n }\n\n if (board.indexOf(\"-\") == -1) {\n $(\"#status\").text(\"IT'S A DRAW\")\n return DRAW; // Draw!\t\t\t\t\n }\n\n return 0;\n}",
"function correct() {\n wins++;\n restartGame();\n }",
"function retrogameEnd() {\n questionContainerElement.classList.add('hide')\n userInfo.classList.add('hide')\n \n var retroHighScore = endScore;\n document.getElementById(\"id_high_score\").value = endScore+1;\n //Variable for leaderboard \n document.getElementById(\"scoreform\").style.display = \"block\";\n document.getElementById(\"id_high_score\").value = retroHighScore;\n submitButton.classList.remove('hide')\n roundNum.classList.add('hide')\n logoutButton.classList.add('hide')\n}",
"function updateLetters(words, keyPressed) {\n // pressed key is in secretWord - display the letter and continue.\n // since a word can have more than one instance of a letter, loop through\n // entire word to capture all instances.\n\n let indexArr = [];\n for (let i = 0; i < words.secretWord.length; i++) {\n if (words.secretWord[i] === keyPressed) {\n indexArr.push(i);\n }\n }\n console.log(`indexes for ${keyPressed} in ${words.secretWord} are ${indexArr}`);\n\n for (let i = 0; i < indexArr.length; i++) { //Loop through indexArr to replace all instances of correct letter\n words.blankWord[indexArr[i]] = keyPressed;\n }\n let solvedWord = words.blankWord.join(''); //join blankWord array to display correctly and to compare to the secretWord string correctly to check for win condition.\n\n blankWordP.textContent = solvedWord;\n if (solvedWord === words.secretWord) { // after blankWord updates, check if it was the last missing letter\n // window.setTimeout(window.alert, 500, `Winner winner chicken dinner!`);\n makeMeme();\n wins++;\n winsDisplaySpan.textContent = wins;\n\n words = window.setTimeout(restartGame, 3500);\n window.setTimeout(destroyMeme, 3500);\n return words\n }\n}",
"function easygameEnd() {\n questionContainerElement.classList.add('hide')\n userInfo.classList.add('hide')\n var easyHighScore = endScore;\n document.getElementById(\"id_high_score\").value = endScore+1;\n //Variable for leaderboard \n document.getElementById(\"scoreform\").style.display = \"block\";\n document.getElementById(\"id_high_score\").value = easyHighScore;\n submitButton.classList.remove('hide')\n roundNum.classList.add('hide')\n logoutButton.classList.add('hide')\n\n}",
"function checkWinner(i) {\n\n //For loop to run through game board to determine if three of the same icons are\n //selected horizontally.\n\n for (var i = 0; i < self.pieces.spaces.length; i += 3) {\n if (self.pieces.spaces[i].player == self.pieces.spaces[i + 1].player && self.pieces.spaces[i].player == self.pieces.spaces[i + 2].player && self.pieces.spaces[i].player != 0) {\n self.gameData.winner = \"player \" + self.pieces.spaces[i].player + \" wins!\";\n self.winner = true;\n }\n }\n\n //For loop to run through game board to determine if three of the same icons are\n //selected vertically.\n\n for (var i = 0; i < 3; i++) {\n if (self.pieces.spaces[i].player == self.pieces.spaces[i + 3].player && self.pieces.spaces[i].player == self.pieces.spaces[i + 6].player && self.pieces.spaces[i].player != 0) {\n self.gameData.winner = \"player \" + self.pieces.spaces[i].player + \" wins!\";\n self.winner = true;\n }\n }\n\n //Checks to see if three of the same icons are displayed diagonally in if/else if\n //statements.\n\n if (self.pieces.spaces[0].player == self.pieces.spaces[4].player && self.pieces.spaces[0].player == self.pieces.spaces[8].player && self.pieces.spaces[0].player != 0) {\n self.gameData.winner = \"player \" + self.pieces.spaces[0].player + \" wins!\";\n self.winner = true;\n } else if (self.pieces.spaces[2].player == self.pieces.spaces[4].player && self.pieces.spaces[2].player == self.pieces.spaces[6].player && self.pieces.spaces[2].player != 0) {\n self.gameData.winner = \"player \" + self.pieces.spaces[2].player + \" wins!\";\n self.winner = true;\n }\n\n\n //Checks to see if the turn count is 10 with no winner, thus declaring a tie game.\n else if (self.gameData.turn == 10) {\n self.gameData.winner = \"Tic Tac Tie!\";\n self.winner = true;\n }\n\n }",
"function matchNumbers(score) {\n\n console.log(score + ' :score');\n console.log(goalNumber + ' :Goal');\n\n // win if score = goalnumber\n if (score === goalNumber) {\n\n $('.win-lose').text('You Win!');\n $('win-lose').css('color', 'darkgreen')\n\n winsCounter++;\n $('#wins').text('Wins: ' + winsCounter);\n\n newGame();\n }\n\n // lose if score > goalnumber\n else if (score > goalNumber) {\n\n $('.win-lose').text('You Lost.');\n $('.win-lose').css('color', 'red');\n\n lossCounter++;\n $('#losses').text('Losses: ' + lossCounter);\n\n newGame();\n }\n\n }",
"rally(winner) {\n if (1 <= this.game_over) {\n if (this.game_over < 2) {\n this.msg = txt_GameOver;\n this.game_over++;\n }\n } else if (winner == txt_Random) {\n if (this.servingTeam() == this.winningTeam()) {\n this.serverWins();\n } else {\n this.serverLoses();\n }\n } else {\n if (this.servingTeam() == winner) {\n this.serverWins();\n } else {\n this.serverLoses();\n }\n }\n this.draw();\n }",
"function showAnswer(gameWon) {\n\n var codeLabel = document.getElementById('code');\n // codeLabel.innerHTML = '<strong>' + answer.value + '</strong>';\n codeLabel.innerHTML = answer.value;\n if (gameWon) {\n // add success class to code label\n codeLabel.classList.add('success');\n } else {\n // add lost failure class\n codeLabel.classList.add('failure');\n }\n}",
"function winLoss() {\n if (userScore === answer) {\n winCount++\n console.log(\"new winCount is \" + winCount);\n $(\"#lossMessage\").hide();\n $(\"#winMessage\").show(300);\n $(\"#wins\").text(\"Wins: \" + winCount);\n newRound();\n }\n\n else if (userScore > answer) {\n lossCount++\n console.log(\"new lossCount is \" + lossCount);\n $(\"#winMessage\").hide();\n $(\"#lossMessage\").show(300);\n $(\"#losses\").text(\"Losses: \" + lossCount);\n newRound();\n }\n \n}",
"function endGame(villagersWin) {\n console.log(\"Endgame called\");\n\n var cycleNumber = GameVariables.findOne(\"cycleNumber\").value - 1;\n var winnerText = \"\";\n\n if (villagersWin) {\n console.log(\"Villagers win\");\n winnerText = \"The Villagers have won!\";\n } else {\n console.log(\"Werewolves win\");\n winnerText = \"The Werewolves have won!\";\n }\n\n EventList.insert({type: \"info\", cycleNumber: cycleNumber, text: winnerText, timeAdded: new Date()});\n\n GameVariables.update(\"lastGameResult\", {$set: {value: villagersWin, enabled: true}});\n\n var players = Players.find({joined: true});\n var werewolfId = Roles.findOne({name: \"Werewolf\"})._id;\n\n // Let's set the variables for all the players that were in the game\n players.forEach(function(player) {\n Players.update(player._id, {$set: {seenEndgame: false, ready: false}});\n\n if (villagersWin) {\n if (player.role == werewolfId) {\n Players.update(player._id, {$set: {alive: false}});\n }\n } else {\n if (player.role != werewolfId) {\n Players.update(player._id, {$set: {alive: false}});\n }\n }\n });\n\n // Re-enable the lobby\n GameVariables.update(\"gameMode\", {$set: {value: \"lobby\"}});\n}",
"function change_text( player, target_hit )\n{\n\tfor (var i = 0; i < board_sections.length; i++) \n\t{\n\t\tvar section_text = $(board_sections[i]).text();\n\t\tif (target_hit == section_text) \n\t\t{\n\t\t\tif (player.marker == 'X') \n\t\t\t{\n\t\t\t\t$(board_sections[i]).css('color', '#91c46b');\n\t\t\t\t$(board_sections[i]).text('X');\n\n\t\t\t}\n\t\t\telse if (player.marker == 'O')\n\t\t\t{\n\t\t\t\t$(board_sections[i]).css('color', '#d9534f');\n\t\t\t\t$(board_sections[i]).text('O');\n\t\t\t}\n\t\t}\n\t}\n\tcheck_game( player );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sendResult function executes the POST request to save the data to the server (and subsequently the results.json file) | async function sendResult(result) {
// Transfers the result to string format
result = JSON.stringify(result);
// Error handling ensures graceful handling of any problems
try {
// Sends POST request containing the result in the body
let response = await fetch('./result',
{
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'result=' + result
});
// Detects any problems in the execution of the POST request
if(!response.ok){
// Throws an error, including a statement as well as status code and text
throw new Error('Problem sending results: ' + response.status + ' ' + response.statusText);
}
}
catch (error) {
// Informs the user of the error
alert (error);
}
} | [
"function __saveResults(bSubmit){\n \n var activityBodyObjectRef = $(__constants.DOM_SEL_ACTIVITY_BODY).attr(__constants.ADAPTOR_INSTANCE_IDENTIFIER); \n /*Getting answer in JSON format*/\n var answerJSON = __getAnswersJSON(false);\n\n if(bSubmit===true) {/*Hard Submit*/\n\n /*Send Results to platform*/\n activityAdaptor.submitResults(answerJSON, activityBodyObjectRef, function(data, status){\n if(status=== __constants.STATUS_NOERROR){\n __state.activitySubmitted = true;\n /*Close platform's session*/\n activityAdaptor.closeActivity();\n __state.currentTries = 0;\n } else {\n /* There was an error during platform communication, so try again (till MAX_RETRIES) */ \n if(__state.currentTries < __config.MAX_RETRIES) {\n __state.currentTries++ ;\n __saveResults(bSubmit);\n }\n\n }\n\n });\n } else{ /*Soft Submit*/\n /*Send Results to platform*/\n activityAdaptor.savePartialResults(answerJSON, activityBodyObjectRef, function(data, status){\n if(status=== __constants.STATUS_NOERROR){\n __state.activityPariallySubmitted = true;\n } else {\n /* There was an error during platform communication, do nothing for partial saves */\n }\n });\n }\n }",
"function sendResultsToFlow(res, results, contextOut) {\n\n // return to caller\n return res.json({\n speech: results,\n displayText: results,\n source: \"webhook-arrow-testing\"\n });\n\n }",
"function saveResult(currentQuestion,number, answer ){\n\t$.ajax({\n type: \"POST\",\n url: \"save_result.php\", \n data: {\n\t\t\t questionNo: currentQuestion\n\t\t\t, testNumber: number\n\t\t\t, testAnswer: answer\n\t\t\t},\n success: function (data) {\n\t\t data = jQuery.parseJSON( data );\n\t\t $(\"#answer\").html(\"<strong> \"+answer+ \"</strong><br><strong>\"+data.totalRuns+\"</strong> times/time \"+number+\" is used as input for Question \"+currentQuestion);\n\t }\n\t});\n}",
"postResults() {\n const sendPromises = []\n\n this.failedSpecs.forEach((failedInfo) => {\n sendPromises.push(this._sendData(Object.assign({\n type: 'failedSpecs'\n }, failedInfo)))\n })\n\n return Promise.all(sendPromises)\n }",
"function submitQuery() {\n \"use strict\";\n const results = document.getElementById(\"queryResults\");\n const query = getBaseURL() + \"data/?\" + getQueryParamString();\n\n fetch(query).then(function (response) {\n const contentType = response.headers.get(\"content-type\");\n if (contentType && contentType.indexOf(\"application/json\") !== -1) {\n return response.json();\n } else {\n return response.text();\n }\n }).then(function (data) {\n if (typeof data === \"string\") {\n results.textContent = data;\n } else {\n results.textContent = JSON.stringify(data, null, 4);\n }\n });\n}",
"function sendToServer(details) {\n var requestOptions = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(details),\n };\n fetch('/savegame', requestOptions)\n .then((response) => response.text())\n .catch((error) => console.log('error', error));\n}",
"function sendToTextFile(data) {\n fs.appendFile('results.txt', data, function(err) {\n if (err) {\n console.error(err);\n process.exit(1);\n }\n console.log('Successfully wrote to file');\n });\n}",
"function record_sms_send_result(re) {\n var url = get_url_report_result(re);\n count_result(re);\n ajax_api(url, function(re){\n trace('Recording sms result : ...');\n if ( re == 'promise.failed' ) {\n setDisplayStatus(\"Connecting to SMSGate Server has been failed.\");\n setDisplayErrorAjaxRecording(++count_error_recording);\n return callback_sms_send_finished();\n }\n if ( re.error ) {\n setDisplayStatus(re.message);\n setDisplayErrorAjaxRecording(++count_error_recording);\n callback_sms_send_finished();\n }\n else {\n setDisplayStatus(\"sms send result - recorded.\");\n callback_sms_send_finished();\n }\n\n\n });\n}",
"function writeToFile(result) {\n fs.writeFile('result.json', JSON.stringify(result), err => {\n if (err) throw err;\n });\n}",
"function sendDataToServer(survey) {\n //var resultAsString = JSON.stringify(survey.data);\n //alert(resultAsString); //send Ajax request to your web server.\n let dataReq = new RequestObj(1, \"/survey\", \"/save/projects/?/context/?\", [projectName, context], [], survey.data);\n userEmail = survey.data.EMAIL1;\n serverSide(dataReq, \"POST\", function () {\n //log.warn(a);\n let asciiMail = \"\";\n for (let i = 0; i < userEmail.length; i++) {\n asciiMail += userEmail[i].charCodeAt(0) + \"-\";\n }\n asciiMail = asciiMail.substring(0, asciiMail.length - 1);\n location.href = window.location.href + \"&userEmail=\" + asciiMail;\n })\n}",
"function sendRichResultsToFlow(res, results,richData,contextOut) {\n\n return res.json ({\n speech: results,\n displayText: results,\n source: \"webhook-arrow-testing\",\n data: {\n richData: richData\n },\n contextOut: contextOut\n })\n }",
"function saveDiffResultAndUpdateDataJson(submissionsDir, diffResult, changesetId) {\n var diffResultFileName = 'diffResult-' + changesetId + '.xml';\n fs.writeFile(submissionsDir + '/' + diffResultFileName, diffResult, function (err) {\n // do nothing\n });\n updateDataJson(submissionsDir, changesetId, diffResultFileName, null);\n}",
"function sendToServer() {\n // Url issue is sent to\n const url = 'http://localhost:1234/whap/add-issue?' + 'iss';\n // Data being sent\n var data = {\n name: document.getElementById(\"title\").value,\n des: document.getElementById(\"msg\").value,\n prio: document.getElementById(\"priority\").value,\n os: document.getElementById(\"OS\").value,\n com: document.getElementById(\"component\").value,\n ass: document.getElementById(\"assignee\").value,\n user: window.name\n };\n\n // Posts the data\n var resp = postData('http://localhost:1234/whap/add-issue', data)\n // Tells user they did it\n .then(alert(\"You did it\"));\n}",
"function saveResults(db, type){\n\t\tvar test = getSelectedTest().id;\n\t\tif (test == 0 || test == 1)\n\t\t\ttest = \"post\";\n\t\telse if (test == 2 || test == 3)\n\t\t\ttest = \"get\";\n\t\telse if (test == 4 || test == 5)\n\t\t\ttest = \"update\"\n\n\t\tvar time = $scope.time;\n\t\tfirebase.database().ref('test_history/' + test + '/' + db.name.toLowerCase() + '/' + type).push({\n\t\t\tip: ipInfo,\n\t\t\ttime_ms: time\n\t\t});\n\n\t\t$scope.completedTests.push({\n\t\t\tdb: db,\n\t\t\ttime: time,\n\t\t\tresult: \"Sucess\"\n\t\t});\n\t\tnextTest();\n\t}",
"function makePostRequest() {\n console.group(\"createMeme makePostRequest\");\n let inputs = memeForm.getElementsByTagName(\"input\");\n\n let inputname = inputs[\"name\"].value;\n let inputcaption = inputs[\"caption\"].value;\n let inputUrl = inputs[\"url\"].value;\n\n console.table(inputs);\n\n if (checkDataValidity(inputs, \"create\")) {\n const memeData = {\n name: inputname,\n url: inputUrl,\n caption: inputcaption,\n };\n\n console.table(memeData);\n\n fetch(encodeURI(xmemeBackendUrl), {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n charset: \"UTF-8\",\n },\n body: JSON.stringify(memeData),\n })\n .then((response) => {\n console.dir(response);\n if (response.status === 409 || response.status === \"409\") {\n console.error(\"Duplicate Meme Posted\");\n triggerIframe(\"Duplicate Data\");\n } else if (!response.ok) {\n console.error(\"Error with Server Response : \" + response.status);\n triggerIframe(\"Something went wrong! Please try again.\");\n } else if (response.ok || response.status === 200) {\n console.log(\"meme posted\");\n triggerIframe(\"Meme Created!\");\n return response.json();\n }\n })\n .then((data) => {\n console.log(\"Meme Posted Successfully:\", JSON.stringify(data));\n })\n .catch((error) => {\n triggerIframe(\"Something went wrong! Please try again.\");\n console.error(\"Error while posting meme:\", error);\n });\n }\n console.groupEnd();\n}",
"onTestResult(result) {\n this.results = this.results.concat(result);\n ResultDbAgent.newTest(this.frameworkid, result.test, (testid) => {\n delete result.test;\n for (var i in result) {\n ResultDbAgent.newResult(testid, i, i.toUpperCase(), roundFloat(result[i], 7));\n }\n this.testsComplete++;\n this.sendProgress();\n this.nextTest();\n });\n }",
"function sendData() {\n if (title.value == '' || title.value == '' || title.value == '' || title.value == '') {\n alert('Por favor complete el formulario.')\n } else {\n const newProd = { \"title\": title.value, \"price\": price.value, \"thumbnail\": thumbnail.value, \"form\": form.value };\n enviarDatos('http://localhost:8080/api/productos', newProd)\n .then(() => {\n socket.emit('postProduct');\n }).catch(error => {\n console.log('Hubo un problema con la petición Fetch:' + error.message);\n });\n }\n return false;\n}",
"submitCurrentResponse(){\n this.imageTaskView.checkAnswersAndUpdateView();\n let imageTaskResponse = this.imageTaskView.getResponse();\n if (imageTaskResponse.questionResponses.length > 0) {\n this.serverComm.submitImageTaskResponse(imageTaskResponse, this);\n }\n }",
"function webhookTrigger(){\n if(action_webhook){\n console.log('webhook trigger');\n\n var dataString = JSON.stringify(results_json); // '{\"something\":2}';\n\n var contentType = 'application/json';\n\n triggerEmail.httpSend(action_webhook_prototol, action_webhook_host, action_webhook_endpoint, action_webhook_method, contentType, dataString);\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
display picture and restaurant name and rating function | function displayRestaurantDetails(restaurant) {
let avrageRating = generateAvrageRating(restaurant)
const commentsDiv = document.getElementById('comments')
commentsDiv.classList.add('container', 'text-center', "principal", "border", 'rounded', "border-primary", 'mt-2')
commentsDiv.classList.remove('d-none')
// creating restaurant picture
const photoRow = document.createElement('div')
photoRow.classList.add('row', 'py-2')
const restaurantPhoto = document.createElement('img')
restaurantPhoto.classList.add('col-lg-4', 'border', 'border-primary', 'p-0', 'mx-2')
if (restaurant.photoRestaurant) {
restaurantPhoto.src = `https://maps.googleapis.com/maps/api/place/photo?maxwidth=500&photoreference=${restaurant.photoRestaurant}&key=AIzaSyBll93EcgKSTvPgM3554BIvyutwDjFdWaw`
} else {
restaurantPhoto.src = restaurant.imgSrc
}
photoRow.appendChild(restaurantPhoto)
commentsDiv.appendChild(photoRow)
// creating restaurant rating, name and adress
const restaurantDetail = document.createElement('div')
restaurantDetail.classList.add('col-lg-7')
const name = document.createElement('h1')
name.classList.add('text-danger', 'text-center')
name.innerText = restaurant.restaurantName
const adress = document.createElement('p')
adress.classList.add('text-muted', 'text-center')
adress.innerHTML = 'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Esse praesentium illum omnis optio cumque! Qui corrupti ipsum nihil odio! Et placeat quibusdam iusto eius blanditiis architecto nam ea corporis minima!'
const rating = document.createElement('div')
rating.classList.add('col-lg-6', 'center')
starsCreate({ clickable: false, rating: avrageRating })
rating.appendChild(starContainer)
rating.innerHTML += avrageRating
//check if restaurant is open
let openStatus
if (restaurant.openNow == true) {
openStatus = `<span class='text-success'> Open</span>`
} else {
openStatus = `<span class='text-danger'> Closed</span>`
}
const description = document.createElement('div')
description.innerHTML = `
<ul class="list-group list-group-flush">
<li class="list-group-item"><p > <span class='font-weight-bold text-muted '>Restaurant Adress : </span> ${restaurant.adress}</p></li>
<li class="list-group-item"><p > <span class='font-weight-bold text-muted '>Local Phone Number : </span> ${restaurant.localPhone}</p>
<p > <span class='font-weight-bold text-muted'>International Phone Number : </span> ${restaurant.internationalPhone}</p></li>
<li class="list-group-item"><p > <span class='font-weight-bold text-muted'>Restaurant Status : </span> ${openStatus}</p></li>
<li class="list-group-item"><p > <span class='font-weight-bold text-muted'>Website : </span> <a class='link' href='${restaurant.website}' target="_blank">${restaurant.restaurantName}</a></p></li>
</ul>`
restaurantDetail.appendChild(name)
restaurantDetail.appendChild(adress)
restaurantDetail.appendChild(rating)
restaurantDetail.appendChild(description)
photoRow.appendChild(restaurantDetail)
} | [
"function showRating(ratings) {\n let oneStars = +ratings.one \n let twoStars = +ratings.two *2\n let threeStars = +ratings.three*3\n let fourStars = +ratings.four*4\n let fiveStars = +ratings.five*5\n\n let totalRatings = +ratings.one + +ratings.two + +ratings.three + +ratings.four + +ratings.five\n\n let averageRating = ((oneStars + twoStars + threeStars + fourStars + fiveStars)/totalRatings)\n let averageRatingFormatted = averageRating.toFixed(2)\n return averageRatingFormatted\n}",
"static imageAltDescForRestaurant(restaurant) {\r\n return (`Restaurant: ${restaurant.name} of ${restaurant.cuisine_type} cuisine type`);\r\n }",
"function ramenClick(event) {\n const ramenDetails = document.getElementById(\"ramen-detail\")\n const ramenImage = ramenDetails.querySelector(\"img\")\n ramenImage.src = event.image\n const ramenName = ramenDetails.querySelector(\"h2\")\n ramenName.innerText = event.name\n const ramenRestaurant = ramenDetails.querySelector(\"h3\")\n ramenRestaurant.textContent = event.restaurant \n const ramenRating = document.getElementById(\"rating-display\")\n ramenRating.textContent = event.rating\n const ramenComment = document.getElementById(\"comment-display\")\n ramenComment.textContent = event.comment\n}",
"static smallImageUrlForRestaurant(restaurant) {\r\n return (`/img/small/${restaurant.photograph}.jpg`);\r\n }",
"function displayRestaurantInfo(place) {\n $('#review-window').show();\n $('#add-review-button').show();\n restaurantInfoContainer.show();\n $('#name').text(place.name);\n $('#address').text(place.vicinity);\n $('#telephone').text(place.formatted_phone_number);\n\n var reviewsDiv = $('#reviews');\n var reviewHTML = '';\n reviewsDiv.html(reviewHTML);\n if (place.reviews) {\n if (place.reviews.length > 0) {\n for (var i = 0; i < place.reviews.length; i += 1) {\n var review = place.reviews[i];\n var avatar;\n if (place.reviews[i].profile_photo_url) {\n avatar = place.reviews[i].profile_photo_url;\n } else {\n avatar = 'img/avatar.svg';\n }\n reviewHTML += `<div class=\"restaurant-reviews\">\n <h3 class=\"review-title\">\n <span class=\"user-avatar\" style=\"background-image: url('${avatar}')\"></span>`;\n if (place.rating) {\n reviewHTML += `<span id=\"review-rating\" class=\"rating\">${placeRating(review)}</span>`;\n }\n reviewHTML += ` <h3>${place.reviews[i].author_name}</h3>\n </h3>\n <p> ${place.reviews[i].text} </p>\n </div>`;\n reviewsDiv.html(reviewHTML);\n }\n }\n }\n\n /********** Street view using Google API **********/\n\n /*** Add Street View ***/\n var streetView = new google.maps.StreetViewService();\n streetView.getPanorama({\n location: place.geometry.location,\n radius: 50\n }, processStreetViewData);\n\n var streetViewWindow = $('#street-view-window');\n var photoContainer = $('#photo');\n var photoWindow = $('#see-photo');\n var seeStreetView = $('#see-street-view');\n photoContainer.empty();\n photoContainer.append('<img class=\"place-api-photo\" ' + 'src=\"' + createPhoto(place) + '\"/>');\n\n streetViewWindow.show();\n if (photo) {\n photoWindow.show();\n } else {\n photoWindow.hide();\n }\n\n function processStreetViewData(data, status) {\n if (status === 'OK') {\n var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'));\n panorama.setPano(data.location.pano);\n panorama.setPov({\n heading: 440,\n pitch: 0\n });\n panorama.setVisible(true);\n\n } else {\n photoWindow.hide();\n streetViewWindow.hide();\n photoContainer.show();\n }\n }\n }",
"function rottenTomato (){\n for(var i = 0; i > 0; i++) {\n if(jsonData.Ratings[1].Source === \"Rotten Tomatoes\") {\n console.log(\"Rotten Tomatoes Rating: \" + jsonData.Ratings[1].Value);\n } else {\n console.log (\"Rotten Tomatoes Rating: \" + null);\n }\n }\n }",
"function moonStarStars(ratingname, defaultValue,course_id)\n{\n\tmoonStars(ratingname, defaultValue, 'star_x_gray.png', 'star_x_gold.png',25, [\"\",\"\",\"\",\"\",\"\"],course_id)\n}",
"static imageSrcUrlForRestaurant(restaurant) {\r\n return (`/img2/${restaurant.id}` + `-300_small.webp`);\r\n }",
"function Restaurant(name, type, stars) {\n this.name = name;\n\tthis.type = type;\n this.stars = stars;\n \n this.addStars = function (num) {\n this.stars += num;\n return this.stars;\n };\n}",
"function displayBreed(image) {\r\n $('#breed_image').attr('src', image.url);\r\n $(\"#breed_data_table tr\").remove();\r\n \r\n var breed_data = image.breeds[0]\r\n $.each(breed_data, function(key, value) {\r\n // as 'weight' and 'height' are objects that contain 'metric' and 'imperial' properties, just use the metric string\r\n if (key == 'weight' || key == 'height') value = value.metric\r\n // add a row to the table\r\n $(\"#breed_data_table\").append(\"<tr><td>\" + key + \"</td><td>\" + value + \"</td></tr>\");\r\n });\r\n }",
"static imageSrcSetUrlForRestaurant(restaurant) {\r\n return (`/img2/${restaurant.id}` + `-300_small.webp 300w, ` + `/img/${restaurant.id}` + `.webp 600w`);\r\n }",
"function moonStars(ratingname, defaultValue, emptyImage, fullImage,Image_size, optionNames,course_id)\n{\n\t\n\t\n\t//Generate the actual form of images\n\tdocument.write(\"<form name=\\\"\"+ratingname+course_id+\"form\\\" class=\\\"Rating_item\\\" >\");\n\tfor(count=1; count< optionNames.length+1; count=count+1)\n\t{\n\t\tdocument.write(\"<input type=\\\"radio\\\" name=\\\"\"+ratingname+\"buttons\\\" value=\\\"\"+(count)+\"\\\" \");\n\t\tif (defaultValue == count)\n\t\t{\n\t\t\tdocument.write(\"checked=\\\"True\\\"\")\n\t\t}\n\t\tdocument.write(\"/>\");\n\t}\n\tdocument.write(\"</form><table cellspacing=\\\"0\\\" class=\\\"Rating_item\\\"><tr>\");\n\t//generate the table of image labels\n\tfor(count=1; count< optionNames.length+1; count=count+1)\n\t{\n\t\tdocument.write(\"<td width=\"+Image_size+\" style=\\\" text-align: center; padding: 0; border: 0; margin: 0;\\\">\")\n\t\tdocument.write(optionNames[count-1])\n\t\tdocument.write(\"</td>\")\n\t}\n\tdocument.write(\"</tr></table>\")\n\t\n\t//add the async function that colors and submits the image form\n\twindow.addEvent(\"domready\",function() { \n\t\t\t\t\t\n\t\tMooStarRatingImages.defaultImageFolder = '/media/'; //Default images folder definition. You will use your own \n\n\t\t// Create our instance \n\t\t// Advanced options \n\t\tvar advancedRating = new MooStarRating({ \n\t\t form: ratingname+course_id+'form', //Form name \n\t\t radios: ratingname+'buttons', //Radios name \n\t\t half: false, //if you need half star rating just make this true \n\t\t imageEmpty: emptyImage, //Default images are in definition. You will use your own \n\t\t imageFull: fullImage, \n\t\t imageHover: null, \n\t\t width: Image_size,\n\t\t height: Image_size, \n\t\t tip: '[VALUE] / '+optionNames.length, //Mouse rollover tip \n\t\t tipTarget: $('htmlTip'), //Tip element \n\t\t tipTargetType: 'html', //Tip type is HTML \n\t\t \n\t\t // Send ajax request to server to save rating \n\t\t onClick: function(value) { \n\t\t \n\t\t var requestHTMLData = new Request({ \n\t\t\t url: '/course/'+course_id+'/submit/', \n\t\t\t data: {Rating_Value: value, Rating_Name: ratingname} \n\t\t\t }); \n\t\t requestHTMLData.send(); \n\t\t } \n\t\t }); \n\t\t\t\t\t\n\t}); \n}",
"function respondWithRating(title){\n voiceBox.request(url+'?t='+title+'&y=&plot=short&r=json', function (error, response, body){\n var body = JSON.parse(body)\n voiceBox.respond(title+' has an average rating of '+body.imdbRating);\n });\n}",
"function getfoodAPI() {\n fetch(url)\n .then(function (r) {\n return r.json();\n })\n .then(function (data) {\n $('.RecipePicture').empty()\n $('.DrinkPicture').empty()\n for (i = 0; i < 10; i++) {\n foodID = data.matches[i].id;\n Dish = data.matches[i].recipeName;\n var imgDiv = $(\"<div class=col-md-4>\");\n imgURL = data.matches[i].imageUrlsBySize[\"90\"];\n var rate = $(\"<h4>\").text(\"Rating: \" + data.matches[i].rating);\n var name = $(\"<h4>\").text(data.matches[i].recipeName);\n var image = $(\"<img>\");\n image.attr(\"src\", imgURL);\n image.attr(\"class\", \"icon\");\n image.attr(\"data-ingre\", i)\n image.attr(\"data-nameofDish\", Dish);\n image.attr(\"data-typeofImg\", \"food\");\n image.attr(\"data-foodID\", foodID);\n imgDiv.append(rate);;\n imgDiv.append(name);\n imgDiv.append(image);\n $(\".RecipePicture\").prepend(imgDiv);\n }\n })\n\n .catch(function (err) {\n console.error('Fetch Error :-S', err);\n });\n}",
"function renderImage(response) {\n\n //getting the link of the first item in the response\n const imageLink = response.items[0].link\n\n //creating an image element with the src as the above imageLink\n //and width and heright of 200rem\n const image = document.createElement('img')\n image.setAttribute('src', imageLink)\n image.setAttribute('width', '200rem')\n image.setAttribute('height', '200rem')\n\n //getting the food name (this is the searchTerm from the response)\n const foodName = response.queries.request[0].searchTerms\n\n //adding the image element to the list\n addImageToFood(image, foodName)\n \n}",
"generateStars(rating)\n\t{\n\t\tlet i\n\t\tlet output = []\n\t\trating = Math.round(rating * 2) / 2\n\t\tfor (i = rating; i >= 1; i--){\n\t\t\toutput.push(\"<i class='fa fa-star' aria-hidden='true'></i> \")\n\t\t}\n\t\tif (i === .5){\n\t\t\toutput.push(\"<i class='fa fa-star-half-o' aria-hidden='true'></i> \")\n\t\t}\n\t\tfor (let i = (5 - rating); i >= 1; i--){\n\t\t\toutput.push(\"<i class='fa fa-star-o' aria-hidden='true'></i> \")\n\t\t}\n\t\treturn output.join(\"\")\n\t}",
"function toRatingsPage() {\r\n id(\"result-view\").classList.add(\"hidden\");\r\n id(\"rate-view\").classList.remove(\"hidden\");\r\n id(\"rating\").addEventListener(\"change\", rateEgg);\r\n }",
"function displayRatingInModal() {\n\tvar rating = $('#rating');\n\tif(moves >= 20) {\n\t\trating.html('<i class=\"fa fa-star\" aria-hidden=\"true\">');\n\t}\n\telse if (moves >= 12) {\n\t\trating.html('<i class=\"fa fa-star\" aria-hidden=\"true\"></i></i><i class=\"fa fa-star\" aria-hidden=\"true\"></i>');\n\t}\n\telse {\n\t\trating.html('<i class=\"fa fa-star\" aria-hidden=\"true\"></i><i class=\"fa fa-star\" aria-hidden=\"true\"></i><i class=\"fa fa-star\" aria-hidden=\"true\"></i>');\n\t}\n}",
"function displayMovieImageAndDetail(index) {\n console.log(\"index and length\", index, featuredResults.length);\n let imgPath = featuredResults[index].imageUrl;\n if (index < featuredResults.length) {\n if (imgPath.search(\"w342null\") >= 0) {\n // there are no image poster, so replace with default image\n imgPath = \"../img/movie_poster.jpg\";\n }\n let htmlString = `<img class='movie-image' src='${imgPath}' alt='${featuredResults[index].title}' width='400' height='600' value=${index}>`;\n $(\"#selected-image\").html(htmlString);\n $(\"#title\").html(featuredResults[index].title);\n $(\"#synopsis-content\").html(featuredResults[index].overview);\n $(\"#rating-content\").html(featuredResults[index].rating);\n $(\"#release-content\").html(featuredResults[index].release_date);\n // display the list of genres the movie belongs to\n let genreString = \"\";\n featuredResults[index].genres.forEach((name, i) => {\n console.log(\"Genre: \", name);\n if (i != 0) genreString += \", \";\n genreString += name;\n });\n $(\"#genre-content\").html(genreString);\n $(\"#price-content\").html(\"$\" + featuredResults[index].price);\n $(\"#add-movie\").html(\"Add to the Cart\");\n $(\"#add-movie\").prop(\"disabled\", false);\n } else {\n $(\"#selected-movie-container\").hide();\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encrypt payment password(DES) by RSA | function encryption() {
var DES_key = document.getElementById("payment_password").value;
if (DES_key.length != 0) {
var encrypted_des_key = RSA_encryption(DES_key);
document.getElementById("payment_password").value = encrypted_des_key;
}
} | [
"function RSA_encryption(deskey) {\n var pubilc_key = \"-----BEGIN PUBLIC KEY-----MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzdxaei6bt/xIAhYsdFdW62CGTpRX+GXoZkzqvbf5oOxw4wKENjFX7LsqZXxdFfoRxEwH90zZHLHgsNFzXe3JqiRabIDcNZmKS2F0A7+Mwrx6K2fZ5b7E2fSLFbC7FsvL22mN0KNAp35tdADpl4lKqNFuF7NT22ZBp/X3ncod8cDvMb9tl0hiQ1hJv0H8My/31w+F+Cdat/9Ja5d1ztOOYIx1mZ2FD2m2M33/BgGY/BusUKqSk9W91Eh99+tHS5oTvE8CI8g7pvhQteqmVgBbJOa73eQhZfOQJ0aWQ5m2i0NUPcmwvGDzURXTKW+72UKDz671bE7YAch2H+U7UQeawwIDAQAB-----END PUBLIC KEY-----\";\n var encrypt = new JSEncrypt();\n encrypt.setPublicKey(pubilc_key);\n var encrypted = encrypt.encrypt(deskey);\n return encrypted;\n }",
"function pkcs1pad2(s,n) {\r\n if(n < s.length + 11) {\r\n alert(\"Message too long for RSA\");\r\n return null;\r\n }\r\n var ba = new Array();\r\n var i = s.length - 1;\r\n while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);\r\n ba[--n] = 0;\r\n var rng = new SecureRandom();\r\n var x = new Array();\r\n while(n > 2) { // random non-zero pad\r\n x[0] = 0;\r\n while(x[0] == 0) rng.nextBytes(x);\r\n ba[--n] = x[0];\r\n }\r\n ba[--n] = 2;\r\n ba[--n] = 0;\r\n return new BigInteger(ba);\r\n}",
"function encrypt() {\n\n\tconsole.log('Encrypting Key');\n\t\n // Start by getting Key and Plaintext into byte arrays\n var keyField = document.getElementById(\"key\");\n var hexString = keyField.value;\n var keyBytes = hexStringToByteArray(hexString);\n\n var plaintextField = document.getElementById(\"plaintext\");\n var plaintext = plaintextField.value;\n var plaintextBytes = stringToByteArray(plaintext);\n\n // Make a CryptoKey from the Key string\n window.crypto.subtle.importKey(\n \"raw\",\n keyBytes,\n {name: \"AES-CBC\", length: 256},\n false,\n [\"encrypt\"]\n ).then(function(key){\n // Get a random IV, put in IV field, too\n var iv = window.crypto.getRandomValues(new Uint8Array(16));\n var ivField = document.getElementById(\"iv\");\n var ivHexString = byteArrayToHexString(iv);\n ivField.value = ivHexString;\n\n // Use the CryptoKey to encrypt the plaintext\n return window.crypto.subtle.encrypt(\n {name: \"AES-CBC\", iv: iv},\n key,\n plaintextBytes\n );\n }).then(function(ciphertextBuf){\n // Encode ciphertext to base 64 and put in Ciphertext field\n ciphertextBytes = new Uint8Array(ciphertextBuf);\n base64Ciphertext = byteArrayToBase64(ciphertextBytes);\n ciphertextField = document.getElementById(\"ciphertext\");\n ciphertextField.value = base64Ciphertext;\n }).catch(function(err){\n alert(\"Encryption error: \" + err.message);\n });\n}",
"function indcpaEncrypt(m, publicKey, coins, paramsK) {\r\n\r\n var ciphertext = new Array(1088);\r\n\r\n // initialise\r\n var sp = polyvecNew(paramsK);\r\n var ep = polyvecNew(paramsK);\r\n var bp = polyvecNew(paramsK);\r\n\r\n var result = indcpaUnpackPublicKey(publicKey, paramsK);\r\n\r\n var publicKeyPolyvec = result[0];\r\n var seed = result[1];\r\n\r\n var k = polyFromMsg(m);\r\n\r\n var at = indcpaGenMatrix(seed, true, paramsK);\r\n\r\n for (var i = 0; i < paramsK; i++) {\r\n sp[i] = polyGetNoise(coins, i);\r\n ep[i] = polyGetNoise(coins, i + paramsK);\r\n }\r\n\r\n var epp = polyGetNoise(coins, paramsK * 2);\r\n\r\n sp = polyvecNtt(sp, paramsK);\r\n\r\n sp = polyvecReduce(sp, paramsK);\r\n\r\n\r\n for (i = 0; i < paramsK; i++) {\r\n bp[i] = polyvecPointWiseAccMontgomery(at[i], sp, paramsK);\r\n }\r\n\r\n var v = polyvecPointWiseAccMontgomery(publicKeyPolyvec, sp, paramsK);\r\n\r\n bp = polyvecInvNttToMont(bp, paramsK);\r\n\r\n v = polyInvNttToMont(v);\r\n\r\n var bp1 = polyvecAdd(bp, ep, paramsK);\r\n\r\n v = polyAdd(polyAdd(v, epp), k);\r\n\r\n var bp3 = polyvecReduce(bp1, paramsK);\r\n\r\n ciphertext = indcpaPackCiphertext(bp3, polyReduce(v), paramsK);\r\n return ciphertext;\r\n}",
"function seed2key(pk, c){ return hex2hexKey(hash256(pk+c)); }",
"function generateKey() {\n\t\n\tconsole.log('Generating Key');\n\n\twindow.crypto.subtle.generateKey(\n\t\t{name: 'AES-CBC', length: 256}, \n\t\ttrue, \n\t\t['encrypt', 'decrypt']\n\t)\n\t.then(function (key) {\n // Export to ArrayBuffer\n return window.crypto.subtle.exportKey(\"raw\",key);\n\t})\n\t.then(function (buf) {\n\t\tvar byteArray = new Uint8Array(buf);\n\t\tvar keyField = document.getElementById(\"key\");\n\t\tkeyField.value = byteArrayToHexString(byteArray);\n\t})\n\t.catch(function (err) {\n\t\tthrow new Error(err.message);\n\t});\n}",
"getPrivKey() {\n var output = PrivKeyAsn1.encode({\n d: this.key.priv.toString(10),\n }, \"der\")\n return output.toString('hex')\n }",
"function setPassword(password, callback){\n webSocket.shh.generateSymKeyFromPassword(password, callback);\n}",
"function RSASetPrivate(N,E,D) {\r\n if(N != null && E != null && N.length > 0 && E.length > 0) {\r\n this.n = parseBigInt(N,16);\r\n this.e = parseInt(E,16);\r\n this.d = parseBigInt(D,16);\r\n }\r\n else\r\n alert(\"Invalid RSA private key\");\r\n}",
"generatePrivateKey() {\n // Generates 64 hexadecimal values then concatenates all 64 values\n let r = [];\n for (let i = 0; i < 64; i++) {\n r.push(this.random.integer(0, 15).toString(16));\n }\n return r.join('');\n }",
"function create_keychain(user_pass)\n{\n var params = { keyBytes: 32, ivBytes: 16 };\n var dk = keythereum.create(params);\n var password = user_pass;\n var kdf = \"pbkdf2\";\n \n var options = {\n kdf: \"pbkdf2\",\n cipher: \"aes-128-ctr\",\n kdfparams: {\n c: 262144,\n dklen: 32,\n prf: \"hmac-sha256\"\n }\n };\n \n try\n {\n var keyObject = keythereum.dump(password, dk.privateKey, dk.salt, dk.iv, options);\n keythereum.exportToFile(keyObject);\n return keyObject;\n }\n catch(err)\n {\n console.log(\"Enter a password\");\n }\n\n}",
"loginDecryptData(request, self){\n\n let decryptBlob = (privateKey, blob, lengthChars = 4)=>{\n let icn = new iCrypto();\n let symLength = parseInt(blob.substr(-lengthChars))\n let blobLength = blob.length;\n let symk = blob.substring(blobLength- symLength - lengthChars, blobLength-lengthChars );\n let cipher = blob.substring(0, blobLength- symLength - lengthChars);\n icn.addBlob(\"symcip\", symk)\n .addBlob(\"cipher\", cipher)\n .asym.setKey(\"priv\", privateKey, \"private\")\n .asym.decrypt(\"symcip\", \"priv\", \"sym\", \"hex\")\n .sym.decrypt(\"cipher\", \"sym\", \"blob-raw\", true)\n return icn.get(\"blob-raw\")\n };\n\n let encryptBlob = (publicKey, blob, lengthChars = 4)=>{\n let icn = new iCrypto();\n icn.createSYMKey(\"sym\")\n .asym.setKey(\"pub\", publicKey, \"public\")\n .addBlob(\"blob-raw\", blob)\n .sym.encrypt(\"blob-raw\", \"sym\", \"blob-cip\", true)\n .asym.encrypt(\"sym\", \"pub\", \"symcip\", \"hex\")\n .encodeBlobLength(\"symcip\", 4, \"0\", \"symcipl\")\n .merge([\"blob-cip\", \"symcip\", \"symcipl\"], \"res\")\n return icn.get(\"res\");\n };\n\n if (!self.session){\n console.log(\"invalid island request\");\n return;\n }\n\n let clientHSPrivateKey, taPrivateKey, taHSPrivateKey;\n let token = request.body.token;\n let loginData = request.body.dataForDecryption;\n let ic = new iCrypto();\n ic.asym.setKey(\"priv\", self.session.privateKey, \"private\");\n\n //Decrypting client Hidden service key\n if (loginData.clientHSPrivateKey){\n clientHSPrivateKey = decryptBlob(self.session.privateKey, loginData.clientHSPrivateKey)\n }\n\n if (loginData.topicAuthority && loginData.topicAuthority.taPrivateKey){\n taPrivateKey = decryptBlob(self.session.privateKey, loginData.topicAuthority.taPrivateKey )\n }\n\n if (loginData.topicAuthority && loginData.topicAuthority.taHSPrivateKey){\n taHSPrivateKey = decryptBlob(self.session.privateKey, loginData.topicAuthority.taHSPrivateKey)\n }\n\n let preDecrypted = {};\n\n if (clientHSPrivateKey){\n preDecrypted.clientHSPrivateKey = encryptBlob(token, clientHSPrivateKey)\n }\n if (taPrivateKey || taHSPrivateKey){\n preDecrypted.topicAuthority = {}\n }\n if (taPrivateKey){\n preDecrypted.topicAuthority.taPrivateKey = encryptBlob(token, taPrivateKey)\n }\n if (taHSPrivateKey){\n preDecrypted.topicAuthority.taHSPrivateKey = encryptBlob(token, taHSPrivateKey)\n }\n\n let decReq = new Message(self.version);\n decReq.headers.pkfpSource = self.session.publicKeyFingerprint;\n decReq.body = request.body;\n decReq.body.preDecrypted = preDecrypted;\n decReq.headers.command = \"login_decrypted_continue\";\n decReq.signMessage(self.session.privateKey);\n console.log(\"Decryption successfull. Sending data back to Island\");\n\n self.chatSocket.emit(\"request\", decReq);\n }",
"function xorCrypt(str, key) {\n var output = '';\n for (var i = 0; i < str.length; ++i) {\n output += String.fromCharCode(key ^ str.charCodeAt(i));\n }\n return output;\n}",
"function getDecipher(cipher) {\n var salt = cipher.substring(0, 6);\n var password = cipher.substring(6, cipher.length);\n var decipher = crypto.createDecipher('aes-256-cbc', salt);\n decipher.update(password, 'base64', 'utf8');\n return decipher.final('utf8')\n \n}",
"function DISABLEgenerate_encryption_key_4() {\n console.debug(\"navigate-collection.js: generate_encryption_key_4.begin\");\n\n // get default private key\n\n var signing_key_jwk;\n var encryption_key_jwk;\n\n var signing_key_obj;\n var encryption_key_obj;\n\n var defaultEncryptionKeyId;\n var privateKeyJwk;\n var uuid;\n var offeredKeyId;\n\n var signatureStr;\n var publicKeyJwk;\n\n var default_signingkey_found;\n var default_signingkey_created;\n var default_encryptedkey_found;\n var default_encryptedkey_created;\n\n // look for default signing key in the database first, and use this if found\n\n var key;\n key = loadFromIndexedDB_nonpromise(\"keyPairsDB\", \"keyPairsStore\", 'defaultPrivateKey');\n\n console.debug(key);\n console.debug(typeof key);\n if (typeof key == \"undefined\") {\n console.debug(\"default signing key not found\");\n\n } else {\n console.debug(\"a default signing key was found\");\n\n }\n\n window.crypto.subtle.generateKey({\n name: \"RSASSA-PKCS1-v1_5\",\n modulusLength: 1024,\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: {\n name: \"SHA-1\"\n },\n },\n true,\n [\"sign\", \"verify\"]).\n then(function (a) {\n console.debug(\"1\");\n console.debug(a);\n console.debug(a.publicKey);\n signing_key_obj = a;\n return window.crypto.subtle.exportKey(\"jwk\", a.publicKey);\n }).then(function (b) {\n console.debug(\"21\");\n publicKeyJwk = b;\n return 0;\n }).catch(function (err) {\n console.debug(\"HEY!: \" + err.message);\n }).then(function (c) {\n console.debug(c);\n console.debug(\"should have signing key at this point\");\n console.debug(signing_key_obj);\n return loadFromIndexedDB_nonpromise(\"encryptionKeysDB\", \"encryptionKeysStore\", 'defaultSecretKey');\n\n }).then(function (d) {\n console.debug(d);\n console.debug(typeof d);\n // was a default encryption key found ?\n\n\n return \"notfound\";\n //\t if (typeof d == \"undefined\"){\n //\t\t console.debug(\"default encryption key not found\");\n //return 0;\n //\t }else{\n //\t\t console.debug(\"a default encryption key was found\");\n //return 1;\n //\t }\n\n\n }).then(function (e) {\n console.debug(e);\n console.debug(typeof e);\n var algoKeyGen = {\n name: 'AES-GCM',\n // length: 256\n length: 128\n };\n var keyUsages = [\n 'encrypt',\n 'decrypt'\n ];\n\n if (typeof e == \"string\") {\n // no def. key found\n console.debug(\"create new encryption key\");\n\n return window.crypto.subtle.generateKey(algoKeyGen, true, keyUsages);\n } else {\n return window.crypto.subtle.generateKey(algoKeyGen, true, keyUsages);\n\n }\n\n }).then(function (f) {\n console.debug(f);\n console.debug(typeof f);\n\n });\n\n // if new keys were created earlier, save them in the database now\n\n\n //var key = generate_private_key();\n\n\n console.debug(\"navigate-collection.js: generate_encryption_key_4.end\");\n\n}",
"function encryptData(textToEncryp){\n \n // Cipher text\n const cipher = crypto.createCipheriv('aes256', cipherKey, initializationVector);\n \n // Text encrypted with AES-256\n let encrypted = cipher.update(textToEncryp,'utf8','hex');\n encrypted += cipher.final('hex');\n // JSON with Ciphrered Key, initialization vector and ciphered password.\n const result = {key:cipherKey, iv:initializationVector, encrypted:encrypted}\n\n return result;\n}",
"function EvpKDFCompute(password, salt, cfg) {\n // Init hasher\n const newHasher = () => crypto_1.createHash('md5');\n const keySize = cfg.keySize;\n // skipped\n // var iterations = cfg.iterations;\n // Initial values\n let derivedKey, block;\n // Generate key\n for (let k = 0; k < keySize; k++) {\n const hasher = newHasher();\n if (block)\n hasher.update(block);\n block = hasher\n .update(password)\n .update(salt)\n .digest();\n // This code is from crypto-js, but iterations is always 1 in our use case\n //// Iterations\n //for (var i = 1; i < iterations; i++) {\n // block = newHasher().update(block).digest();\n //}\n derivedKey = derivedKey ? Buffer.concat([derivedKey, block]) : block;\n }\n return derivedKey.slice(0, keySize * 4);\n}",
"function generateAndSetKeypair () {\n opts.log(`generating ${opts.bits}-bit RSA keypair...`, false)\n var keys = peerId.create({\n bits: opts.bits\n })\n config.Identity = {\n PeerID: keys.toB58String(),\n PrivKey: keys.privKey.bytes.toString('base64')\n }\n opts.log('done')\n opts.log('peer identity: ' + config.Identity.PeerID)\n\n writeVersion()\n }",
"function Password(){\r\n this.word = 'pass';\r\n this.seed = 1;\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parses and returns a group. | parseGroup() {
const startPos = this.tok.pos;
this.tok.consume("(");
let items = [];
while (true) {
const next = this.tok.peek();
if (next == "(")
items.push(this.parseGroup());
else if (next !== null && /^[A-Z][a-z]*$/.test(next))
items.push(this.parseElement());
else if (next == ")") {
this.tok.consume(next);
if (items.length == 0)
throw new ParseError("Empty group", startPos, this.tok.pos);
break;
}
else
throw new ParseError("Element, group, or closing parenthesis expected", this.tok.pos);
}
return new Group(items, this.parseOptionalNumber());
} | [
"groupSpecifier() {\n this._lastStrValue = \"\";\n if (this.eat(unicode_1.QuestionMark)) {\n if (this.eatGroupName()) {\n if (!this._groupNames.has(this._lastStrValue)) {\n this._groupNames.add(this._lastStrValue);\n return;\n }\n this.raise(\"Duplicate capture group name\");\n }\n this.raise(\"Invalid group\");\n }\n }",
"group (name) {\n var me = `${this.visualType}-${this.model.uid}`,\n group = this.visualParent.getPaperGroup(me);\n if (name && name !== this.visualType) return this.paper().childGroup(group, name);\n else return group;\n }",
"parseStringGroup(modeName, // Used to describe the mode in error messages.\n optional, raw) {\n const groupBegin = optional ? \"[\" : \"{\";\n const groupEnd = optional ? \"]\" : \"}\";\n const nextToken = this.nextToken;\n\n if (nextToken.text !== groupBegin) {\n if (optional) {\n return null;\n } else if (raw && nextToken.text !== \"EOF\" && /[^{}[\\]]/.test(nextToken.text)) {\n // allow a single character in raw string group\n this.gullet.lexer.setCatcode(\"%\", 14); // reset the catcode of %\n\n this.consume();\n return nextToken;\n }\n }\n\n const outerMode = this.mode;\n this.mode = \"text\";\n this.expect(groupBegin);\n let str = \"\";\n const firstToken = this.nextToken;\n let nested = 0; // allow nested braces in raw string group\n\n let lastToken = firstToken;\n\n while (raw && nested > 0 || this.nextToken.text !== groupEnd) {\n switch (this.nextToken.text) {\n case \"EOF\":\n throw new ParseError(\"Unexpected end of input in \" + modeName, firstToken.range(lastToken, str));\n\n case groupBegin:\n nested++;\n break;\n\n case groupEnd:\n nested--;\n break;\n }\n\n lastToken = this.nextToken;\n str += lastToken.text;\n this.consume();\n }\n\n this.mode = outerMode;\n this.gullet.lexer.setCatcode(\"%\", 14); // reset the catcode of %\n\n this.expect(groupEnd);\n return firstToken.range(lastToken, str);\n }",
"function getCurrentMapMatchedGroup (createNewGroup){\n\n\t var mapMatchedGroup;\n\t \n\t if (currRoadShapeArr.length == 1 && createNewGroup){ // we have just started to create a road on the map so we need a corresponding group for this roadCreated\n\t\t mapMatchedGroup= new H.map.Group();\n\t\t mapMatchedRoadGroups.push(mapMatchedGroup);\n\t }else{ // a group for this road already existing so return the last one from the array\n\t \t mapMatchedGroup = mapMatchedRoadGroups[mapMatchedRoadGroups.length - 1];\t\t\t\t\n\t }\n\n\t return mapMatchedGroup;\n\t}",
"group(str) {\n var group = new OpenFDASearch(this);\n this.groups.push(group);\n return group.search(str);\n }",
"parseColorGroup(optional) {\n const res = this.parseStringGroup(\"color\", optional);\n\n if (!res) {\n return null;\n }\n\n const match = /^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);\n\n if (!match) {\n throw new ParseError(\"Invalid color: '\" + res.text + \"'\", res);\n }\n\n let color = match[0];\n\n if (/^[0-9a-f]{6}$/i.test(color)) {\n // We allow a 6-digit HTML color spec without a leading \"#\".\n // This follows the xcolor package's HTML color model.\n // Predefined color names are all missed by this RegEx pattern.\n color = \"#\" + color;\n }\n\n return {\n type: \"color-token\",\n mode: this.mode,\n color\n };\n }",
"function group( item ) {\n\n item [ 'type' ] = TYPE.GROUP;\n item [ 'token' ] = item.uuid;\n item [ 'ts' ] = Service.$tools.getTimestamp( item.updatetime );\n \n return item;\n \n }",
"function _getGroupDataSelector(item) {\n return item.group;\n }",
"function buildGroup(container, renderNode, sceneElement, sceneClass) {\n sceneClass = sceneClass || scene.Class.Scene.GROUP;\n var isNewSceneGroup = selectChild(container, 'g', sceneClass).empty();\n var sceneGroup = selectOrCreateChild(container, 'g', sceneClass);\n // core\n var coreGroup = selectOrCreateChild(sceneGroup, 'g', scene.Class.Scene.CORE);\n var coreNodes = _.reduce(renderNode.coreGraph.nodes(), function (nodes, name) {\n var node = renderNode.coreGraph.node(name);\n if (!node.excluded) {\n nodes.push(node);\n }\n return nodes;\n }, []);\n if (renderNode.node.type === graph.NodeType.SERIES) {\n // For series, we want the first item on top, so reverse the array so\n // the first item in the series becomes last item in the top, and thus\n // is rendered on the top.\n coreNodes.reverse();\n }\n // Create the layer of edges for this scene (paths).\n scene.edge.buildGroup(coreGroup, renderNode.coreGraph, sceneElement);\n // Create the layer of nodes for this scene (ellipses, rects etc).\n scene.node.buildGroup(coreGroup, coreNodes, sceneElement);\n // In-extract\n if (renderNode.isolatedInExtract.length > 0) {\n var inExtractGroup = selectOrCreateChild(sceneGroup, 'g', scene.Class.Scene.INEXTRACT);\n scene.node.buildGroup(inExtractGroup, renderNode.isolatedInExtract, sceneElement);\n }\n else {\n selectChild(sceneGroup, 'g', scene.Class.Scene.INEXTRACT).remove();\n }\n // Out-extract\n if (renderNode.isolatedOutExtract.length > 0) {\n var outExtractGroup = selectOrCreateChild(sceneGroup, 'g', scene.Class.Scene.OUTEXTRACT);\n scene.node.buildGroup(outExtractGroup, renderNode.isolatedOutExtract, sceneElement);\n }\n else {\n selectChild(sceneGroup, 'g', scene.Class.Scene.OUTEXTRACT).remove();\n }\n position(sceneGroup, renderNode);\n // Fade in the scene group if it didn't already exist.\n if (isNewSceneGroup) {\n sceneGroup.attr('opacity', 0).transition().attr('opacity', 1);\n }\n return sceneGroup;\n }",
"parseRegexGroup(regex, modeName) {\n const outerMode = this.mode;\n this.mode = \"text\";\n const firstToken = this.nextToken;\n let lastToken = firstToken;\n let str = \"\";\n\n while (this.nextToken.text !== \"EOF\" && regex.test(str + this.nextToken.text)) {\n lastToken = this.nextToken;\n str += lastToken.text;\n this.consume();\n }\n\n if (str === \"\") {\n throw new ParseError(\"Invalid \" + modeName + \": '\" + firstToken.text + \"'\", firstToken);\n }\n\n this.mode = outerMode;\n return firstToken.range(lastToken, str);\n }",
"getGroup (id) {\n assert.equal(typeof id, 'number', 'id must be number')\n return this._apiRequest(`/group/${id}`)\n }",
"function suckGroup(dom) {\n var lastShape = false;\n\n return new ShapeGroup(\n $(\"> p, > li\", dom).map(function(){ \n\n var \n currentShape, \n\n // Set up the obvious content\n options = suckParams(this);\n\n // If a shape already existed then\n // we can add it as our previous\n if(lastShape) {\n options.previous = lastShape;\n }\n\n currentShape = new Description(options);\n\n // Take the previous and add us as the next\n if(lastShape) {\n lastShape.set('next', currentShape);\n }\n\n // And finally, move the pointer forward\n lastShape = currentShape;\n \n // and then dump our contents\n// $(this).remove();\n\n // Then return it for the map\n return currentShape;\n })\n );\n }",
"attachNewGroup() {\n 'use strict'\n let view, builder, groupType, order\n\n view = this\n builder = aljabr.builder\n\n groupType = view.el.select('#group-type-menu')\n .property('value')\n order = parseInt(view.el.select('#group-order-menu')\n .property('value'), 10)\n console.log('groupType: ' + groupType)\n console.log('order: ' + order)\n\n if (groupType === 'empty') {\n aljabr.group = new aljabr.GroupBuilder(aljabr.alphaElements(order))\n }\n else if (groupType === 'cyclic') {\n aljabr.group = aljabr.buildCyclicGroup(order)\n }\n else if (groupType === 'dihedral') {\n aljabr.group = aljabr.buildDihedralGroup(order)\n }\n else if (groupType === 'alternating') {\n aljabr.group = aljabr.buildAlternatingGroup(order)\n }\n else if (groupType === 'symmetry') {\n aljabr.group = aljabr.buildSymmetryGroup(order)\n }\n\n builder.cayleyTableView.attach(aljabr.group)\n builder.cayleyGraphView.attach(aljabr.group)\n\n return\n }",
"function collectGroups(groups) {\n let name = \"\"\n let tags = new Set()\n for (let group of groups) {\n name += `[${group.name}]+`\n collect(tags, group.tags)\n }\n\n name = name.substring(0, name.length - 1)\n \n return new Group(name, tags)\n}",
"function processContentGroup(cGroup, myDoc) {\r\n\t// One content group (i.e. panel) may contain:\r\n\t//\t\txaxis-group-n\r\n\t//\t\tyaxis-group-n-left\r\n\t//\t\tyaxis-group-n-right\r\n\t//\t\tseries-group(s)\r\n\t//\t\tzeroline-group-n\r\n\t//\r\n\t// Special case: line series (lines and points) may be buried\r\n\t// another layer down; move up where we'll find them...\r\n\t// ...if they exist\r\n\t// NOTE: moved down\r\n\t// try {\r\n\t// \tvar outerLineGroup = cGroup.groupItems['all-line-series-outer-group'];\r\n\t// \tif (typeof outerLineGroup !== 'undefined') {\r\n\t// \t\tfor (var gNo = (outerLineGroup.groupItems.length - 1); gNo >= 0; gNo--) {\r\n\t// \t\t\touterLineGroup.groupItems[gNo].move(cGrpou, ElementPlacement.PLACEATBEGINNING);\r\n\t// \t\t}\r\n\t// \t\touterLineGroup.remove();\r\n\t// \t}\r\n\t// }\r\n\t// catch(e) {};\r\n\t//\r\n\t// Number of this group:\r\n\t// \t\t(SVG groups are numbered from zero)\r\n var cIndex = isolateElementIndex(cGroup.name);\r\n\t// Target layer. If there's more than one panel, content layers\r\n\t// are numbered from 1; if not, they're un-numbered\r\n // Move the entire SVG group into the content layer:\r\n\tvar contentLayer = isolateContentLayer(myDoc, cIndex);\r\n\tcGroup.move(contentLayer, ElementPlacement.PLACEATBEGINNING);\r\n\t\r\n\t// Kludge (here) to fix a structural anomaly with line charts\r\n\tfixLineSeriesGroupStructure(cGroup);\r\n\r\n\t// Deal singly...\r\n\t// ...starting with x axis\r\n\tvar xName = c_myXaxisGroup + cIndex;\r\n\tvar xAxisGroup = lookForElement(cGroup, 'groupItems', xName);\r\n\tif (typeof xAxisGroup !== 'undefined') {\r\n\t\tprocessAxisGroup(xAxisGroup, 'x', cIndex, '', contentLayer);\r\n\t\tmoveChildrenUpstairs(xAxisGroup, contentLayer, false);\r\n\t\t// NOTE: don't forget to delete cGroup (if it doesn't self-destruct)\r\n\t}\r\n\r\n // NOTE: axis stacking, Mar'20\r\n // Scatters and v-thermos need stacking the other way round\r\n // (so that grey x-axis ticks don't overlap y-axis black baseline)\r\n // But how do we know it's scatter/v-thermo? We have to loop\r\n // through to a series group and look there:\r\n var yBefore = false;\r\n for (var gNo = 0; gNo < cGroup.groupItems.length; gNo++) {\r\n var gName = cGroup.groupItems[gNo].name;\r\n if (gName.search('scatter') >= 0 || gName.search('thermo-vertical') >= 0) {\r\n yBefore = true;\r\n break;\r\n }\r\n }\r\n\r\n\t// y axis\r\n\t// y-axis can be left and/or right...\r\n\tvar yLeftName = c_myYaxisGroup + cIndex + c_left;\r\n\tvar yAxisGroup = lookForElement(cGroup, 'groupItems', yLeftName);\r\n\tif (typeof yAxisGroup !== 'undefined') {\r\n\t\tprocessAxisGroup(yAxisGroup, 'y', cIndex, c_left, contentLayer);\r\n\t\tmoveChildrenUpstairs(yAxisGroup, contentLayer, yBefore);\r\n }\r\n \r\n\tvar yRightName = c_myYaxisGroup + cIndex + c_right;\r\n\tvar yAxisGroup = lookForElement(cGroup, 'groupItems', yRightName);\r\n\tif (typeof yAxisGroup !== 'undefined') {\t\r\n\t\tprocessAxisGroup(yAxisGroup, 'y', cIndex, c_right, contentLayer);\r\n\t\tmoveChildrenUpstairs(yAxisGroup, contentLayer, yBefore);\r\n\t}\r\n\r\n\t// Blobs (if any)\r\n\tvar bName = c_itsBlobGroup + cIndex;\r\n\ttry {\r\n\t\tvar bGroup = cGroup.groupItems[bName];\r\n\t\tprocessBlobsGroup(bGroup, cIndex);\r\n\t\tbGroup.move(contentLayer, ElementPlacement.PLACEATBEGINNING)\r\n\t}\r\n\tcatch (e) {};\r\n // Series...\r\n var seriesTypeList = '';\r\n var spindleGroup;\r\n\t// There may be more than one series group, so I loop through...\r\n\tfor (var gNo = cGroup.groupItems.length - 1; gNo >= 0; gNo--) {\r\n\t\tvar myGroup = cGroup.groupItems[gNo];\r\n\t\tif (myGroup.name.search('series-group') >= 0) {\r\n var seriesType = myGroup.name.split(':')[1];\r\n var spindleName = 'thermo-spindles-group-' + cIndex;\r\n seriesTypeList += seriesType\r\n\t\t\tswitch(seriesType) {\r\n\t\t\t\tcase 'column':\r\n\t\t\t\t\tprocessColBarPointSeries(myGroup, contentLayer, false);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'bar':\r\n\t\t\t\t\tprocessColBarPointSeries(myGroup, contentLayer, false);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'pie':\r\n\t\t\t\t\tprocessPieSeries(myGroup, contentLayer);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'scatter':\r\n\t\t\t\t\tprocessScatterSeries(myGroup, contentLayer);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'thermo-horizontal':\r\n // Handle spindes and series\r\n spindleGroup = cGroup.groupItems[spindleName];\r\n\t\t\t\t\tprocessThermoSpindles(spindleGroup, contentLayer);\r\n\t\t\t\t\tprocessThermoSeries(myGroup, contentLayer);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'thermo-vertical':\r\n spindleGroup = cGroup.groupItems[spindleName];\r\n\t\t\t\t\tprocessThermoSpindles(spindleGroup, contentLayer);\r\n\t\t\t\t\tprocessThermoSeries(myGroup, contentLayer);\r\n\t\t\t\t\tbreak;\r\n case 'line':\r\n processLineSeries(myGroup, contentLayer);\r\n break;\r\n case 'points':\r\n // Points on pointline series\r\n // debugger;\r\n processColBarPointSeries(myGroup, contentLayer, true);\r\n break;\r\n }\r\n\t\t\tmyGroup.move(contentLayer, ElementPlacement.PLACEATBEGINNING);\r\n\t\t}\r\n }\r\n // Reloop to bring linepoint groups to front\r\n // debugger;\r\n // for (gNo = cGroup.groupItems.length - 1; gNo >= 0; gNo--) {\r\n for (gNo = 0; gNo < contentLayer.groupItems.length; gNo++) {\r\n\t\tvar myGroup = contentLayer.groupItems[gNo];\r\n\t\tif (myGroup.name.search('point-lines') >= 0) {\r\n // debugger;\r\n\t\t\tmyGroup.move(contentLayer, ElementPlacement.PLACEATBEGINNING);\r\n }\r\n }\r\n\r\n\t// Zero line (if any)\r\n\tvar zName = c_itsZeroLineGroup + cIndex;\r\n try {\r\n var zGroup = cGroup.groupItems[zName];\r\n // Process and move to content layer\r\n processZeroLines(zGroup, contentLayer);\r\n }\r\n\tcatch(e) {};\r\n \r\n // Scatter chart z-axis key group (if any)\r\n var kName = c_itsZaxisKeyGroup;\r\n try {\r\n var keyGroup = cGroup.groupItems[kName];\r\n // Process and move to content layer\r\n processScatterZaxisKey(keyGroup, contentLayer);\r\n }\r\n catch(e) {};\r\n // If mixed/double scale with lines and columns, bring lines to front:\r\n if (seriesTypeList.search('line') >= 0 && seriesTypeList.search('column') >= 0) {\r\n bringMixedScaleLineSeriesToFront(contentLayer);\r\n }\r\n\t\t\r\n}",
"createGroup (title, description = '') {\n assert.equal(typeof title, 'string', 'title must be string')\n assert.equal(typeof description, 'string', 'description must be string')\n return this._apiRequest('/group', 'POST', {\n title,\n description\n })\n }",
"function showGroup() {\n\tvar ps = document.querySelectorAll('p, nav, section, article');\n\tvar i = 0;\n\twhile(i < ps.length) {\n\t\tgroupLength = ps[i].childNodes.length;\n\t\tif(groupLength > 1) {\n\t\t\tvar groupChild = document.createElement('span');\n\t\t\tgroupChild.classList.add('vasilis-srm-group');\n\t\t\tgroupChild.innerHTML = \" Group \" + groupLength + \" items\";\n\t\t\tps[i].appendChild(groupChild);\n\t\t}\n\t\ti++;\n\t}\n}",
"function group_parsing(route, dest){\n d3.text(route, function (csvdata) {\n var groups = {};\n var grouped = {};\n var num = +experimentr.data()['num_pairs'];\n var parsedCSV = d3.csv.parseRows(csvdata);\n for (var j = 1; j < parsedCSV.length; j++) {\n if (!(parsedCSV[j][0] in groups)) {\n groups[parsedCSV[j][0]] = [parsedCSV[j]];\n } else {\n groups[parsedCSV[j][0]] = groups[parsedCSV[j][0]].concat([parsedCSV[j]]);\n }\n }\n var values = Object.keys(groups).map(function (key) {\n return groups[key];\n });\n var raw_binary = values.filter(function (d) {\n return d.length == 2;\n });\n if(experimentr.data()['section']=='mat'){\n n_pair = raw_binary.length;\n }\n if(experimentr.data()['section']=='section2'){\n s2_n_pair = raw_binary.length;\n }\n for(i in groups){\n var t = groups[i][0][groups[i][0].length-1];\n if(!(t in grouped)){\n grouped[t] = [groups[i]];\n }else{\n grouped[t] = grouped[t].concat([groups[i]]);\n }\n }\n data[dest] = [];\n var keys = Object.keys(grouped);\n keys.sort();\n var i, len = keys.length;\n for(i=0;i<len;i++){\n data[dest].push(grouped[keys[i]]);\n }\n data[dest].push([]);\n var answer = [];\n for(var i=0;i<raw_binary.length;i++){\n answer.push(raw_binary[i][0][17]);\n }\n data[dest+'_answer'] = answer;\n experimentr.addData(data);\n });\n}",
"function separateGroup(group) {\n var inputs = [];\n var components = [];\n var outputs = [];\n for (var i = 0; i < group.length; i++) {\n var object = group[i];\n if (object instanceof Switch || object instanceof Button || object instanceof Clock)\n inputs.push(object);\n else if (object instanceof LED)\n outputs.push(object);\n else\n components.push(object);\n }\n return {inputs:inputs, components:components, outputs:outputs};\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find the closestspelled synonym to a keyword cutoff: the tolerance, words must be below this to count as spelled similarly to the keyword thesynonyms: multidimensional array of synonyms, first cell in each subarray will be treated as the primary term | function findclosestsynonym(keyword, cutoff, thesynonyms){
keyword = keyword.toLowerCase();
var ret = "", parentID = -1, childID = -1;
for(var synonymparentindex = 0; synonymparentindex< synonyms.length; synonymparentindex++){
for(var synonymchildindex = 0; synonymchildindex < synonyms[synonymparentindex].length; synonymchildindex++){
var value = levenshteinWeighted(keyword, synonyms[synonymparentindex][synonymchildindex]);
if(value == 0){
return {distance: 0, word: synonyms[synonymparentindex][synonymchildindex], parent: synonymparentindex, child: synonymchildindex};
} else if (value < cutoff){
cutoff = value;
ret = synonyms[synonymparentindex][0];
parentID = synonymparentindex;
childID = synonymchildindex;
}
}
}
for(synonymparentindex=0; synonymparentindex < thesynonyms.length; synonymparentindex++){
var value = levenshteinWeighted(keyword, thesynonyms[synonymparentindex]);
if(value == 0){
return {distance: 0, word: thesynonyms[synonymparentindex], parent: synonymparentindex, child: 0};
} else if (value < cutoff){
cutoff = value;
ret = thesynonyms[synonymparentindex];
parentID = synonymparentindex;
}
}
return {distance: cutoff, word: ret, parent: parentID, child: childID};
} | [
"function findsynonym(keyword, thesynonyms, cutoff){\n if(isUndefined(thesynonyms)){thesynonyms = synonyms;}\n if(isUndefined(cutoff)){cutoff = 0;}\n keyword = keyword.toLowerCase();\n var ret = \"\", parentID = -1, childID = -1, wordfound = \"\";\n for(var synonymparentindex = 0; synonymparentindex< thesynonyms.length; synonymparentindex++){\n for(var synonymchildindex = 0; synonymchildindex < thesynonyms[synonymparentindex].length; synonymchildindex++){\n if(thesynonyms[synonymparentindex][synonymchildindex] == keyword){\n return [synonymparentindex, synonymchildindex, 0, thesynonyms[synonymparentindex][0],thesynonyms[synonymparentindex][0]];//found exact match\n } else if(cutoff>0){\n var value = levenshteinWeighted(thesynonyms[synonymparentindex][synonymchildindex], keyword);\n if (value < cutoff){\n cutoff = value;\n ret = thesynonyms[synonymparentindex][0];\n parentID = synonymparentindex;\n childID = synonymchildindex;\n wordfound = thesynonyms[synonymparentindex][synonymchildindex];\n }\n }\n }\n }\n if(ret){return [parentID,childID,cutoff,ret,wordfound];}//found typo\n return [-1,-1,-1, \"\", \"\"];//found nothing\n}",
"function getSimilarWords(term, arr) {\n\treturn arr.filter(word => word.startsWith(term));\n}",
"function findLongestWord(txt) {\n let strArrayA = txtNoPunctuation(txt);\n let strArrayB = cleanTxt(strArrayA);\n \n let orderedArray = strArrayB.sort(function (wordA, wordB){\n return wordB.length - wordA.length || wordA.localeCompare(wordB);\n });\n \n let filterArray = orderedArray.filter((item, pos, ary) => {\n return !pos || item != ary[pos - 1];\n });\n\n return filterArray.filter((i, index) => (index < 10));\n}",
"function matchFoodToWine(uSearch, indexer){\n var terms = uSearch.split(\" \"); //break the user search into an array of words\n var items = []; //Holds list of all wine matches based on search terms \n var i = terms.length - 1; //Iterator\n \n //Goes through search terms to find if there are paired wines in our matching table\n while(i > -1){\n if(indexer[terms[i]]){\n items = items.concat(indexer[terms[i]]);\n }\n i--;\n }\n\n //If no matches were found take the default wines\n if(items.length === 0){\n items = items.concat(indexer.default);\n }\n items.sort();//sort items by alpha\n items = getMode(items);//get item(s) that appear most frequently\n\n //If there are more than 2 varietals to search then select 2\n //at random. In the future this would be more sophisticated for \n //selection mechanism \n if (items.length > 1){\n items = pickRandom(items); //returns an item from the array to search\n }\n varietalInformation = extractVarietalInfo(items);\n return items;\n }",
"function FilterStopWords(wordArray) {\n // get the common words, define storages for uncommon words\n let commonWords = GetStopWords();\n let commonObj = {};\n let uncommonArr = [];\n\n for (i = 0; i < commonWords.length; i++) {\n // we've got an object with all of the common words inside of it \n commonObj[commonWords[i].trim()] = true;\n }\n\n for (i = 0; i < wordArray.length; i++) {\n // we get every word in our book, trim the spaces and lowercase it \n word = wordArray[i].trim().toLowerCase();\n\n // if the passed in word DOESNT MATCH the word in object commonObj, we add it to our uncommonArr array\n if (!commonObj[word]) {\n uncommonArr.push(word);\n }\n }\n // this is now our filtered array, clean of any common word\n return uncommonArr;\n}",
"function filterLongWords(arrayOfWords, i) {\n if (!arrayOfWords || typeof i !== \"number\") return undefined;\n return arrayOfWords.filter(function (word, idx, array) {\n return ('' + word).length > i;\n }, []);\n}",
"includesEpsilonWord() {\n return includesEpsilonWord(this);\n }",
"function fittingWords(str, strArr){\n var strLength = str.length;\n var retArr = [];\n for (var i = 0; i < strArr.length; i++){\n if (strArr[i].length > strLength) retArr.push(strArr[i]);\n }\n return retArr;\n}",
"function spellcheck(originalString, suggestedWords)\r\n{\r\n\t// this function goes through all the words in the originalString,\r\n\t// looks to see if there is a suggestion for that word, and if so,\r\n\t// replaces it with some html\r\n\t\r\n\tg_suggestedWords = suggestedWords;\r\n\t\r\n\t// check for [[ ]], but not [[[ ]]]\r\n\t\t// it's not perfect, but should catch most stuff\r\n//\tvar tokenizer = /(\\{.*?\\})|(\\<.*?\\>)|(\\[\\[.*?\\]\\])|(\\[.*?\\])|(\\b.+?\\b)/;\r\n\r\n\t// I decided that we did want to spellcheck stuff in between <> and () etc\r\n\t\t// so we use this simple tokenizer instead\r\n\tvar tokenizer = /\\b(.+?)\\b/;\r\n\t// 1 is {}\r\n\t// 2 is <>\r\n\t// 3 is [[ ]]\r\n\t// 4 is [ ]\r\n\t// 5 is a word\r\n\tvar the_str = originalString;\r\n\tvar arr = tokenizer.exec(the_str, \"i\");\r\n\tvar rightContext = RegExp.rightContext;\r\n\t\r\n\tvar i = 0;\r\n\twhile (arr != null) {\r\n\t\ti++;\r\n\t\t\r\n\t\tvar word = arr[1];\r\n//\t\talert(\"next word is \" + word);\r\n\t\t// readies for next time\r\n\t\tarr = tokenizer.exec(rightContext);\r\n\t\t// we only need to search to the right of the word\r\n\t\t// that we just found\r\n\t\t// originally the string was searched from the beginning each time\r\n\t\trightContext = RegExp.rightContext;\r\n\t\t\r\n\t\tif (suggestedWords[word])\r\n\t\t{\r\n\t\t\toriginalString = makeWordClickable(word, i, originalString)\r\n\t\t}\r\n\t}\r\n\t// reset for next time someone does a spell check\r\n\tg_lengthAlreadySearched = 0;\r\n\treturn \"<div style='bgcolor:#0000FF' onmousedown='hideSuggestions()'>\" + originalString + \"</div>\";\r\n}",
"function getBestMatchDefinition(dataFromIBM){\n var bestDefList = [];\n var keywords = dataFromIBM.keywords;\n // loop in dataFromIBM\n for(var i=0; i < keywords.length; i++){\n var word = keywords[i];\n \n // get array\n var tempArray = cleanOneKeyword(word, dataFromIBM);\n if (tempArray.length > 0){\n // get max score\n var maxScore = Math.max.apply(Math, tempArray.map(function(o) { return o.score; }));\n // get definition\n var bestDefinition = tempArray.find(function(o){ return o.score == maxScore; })\n bestDefList.push(bestDefinition);\n }\n }\n\n return bestDefList;\n}",
"function levenshteinDistanceExt(arrayA, arrayB)\n{\n\t// create array of distances between all words\n\tvar arrayC = [];\n\tvar c = 0;\n\tfor(var a = 0; a < arrayA.length; a++)\n\t{\n\t\tfor(var b = 0; b < arrayB.length; b++)\n\t\t{\n\t\t\tarrayC[c] = levenshteinDistance(arrayA[a], arrayB[b]);\n\t\t\tc++; \t\t\t\n\t\t}\n\t}\n\t// sort array\n\tarrayC.sort();\n\n\t// sum of arrayA.length best matches\n\tvar result = 0;\n\tfor(var i = 0; i < arrayA.length; i++)\n\t\tresult = result + arrayC[i];\n\treturn result;\n}",
"function findLevenshteinDistance(word_a, word_b) {\n\tlet distMatrix = [];\n\n\tfor (var i = 0; i < (word_b.length + 2); i++) {\n\t\tdistMatrix[i] = [];\n\n\t\tfor (var j = 0; j < (word_a.length + 2); j++) {\n\t\t\tdistMatrix[i][j] = '0';\n\t\t}\t\n\t}\n\n\tdistMatrix[0][0] = '-'; //free.\n\tdistMatrix[0][1] = ' '; //setting empty word.\n\tdistMatrix[1][0] = ' '; //setting empty word.\n\n\tlet wa = word_a.split('');\n\tlet wb = word_b.split('');\n\n\t//consuming word_a.\n\tfor (var j = 2; j < (wa.length + 2); j++) {\n\t\tdistMatrix[0][j] = wa[(j - 2)];\n\t\tdistMatrix[1][j] = (j - 1).toString();\n\t}\n\n\t//consuming word_b.\n\tfor (var i = 2; i < (wb.length + 2); i++) {\n\t\tdistMatrix[i][0] = wb[(i - 2)];\n\t\tdistMatrix[i][1] = (i - 1).toString();\n\t}\n\n\t//Calculating edit distances.\n\tfor (var i = 2; i < (wb.length + 2); i++) {\n\t\tfor (var j = 2; j < (wa.length + 2); j++) {\n\t\t\tlet collumnIndex = j;\n\t\t\tlet lineIndex = i;\n\n\t\t\twhile(distMatrix[0][collumnIndex] == distMatrix[lineIndex][0] && collumnIndex > 2 && lineIndex > 2) {\n\t\t\t\tlineIndex--;\n\t\t\t\tcollumnIndex--;\n\t\t\t}\n\n\t\t\t// console.log(\"lineIndex: \", lineIndex);\n\t\t\t// console.log(\"collumnIndex: \", collumnIndex);\n\n\t\t\tif (collumnIndex > 2 || lineIndex > 2) {\n\t\t\t\tlet deleteCost = parseInt(distMatrix[lineIndex][(collumnIndex - 1)]);\n\t\t\t\tlet replaceCost = parseInt(distMatrix[(lineIndex - 1)][(collumnIndex - 1)]);\n\t\t\t\tlet insertCost = parseInt(distMatrix[(lineIndex - 1)][collumnIndex]);\n\n\t\t\t\tlet helper = deleteCost < replaceCost ? deleteCost : replaceCost;\n\t\t\t\tlet smallestCost = insertCost < helper ? insertCost : helper;\n\n\t\t\t\tdistMatrix[i][j] = (smallestCost + 1).toString();\n\t\t\t} else {\n\t\t\t\tdistMatrix[i][j] = '0';\n\t\t\t}\n\t\t}\n\t}\n\n\tlet dif = (parseInt(distMatrix[word_b.length + 1][word_a.length + 1]) * 100) / word_b.length;\n\n\tconsole.log('\\n_________________________________');\n\tconsole.log(\"\\nWord A: \", word_a);\n\tconsole.log(\"Word B: \", word_b);\n\tconsole.log(\"\\nLevenshtein distance: \", distMatrix[word_b.length + 1][word_a.length + 1]);\n\tconsole.log(\"Structural difference: \", dif);\n\tconsole.log('_________________________________');\n\n\treturn parseInt(distMatrix[word_b.length + 1][word_a.length + 1]);\n}",
"function Similarity(){\n var u = 1;\n for (u = 1; u < TweetCount+1; u ++){\n// check if there is previous text\nconsole.log(\"last text is: \" + TweetLastText[u]);\nif (TweetLastText[u] !== \"\"){\nTweetSimilar[u] = natural.JaroWinklerDistance(TweetLastText[u],TweetText[u]);\nconsole.log(\"the words similarity is: \" + TweetSimilar[u]);\n }\n// check tweet against all others\nvar o = 1;\n for (o = 1; o < TweetCount+1; o ++){\nif (TweetText[o] !== TweetText[u]){\n console.log(natural.JaroWinklerDistance(TweetText[u],TweetText[o]));\n}\n }\n\n\n\n }\n}",
"function getSynonyms2(word, callback) {\n if (word.length <= 3) {\n callback([{ title: word }]);\n return;\n }\n word=word.replace(/ /g,'-');\n let URL = 'https://www.sinonimosonline.com/' + word + '/';\n alfy.fetch(URL, {encoding: 'latin1', json: false}).then(data => {\n let html = data;\n const $ = cheerio.load(html, { decodeEntities: false });\n var synonymsArray = [];\n $('.sinonimo').each(function(i, elem) {\n synonymsArray.push({\n title: $(this).text().trim(),\n arg: URL,\n quicklookurl: URL\n });//push\n }); //each\n callback(synonymsArray);\n }).catch(function (){\n callback([{ title: word }]);\n return;\n });\n}",
"function processword(word, glossword) {\n if (!word || !glossword) {\n return [[], []]\n }\n var results = [];\n var click_database_result = [];\n var morphemes = word.split('-');\n var glosses = glossword.split('-');\n //if there is not the same number of dashes we aren't aligning the correct morphemes and gloss\n if (morphemes.length!=glosses.length) {\n return [[], []];\n }\n var rootindex = -1;\n //identify verb roots so we can distinguish prefixes from suffixes\n for (var i = 0; i < glosses.length; i++) {\n var gloss = glosses[i];\n //all verb root morphemes end with .rt or .aux\n //TODO: does this include be.loc, be.1d, be.2d, etc? @HSande for details\n if (_.startsWith(gloss, 'be.') || _.endsWith(gloss, '.rt') || _.endsWith(gloss, '.aux')) {\n rootindex = i;\n }\n }\n //iterate over morphemes; if there is a verb root, add pre-dashes to suffixes and post-dashes to prefixes: \n //example: g-a-s-o; clg-rtc-eat.rt-pfv = [g-, a-, s, -o]; [clg-, rtc-, eat.rt, -pfv]\n for (var i = 0; i < glosses.length; i++) {\n var gloss = removePunc(glosses[i].toLowerCase());\n // Remove punctuation, make lower case, and replace all \"Latin Letter\n // Small Schwa\" characters with \"Latin Letter Smal E\" characters, so\n // there is just one schwa character in the corpus. \n var morpheme =\n removePunc(morphemes[i].toLowerCase().replace(/\\u0259/g,'\\u01DD'))\n \n if (gloss.match(/^[0-9]*$/)){\n continue\n }\n if (rootindex==-1) {\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else {\n if (i < rootindex) { \n gloss = gloss+'-';\n morpheme = morpheme+'-';\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else if (i > rootindex) {\n gloss = '-'+gloss;\n morpheme = '-'+morpheme;\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n } else {\n results.push({moroword:[{word:morpheme, count:1}], definition:gloss});\n click_database_result.push({moroword:morpheme, definition:gloss});\n }\n }\n }\n return [results, click_database_result];\n }",
"function suggest(trie_level, word, word_position, build_word, build_array) {\n\t//console.log(word, build_word, build_dist);\n\t// first check and make sure this path is okay\n\tlet curr_dist = build_array[build_array.length - 1][build_array[0].length - 1];\n\tconsole.log(\"\\n\\n\", word, build_word, curr_dist);\n\tprintMultiArray(build_array);\n\tif (word.length <= 2) {\n\t\tif (build_word != word) return suggest(trie_level.childs[word.charCodeAt(build_word.length) - 97], word, word_position + 1, build_word + word[build_word.length], new_array(build_array, word, word[build_word.length]));\n\t\treturn [...auto_complete(trie_level, word, curr_dist)];\n\t}\n\n\tif (curr_dist > 3 && Math.abs(word.length - build_word.length) < 3){\n\t\treturn []; // dud track\n\t}\n\n\tif (word_position >= word.length - 1)\n\t\t// start searching for a auto-complete\n\t\treturn [auto_complete(trie_level, build_word, curr_dist)];\n\n\t// difference between the two current words is less than 2\n\tif (Math.abs(word.length - build_word.length) < 2 && trie_level.finished) { // return\n\t\treturn [{\n\t\t\tword: build_word,\n\t\t\tload: trie_level.finished,\n\t\t\tdist: curr_dist // grab bottom right distance\n\t\t}];\n\t}\n\n\t// otherwise start looking for good paths to travel down\n\t// we can try a certain amount of levels - until the first two letters are off we can continue looking\n\tlet all_suggests = [];\n\tfor (let check_children = 0; check_children < trie_level.childs.length; check_children++)\n\t\tall_suggests = trie_level.childs[check_children] ? [...all_suggests, ...suggest(trie_level.childs[check_children], word, word_position + 1, build_word + String.fromCharCode(check_children + 97), build_array[0].length != build_array.length ? new_array(build_array, word, String.fromCharCode(check_children + 97)) : build_array)] : all_suggests;\n\n\tif (build_word.length == 0 && all_suggests.length) {\n\t\tfor (let i = 0; i < all_suggests.length; i++)\n\t\t\tall_suggests[i].signifigance = all_suggests[i].load - (all_suggests[i].dist * 3);\n\t\tquicksort(all_suggests, 0, all_suggests.length - 1, \"signifigance\");\n\t\tall_suggests = all_suggests.splice(0, 5);\n\t}\n\treturn all_suggests;\n}",
"function calculateKeyword(treated){\n if(treated.length > 63){\n fundamental_vars.tooBigKeys = true;\n return treated.substring(0,63);\n } else if(treated.length < 2){\n fundamental_vars.tooSmallKeys = true;\n return false;\n }\n return treated;\n}",
"getSuggestions(name, distance = 3) {\n const leven = require('leven');\n const { commands, aliases } = this.getAllCommandsAndAliases();\n const suggestions = commands\n .filter(({ commandName }) => leven(name, commandName) <= distance)\n .map(({ commandName }) => commandName);\n return suggestions.concat(Object.keys(aliases).filter((alias) => leven(name, alias) <= distance));\n }",
"rank(word){cov_25grm4ggn6.f[6]++;cov_25grm4ggn6.s[27]++;if(!word){cov_25grm4ggn6.b[10][0]++;cov_25grm4ggn6.s[28]++;return 0;}else{cov_25grm4ggn6.b[10][1]++;}cov_25grm4ggn6.s[29]++;if(!word.length){cov_25grm4ggn6.b[11][0]++;cov_25grm4ggn6.s[30]++;return 0;}else{cov_25grm4ggn6.b[11][1]++;}cov_25grm4ggn6.s[31]++;if(!this.max){cov_25grm4ggn6.b[12][0]++;cov_25grm4ggn6.s[32]++;return 0;}else{cov_25grm4ggn6.b[12][1]++;}cov_25grm4ggn6.s[33]++;if(!this.maxLength){cov_25grm4ggn6.b[13][0]++;cov_25grm4ggn6.s[34]++;return 0;}else{cov_25grm4ggn6.b[13][1]++;}cov_25grm4ggn6.s[35]++;if(!this.count[word]){cov_25grm4ggn6.b[14][0]++;cov_25grm4ggn6.s[36]++;return 0;}else{cov_25grm4ggn6.b[14][1]++;}cov_25grm4ggn6.s[37]++;word=word.toString().toLowerCase();//normalize word length weighting\nlet weight=(cov_25grm4ggn6.s[38]++,word.length/this.maxLength);cov_25grm4ggn6.s[39]++;return weight*(this.count[word]/this.max);}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test: createQueryFromJson(jsonQuery) Creating query for: TREND | function testCreateQueryFromJsonTrend() {
// Call the function to test
var generatedOutput = createQueryFromJson(jsonQueryTrend);
var expectedOutput =
'Monthly trend of Sum of Units where Item is In Binder, Pencil, Pen' +
' from OrderDate 2019-01-06 to 2019-07-12';
// Checking if generated output is same as expected output
assertEquals(expectedOutput, generatedOutput, 'createQueryFromJsonTrend');
} | [
"function testCreateQueryFromJsonTimeCompare() {\n // Call the function to test\n var generatedOutput = createQueryFromJson(jsonQueryTimeCompare);\n var expectedOutput = \n 'Compare the Mean of Unit Cost for the OrderDate 2019-01-06 to 2019-03-15' +\n ' and 2019-04-01 to 2019-07-12 by Region';\n \n // Checking if generated output is same as expected output\n assertEquals(expectedOutput, generatedOutput, 'testCreateQueryFromJsonTimeCompare');\n}",
"function testCreateQueryFromJsonTopK() {\n // Call the function to test\n var generatedOutput = createQueryFromJson(jsonQueryTopK);\n var expectedOutput = \n 'Find the top-7 Rep with maximum Total where Units is Greater than 50';\n \n // Checking if generated output is same as expected output\n assertEquals(expectedOutput, generatedOutput, 'createQueryFromJsonTopK');\n}",
"function testCreateQueryFromJsonShow() {\n // Call the function to test\n var generatedOutput = createQueryFromJson(jsonQueryShow);\n var expectedOutput = \n 'Show Sum of Units for Item from OrderDate 2019-01-06 to 2019-07-12';\n \n // Checking if generated output is same as expected output\n assertEquals(expectedOutput, generatedOutput, 'createQueryFromJsonShow');\n}",
"function testCreateQueryFromJsonCorrelation() {\n // Call the function to test\n var generatedOutput = createQueryFromJson(jsonQueryCorrelation);\n var expectedOutput = \n 'Correlation between Unit Cost and Total for each Item';\n \n // Checking if generated output is same as expected output\n assertEquals(expectedOutput, generatedOutput, 'createQueryFromJsonCorrelation');\n}",
"function buildQueryObject(formData) {\n const {\n time_range,\n since,\n until,\n order_desc,\n row_limit,\n row_offset,\n limit,\n timeseries_limit_metric,\n queryFields\n } = formData,\n residualFormData = _objectWithoutPropertiesLoose(formData, [\"time_range\", \"since\", \"until\", \"order_desc\", \"row_limit\", \"row_offset\", \"limit\", \"timeseries_limit_metric\", \"queryFields\"]);\n\n const numericRowLimit = Number(row_limit);\n const numericRowOffset = Number(row_offset);\n const {\n metrics,\n groupby,\n columns\n } = (0, _extractQueryFields.default)(residualFormData, queryFields);\n const groupbySet = new Set([...columns, ...groupby]);\n return _extends({\n extras: (0, _processExtras.default)(formData),\n granularity: processGranularity(formData),\n groupby: (0, _processGroupby.default)(Array.from(groupbySet)),\n is_timeseries: groupbySet.has(DTTM_ALIAS),\n metrics: metrics.map(_convertMetric.default),\n order_desc: typeof order_desc === 'undefined' ? true : order_desc,\n orderby: [],\n row_limit: row_limit == null || Number.isNaN(numericRowLimit) ? undefined : numericRowLimit,\n row_offset: row_offset == null || Number.isNaN(numericRowOffset) ? undefined : numericRowOffset,\n since,\n time_range,\n timeseries_limit: limit ? Number(limit) : 0,\n timeseries_limit_metric: timeseries_limit_metric ? (0, _convertMetric.default)(timeseries_limit_metric) : null,\n until\n }, (0, _processFilters.default)(formData));\n}",
"function generateQuery (type) {\n const query = new rdf.Query()\n const rowVar = kb.variable(keyVariable.slice(1)) // don't pass '?'\n\n addSelectToQuery(query, type)\n addWhereToQuery(query, rowVar, type)\n addColumnsToQuery(query, rowVar, type)\n\n return query\n }",
"function call_create_query() {\n\t// list every node with class saveQuery:\n\tvar values = '';\n\tvar nodes = dojo.query(\".saveQuery\");\n\n\tfor( var x = 0; x < nodes.length; x++ ) {\n\t\tvar k, v;\n\n\t\tk = nodes[x].id;\n\t\tv = nodes[x].value;\n\t\tif( k == 'name' ) {\n\t\t\tv = encodeURIComponent(v); // make sure the name is encoded.\n\t\t}\n\t\tif( v[0] != '#' ) {\n\t\t\t// console.log(k, v);\n\t\t\tvalues += \"&{0}={1}\".format(k, v);\n\t\t}\n\t}\n\n\tvar xmlhttp = new XMLHttpRequest();\n\tvar url = '{0}?method=create{1}&random={3}'.format(getQuerypage(), values, randomString(5));\n\t// console.log(url);\n\txmlhttp.open('GET', url, false);\n\txmlhttp.send();\n\tif( xmlhttp.status == 200 ) {\n\t\talert('Saved');\n\t} else {\n\t\talert('Error creating:' + xmlhttp.responseText);\n\t}\n}",
"async function test_14_in_params()\n{\n // TODO not expecting this to work yet.\n console.log(\"*** test_14_in_params ***\");\n // initialize a new database\n let [ db, retrieve_root ] = await TU.setup();\n\n // insert data\n const statements = [\n [ DT.addK, \"bob\", K.key(\":name\"), \"Bobethy\" ],\n [ DT.addK, \"bob\", K.key(\":likes\"), \"sandra\" ],\n [ DT.addK, \"sandra\", K.key(\":name\"), \"Sandithan\"]];\n\n db = await DB.commitTxn( db, statements );\n\n // query the data\n const q = Q.parseQuery(\n [Q.findK, \"?a\", \"?b\", \"?c\",\n Q.inK, \"$\", \"?b\", \"?c\",\n Q.whereK, \n [\"?a\", \"?b\", \"?c\"],\n ]\n );\n const r = await Q.runQuery( db, q, K.key( \":name\" ), \"Bobethy\" );\n\n console.log(\"r14\", r);\n assert(\n r.length === 1 && \n r[0][2] === \"Bobethy\", \n \"Query returned an unexpected value\");\n console.log(\"*** test_14_in_params PASSED ***\");\n\n}",
"function analyzeQuery(query, root)\n {\n let allSubQueries = [{\n exact: [],\n sort: {},\n range: []\n }];\n\n // First, go through the query for all exact match fields\n Object.keys(query).forEach(function(key)\n {\n const value = query[key];\n\n // This is not a special mongo field\n if(key[0] != '$')\n {\n // Now look at the value, and decide what to do with it\n if(value instanceof Date || value instanceof mongodb.ObjectID || value instanceof mongodb.DBRef)\n {\n allSubQueries.forEach(subQuery => subQuery.exact.push(trimPeriods(root + key)));\n }\n else if(value instanceof Object)\n {\n const subQueries = analyzeQuery(value, root + key);\n allSubQueries = mergeSubQueries(allSubQueries, subQueries);\n }\n else\n {\n allSubQueries.forEach(subQuery => subQuery.exact.push(trimPeriods(root + key)));\n }\n }\n else\n {\n if(key == '$lt' || key == '$lte' || key == '$gt' || key == '$gte' || key == '$in' || key == '$nin' || key == '$neq' || key == '$ne' || key == '$exists' || key == '$mod' || key == '$all' || key == '$regex' || key == '$size')\n {\n allSubQueries.forEach(subQuery => subQuery.range.push(trimPeriods(root)));\n }\n else if(key == '$eq')\n {\n allSubQueries.forEach(subQuery => subQuery.exact.push(trimPeriods(root)));\n }\n else if(key == \"$not\")\n {\n const elemSubQueries = analyzeQuery(value, root);\n allSubQueries = mergeSubQueries(allSubQueries, elemSubQueries);\n }\n else if(key == '$elemMatch')\n {\n // For $elemMatch, we have to create a subquery, and then modify its field names and merge\n // it into our existing sub queries\n const elemSubQueries = analyzeQuery(value, root + \".\");\n allSubQueries = mergeSubQueries(allSubQueries, elemSubQueries);\n }\n else if(key == '$options' || key == '$hint' || key == '$explain' || key == '$text')\n {\n // We can safely ignore these\n }\n else if(key == '$and' || key == '$or')\n {\n // Ignore these, they are processed after\n }\n else if(key == '$comment')\n {\n // Comments can be used by the application to provide additional metadata about the query\n allComments.push(value);\n }\n else\n {\n console.error(\"Unrecognized field query command: \", key);\n }\n }\n });\n\n // Now if there are $and conditions, process them\n if (query['$and'])\n {\n query['$and'].forEach(function(andSubQuery)\n {\n allSubQueries = mergeSubQueries(allSubQueries, analyzeQuery(andSubQuery, root));\n });\n }\n\n // Lastly, process any $or conditions\n if (query['$or'])\n {\n allSubQueries = mergeSubQueries(allSubQueries, underscore.flatten(query['$or'].map(subQuery => analyzeQuery(subQuery, root))));\n }\n\n return allSubQueries;\n }",
"function query_test() {\n DB.clear_all()\n let album1 = create_dummy(Album)\n let album2 = create_dummy(Album)\n let album3 = create_dummy(Album)\n let all_albums_query = create_live_query().all(Album).make()\n check.equals(all_albums_query.current().length(),3,'all album check')\n all_albums_query.sync()\n let album4 = create_dummy(Album)\n all_albums_query.sync()\n check.equals(all_albums_query.current().length(),4)\n\n let yellowsub_query = create_live_query().all(Album).attr_eq(\"title\",\"Yellow Submarine\").make()\n yellowsub_query.sync()\n all_albums_query.sync()\n check.equals(all_albums_query.current().length(),4, 'total album count')\n check.equals(yellowsub_query.current().length(),0,'yellow sub should be 0')\n\n create_dummy(Album, {title: 'Yellow Submarine'})\n yellowsub_query.sync()\n all_albums_query.sync()\n check.equals(all_albums_query.current().length(),5, 'total album count')\n check.equals(yellowsub_query.current().length(),1)\n\n\n // make three tracks. one on album1 and two on album 2\n create_dummy(Track, {album:album1, title:'title1'})\n create_dummy(Track, {album:album2, title:'title2'})\n create_dummy(Track, {album:album2, title:'title3'})\n\n // make a track query. verify three tracks total\n let all_tracks_query = create_live_query().all(Track).make()\n all_tracks_query.sync()\n check.equals(all_tracks_query.current().length(),3)\n\n // make a track query for tracks on album1, verify 1 track\n let album1_tracks_query = create_live_query().all(Track).attr_eq('album',album1).make()\n check.equals(album1_tracks_query.current().length(),1)\n\n\n // make a track query for tracks on album2, verify 2 tracks\n let album2_tracks_query = create_live_query().all(Track).attr_eq('album',album2).make()\n check.equals(album2_tracks_query.current().length(),2)\n //check the titles\n check.equals(create_live_query().all(Track).attr_eq('title','title1').make().current().length(),1)\n check.equals(create_live_query().all(Track).attr_eq('title','title2').make().current().length(),1)\n //this one should fail\n check.equals(create_live_query().all(Track)\n .attr_eq('title','title4').make()\n .current().length(),0)\n\n //check if attr in array\n console.log(\"checking if title in [title1,title2]\")\n check.equals(create_live_query().all(Track)\n .attr_in_array('title',['title1','title2','title4']).make()\n .current().length(),2)\n\n //check if track in one of a set of albums\n check.equals(create_live_query().all(Track)\n .attr_in_array('album',[album1,album2]).make()\n .current().length(),3)\n\n // all tracks for all albums.\n let all_albums = create_live_query().all(Album).make()\n let all_album_tracks = create_live_query().all(Track)\n .attr_in_array('album',all_albums).make()\n check.equals(all_album_tracks.current().length(),3)\n\n // make a Selection which contains an array of Albums\n // let selected_albums = create_dummy(Selection, {albums:[album2, album3]})\n\n // make a query of albums in the selection\n // let selected_albums_query = create_live_query().all(Track)\n // .attr_in_array('album',selected_albums).make()\n // check.equals(selected_albums_query.current().length(),2)\n\n // make a query of tracks in albums in selection\n // let selected_tracks_query = create_live_query().all(Track)\n // .attr_eq('album',selected_albums_query).make()\n // check.equals(selected_tracks_query.current().length(),2)\n}",
"buildSearchQuery() {\n if (this.get('invalidSearchTerm') || Ember.isEmpty(this.get('searchTerm'))) {\n return {};\n }\n const searchTerm = this.get('searchTerm');\n const query = {};\n\n if (this.get('searchType.date')) {\n if (_dates.default.isValidDate(searchTerm, 'MM/DD/YYYY')) {\n query.birthDate = searchTerm;\n } else {\n this.set('searchType.date', false);\n }\n }\n if (this.get('searchType.ssn')) {\n if (/^\\d{3}-?\\d{2}-?\\d{4}$/.test(searchTerm)) {\n query.socialSecurityNumber = searchTerm;\n this.set('searchTerm', _pfStringUtil.default.formatSSN(this.get('searchTerm')));\n } else {\n this.set('searchType.ssn', false);\n }\n }\n if (this.get('searchType.name')) {\n Ember.merge(query, _patientSearch.default.formatNameParameters(searchTerm));\n }\n if (this.get('searchType.prn')) {\n query.patientRecordNumber = searchTerm;\n }\n return query;\n }",
"function makeCannedQueryTable()\n{\n\t$(\"#tablesorter-list\").html(\"\"); //clear out table\n\tvar strUrl = JSON_API_URL;\n\t//var data = { method:\"CannedQuery.getList\"};\n\tvar data = { method:\"CannedQueryHelper.getSortedList\"};\n\tpostData(strUrl, data, function(json)\n\t{\n\t\tg_canned_query_list_json = json;\n\t\tdrawTable();\n\t}, error);\n}",
"function get_tweets(query, $q) {\n\tvar q = $q.defer();\n\n\tvar transaction \t= tweets_db.transaction([\"tweets\"],\"readonly\");\n\t\n\tvar store \t\t\t= transaction.objectStore(\"tweets\");\n\tconsole.log(\"Nemam Amma Bhagavan Sharanam -- Query is \" + query); \n\n\t// Open index\n\tvar index \t\t\t= store.index(\"query, status_id\");\n\tvar boundedKeyRange = IDBKeyRange.bound([query, \"\"], [query, \"Z\"]);\n\tvar tweets_array \t= new Array();\n\t\n\t// Asynchronous method to search tweets table and return the \n\t// tweets array after all the entries are searched\n\tindex.openCursor(boundedKeyRange, \"prev\").onsuccess = function(e) {\n\t var tweet_cursor = e.target.result;\n\t if(tweet_cursor) {\n\t \t\n\t\t\ttweets_array.push(tweet_cursor.value);\n\t\t\ttweet_cursor.continue();\n\t\t}\n\t\telse {\n\t\t\t// Resolve the promise if there is no error \n\t\t\tconsole.log(\"Nemam Amma Bhagavan Sharanam -- \" + tweets_array.length);\n\t\t\t q.resolve({tweets: tweets_array, num_tweets: tweets_array.length});\n\t\t}\n\t} // openCursor on success\n\t\n\treturn q.promise;\n\n} // get_tweets",
"_init_query(config, parent_keys) {\n parent_keys = parent_keys || [];\n\n if (config.one_required) {\n this._add_one_required(config.one_required, parent_keys);\n }\n\n if (!config.query) {\n throw `Trying to initialize datasource without query (${this.get_id()})`;\n }\n\n for (let [key, subconfig] of Object.entries(config.query)) {\n if (!Object.isObject(subconfig) || subconfig.type === undefined) {\n // Straight up value\n this._set_query_param(key, subconfig, parent_keys);\n } else if (subconfig.type === 'static') {\n // Type indicates it's a straight up value\n this._set_query_param(key, subconfig.data, parent_keys);\n } else if (subconfig.type === 'placeholder') {\n this._set_query_param(key, subconfig.default, parent_keys);\n\n if (subconfig.required) {\n this._add_required_key(key, parent_keys);\n }\n } else if (subconfig.type === 'observer') {\n // Observer, register for event\n this._set_query_param(key, subconfig.default, parent_keys);\n\n if (subconfig.required) {\n this._add_required_key(key, parent_keys);\n }\n\n let mapping;\n\n if (subconfig.mapping || subconfig.mapping_default) {\n mapping = Mapping.gen_mapping(subconfig);\n }\n\n if (subconfig.event_type) {\n let callback = payload => {\n if (subconfig.event_filter) {\n let filter = this.gen_event_filter(subconfig.event_filter);\n if (!filter(this, subconfig.event_type, payload)) {\n return;\n }\n }\n\n let changed = false;\n\n if (mapping) {\n payload = mapping(payload);\n }\n\n if (Utils.is_set(payload, true) || subconfig.default === undefined) {\n changed = this._set_query_param(key, payload, parent_keys);\n } else {\n changed = this._set_query_param(key, subconfig.default, parent_keys);\n }\n\n if (changed && this._auto_get_data) {\n clearTimeout(this._get_data_timeout);\n this._get_data_timeout = setTimeout(() => {\n this._get_data(undefined, this._disable_cache);\n }, this.get_data_timeout);\n }\n };\n\n if (Object.isArray(subconfig.event_type)) {\n Observer.register_many(subconfig.event_type, callback);\n } else {\n Observer.register(subconfig.event_type, callback);\n }\n }\n } else if (subconfig.type === 'dynamic') {\n // Subquery, init recursively\n this._init_query(subconfig, [...parent_keys, key]);\n } else {\n // Invalid\n throw 'Invalid query';\n }\n }\n }",
"function prepareQuery(hash) {\n\t'use strict';\n\tds.historics.prepare({\n\t\t'hash': hash,\n\t\t'start': startTime,\n\t\t'end': endTime,\n\t\t'sources': 'twitter',\n\t\t'name': 'Example historic query'\n\t}, function(err, response) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\t\telse {\n\t\t\tconsole.log('Prepared query: ' + response.id);\n\t\t\tcreateSubscription(response.id);\n\t\t}\n\t});\n}",
"diff(query) {\n if (this.useInitialQuery(query)) {\n return {\n result: this._INITIAL_QUERY.result,\n complete: true\n };\n }\n return super.diff(query);\n }",
"async function getDailyTrips(dayIndex, query) {\n\tconst response = await pgClientForDivvyTrips.query(query);\n\n\n for (i = 0; i < response.rows.length; i++) {\n\n plainTextDateTime = moment(response.rows[i].hour_timestamp).format('YYYY-MM-DD, h:mm:ss a');\n\n\n var countofdept = {\n\n \"total_trips\": response.rows[i].total_trips,\n \"hour_timestamp\": plainTextDateTime,\n \"day\": response.rows[i].day\n\n };\n\n dailyTrips[dayIndex].push(countofdept);\n\n }\n}",
"function convertExistingQueryProps(json, builder) {\n const keys = Object.keys(json);\n\n for (let i = 0, l = keys.length; i < l; ++i) {\n const key = keys[i];\n const value = json[key];\n\n if (isQueryProp(value)) {\n json[key] = queryPropToKnexRaw(value, builder);\n }\n }\n\n return json;\n}",
"function delete_tweets_by_query(query, $q) {\n\tvar q \t \t\t\t= $q.defer();\n\tvar index \t\t\t= tweets_db.transaction([\"tweets\"], \"readwrite\").objectStore(\"tweets\").index(\"query, status_id\");\n\tvar boundedKeyRange = IDBKeyRange.bound([query, \"\"], [query, \"Z\"]);\n\tindex.openCursor(boundedKeyRange).onsuccess = function(event) {\n\t\tvar tweet_cursor = event.target.result;\n\t\tif (tweet_cursor) {\n\t\t \t// Delete Request for deleting tweet\n\t\t var request = tweet_cursor.delete();\n\t\t request.onsuccess = function() {\n\t\t \tconsole.log(\"Nemam Amma Bhagavan Sharanam -- Deleted Tweet\");\n\t\t };\n\t\t // Move to the next tweet\n\t\t tweet_cursor.continue();\n\t \t} // if cursor is valid\n\t \telse {\n\t \t\t// All tweets are deleted\n\t \tconsole.log(\"Nemam Amma Bhagavvan Sharanam -- No more entries!\");\n\t \tq.resolve(\"All Tweets are deleted\");\n\t \t} // Else cursor is null\n\n\t} // OpenCursor\n\treturn q.promise;\n} // delete_tweets_by_query"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create an eosjs authority provider using this link. | makeAuthorityProvider() {
const { rpc } = this;
return {
async getRequiredKeys(args) {
const { availableKeys, transaction } = args;
const result = await rpc.fetch('/v1/chain/get_required_keys', {
transaction,
available_keys: availableKeys.map(utils_1.normalizePublicKey),
});
return result.required_keys.map(utils_1.normalizePublicKey);
},
};
} | [
"newAuthorisedCapability (holder, id, type, location, sphere, validFrom, validTo) {\n const subject = {\n id: 'did:caelum:' + this.did + '#issued-' + (id || 0),\n capability: {\n type: type || 'member',\n sphere: (['over18', 'oidc'].includes(type) ? 'personal' : 'professional')\n }\n }\n if (location) subject.capability.location = location\n const credential = {\n '@context': [\n 'https://www.w3.org/2018/credentials/v1',\n 'https://caelumapp.com/context/v1'\n ],\n id: 'did:caelum:' + this.did + '#issued',\n type: ['VerifiableCredential', 'AuthorisedCapability'],\n issuer: 'did:caelum:' + this.did,\n holder: holder,\n issuanceDate: new Date().toISOString(),\n credentialSubject: subject\n }\n return credential\n }",
"async function apiManagementCreateAuthorizationProviderGenericOAuth2() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const authorizationProviderId = \"eventbrite\";\n const parameters = {\n displayName: \"eventbrite\",\n identityProvider: \"oauth2\",\n oauth2: {\n grantTypes: {\n authorizationCode: {\n authorizationUrl: \"https://www.eventbrite.com/oauth/authorize\",\n clientId: \"\",\n clientSecret: \"\",\n refreshUrl: \"https://www.eventbrite.com/oauth/token\",\n scopes: \"\",\n tokenUrl: \"https://www.eventbrite.com/oauth/token\",\n },\n },\n redirectUrl:\n \"https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ApiManagementClient(credential, subscriptionId);\n const result = await client.authorizationProvider.createOrUpdate(\n resourceGroupName,\n serviceName,\n authorizationProviderId,\n parameters\n );\n console.log(result);\n}",
"getIdentityprovidersPureengage() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/pureengage', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"async launchTopicAuthority(taPrivateKey = Err.required(),\n taHSPrivateKey = Err.required(),\n taPkfp = Err.required()){\n Logger.debug(\"About to launch topic authority: \" + taPkfp);\n await this.connector.checkLaunchIfNotUp(taHSPrivateKey);\n const ta = new TopicAuthority(this.historyManager);\n ta.encryptCachePrivateKey(taPrivateKey);\n ta.setKeysFromPrivate(taPrivateKey);\n ta.setResidence(iCrypto.onionAddressFromPrivateKey(taHSPrivateKey));\n await ta.loadMetadata();\n ta.loadInviteIndex();\n this.registerTopicAuthority(ta);\n Logger.debug(\"Topic authority was launched\");\n }",
"async function initialize() {\n const web3 = new Web3(await oracle_1.getWeb3Provider());\n // Get the provider and contracts\n const provider = await initProvider(web3);\n const title = await provider.getTitle();\n if (title.length == 0) {\n console.log(\"Initializing provider\");\n const res = await provider.initiateProvider(oracle_1.ProviderData);\n console.log(res);\n console.log(\"Successfully created oracle\", oracle_1.ProviderData.title);\n for (const spec in oracle_1.Responders) {\n const r = await provider.initiateProviderCurve({\n endpoint: spec,\n term: oracle_1.Responders[spec].curve\n });\n console.log(r);\n console.log(\"Successfully initialized endpoint\", spec);\n }\n }\n console.log(\"Oracle exists. Listening for queries\");\n provider.listenQueries({}, (err, event) => {\n if (err) {\n throw err;\n }\n handleQuery(provider, event, web3);\n });\n}",
"function anchor_type_create(anchor_type)\n{\n var anchor_main_hash=getMainAchorHash();\n var new_anchorType= {Anchor_Type:anchor_type,Anchor_Text:\"\"};\n var key=commit(\"anchor\",new_anchorType);\n commit(\"anchor_links\",{Links:[{Base:anchor_main_hash,Link:key,Tag:\"Anchor_Type\"}]});\n var anctyplnk= getLink(anchor_main_hash,\"Anchor_Type\",{Load:true});\n return anctyplnk.Links[0].H;\n}",
"async function createEOSToken () {\n const TOKEN_ABI_PATH = './tests/testing-contracts/compiled/eosio.token.abi';\n const TOKEN_WASM_PATH = './tests/testing-contracts/compiled/eosio.token.wasm';\n const TOTAL_SUPPLY = '1000000000.0000 SYS';\n\n // Creates eosio.token account if you don't have it\n try {\n const tokenAccount = await Account.createFromName('eosio.token');\n const tokenContract = await eoslimeTool.Contract.deployOnAccount(TOKEN_WASM_PATH, TOKEN_ABI_PATH, tokenAccount);\n await tokenContract.actions.create([tokenAccount.name, TOTAL_SUPPLY]);\n await tokenContract.actions.issue([ACCOUNT_NAME, TOTAL_SUPPLY, 'memo']);\n } catch (error) {\n }\n }",
"async function apiManagementCreateAuthorizationProviderOobGoogle() {\n const subscriptionId = process.env[\"APIMANAGEMENT_SUBSCRIPTION_ID\"] || \"subid\";\n const resourceGroupName = process.env[\"APIMANAGEMENT_RESOURCE_GROUP\"] || \"rg1\";\n const serviceName = \"apimService1\";\n const authorizationProviderId = \"google\";\n const parameters = {\n displayName: \"google\",\n identityProvider: \"google\",\n oauth2: {\n grantTypes: {\n authorizationCode: {\n clientId: \"\",\n clientSecret: \"\",\n scopes:\n \"openid https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email\",\n },\n },\n redirectUrl:\n \"https://authorization-manager.consent.azure-apim.net/redirect/apim/apimService1\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new ApiManagementClient(credential, subscriptionId);\n const result = await client.authorizationProvider.createOrUpdate(\n resourceGroupName,\n serviceName,\n authorizationProviderId,\n parameters\n );\n console.log(result);\n}",
"function createProvider() {\n return (new LocalProvider());\n }",
"function addRootAuthorities(resp) {\n rootAuthorities.forEach(function (authority) {\n resp.authority.push(dns.NS({\n name: '',\n data: authority + '.',\n ttl: 518400\n }));\n });\n}",
"async function createAOSProvider() {\n const subscriptionId =\n process.env[\"WORKLOADS_SUBSCRIPTION_ID\"] || \"00000000-0000-0000-0000-000000000000\";\n const resourceGroupName = process.env[\"WORKLOADS_RESOURCE_GROUP\"] || \"myResourceGroup\";\n const monitorName = \"mySapMonitor\";\n const providerInstanceName = \"myProviderInstance\";\n const providerInstanceParameter = {\n providerSettings: {\n prometheusUrl: \"http://192.168.0.0:9090/metrics\",\n providerType: \"PrometheusOS\",\n sapSid: \"SID\",\n sslCertificateUri: \"https://storageaccount.blob.core.windows.net/containername/filename\",\n sslPreference: \"ServerCertificate\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new WorkloadsClient(credential, subscriptionId);\n const result = await client.providerInstances.beginCreateAndWait(\n resourceGroupName,\n monitorName,\n providerInstanceName,\n providerInstanceParameter\n );\n console.log(result);\n}",
"getIdentityprovidersOkta() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/okta', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"getIdentityproviders() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"generateOnionService(){\n let pkraw = forge.rsa.generateKeyPair(1024);\n let pkfp = forge.pki.getPublicKeyFingerprint(pkraw.publicKey, {encoding: 'hex', md: forge.md.sha1.create()})\n let pem = forge.pki.privateKeyToPem(pkraw.privateKey);\n\n if (pkfp.length % 2 !== 0) {\n // odd number of characters\n pkfp = '0' + pkfp;\n }\n let bytes = [];\n for (let i = 0; i < pkfp.length/2; i = i + 2) {\n bytes.push(parseInt(pkfp.slice(i, i + 2), 16));\n }\n\n let onion = base32.encode(bytes).toLowerCase() + \".onion\";\n return {onion: onion, privateKey: pem};\n }",
"function linkProviderWithUser() {\n // TODO: implement this: used for registering an already existing user with a provider\n }",
"async created () {\n // Create a new instance of OIDC client using members of the given options object\n this.oidcClient = new Oidc.UserManager({\n userStore: new Oidc.WebStorageStateStore(),\n authority: options.authority,\n client_id: options.client_id,\n redirect_uri: redirectUri,\n response_type: options.response_type,\n scope: options.scope\n })\n\n try {\n // If the user is returning to the app after authentication..\n if (\n window.location.hash.includes('id_token=') &&\n window.location.hash.includes('state=') &&\n window.location.hash.includes('expires_in=')\n ) {\n // handle the redirect\n await this.handleRedirectCallback()\n onRedirectCallback()\n }\n } catch (e) {\n this.error = e\n } finally {\n // Initialize our internal authentication state\n this.user = await this.oidcClient.getUser()\n this.isAuthenticated = this.user != null\n this.loading = false\n }\n }",
"function OAuthManager() {\n}",
"function createArea(axios$$1, area) {\n return restAuthPost(axios$$1, 'areas', area);\n }",
"getIdentityprovidersOnelogin() { \n\n\t\treturn this.apiClient.callApi(\n\t\t\t'/api/v2/identityproviders/onelogin', \n\t\t\t'GET', \n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\t{ },\n\t\t\tnull, \n\t\t\t['PureCloud OAuth'], \n\t\t\t['application/json'],\n\t\t\t['application/json']\n\t\t);\n\t}",
"setProvider(provider) {\n this.provider = provider;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
singleClickFunc function hides and shows an indivdual card | function singleClickFunc() {
//TODO add your code here to get the desired functionality
$('.cardImg', this).toggle();
console.log('Running singleClickFunc()')
} | [
"function handletoggleUserCard() {\n userCard.style.visibility = 'visible';\n}",
"function toggleCardTools() {\n if (cardTools.css('display') == 'none') {\n cardTools.slideDown(400);\n } else if (cardTools.css('display') == 'block') {\n cardTools.slideUp(150);\n }\n }",
"function showingHiddingCanvas(mode){\r\n\t\r\n\t let x = document.getElementById(\"display-mode\");\r\n\t x.style.display = mode;\r\n\r\n}",
"function hide(card1, card2){\n\n //hide the cards\n card1.removeClass(\"open show\");\n card2.removeClass(\"open show\");\n\n //reset opened cards list\n openedCards = [];\n}",
"function showCard(card, callback) {\n $(\"#question-content\").html(card.question.replace(/\\n/g, \"<br/>\"));\n $(\"#answer-content\").html(card.answer.replace(/\\n/g, \"<br/>\"));\n\n // Set up answer toggle\n $(\"#answer-placeholder\").show();\n $(\"#answer-content\").hide();\n $(\"#answer-panel\").click(function() {\n $(\"#answer-content\").show();\n $(\"#answer-placeholder\").hide();\n $(this).off();\n });\n\n // set click listener on grade buttons\n $(\"#grade-toolbar button\").on('click.grade', function() {\n $(\"#grade-toolbar button\").off('click.grade');\n callback(card, parseInt($(this).data(\"grade\")));\n });\n }",
"function hideCard(card) {\n // get a list of all cards\n\n let cardArray = ['lbValue','kgValue','ozValue','gmValue'];\n\n \tfor(var i= 0;i < cardArray.length; i++) {\n \t\tif(cardArray[i] == card) {\n \t\t\tlet match = cardArray[i];\n\n\n \t\t\tdocument.getElementById(match).style.display = 'none';\n \t\t}\n \t\telse {\n let match = cardArray[i];\n \t\t\tdocument.getElementById(match).style.display = 'block';\n \t\t\t\n \t\t}\n \t}\n\n \tupdateValues() ;\n \t\n }",
"function showCardReading(carddiv) {\r\n\t\r\n}",
"function enableClickOnCard () {\n\topenCardList[0].click(flipCard);\n}",
"function showmain_img(btnsw,hid1,hid2,hid3,hid4,hid5,hid6,shwmain){\n\n\tbtnsw.click(function(){\n\n\t\thid1.hide(\"fast\");\n\n\t\thid2.hide(\"fast\");\n\n\t\thid3.hide(\"fast\");\n\n\t\thid4.hide(\"fast\");\n\n\t\thid5.hide(\"fast\");\n\n\t\thid6.hide(\"fast\");\n\n\t\tshwmain.show(\"fast\");\n\n\t});\n\n}",
"function renderBlackcard(){\n blackCardsContainer.show();\n blackCardsContainer.children().each(function(){\n $(this).on(\"click touch\", function(){\n blackCardsContainer.hide();\n cardPreview.show();\n app();\n });\n });\n }",
"function clickedCard() {\r\n cardsDeck.addEventListener('click', function (card) {\r\n showCard(card);\r\n });\r\n}",
"function showCard(card){\n card.classList.add('show','open');\n}",
"function close_card(){ \r\n \tcart.style.display = \"none\";\r\n }",
"function toggleCardColor() {\n if (cardColor.css('display') == 'none') {\n cardColor.slideDown(150);\n } else if (cardColor.css('display') == 'block') {\n cardColor.slideUp(400);\n }\n }",
"function flipCard(card) {\n card.classList.toggle('open');\n card.classList.toggle('show');\n}",
"function toggle_display(idname)\n{\n\tobj = fetch_object(idname);\n\tif (obj)\n\t{\n\t\tif (obj.style.display == \"none\")\n\t\t{\n\t\t\tobj.style.display = \"\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tobj.style.display = \"none\";\n\t\t}\n\t}\n\treturn false;\n}",
"function toggle() {\n if (a1 == 1) {\n setShowMe1(\n !showMe1\n ); \n }\n /* Toggles second card if answer for question 2 or 4 is true */\n if (a2 == 1 || a4 == 1) {\n setShowMe2(\n !showMe2\n ); \n }\n /* Toggles third card if answer for question 3 is true */\n if (a3 == 1) {\n setShowMe3(\n !showMe3\n );\n }\n /* Toggles fourth card if answer for question 4 is true */\n if (a5 == 1) {\n setShowMe4(\n !showMe4\n ); \n }\n /* Toggles last card if no answer is true */\n if (a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0 && a5 == 0) {\n setShowMe5(!showMe5);\n }\n }",
"function showHideAuthor () {\n\n //chair description is hidden here\n chairText.style.display=displayNone;\n\n if (authorDisplay.style.display === displayNone || authorDisplay.style.display === \"\") {\n authorDisplay.setAttribute(\"class\", \"grid-item slide-left\");\n\n authorDisplay.style.display = displayBlock;\n aboutAuthor.style.display=displayBlock;\n\n authorMenu.innerHTML=\"close the description\";\n aboutMenu.style.display=displayNone;\n\n } else {\n authorDisplay.setAttribute(\"class\", \"grid-item\");\n\n authorDisplay.style.display = displayNone;\n aboutAuthor.style.display=displayNone;\n\n authorMenu.innerHTML=\"about the author\";\n aboutMenu.style.display=displayBlock;\n }\n}",
"function showHelper(event, element) {\n $ctrl.ide.tooltip.hide();\n for(const menuButton of dropdownButtons){\n if(element.parentNode !== menuButton) {\n menuButton.hideDropdown(event);\n }\n }\n \n element.style.visibility = \"visible\";\n element.setAttribute(\"visible\", \"\");\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the given litemessage id is in LevelDB's litemessage index (only opn main branch), or it's in the pending pool, the return value will be `true`. | async hasLitemsg(litemsgId) {
return (await this.blockchain.litemsgOnMainBranch(litemsgId))
|| this.inLitemsgPool(litemsgId);
} | [
"function isState(message){\n console.log(states.indexOf('' + message) + ' ' + message);\n if (states.indexOf(message) != -1){\n return true;\n } else {\n return false;\n }\n}",
"isSaved(id) {\n if ( id in this.state.savedItems ) {\n return true\n }\n else {\n return false\n }\n }",
"get canMarkThreadAsRead() {\n if (\n (this.displayedFolder && this.displayedFolder.getNumUnread(false) > 0) ||\n this.view._underlyingData === this.view.kUnderlyingSynthetic\n ) {\n // If the messages limit is exceeded we bail out early and return true.\n if (this.selectedIndices.length > this.MAX_COUNT_FOR_MARK_THREAD) {\n return true;\n }\n\n for (let i of this.selectedIndices) {\n if (\n this.view.dbView.getThreadContainingIndex(i).numUnreadChildren > 0\n ) {\n return true;\n }\n }\n }\n return false;\n }",
"async function verifyTweetExistance(tweet_id){\n const { rowCount } = await pool.query(\"SELECT ID FROM tweets WHERE ID = $1\",[tweet_id])\n if(rowCount) return true\n else return false\n}",
"contains (data, size = data.length) {\n for (let i = 0; i < this.nHashes; i++) {\n const idx = hash(i, this.nHashes, data, size) % this.nBits\n if (this.bfMask) {\n if (!this.bfMask.get(idx))\n return false\n }\n else if (this.bfCntr) {\n if (bfGet(this.bfCntr, idx) === 0)\n return false\n }\n }\n return true\n }",
"function messageOnPage(messageID) {\n return ($j(\"a[name='\" + messageID + \"']\").length > 0);\n }",
"inCache(addr) {\n console.assert(0 <= addr.idx && addr.idx < this.setNum, \"Illegal index: \" + addr.idx);\n\n var entries = this.sets[addr.idx];\n for(var i = 0; i < entries.length; i++) {\n if(addr.tag == entries[i].tag && entries[i].valid) {\n return i;\n }\n }\n\n return null;\n }",
"async checkIfGameisBorrowed(id) {\n const gameCollection = await rentGameCollection();\n const rentgame = await gameCollection.findOne({ gameId: id });\n if (!rentgame) return false;\n if (rentgame.isBorrowed) {\n return true;\n }\n return false;\n }",
"function checkMessageStore(rssItem) {\n return !!messagesStore[rssItem.link];\n}",
"updateIsOnGraphStatus(id) {\n var docNode = this.getDocNodeShortText(id);\n if (!docNode) {\n return false\n }\n\n if (docNode && !this.getEditor().value.document.hasNode(docNode.key)) {\n // tell the graph node that there is no doc node any more, for whatever reason\n this.removeDocNode(id)\n return false\n }\n\n return true\n }",
"function checkIfInAnalysisQueue(systemId, callback) {\n var params = {\n Key: {\n SystemId: {\n S: systemId\n }\n },\n TableName: tableName\n };\n db.getItem(params, function(err, data) {\n if (err) {\n console.log(\"ERROR (getSystem)\", err, err.stack);\n return callback(err);\n }\n\n var inQueue;\n if (data && data.Item) {\n if(data.Item.InQueue) inQueue = data.Item.InQueue.S === 'Y';\n else inQueue = false;\n } else {\n inQueue = null;\n }\n\n return callback(err, inQueue);\n });\n}",
"Ln(t, e, n, s) {\n // The query needs to be refilled if a previously matching document no\n // longer matches.\n if (n.size !== e.size) return !0; // Limit queries are not eligible for index-free query execution if there is\n // a potential that an older document from cache now sorts before a document\n // that was previously part of the limit. This, however, can only happen if\n // the document at the edge of the limit goes out of limit.\n // If a document that is not the limit boundary sorts differently,\n // the boundary of the limit itself did not change and documents from cache\n // will continue to be \"rejected\" by this boundary. Therefore, we can ignore\n // any modifications that don't affect the last document.\n\n const i = \"F\"\n /* First */\n === t ? e.last() : e.first();\n return !!i && (i.hasPendingWrites || i.version.compareTo(s) > 0);\n }",
"idAlreadyExistsInBundle(id) {\n for (let e of this.entry) {\n let resource = e.resource;\n if (resource['id'] === id)\n return true;\n }\n return false;\n }",
"isBusy() {\n return this.totalTasks() >= this.options.maxPoolSize;\n }",
"addOrder(order) {\n\t\tlet found = false;\n\t\tthis.pool.forEach((o) => {\n\t\t\tif (o.id == order.id)\n\t\t\t\tfound = true;\n\t\t});\n\t\tif (!found)\n\t\t\tthis.pool.push(order);\n\t\treturn !found;\n\t}",
"isLocalOnHold() {\n if (this.state !== CallState.Connected) return false;\n if (this.unholdingRemote) return false;\n let callOnHold = true; // We consider a call to be on hold only if *all* the tracks are on hold\n // (is this the right thing to do?)\n\n for (const tranceiver of this.peerConn.getTransceivers()) {\n const trackOnHold = ['inactive', 'recvonly'].includes(tranceiver.currentDirection);\n if (!trackOnHold) callOnHold = false;\n }\n\n return callOnHold;\n }",
"function isInParty(pokeID) {\n if(partyList.find(({id}) => id === pokeID)) {\n return true;\n } else {\n return false;\n }\n }",
"function tileIdExistsInArray(tileId, array) {\n\t\tfor (var i = 0; i < array.length; i++) {\n\t\t\tvar nextTileId = array[i].attr(\"id\");\n\t\t\tif (tileId == nextTileId) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n}",
"checkID(id){\n for (var i = 0; i < this.player_list.length; i++) {\n if (this.player_list[i].id == id) {\n return true;\n }\n }\n return false;\n }",
"checkIfCurrentJob() {\n return (this.jobId === DiffDrawer.currentJobId);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Post a xmlhttp request on server to save company data, reset page content accordingly | function saveCompanyData (callback) {
const xhr = new XMLHttpRequest();
xhr.open('POST', `/settings?id=${companyId}`);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.send(JSON.stringify({
company_name: document.getElementById('company-name-input').value,
country: document.getElementById('company-country-input').value,
phone_number: document.getElementById('company-phone-number-input').value || null,
account_holder_name: document.getElementById('company-account-holder-name-input').value || null,
timezone: document.getElementById('country-timezone-input').value || null
}));
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.responseText) {
const response = JSON.parse(xhr.responseText);
if (!response.success && response.error)
return callback(response.error);
return callback(null);
}
};
} | [
"function saveCompany(company) {\n\n // update the target URL\n var targetUrl = CompanyUrl;\n\n // Update the stored data\n $.ajax({\n url: targetUrl,\n type: 'POST',\n dataType: 'json',\n data: company,\n success: function (data, txtStatus, xhr) {\n var token;\n clearCompanyDetails();\n clearCompanies();\n token = loadCompanyData(refreshCompanyComboData);\n setEditMode(false);\n },\n error: function (xhr, textStatus, errorThrown) {\n alert(\"Error Saving new Company: \" +xhr.Response.text);\n }\n });\n }",
"function postCompanyInfo() {\r\n\r\n var companyInfo = new JobSearchApp.Models.Company({\r\n name: $compName.val(),\r\n companyEmail: $compEmail.val(),\r\n phone: $tel.val(),\r\n url: $compUrl.val()\r\n });\r\n\r\n JobSearchApp.DataAccess.saveCompany(companyInfo, function (postedCompany) {\r\n toastr.success(\"Company info posted to Azure\");\r\n console.log(postedCompany);\r\n\r\n postJob(postedCompany.id);\r\n postAddress(postedCompany.id);\r\n\r\n }, function (error) {\r\n toastr.error(\"Your posting to Azure failed\");\r\n console.log(error);\r\n });\r\n\r\n }",
"function updateCompany(company) {\n\n // update the target URL\n var targetUrl = CompanyUrl;\n\n // Update the stored data\n $.ajax({\n url: targetUrl,\n type: 'PUT',\n dataType: 'json',\n data: company,\n success: function (data, txtStatus, xhr) {\n var token;\n clearCompanyDetails();\n clearCompanies();\n token = loadCompanyData(refreshCompanyComboData);\n setEditMode(false);\n },\n error: function (xhr, textStatus, errorThrown) {\n alert(\"Error Saving new Company: \" + xhr.Response.text);\n }\n });\n }",
"function sendDataServer(contactObject,productsTab,dataMemory,dataTemp) {\n var requestOrder = '{\"contact\": '+ JSON.stringify(contactObject)+ ', \"products\": '+ JSON.stringify(productsTab)+'}';\n dataTemp.setItem(\"toSend\",requestOrder);\n document.location.href = \"../pages/validation.html\";\n dataMemory.clear();\n}",
"function saveContentEdit(_data){\n var docu = new DOMParser().parseFromString('<content></content>', \"application/xml\")\n var newCDATA=docu.createCDATASection(_data);\n $(data).find(\"page\").eq(currentPage).find(\"content\").first().empty();\n $(data).find(\"page\").eq(currentPage).find(\"content\").first().append(newCDATA);\n $(data).find(\"page\").eq(currentPage).attr(\"review\", review);\n sendUpdate();\n }",
"function saveAndPublishResponse(resp) {\n resContainer.innerHTML = publishAsText(resp);\n lastReqResponse = resp;\n localStorage.setItem('lastReqResponse', JSON.stringify(resp)); \n}",
"function updateCompanyHandler() {\n var company = new Company();\n\n company.CompanyID = currentCompany.CompanyID;\n company.Name = $(\"#txtName\").val();\n company.ContactName = $(\"#txtContactName\").val();\n company.ContactAlias = $(\"#txtContactAlias\").val();\n company.DomainName = $(\"#txtDomainName\").val();\n company.OrganizationRestricted = $(\"#orgFlag\").prop('checked');\n company.ProjectRestricted = $(\"#projectFlag\").prop('checked');\n company.isActive = $(\"#activeFlag\").prop('checked');\n\n updateCompany(company);\n\n }",
"function XmlHttpPOST(xmlhttp, url, data) {\n try {\n xmlhttp.open(\"POST\", url, true);\n xmlhttp.send(data);\n\n } catch (ex) {\n // do nothing\n }\n}",
"saveChanges() {\n return spPost(WebPartDefinition(this, \"SaveWebPartChanges\"));\n }",
"function AssignCompany() {\r\n if ($scope.CompanyList.length == 1) {\r\n $scope.CompanyId = $scope.CompanyList[0].CompanyId.toString();\r\n }\r\n $http({\r\n method: \"POST\",\r\n url: \"/api/Admin/ResetToken\",\r\n params: { companyId: $scope.CompanyId }\r\n }).success(function (data) {\r\n if (data == 'success')\r\n LoadUserList();\r\n }).error(function (error) {\r\n });\r\n }",
"function sendDataToPersist() {\n let inputs = memeForm.getElementsByTagName(\"input\");\n let inputname = inputs[\"name\"].value;\n log(\"inputname => \" + inputname);\n if (inputname === \"\") {\n log(\"makePatchRequest\");\n makePatchRequest(inputs);\n } else {\n log(\"makePostRequest\");\n makePostRequest(inputs);\n }\n}",
"formSave() {\n $(document).off('click', '#form-save');\n $(document).on('click', '#form-save', $.proxy(function(){\n //convert form to json object\n var formInJSON = save.saveData(\".\"+this.options.subElement);\n\n var title = formInJSON.title;\n //if sid on the url params then it will become the filename of the editor\n if (\"sid\" in this.params && this.params.sid !== undefined) {\n title = this.params.sid;\n }\n //options for the pcapi\n var options = {\n remoteDir: \"editors\",\n path: encodeURIComponent(title)+\".json\",\n data: JSON.stringify(formInJSON)\n };\n\n //check if the survey is public\n if(this.params.public === 'true'){\n options.urlParams = {\n 'public': 'true'\n };\n }\n\n //store the form to pcapi\n pcapi.updateItem(options).then(function(result){\n utils.giveFeedback(\"Your form has been saved successfully\");\n });\n\n }, this));\n }",
"function SaveCompanyShift() {\r\n if (!ValidateShiftTime()) {\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n CreateRequestObject();\r\n var data = JSON.stringify($scope.ShiftList);\r\n $http({\r\n method: \"POST\",\r\n url: \"api/Admin/SaveShift\",\r\n params: { requestParam: data }\r\n }).then(function (successData) {\r\n if (successData.status == 202) {\r\n $scope.ErrorMsg = successData.data;\r\n angular.element('#idReqValidation').show();\r\n return;\r\n }\r\n if (successData.data == 'Y') {\r\n $scope.Reset();\r\n $scope.SuccessMessage = 'Shift details saved successfully for selected company';\r\n }\r\n });\r\n }",
"function processTripIdSaveResponse(data){\n\t\t// if validation errors exist, display them.\n\t\tif(data.validationErrors.errors != undefined){\n\t\t\tprocessTripIdValidationErrors(data.validationErrors.errors);\n\t\t\tsaveValidationErrors = true;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// if multiple appointments found for the given date range,\n\t\t// prompt user to choose an appointment\n\t\tif(data.validationErrors.appointments != null){\n\t\t\thandleMultipleAppointments(dojo.fromJson(data.validationErrors.appointments[0]), \"Travel Requisitions\");\n\t\t\tsaveValidationErrors = true;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// display errors in error grid\n\t\tif((data.errors != null)){\n\t\t\tupdateErrorsGrid(data.errors);\n\t\t}\n\t\t\n\t\t// if save successful\n\t\tif(data.response.treqEventId != null){\n\t\t\t// update request Id\n\t\t\tdojo.byId('treqEventId').value = data.response.treqEventId;\n\t\t\t\n\t\t\t// update revision no\n\t\t\tdojo.byId('revNo').innerHTML = data.response.revisionNo;\n\t\t\t\n\t\t\t// update prev next button state\n\t\t\tif(data.response.revisionNo > 0){\n\t\t\t\tdojo.byId('prevRevBtn').disabled = false;\n\t\t\t\tdojo.byId('nextRevBtn').disabled = true;\n\t\t\t}\n\t\t\t\n\t\t\t// show save confirmation\n\t\t\tnotifyTripId('Saved successfully', false);\n\t\t\t// refresh details tab if save was performed through the pop up\n\t\t\tif (dijit.byId('travel_req_tab_container').selectedChildWidget.id != \"idTab\"){\n\t\t\t\tdijit.byId('travel_req_tab_container').selectedChildWidget.refresh();\n\t\t\t}\n\t\t\t\n\t\t\t// if modify was saved, set the tabs to reload\n\t\t\t/*if(modifyBtnClicked){ \n\t\t\t\tif(findElementPositionInArray(tabsToReload, 'expenseDetailsTab') < 0)\n\t\t\t\t\ttabsToReload.push('expenseDetailsTab');\n\t\t\t\tif(findElementPositionInArray(tabsToReload, 'liquidationsTab') < 0)\n\t\t\t\t\ttabsToReload.push('liquidationsTab');\n\n\t\t\t\t// reset variable state\n\t\t\t\tmodifyBtnClicked = false;\n\t\t\t}\t*/\n\t\t}else{\n\t\t\t// expense event Id is always returned, if operation is successful\n\t\t\tnotifyTripId('Save failed!', true);\n\t\t\t// this return will evaluate to problemsDuringSave = true;\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}",
"function save(_customer_id)\n { \n close_customer_search();\n if(window.mobileSaveBrowseData){\n window.mobileSaveBrowseData(_customer_id, 36313484);\n } else {\n win = null;\n try {\n Bm.setAttrVal('_customer_id', _customer_id);\n } catch(e) {\n console.log(e);\n } \n \n setDocFormIds(document_id, window.document.bmDocForm.document_number.value, 36313484);\n bmSubmitForm('/commerce/buyside/document.jsp', window.document.bmDocForm, bmValidateForm, 'performAction');\n }\n }",
"function sendDataToServer(survey) {\n //var resultAsString = JSON.stringify(survey.data);\n //alert(resultAsString); //send Ajax request to your web server.\n let dataReq = new RequestObj(1, \"/survey\", \"/save/projects/?/context/?\", [projectName, context], [], survey.data);\n userEmail = survey.data.EMAIL1;\n serverSide(dataReq, \"POST\", function () {\n //log.warn(a);\n let asciiMail = \"\";\n for (let i = 0; i < userEmail.length; i++) {\n asciiMail += userEmail[i].charCodeAt(0) + \"-\";\n }\n asciiMail = asciiMail.substring(0, asciiMail.length - 1);\n location.href = window.location.href + \"&userEmail=\" + asciiMail;\n })\n}",
"function edit_currents() {\r\n console.log('--------------------------------')\r\n title = document.getElementById(\"current_title\").value\r\n keywords = document.getElementById(\"current_keywords\").value\r\n descriptions = document.getElementById(\"current_descriptions\").value\r\n\r\n // Sent POST request\r\n url = edit_currents_url\r\n console.log(url)\r\n $.post(url,\r\n // POST\r\n {\r\n // kkkxxxx: kkk is prefix to note keyword, xxxx is the keyword\r\n kkkdate: (new Date()).valueOf(),\r\n kkktitle: title,\r\n kkkkeywords: keywords,\r\n kkkdescriptions: descriptions\r\n },\r\n\r\n // Handle response\r\n function (data, status) {\r\n console.log(`Posting to ${url}`)\r\n console.log(\"Data: \" + data + \"\\nStatus: \" + status)\r\n alert(`Response: ${data}`)\r\n\r\n dict = JSON.parse(data)\r\n document.getElementById(\"current_title\").value = dict.title\r\n document.getElementById(\"current_keywords\").value = dict.keywords\r\n document.getElementById(\"current_descriptions\").value = dict.descriptions\r\n keywords_onchange()\r\n descriptions_onchange()\r\n\r\n // Enable commit button\r\n document.getElementById(\"commit\").disabled = false\r\n },\r\n );\r\n}",
"function SavePage ()\n{\n\tvar PageName = doAction('REQ_GET_FORMVALUE', \"PageName\", \"PageName\");\n\tif (!PageName)\n\t{\n\t\tPageName = doAction('ST_GET_STATEDATA', 'CurrentPageName', 'CurrentPageName');\n\t\tif (!PageName || PageName == '')\n\t\t\tPageName = gHOME_PAGE;\n\t}\n\tvar seObj = generateSEObjects (gCURRENT_PAGE);\n\taddUpdateSiteEditorCfg (PageName, seObj.pageObjArray[gCURRENT_PAGE], \n\t\t\t\t\t\t\tseObj.pageObjArray[gBASE_PAGE], seObj.colNames);\n\treturn (SavePageByName (PageName));\n}",
"function makeCorsRequest() {\n var url = 'https://h0h46kcpo6.execute-api.us-east-2.amazonaws.com/Prod?text='+contenttosend;\n var xhr = createCORSRequest('GET', url);\n if (!xhr) {\n //console.log(\"CORS not supported\");\n return;\n }\n\n // Response handlers.\n xhr.onload = function() {\n if(content != null || content != \"\"){\n var content = JSON.parse(xhr.responseText).text;\n //console.log(\"Received: \"+content);\n\n// Content edits before insertion back into website.\n// Potential code goes here.\n//**************************\n\n// Set text back and edit the content.\nif (window.getSelection().toString() != \"\") {\n //console.log(\"Placing selected text back...\");\n sel = window.getSelection();\n if (sel.rangeCount) {\n range = sel.getRangeAt(0);\n range.deleteContents();\n range.insertNode(document.createTextNode(content));\n }\n}\nelse if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n range.text = content;\n}\nelse{\n if(window.location.host == \"mail.google.com\"){\n foundElement[0].innerHTML = content;\n }\n else if(window.location.host == \"www.facebook.com\"){\n foundElement[0].innerHTML = content;\n }\n else{\n foundElement.value = content;\n }\n}\n }\n };\n\n xhr.onerror = function() {\n //console.log(\"Request error\");\n };\n xhr.send();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if there are any modified records before OOSE risk/coverage/class/component data | function preOoseChangeValidation(type, gridId, baseRecordIdColumnName) {
isForOose = "Y";
var valid = true;
var XMLData = getXMLDataForGridName(gridId);
var rowIndex = 0;
var currentRowId = getSelectedRow(gridId);
var baseRecordId = XMLData.recordset(baseRecordIdColumnName).value;
var recordModeCode = XMLData.recordset("CRECORDMODECODE").value;
// Loop the riskListGrid recordset to do the check
first(XMLData);
while (!XMLData.recordset.eof) {
var curRecordModeCode = XMLData.recordset("CRECORDMODECODE").value;
var curBaseRecordId = XMLData.recordset(baseRecordIdColumnName).value;
if (!isEmpty(curBaseRecordId)
&& curBaseRecordId == baseRecordId
&& (curRecordModeCode == "TEMP" || curRecordModeCode == "REQUEST")) {
valid = false;
currentRowId = XMLData.recordset("ID").value;
alert(getMessage("pm.oose.modified.record.exist.error2", new Array(type)));
break;
}
rowIndex ++;
next(XMLData);
}
selectRowById(gridId, currentRowId, rowIndex);
return valid;
} | [
"haveChanges() {\n return this.code !== this.codeFromTableau;\n }",
"_isModify(orgUnit) {\n return Object.keys(orgUnit).length > 0;\n }",
"_checkEmberModelsOnDirty() {\n let checkresult = false;\n\n let editformIsDirty = this.get('model.editform.hasDirtyAttributes');\n\n let dataobject = this.get('model.dataobject');\n\n let attributes = dataobject.get('attributes');\n let changedAttributes = attributes.filterBy('hasDirtyAttributes');\n let attributesIsDirty = changedAttributes.length > 0 ? true : false;\n\n let association = this.get('store').peekAll('fd-dev-association');\n let changedAssociations = association.filterBy('hasDirtyAttributes');\n let associationIsDirty = changedAssociations.length > 0 ? true : false;\n\n let aggregation = this.get('store').peekAll('fd-dev-aggregation');\n let changedAggregation = aggregation.filterBy('hasDirtyAttributes');\n let aggregationIsDirty = changedAggregation.length > 0 ? true : false;\n\n if (editformIsDirty || attributesIsDirty || associationIsDirty || aggregationIsDirty) {\n checkresult = true;\n }\n\n return checkresult;\n }",
"async verifyUnchanged () {\n\t\t// query the database directly for our test models, verify the\n\t\t// update query has not yet persisted\n\t\tconst ids = this.models.map(model => model.id);\n\t\tconst response = await this.mongoData.test.getByIds(ids);\n\t\tresponse.forEach(responseObject => {\n\t\t\tAssert(responseObject.text === 'hello' + responseObject.number, `model ${responseObject.id} was persisted`);\n\t\t});\n\t}",
"function checkUnsavedChanges()\n{\n\tif(store.dirty)\n\t\t{\n\t\tif(confirm(config.messages.unsavedChangesWarning))\n\t\t\tsaveChanges();\n\t\t}\n}",
"function verifyExtraFieldsFromProduct() {\n if ($scope.device.product.extraFields) {\n\n }\n }",
"function isDifferrent(existing, entry) {\n\tfor (var prop in entry) {\n\t\tif (existing.hasOwnProperty(prop)) {\n\t\t\t// comparing array of interests otherwise suggests new data present\n\t\t\tif ((typeof entry[prop] !== 'object' && existing[prop] !== entry[prop])\n\t\t\t\t|| (typeof entry[prop] == 'object' && !arraysEqual(existing[prop], entry[prop]))) {\n\n\t\t\t\t// ****ideally want this logged to a temp file\n\t\t\t\t// console.log(`updated ${prop}: ${entry.orgName.substr(0,20)}: ${existing[prop]} -> ${entry[prop]}`);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\t// new data field supplied, also considered an update\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"_checkIfDirty(){\n if (this._isDirty === true){\n this._isDirty = false;\n this._refresh();\n }\n }",
"mutateStatCheck() {\n if (!this.levelInfos.has(this.curLevelNum)) {\n console.error('Tried to mutate stat but Bookkeeper does not have current level?');\n return false;\n }\n return true;\n }",
"parametersChanged() {\n let arr = Object.entries(this.parameters)\n let res = arr.map(item=>{\n return this.prevParameters[item[0]] == item[1]\n }).find(item=>!item)\n\n this.prevParameters = {...this.parameters}\n return !res\n }",
"function checkLineIfCommited(id){\n\tvar dv = id.split(\"||\");\n\tvar dev1 = dv[0].split(\".\");\n\tvar dev2 = dv[1].split(\".\");\n\tvar device1 = dev1[0];\n\tvar device2 = dev2[0];\n\tvar dev1Condition = false;\n\tvar dev2Condition = false;\n\tif(globalInfoType == \"JSON\"){\n var devices = getDevicesNodeJSON();\n }else{\n var devices =devicesArr;\n }\n\tfor (var a=0; a<devices.length; a++){\n\t\tif (devices[a].ObjectPath== device1 && devices[a].Status.toLowerCase() == \"reserved\"){\n\t\t\tdev1Condition = true;\n\t\t}\n\t\tif (devices[a].ObjectPath== device2 && devices[a].Status.toLowerCase() == \"reserved\"){\n\t\t\tdev2Condition = true;\n\t\t}\n\t}\n\tif (dev1Condition == true && dev2Condition == true){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"function compareChanges(timestamp,dbchanges, sfchanges,objectname) {\n var map={};\n var missed = [];\n var sf_missed = [];\n var late = [];\n var okay = [];\n w.info(moment().format()+\":\"+'CompareChanges for '+objectname);\n\n if (sfchanges==null) {\n w.info(moment().format()+\":\"+' No data from Salesforce');\n } else {\n w.info(moment().format()+\":\"+' Salesforce '+sfchanges.records.length+' records for '+objectname);\n for (var i = 0; i < sfchanges.records.length; i++) {\n var record = sfchanges.records[i];\n //w.debug(JSON.stringify(record));\n var timestring = moment(record.LastModifiedDate).utc().format('YYYY-MM-DDTHH:mm:ss[Z]');\n w.info(moment().format()+\":\"+\" \"+record.Id+\":\"+timestring);\n map[record.Id] = record.LastModifiedDate;\n }\n }\n\n w.info(moment().format()+\":\"+' Database '+dbchanges.length+' records for '+objectname);\n var total_latency = 0;\n for (var j=0;j<dbchanges.length;j++) {\n var sf_id = dbchanges[j][0];\n\n var lastmodifieddate = dbchanges[j][1];\n var updatedTime = dbchanges[j][2];\n\tvar sf_date = moment(lastmodifieddate).utc()\n\tvar db_date = moment(updatedTime).utc();\n var sf_lastmodified = sf_date.utc().format('YYYY-MM-DDTHH:mm:ss[Z]');\n var db_lastmodified = sf_date.format('YYYY-MM-DDTHH:mm:ss[Z]');\n var db_updatedTime = db_date.format('YYYY-MM-DDTHH:mm:ss[Z]');\n\tvar latency = (db_date.toDate() - sf_date.toDate())/1000;\n\t\ttotal_latency = total_latency + latency;\n\tvar MAX_SLA_LATENCY=300; // 300s = 5 minutes\n w.info(moment().format()+\":\"+' '+sf_id+\":\"+db_lastmodified+\" \"+db_updatedTime+\" \"+latency);\n \n var value = map[sf_id];\n\tvar fbrecord = {'sf_id':sf_id,'db_lastmodified':db_lastmodified,\n 'db_updatedTime':db_updatedTime,'latency':latency,'objectname':objectname};\n\n\t// Remove this record id+lastmodified from the missing global list\n\ttry {\n\t// w.debug('Missed:'+sf_id+' - '+db_lastmodified);\n\tvar removekey=\"missed/\"+objectname+'/'+sf_id+\"/\"+db_lastmodified;\n\tmonitor.util.removeFirebaseString(removekey);\n\t} catch (err101) { w.error(moment().format()+\":\"+\" Error removing \"+removekey+\":\"+err101);}\n\n if (typeof(value)=='undefined') {\n w.info(moment().format()+\":\"+' Previous DB batch?: '+sf_id+\":\"+value);\n // Database result was is not in Salesforce query. \n // It is probably in the previous SF query window.\n } else {\n \t sf_lastmodified = moment(value).utc().format('YYYY-MM-DDTHH:mm:ss[Z]');\n\t fbrecord['sf_lastmodified']=sf_lastmodified;\n\t}\n\tif (latency > MAX_SLA_LATENCY) {\n late.push(fbrecord);\n\t try {\n\t monitor.util.updateFirebaseString(\"late/\"+objectname+'/'+sf_id,db_lastmodified,latency);\n\t } catch (err102) { w.error(moment().format()+\":\"+\" Error updating late: \"+sf_id+\":\"+err102);}\n\t} else {\n \n if (sf_lastmodified> db_lastmodified) {\n w.info(moment().format()+\":\"+' Multiple updates. Latest missed: '+sf_id+\": Salesforce - \"+sf_lastmodified+\" | DB - \"+lastmodifieddate);\n // This update has not come through but an earlier update came in the same window.\n sf_missed.push({'sf_id':sf_id,'sf_lastmodified':sf_lastmodified });\n \t\ttry {\n\t\tmonitor.util.updateFirebaseString(\"missed/\"+objectname+'/'+sf_id,sf_lastmodified,1);\n\t } catch (err103) { w.error(moment().format()+\":\"+\" Error updating missed \"+id+\":\"+err103);}\n } else {\n\t\t// okay.push({'sf_id':sf_id,'sf_lastmodified':sf_lastmodified, 'db_updatedTime':db_updatedTime,'latency':latency });\n\t\t//w.debug(\":::sf_id:\"+sf_id+\" fbrecord:\"+fbrecord.sf_id);\n\t\tokay.push(fbrecord);\n \t\ttry {\n\t\tmonitor.util.updateFirebaseString(\"okay/\"+objectname+'/'+sf_id,sf_lastmodified,latency);\n\t } catch (err103) { w.error(moment().format()+\":\"+\" Error updating okay \"+sf_id+\":\"+err103);}\n }\n delete map[sf_id];\n }\n }\n var id;\n for (id in map){\n // These did not come down to the database and may be waiting in the queue\n var timestring = moment(map[id]).utc().format('YYYY-MM-DDTHH:mm:ss[Z]');\n sf_missed.push({'sf_id':id,'sf_lastmodified':timestring });\n \ttry {\n\tmonitor.util.updateFirebaseString(\"missed/\"+objectname+'/'+id,timestring,1);\n } catch (err104) { w.error(moment().format()+\":\"+\" Error updating missed \"+id+\":\"+err104);}\n }\n\n var average_latency=0;\n var range=monitor.util.getTimeBucket(timestamp);\n var timestamp = range[1].utc();\n if (okay.length>0 || late.length>0) { average_latency = total_latency / (okay.length+late.length);}\n if (late.length>0 || sf_missed.length>0) {\n var message = ' XC:'+objectname+': '+timestamp.format('MM-DD HH:mm Z')\n\t\t\t+'| ok:'+okay.length+\" missed:\"+sf_missed.length+\" late:\"+late.length+' latency:'+average_latency;\n monitor.sendalert.alert(message);\n }\n var metrics={};\n metrics[\"type\"]=\"Metrics\";\n metrics[\"timestamp\"]=timestamp.format('YYYY-MM-DDTHH:mm:ss[Z]');\n metrics[\"object\"]=objectname;\n metrics[\"okay\"]=okay.length;\n metrics[\"missed\"]=missed.length;\n metrics[\"late\"]=late.length;\n metrics[\"latency\"]=average_latency;\n monitor.util.logglyclient.log(metrics);\n w.info(moment().format()+\":\"+' Metrics: '+objectname+' |'+timestamp.format('YYYY-MM-DDTHH:mm:ss[Z]')\n\t\t\t+'| okay:'+okay.length+\" missed:\"+sf_missed.length+\" late:\"+late.length+' latency:'+average_latency);\n w.info(moment().format()+\":\"+' Missed:',sf_missed);\n \n monitor.util.updateFirebase(timestamp, objectname+'_latency', average_latency);\n monitor.util.updateFirebase(timestamp, objectname+'_late', late.length);\n monitor.util.updateFirebase(timestamp, objectname+'_okay', okay.length);\n monitor.util.updateFirebase(timestamp, objectname+'_missed', sf_missed.length);\n monitor.util.updateFirebase(timestamp, objectname+'_missed_records', sf_missed);\n monitor.util.updateFirebase(timestamp, objectname+'_late_records', late);\n w.info(moment().format()+\":\"+'Finished compare.');\n\n}",
"function validateBillThreshold(type) {// BeforeSubmit function on vendor bill\n\tvar currentContext = nlapiGetContext(); \n\t// If the context is \"User Interface\" or \"CSV Import\".\n\tnlapiLogExecution('DEBUG', 'type '+type, 'currentContext '+currentContext.getExecutionContext());\n\tif (type == 'create' || type == 'edit') {// Validating when the record is created. \n\t\tvar createdFrom = nlapiGetFieldValue('custbody_spk_poid');\n\t\tvar vbSubs = nlapiGetFieldValue('subsidiary');\n\t\tif (createdFrom) {// If created from a purchase order.\n\t\t\t/****** Loading PO record and fetching required fields ******/\n\t\t\tvar poRec = nlapiLoadRecord('purchaseorder',createdFrom);\n\t\t\tvar poAmount = poRec.getFieldValue('total');\n\t\t\tvar poStatus = poRec.getFieldValue('status');\n\t\t\tvar currentVBAmount = parseFloat(nlapiGetFieldValue('usertotal'));\n\t\t\tnlapiLogExecution('DEBUG', 'poAmount is'+poAmount, 'poStatus'+poStatus);\n\t\t\tvar thresholdAmount = parseFloat(poAmount)+ parseFloat(poAmount/10); // Calculating the threshold amount.\n\t\t\tvar totalBillAmount = 0;\t\t\t\n\t\t\t// Creating dynamic saved search for finding other Bills for the same Purchase Order\n\t\t\tvar filter = new Array();\n\t\t\tvar column = new Array();\n\t\t\tfilter[0] = new nlobjSearchFilter('createdfrom', null, 'is', createdFrom);\n\t\t\tfilter[1] = new nlobjSearchFilter('mainline', null, 'is', 'T');\n\t\t\tif(type == 'edit') {\n\t\t\t\tfilter[2] = new nlobjSearchFilter('internalid', null, 'noneof', nlapiGetRecordId());\n\t\t\t}\n\t\t\tcolumn[0] = new nlobjSearchColumn('fxamount');\n\t\t\tvar records = nlapiSearchRecord('vendorbill', null, filter, column);\n\t\t\tif (records) {\n\t\t\t\tfor (var i = 0; i < records.length; i++) {\n\t\t\t\t\tvar vbValue = parseFloat(records[i].getValue('fxamount'));\n\t\t\t\t\ttotalBillAmount = parseFloat(totalBillAmount) + parseFloat(vbValue);\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'totalBillAmount '+totalBillAmount, 'vbValue '+vbValue+ ' i '+i);\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG', 'thresholdAmount '+thresholdAmount, 'Final Bill amnt is '+totalBillAmount+ ' currentVBAmount '+currentVBAmount);\n\t\t\t\ttotalBillAmount = parseFloat(totalBillAmount+currentVBAmount);\n\t\t\t\t// Comparing the Bill Amount and PO Amount.\t\t\t\t \n\t\t\t\tif (parseFloat(totalBillAmount) > parseFloat(thresholdAmount)) {\n\t\t\t\t\tthrow nlapiCreateError('User Defined', 'The Bill Total Amount is exceeding the 10% threshold of the PO Amount; so cannot save the Bill. Please reduce the amount to within %10 range in order to save the bill. And raise another PO for the additional Amount.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(parseFloat(currentVBAmount) > parseFloat(thresholdAmount)) {\n\t\t\t\t\tthrow nlapiCreateError('User Defined', 'The Bill Total Amount is exceeding the 10% threshold of the PO Amount; so cannot save the Bill. Please reduce the amount to within %10 range in order to save the bill. And raise another PO for the additional Amount.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"function validateModified(cb_err) {\n if (typeof this.modified !== 'undefined') {\n if (!validator.isDate(this.modified)) {\n cb_err();\n }\n }\n }",
"function checkReserveParts(){\n \n for(var part in reservationsJSONarr){\n \n if(!(part in progressData)){\n \n //handle the mismatch\n reservationsJSONarr[part].removed = historyIndex;\n }\n }\n //saveReservations();\n}",
"function isModified() {\n\tif (is_modified)\n\t\tif (!confirm('Data on this page has been modified.\\nIf you proceed, changes wont\\'t be saved.\\nProceed anyway?'))\n\t\t\treturn false;\n\treturn true;\n}",
"function Master_DataCheck(){ \n\t\tif(LINE_PART.bindcolval == \"\" ) {\n\t\t\talert(\"Project 누락\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(LINE_PART.index != 3) {\n\t\t\tif( PROJECT.index == 0 ) {\n\t\t\t\talert(\"물류비 부담 누락\"); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif(strim(ETD_DT.Text) == \"\" ) {\n\t\t\talert(\"반출일자 누락\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(txt_obj_remk.value) == \"\" ) {\n\t\t\talert(\"투입목적/공정 누락\"); \n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/**\n\t\tif (DLVL_TYPE.bindcolval!=\"0001\")\t{\n\t\t\tif(strim(FAC_PERSON.value) == \"\" || strim(FAC_PRSTEL.value) == \"\") {\n\t\t\t\talert(\"공장담당자정보 누락\"); \n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t**/\n\n\t\tif(strim(CUST_CD.Text) == \"\" ) {\n\t\t\talert(\"신청업체 누락\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(strim(CUST_PRSN.value) == \"\" ) {\n\t\t\talert(\"신청업체 담당자 누락\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(CUST_TELNO.value) == \"\" ) {\n\t\t\talert(\"신청업체 전화번호 누락\"); \n\t\t\treturn false;\n\t\t} \n\n\t\tif(strim(SHIPPER.Text) == \"\" ) {\n\t\t\talert(\"실화주 누락\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(SHIPPERPS.value) == \"\" ) {\n\t\t\talert(\"실화주 담당자 누락\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(strim(SHIPPERTEL.value) == \"\" ) {\n\t\t\talert(\"실화주 전화번호 누락\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif(CARGO_TYPE.bincolval == \"\" ) {\n\t\t\talert(\"적재구분 누락\"); \n\t\t\treturn false;\n\t\t}\n\n\t\tfor (var i=1; i<=gcDs4.countrow; i++) {\n\t\t\tif (strim(gcDs4.namevalue(i,\"CARTYPENO\"))==\"\")\t{\n\t\t\t\talert(\"차량정보 (차량) 누락\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"CTN_STDRD\"))==\"\")\t{\n\t\t\t\talert(\"차량정보 (대표품목) 누락\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"LD_CARGO\"))==\"\")\t{\n\t\t\t\talert(\"차량정보 (상차지) 누락\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (strim(gcDs4.namevalue(i,\"OFF_CARGO\"))==\"\")\t{\n\t\t\t\talert(\"차량정보 (하차지) 누락\");\n\t\t\t\treturn false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn true ; //누락 된 건이 한개도 없을때\n\t}",
"function wasChanged(tr){\n let htmlPath = \"#\" + tr.id + \" > td.assignment_score > div > span.tooltip > span\";\n return document.querySelector(htmlPath).className === \"grade changed\";\n}",
"function updateCorruptedData(request,replay){\n\n // Create corrupted document\n if(!corrupted_data.hasOwnProperty(request.data.doc)){\n corrupted_data[request.data.doc]={};\n }\n\n // If it is a delete request\n if(request.data.type==\"delete\"){\n corrupted_data[request.data.doc][request.id] = {};\n }\n else{\n\n // Create corrupted document version\n if(!corrupted_data[request.data.doc].hasOwnProperty(request.id)){\n corrupted_data[request.data.doc][request.id]={};\n }\n\n // Merge corrupted data\n if(!replay){\n if(corrupted_data[request.data.doc].hasOwnProperty(\"last\")){\n corrupted_data[request.data.doc][request.id] = auxiliarFunctions.merge(corrupted_data[request.data.doc][corrupted_data[request.data.doc][\"last\"]],request.data.data);\n }\n else{\n corrupted_data[request.data.doc][request.id] = request.data.data;\n }\n }\n // Blind write\n else{\n corrupted_data[request.data.doc][request.id] = diff(corrupted_data[request.data.doc][corrupted_data[request.data.doc][\"last\"]],request.data.data);\n }\n }\n corrupted_data[request.data.doc][\"last\"]=request.id; \n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given an element, color it by inlining a fill or stroke attribute. If color isn't define, it will use the current computed style for use when applying styles via CSS | function svgcolor(el, color) {
var fill = $(el).attr('fill');
var stroke = $(el).attr('stroke');
var isFill, isStroke;
if (!fill && !stroke) {
isFill = true;
} else {
if (fill && fill !== 'none') {
isFill = true;
}
if (stroke && stroke !== 'none') {
isStroke = true;
}
}
if (isStroke) {
$(el).attr('stroke', data.options.colorify || stroke);
}
if (isFill) {
$(el).attr('fill', data.options.colorify || fill);
}
} | [
"function svgColorHandler(svgId, color) {\n document.getElementById(svgId).getSVGDocument().getElementsByTagName(\"g\")[0].style.fill = color;\n }",
"set strokeColor(color) {\n var hex = STYLE_UTIL.getHexColor(color);\n if (hex) {\n var stroke = SLD.stroke(this._symbolizer);\n stroke.setColor(STYLE_UTIL._filterFactory.literal(hex));\n } else {\n throw new Error(\"Can't determine hex color from strokeColor '\" + color + \"'.\")\n }\n }",
"function changeColor(id, color) {\n\t// haal path dmv id en zet die naar kleur\n document.getElementById(id).style.fill = color;\n\n}",
"function setNormalColor(oElement)\n{\n oElement.style.background = BG_DEF_CLR;\n oElement.style.color = FG_DEF_CLR;\n}",
"function highlightItems(color, items){\n items.style({\"stroke\":color, \"opacity\": \"1\"});\n}",
"function colorCheckMark()\n{\n document.getElementById(\"mood-logged-checkmark\").style[\"fill\"] = moodColorsList[currentMood].color;\n}",
"function setColour() {\r\n vertices.selectAll(\"circle\")\r\n .style(\"fill\", function (v) {\r\n\r\n // If not connected to any other vertex, set colour to grey\r\n if (!v.degree)\r\n return customColours[2];\r\n\r\n // If general graph, set colour to red\r\n if (selectedAlgorithm == 3)\r\n return customColours[1];\r\n\r\n // If left-hand vertex, set colour to red and if right-hand vertex, set colour to blue\r\n if (v.parity)\r\n return customColours[v.parity % 2];\r\n\r\n // If non-bipartite graph, use one of the standard colours\r\n else\r\n return standardColours(v.id);\r\n\r\n });\r\n}",
"function setTheElementInnerTextWithNewColor(elementId,text,color){\n\tlet worningText = element(elementId)\n\tworningText.innerText = text;\n\tworningText.style.color = color;\n}",
"function w3_color(el_id, color, bkgColor, cond)\n{\n\tvar el = w3_el(el_id);\n\tif (!el) return null;\n\tvar prev_fg = el.style.color;\n\tvar prev_bg = el.style.backgroundColor;\n\t\n\t// remember that setting colors to '' restores default\n\tcond = (isUndefined(cond) || cond);\n if (color != undefined && color != null) el.style.color = cond? color:'';\n if (bkgColor != undefined && bkgColor != null) el.style.backgroundColor = cond? bkgColor:'';\n\treturn { color: prev_fg, backgroundColor: prev_bg };\n}",
"function clickColor(event) {\n const target = event.target;\n selectedColor = target.style.fill;\n}",
"function cycleDrawColour() {\n Data.Edit.Node.style.stroke = cycleColour(Data.Edit.Node.style.stroke);\n hasEdits(true);\n}",
"function changeForegroundColor(eid, color) {\n if(document.getElementById && (elem=document.getElementById(eid)))\n elem.style.color=color;\n}",
"function focusAddIconColor(id, element, color){\n\tvar forElement \t\t= null; \n\tvar colorElement\t= null;\n\tvar elementInvalid\t= null;\n\tif( element == 1 ){\n\t\tforElement \t= $(id).attr('id');\n\t\telementInvalid = $('#'+forElement).closest('.mdl-textfield');\n\t\tif ( !elementInvalid.hasClass('is-invalid')) {\n\t\t\t$('.mdl-input-group').find('.mdl-icon i').removeAttr('style');\n\t\t}\n\t} else {\n\t\tforElement \t\t= $(id).find('button.selectpicker').attr('data-id');\n\t\t$('.mdl-input-group').find('.mdl-icon i').removeAttr('style');\n\t}\n\t$(id).closest('.mdl-input-group').find('.mdl-icon i').css('color', color);\n}",
"function colorChange(selectObj, dataname) {\n var idx = selectObj.selectedIndex;\n var color = selectObj.options[idx].value;\n\n d3.select(\"#\" + dataname)\n .attr(\"style\", \"stroke: \" + color)}",
"function addStroke(node, color=\"red\", width=3){\n diagram.model.commit(function (m){\n m.set(node, \"stroke\", color)\n m.set(node, \"strokeWidth\", width)\n }, \"add stroke\");\n}",
"function processElement(element) {\n if(element.colorChanged) {\n return;\n }\n\n element.style.backgroundColor = colors[parseInt(Math.random() * colors.length)];\n element.colorChanged = true;\n}",
"setColor(clutterColor) {\n this._horizLeftHair.background_color = clutterColor;\n this._horizRightHair.background_color = clutterColor;\n this._vertTopHair.background_color = clutterColor;\n this._vertBottomHair.background_color = clutterColor;\n }",
"function setColor(id, color) {\n\tdocument.getElementById(id).style.color = color;\n}",
"fill(colour) {\r\n this.ctx.fillStyle = colour;\r\n this.ctx.fillRect(0, 0, this.width, this.height);\r\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generic event dispatcher for ui:compose:recordpage resource type This is used when deleting, updating, creating records and where validation errors occur | dispatchUiEvent (eventType, record = this.record, args = {}) {
const resourceType = `ui:compose:${this.getUiEventResourceType || 'record-page'}`
const argsBase = {
errors: this.errors,
validator: this.validator,
...args,
}
return this
.$EventBus
.Dispatch(compose.RecordEvent(
record, { eventType, resourceType, args: argsBase }))
} | [
"handleNavigationToRecord(){\n this[NavigationMixin.Navigate]({\n type:'standard__recordPage',\n attributes:{\n recordId:this.recordId,\n objectApiName:CAR_OBJECT.objectApiName,\n actionName:'view'\n }\n })\n }",
"navigateToEditRecordPage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n \"recordId\": this.recordId,\n \"objectApiName\": \"Account\",\n \"actionName\": \"edit\"\n },\n });\n }",
"onRecordLoad(event) {\n const record = event.detail && event.detail.records && event.detail.records[this.recordId];\n this.addRecordToCache(record);\n this.handleRecordFields(record);\n }",
"navigateToViewRecordPage() {\n this[NavigationMixin.Navigate]({\n type: 'standard__recordPage',\n attributes: {\n \"recordId\": this.recordId,\n \"objectApiName\": \"Account\",\n \"actionName\": \"view\"\n },\n });\n }",
"function btnActionPageEventHandler () {\n\t\n\tvar currentBtnPageName = document.getElementById('btnPageName');\n\tvar currentBtnDelPage = document.getElementById('btnDelPage');\n\t\n\tcurrentBtnPageName.addEventListener('click', function () {\n\t\tsetValue(currentBtnPageName.dataset.element, currentBtnPageName.dataset.property, currentBtnPageName.dataset.secondaryElement)\n\t}, false);\n\n\tcurrentBtnDelPage.addEventListener('click', function () {\n\t\tsetDeletePage(currentBtnPageName.dataset.property)\n\t}, false);\n\n}",
"function addRecordsChangedListeners(datastore) {\n\n var rcTargetCb = rcCbBuilder(targetTable, templateTable, renderTarget, renderTemplate);\n var rcPingCb = rcCbBuilder(pingTable, targetTable, renderPing, renderTarget);\n var rcTemplateCb = rcCbBuilder(templateTable, templateTable, renderTemplate, renderTemplate);\n\n datastore.recordsChanged.addListener(rcTargetCb);\n datastore.recordsChanged.addListener(rcPingCb);\n datastore.recordsChanged.addListener(rcTemplateCb);\n }",
"function registerFormEvents() {\n if (inlineJs.crudId == 1 || inlineJs.crudId == 2) {\n validateForm('form#' + inlineJs.controller + 'Post');\n\n //Size the forms\n sizeForm();\n\n //Max length indicator\n maxLengthIndicator();\n\n //Register searchable select\n registerSearchableSelect();\n\n }//E# if statement\n //Register Reset button\n resetForm('.resetButton');\n}",
"function targetAddCb(e) {\n e.preventDefault();\n var $template = $(this).closest('.template');\n var $parent = $(this).parent();\n var parentId = $template.attr('id');\n createTargetRecordFromForm($parent, parentId);\n }",
"function processEvent(event) {\n var type = event.type;\n var sender = event.sender;\n var target = event.target;\n var context = event['in'];\n // the resource object is added to the repository even for\n // \"deleted\" and \"completed\" events because event handlers\n // may reasonably expect the resource from the event to be\n // present in the repository\n put(new Stack.Resource(sender.href, sender.rel), true);\n if (event.resource) {\n put(event.resource);\n // an event handler may save a reference to event.resource\n // and later check its state, so we want to replace event.resource\n // with a reference to the resource in the repository, which\n // may be updated later by UCWA events\n event.resource = resources[event.resource.href];\n }\n else {\n put(new Stack.Resource(target.href, target.rel), true);\n // an empty \"updated\" event indicates that the state of the target resource\n // has changed, but UCWA isn't sending its new state in the event: to get\n // that state the client needs to send a GET request; so the resource object\n // is only marked as obsolete and the stack leaves it up to the model layer\n // to decide whether it's worth sending the GET\n if (type == 'updated')\n resources[target.href].dirty(true);\n }\n if (context) {\n put(new Stack.Resource(context.href, context.rel), true);\n if (type == 'added') {\n resources[context.href].addLink(target.rel, target.href);\n if (!resources[target.href].memberships(context.href))\n resources[target.href].memberships.add(resources[context.href], context.href);\n }\n if (type == 'deleted') {\n resources[context.href].removeLink(target.rel, target.href);\n if (resources[target.href].memberships(context.href))\n resources[target.href].memberships.remove(context.href);\n }\n }\n if (type == 'deleted' || type == 'completed') {\n // if the event target is a member of a collection then we should not delete it from\n // the repository because the target may exist outside the collection; for instance\n // when someone stops typing in a conversation, the server sends a \"participant\n // deleted in typingParticipants\" event.\n if (!context)\n remove(target.href);\n }\n }",
"function templateAddCb(e) {\n e.preventDefault();\n var $template = $(this).closest('.template');\n var $parent = $(this).parent();\n var parentId = $template.attr('id');\n createTemplateRecordFromForm($parent, parentId);\n }",
"_defineListeners() {\n this.editor.model.on('insertContent', (eventInfo, [modelElement]) => {\n if (!isDrupalMedia(modelElement)) {\n return;\n }\n this.upcastDrupalMediaIsImage(modelElement);\n // Need to upcast DrupalMediaType to model so it can be used to show\n // correct buttons based on bundle.\n this.upcastDrupalMediaType(modelElement);\n });\n }",
"function loadRecord(n) {\n // Make Save button visible\n swapButtons('save');\n\n var f = document.forms[0];\n\n f.url.value = data[n].url;\n f.type.value = data[n].type;\n\n n_save = n;\n}",
"_handleButtonNewResourceList()\n {\n var project = Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_GET_ACTIVE);\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__RESOURCELIST_CREATE, {project: project});\n }",
"function historyTableCellClickHandler(field, column, row, rec) {\n if (column === 'edit') {\n $('#history_id').val(rec.id);\n $('#history_memberId').val(currentMemberId);\n $('#history_title').val(rec.title);\n $('#history_started_at').val(rec.started_at);\n $('#history_finished_at').val(rec.finished_at);\n $('#history_memo').val(rec.memo);\n $('#history_dialog_title').text(i18n.messages.memberdetail.history_updatetitle);\n $('#btnMemberHistorySave').removeAttr('disabled');\n $('#memberHistoryDialog').modal('show');\n } else if (column === 'delete') {\n $('#history_id').val(rec.id);\n showConfirmMessage(\"Delete Member History\", \"Do you want to delete the item?\", \"Delete\", historyDeleteHandler)\n }\n}",
"static initStaticEvents() {\n\n // Save button for saving GeneralInfo\n\n $('.stepWrapper:nth-of-type(1) .saveBtn').click(()=>{\n \n this.update();\n\n })\n\n }",
"function fnBindEventDataTableControls() {\n jQuery('.btnDelete').on('click', function (event) {\n event.preventDefault();\n var arrayRowId = this.id.split('-');\n var id = arrayRowId[1];\n showBittionAlertModal({content: '¿Está seguro de eliminar?', title: 'Eliminar'});\n jQuery('#bittionBtnYes').click(function (event) {\n fnDeleteIngredient(id); //(id, object)\n event.preventDefault();\n });\n });\n\n jQuery('.btnUpdate').on('click', function (event) {\n event.preventDefault();\n var arrayRowId = this.id.split('-');\n var id = arrayRowId[1];\n fnReadIngredientUpdate(id);\n jQuery('#modalProduct').modal({show: 'true', backdrop: 'static'});\n });\n }",
"registerEvents() {\n\t\t\tthis.container = this.getContainer();\n\t\t\tthis.registerListEvents();\n\t\t\tthis.registerForm();\n\t\t}",
"onRender() {}",
"function ValidateCurrentPageData(){\n console.log(\"Validating: \" + screenHandler.current_page);\n switch (screenHandler.current_page) {\n case 'config_screen':\n DisallowBackButton(true);\n (settings.record_type && settings.method_selection_type && settings.action_type) ? DisallowContinueButton(false) : DisallowContinueButton(true);\n break;\n\n case 'choose_fields_screen':\n (fields.selected.length > 0) ? DisallowContinueButton(false) : DisallowContinueButton(true);\n break;\n\n case 'set_field_values_screen':\n break;\n\n case 'manual_select_screen':\n (records.selected.length > 0) ? DisallowContinueButton(false) : DisallowContinueButton(true);\n break;\n\n case 'insert_ids_screen':\n break;\n\n case 'confirmation_screen':\n break;\n }\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
apply action to decisionTreeNode.state, returns resulting state | apply(decisionTreeNode) {
throw new Error("SmartAction is abstract class, should not be instantiated");
} | [
"apply(state) {\n let newCanvas = state.canvas.clone().drawStep(this)\n return new State(state.target, newCanvas, this.distance)\n }",
"function changestate(){\n let stateplot=d3.select('#state_selected').node().value;\n buildplot(stateplot)}",
"function StateCondition(actionManager,target,/** Value to compare with target state */value){var _this=_super.call(this,actionManager)||this;_this.value=value;_this._target=target;return _this;}",
"visitConstraint_state(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"processEngineStep(state, action) {\n let stateDelta = []; // Holds an array of objects marking all x, y coordinate updated\n\n // The change in the coordinates of the head, based on the direction facing\n let deltaX = SnakeEngine.DIRECTIONS[state.direction].x;\n let deltaY = SnakeEngine.DIRECTIONS[state.direction].y;\n\n let newHeadX = state.headX + deltaX;\n let newHeadY = state.headY + deltaY;\n\n let utilities = [0];\n\n state = state.clone();\n\n if (this.isGameOverPos(newHeadX, newHeadY, state)) {\n state.terminalState = true;\n\n } else {\n if (state.getTile(newHeadX, newHeadY) == SnakeState.FOOD) {\n utilities = [1]; // Get 1 utility if food was eaten\n\n let {foodX, foodY} = state.addFood();\n stateDelta.push({x: foodX, y: foodY});\n\n } else {\n let {tailX, tailY} = state.removeTail();\n stateDelta.push({x: tailX, y:tailY});\n }\n\n // Update the head position last to avoid overwriting the food position too early\n state.updateHead(newHeadX, newHeadY);\n stateDelta.push({x: newHeadX, y: newHeadY});\n }\n\n return this.makeProcessedActionOutcome(utilities, state, stateDelta);\n }",
"function updateState(e){\r\n for (var i = 0; i < currentState.transitions.length; i++) {\r\n if (currentState.transitions[i].input == e.type){\r\n //based on input type and current state, do appropriate action\r\n currentState.transitions[i].action(e, elem);\r\n nextState = currentState.transitions[i].endState;\r\n setCurrentState(nextState);\r\n return;\r\n } \r\n }\r\n}",
"updateActionStates() {\n ssui.originalUpdateActionStatesFunc.call(this);\n \tlet graph = this.editor.graph;\n this.actions.get('group').setEnabled(graph.getSelectionCount() >= 1);\n }",
"applyDesignatedState () {\n const dstate = this.designatedState;\n const cstate = this.currentState;\n this.designatedState = {};\n const command = {};\n if (typeof dstate.state !== 'undefined') { // check if HomeKit actually set an on/off state\n if (dstate.state === true && dstate.level !== 0) {\n command.state = 'On';\n if (this.platform.darkMode) { // set cached level in dark mode\n if (typeof dstate.level === 'undefined' && typeof cstate.cachedLevel !== 'undefined' && (dstate.state === true || cstate.state !== false)) {\n dstate.level = cstate.cachedLevel;\n } else if (typeof dstate.level === 'number') {\n if (cstate.powerOffByBrightness && dstate.level === 100) {\n cstate.powerOffByBrightness = false;\n dstate.level = cstate.cachedLevel;\n // TODO: why exactly is this here? can this be avoided with updateHomekitState()?\n this.accessory.getService(Service.Lightbulb).getCharacteristic(Characteristic.Brightness).updateValue(dstate.level);\n } else if (cstate.powerOffByBrightness === false) {\n cstate.cachedLevel = cstate.level;\n }\n }\n }\n if (dstate.level > 1) {\n command.level = dstate.level;\n } else if (dstate.level === 1) { // set night mode if level is 1, remove \"on\" from command\n delete command.state;\n command.commands = ['night_mode'];\n }\n cstate.level = dstate.level;\n } else {\n command.state = 'Off';\n if (this.platform.darkMode) {\n if (cstate.level !== 1) {\n cstate.cachedLevel = cstate.level;\n }\n if (dstate.level === 0) {\n cstate.powerOffByBrightness = true;\n } else {\n cstate.powerOffByBrightness = false;\n }\n command.level = 1;\n cstate.level = command.level;\n }\n }\n cstate.state = command.state;\n }\n if (dstate.saturation !== undefined) {\n if (dstate.saturation === 0) {\n if (command.commands) {\n command.commands = command.commands.concat(['set_white']);\n } else {\n command.commands = ['set_white'];\n }\n } else {\n command.saturation = dstate.saturation;\n }\n cstate.saturation = dstate.saturation;\n }\n if (dstate.hue !== undefined) {\n if (!(dstate.saturation === 0)) {\n command.hue = dstate.hue;\n }\n cstate.hue = dstate.hue;\n }\n if (!this.platform.rgbcctMode) {\n const useWhiteMode = TestWhiteMode(dstate.hue, dstate.saturation);\n if (useWhiteMode) {\n delete command.saturation;\n delete command.hue;\n let kelvin = 100;\n if (dstate.hue > 150) {\n kelvin = 0.5 - dstate.saturation / 40;\n } else {\n kelvin = Math.sqrt(dstate.saturation * 0.0033) + 0.5;\n kelvin = Math.min(1, Math.max(0, kelvin));\n }\n kelvin *= 100;\n kelvin = Math.round(kelvin);\n\n command.kelvin = kelvin;\n cstate.kelvin = kelvin;\n }\n } else if (dstate.color_temp !== undefined) {\n command.color_temp = dstate.color_temp;\n cstate.color_temp = dstate.color_temp;\n }\n this.platform.sendCommand(this.name, this.device_id, this.remote_type, this.group_id, command);\n }",
"function SlideState(){\n\tviewState = new stateClass(stk[stkCurr]);\n\tToState(stk[stkCurr].state);\n}",
"updateCheck() {\r\n this.setState((oldState) => {\r\n return {\r\n checked: !oldState.checked,\r\n };\r\n });\r\n this.updateChart(this.state.checked)\r\n }",
"function decisionTwo(){\n switch(trackBranch){\n case \"A1\":\n decisionTwoBrA();\n break;\n case \"B1\":\n decisionTwoBrB();\n break;\n case \"C1\":\n decisionTwoBrC();\n break;\n }\n }",
"function evaluator() {\n state.seg = segments['intro']; // starting from intro\n var block_ix = 0;\n\n // use global state to synchronize\n var handlers = {\n text : function(text) {\n var $text = $('<p></p>').appendTo($main);\n var timeoutid;\n var line_ix = 0;\n var char_ix = 0;\n state.status = 'printing';\n $triangle.hide();\n var text_printer = function() {\n var line = text.lines[line_ix];\n if (!line) {\n clearTimeout(timeoutid);\n $text.append('<br/>');\n // peek if next block is a branch block\n var next = get_next();\n if (next && next.type == 'branches') {\n next_block()\n } else {\n state.status = 'idle';\n $triangle.show();\n }\n return;\n }\n var interval = state.print_interval;\n if (char_ix < line.length) {\n var c = line[char_ix++];\n if (c == ' ') {\n c = ' ';\n }\n $text.append(c);\n } else {\n $text.append('<br/>');\n line_ix += 1;\n char_ix = 0;\n interval *= 6; // stop a little bit longer on new line\n }\n timeoutid = setTimeout(text_printer, interval);\n }\n timeoutid = setTimeout(text_printer, state.print_interval);\n },\n branches : function(branches) {\n var $ul = $('<ul class=\"branches\"></ul>').appendTo($main);\n state.status = 'branching'\n settings.cheated = false;\n var blur_cb = function(e) {\n settings.cheated = true;\n };\n $(window).on('blur', blur_cb);\n\n\n $.each(branches.cases, function(ix, branch){\n if (branch.pred == '?' || eval(branch.pred)) {\n var span = $('<span></span>').text(branch.text).data('branch_index', ix);\n $('<li></li>').append(span).appendTo($ul);\n }\n });\n $('li span', $ul).one('click', function(e){\n state.choice = parseInt( $(this).data('branch_index') );\n $(window).off('blur', blur_cb);\n clean_main();\n next_block();\n return false;\n });\n },\n code : function(code) {\n var control = new function() {\n var self = this;\n this.to_label = function(label) {\n self.next_label = label;\n };\n this.jump_to = function(segname) {\n self.next_seg = segname;\n }\n // extra functions\n this.clean_main = clean_main;\n this.reset = function() {\n settings = {}; // need to clean up the settings.\n constants.usual_print = 20; // on following playthrough, have faster printing\n self.jump_to('intro');\n };\n };\n eval(code.code);\n // handle the outcome\n if (control.next_seg) {\n state.seg = segments[control.next_seg];\n if (!state.seg) throw \"invalid segment jump:\" + control.next_seg;\n // jumping into label in another segment\n if (control.next_label) {\n var next = state.seg.labels[control.next_label]\n if (!next)\n throw \"invalid seg+label jump:\" + control.next_seg + \":\" + control.next_label;\n next_block(next);\n } else {\n next_block(state.seg[0]);\n }\n return;\n } else if (control.next_label) {\n var next = state.seg.labels[control.next_label];\n if (!next) throw \"invalid lable jump:\" + control.next_label;\n next_block(next);\n } else {\n next_block();\n }\n },\n label : function(label) {\n if (label.jump) {\n var next = state.seg.labels[label.name];\n if (!next) throw \"invalid jump label:\" + label.name;\n next_block(next);\n } else {\n next_block();\n }\n }\n\n };\n\n function clean_main() {\n $main.empty();\n }\n\n function handle_block() {\n console.log(\"doing block:\")\n console.log(state.block);\n handlers[state.block.type](state.block);\n }\n\n function get_next() {\n var block_in_seg = state.seg.indexOf(state.block);\n return state.seg[block_in_seg+1];\n }\n\n function next_block(block) {\n state.block = block || get_next();\n\n // necessary resets\n state.print_interval = constants.usual_print;\n handle_block();\n }\n\n function global_click_callback(e) {\n if (state.status == 'idle') {\n next_block();\n } else if (state.status == 'printing') {\n state.print_interval /= 5;\n }\n return false;\n }\n $(document).on('click', global_click_callback);\n\n // kick off\n state.block = state.seg[0];\n\n // !!!!!!!!!! DEBUG JUMP\n // state.seg = segments['puzzle'];\n // state.block = state.seg.labels['q1'];\n\n handle_block();\n}",
"function setSelectedNode(node) {\n selected_node = node;\n var selectedNodeLabel = d3.select('#edit-pane');\n // update selected node label\n selectedNodeLabel.html(selected_node ? '<strong>' + selected_node.lbl + ': ' + selected_node.wid + '</strong>' : 'No state selected');\n\n }",
"function getNodeState($node, relation) {\n var $target = {};\n if (relation === 'parent') {\n $target = $node.closest('table').closest('tr').siblings(':first').find('.node');\n } else if (relation === 'children') {\n $target = $node.closest('tr').siblings();\n } else {\n $target = $node.closest('table').parent().siblings();\n }\n if ($target.length) {\n if ($target.is(':visible')) {\n return {\"exist\": true, \"visible\": true};\n }\n return {\"exist\": true, \"visible\": false};\n }\n return {\"exist\": false, \"visible\": false};\n }",
"function decisionThree(){\n switch(trackBranch){\n //Branch A decision 3 calls.\n case \"A2a\":\n decisionThreeBrA1();\n break;\n case \"A2b\":\n decisionThreeBrA2();\n break;\n case \"A2c\":\n decisionThreeBrA3();\n break;\n \n //Branch B decision 3 calls.\n case \"B2a\":\n decisionThreeBrB1();\n break;\n case \"B2b\":\n decisionThreeBrB2();\n break;\n case \"B2c\":\n decisionThreeBrB3();\n break;\n \n //Branch C decision 3 calls.\n case \"C2a\":\n decisionThreeBrC1();\n break;\n case \"C2b\":\n decisionThreeBrC2();\n break;\n case \"C2c\":\n decisionThreeBrC3();\n break;\n }\n }",
"_checkNode(node) {\n node.setAttribute('aria-checked', 'true')\n node.tabIndex = 0\n\n store.dispatch(setLabelBackgroundColor(node.bgColor))\n }",
"function setState(param,cb) {\n if(_.isFunction(param)) {\n this.state = param(this.state,this.props);\n } else {\n this.state = Object.assign({},this.state,param)\n if(!_.isNil(cb)) {\n cb(this.state)\n }\n }\n \n if(this.state.mouseOver && this.state.mouseClicked) {\n this.props.onClickHandler(this.props._id, this.state.mouseBtn) \n }\n \n \n \n if(shouldUpdate) {\n this.render()\n }\n \n \n return this.state\n }",
"onNodeSave(){\n const treeList = deepcopy(this.props.value.treeList);\n\n const {selectedNode} = this.props.value;\n\n this.findNode(treeList, selectedNode.id, node => {\n node.iconUrl = selectedNode.iconUrl;\n node.priority = selectedNode.priority;\n node.module = selectedNode.module;\n });\n\n const newValue = {\n ...this.props.value,\n selectedNode: null,\n treeList: treeList\n };\n\n this.props.onChange({\n value: newValue\n });\n }",
"function getStateLabel(){\n\t\t/*jshint validthis:true */\n\t\tif (! this.state){\n\t\t\treturn \"off\";\n\t\t}\n\n\t\tvar position = (_dec2bin(this.state).length - 1).toString(),\n\t\t\tlabels = _.invert(this.conditions);\n\n\t\treturn labels[position];\n\t}",
"function setStateToUpdCat(state,res){\n state.category = res.category;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if the value entered in the text box is valid. Valid values are positive dollar amounts. Displays an error on the page if value is invalid. Returns false if value is invalid, returns true if value is valid. | function is_valid_value() {
var value = $('#valueInput')[0].value;
var error = $("#errorAlert");
// Make sure value contains only numbers and up to one decimal point
var valid_characters = "0123456789.";
var char_result = true;
var point = 0;
// Check each character for validity, decimal points
for (var i = 0; i < value.length && char_result == true; i++) {
var temp = value.charAt(i);
if (valid_characters.indexOf(temp) == -1) {
char_result = false;
}
if (temp == "."){
point++;
}
}
// Checks decimal point count
if (point > 1)
char_result = false;
// Display error in page
if (value.length == 0) {
error.innerHTML = "You must enter a value";
return false;
}
if(!char_result) {
error.innerHTML = "You can only enter numbers and a decimal point";
return false;
} else {
error.innerHTML = "";
return true;
}
} | [
"function isValidAmount(element){\n\t\n\t\t// user's amount\n\t\tvar amount = element.value;\t\n\t\t\n\t\t// parse amount as float\n\t\tamount = parseFloat(amount);\n\t\t\n\t\t// if amount is number, parse amount\n\t\tif(!isNaN(amount) && amount > 0.0 && amount < 100000){\n\t\t\n\t\t\t// test passed\n\t\t\treturn true;\n\t\t\t\n\t\t}else{\n\t\t\n\t\t\t// alert user of error\n\t\t\talert(\"Amount has to be in range: 0 to 100,000.\");\n\t\t\t\n\t\t\t// shift focus to failed webpage field\n\t\t\telement.focus();\n\t\t\t\n\t\t\t// test failed\n\t\t\treturn false;\n\t\t}\n\t}",
"function requiredAT(objVal,strError, isZero){\n var objValue=document.getElementById(objVal); \n if(eval(objValue.value.trim().length) == 0 ){\n if(!strError || strError.length ==0){\n alert(objValue.name + \" : Required Field\"); objValue.focus(); \n return false; \n } \n alert(strError); objValue.focus(); \n return false; \n }\n if(isZero != null){\n if(isZero == 1){\n if(!numeric(objVal, \"Please enter Numeric Data only.\", 1))\n return false;\n if(!CheckForZeroAT(objValue))\n return false; \n }\n }\n return true; \n }",
"function validateTaxableIncome() {\n var taxableIncome = document.TaxCalculator.taxableIncome.value;\n var regex = /[0-9]|\\./;\n \n if (taxableIncome === \"\" || taxableIncome === \"0.00\" || taxableIncome === \"0\") {\n errorMessage += \"Please Enter your Taxable Income. \\n\";\n document.getElementById(\"taxableIncome\").style.backgroundColor=\"red\";\n return false;\n } else if (!regex.test(taxableIncome)) {\n errorMessage += \"Please Enter Only a Numberic Value As your Taxable Income. \\n\";\n document.getElementById(\"taxableIncome\").style.backgroundColor=\"red\";\n return false;\n } else {\n document.getElementById(\"taxableIncome\").style.backgroundColor=\"\";\n return true;\n }\n}",
"function validatePounds() {\n\tvar ptr = $(\"numItemWeightLb\"); \t\t//Pointer to pounds input field\n\tvar err = $(\"errItemWeightLb\");\t\t//Pointer to error marker for pounds\n\tvar input;\t\t\t\t\t\t\t\t\t//Contents of the pounds text box\n\t\n\terr.style.visibility = \"hidden\";\n\tif(ptr.value == \"\") {\n\t\terr.style.visibility = \"visible\";\n\t\terr.title = \"You must enter the number of pounds.\";\n\t} else {\n\t\tinput = FormatNumber(ptr.value, \"G\"); //Unformat it (remove commas\n\t\tinput = parseInt(input);\n\t\tif(input<0) { \n\t\t\terr.style.visibility = \"visible\";\n\t\t\terr.title = \"Pounds must be at least 0\";\n\t\t} else {\n\t\t\tptr.value = FormatNumber(input, \"N0\");\n\t\t} //end if\n\t}//end if\n\n\treturn err.style.visibility == \"hidden\";\n\n}",
"function required(objVal,strError, isZero){\n var objValue=document.getElementById(objVal); \n if(eval(objValue.value.trim().length) == 0 ){\n if(!strError || strError.length ==0){\n alert(objValue.name + \" : Required Field\"); objValue.focus(); \n return false; \n } \n alert(strError); objValue.focus(); \n return false; \n }\n if(isZero != null){\n if(isZero == 1){\n if(!numeric(objVal, \"Please enter Numeric Data only.\", 1))\n return false;\n if(!CheckForZero(objValue))\n return false; \n }\n }\n return true; \n }",
"function isValidAmount(sender) {\n var id = $(sender).attr('id');\n var elementValue = $('#' + id).val();\n var expamount = /^(?:\\d*\\.\\d{1,2}|\\d+)$/;\n\n if (elementValue.length > 0)\n return expamount.test(elementValue)\n else\n return true;\n}",
"function validateQty(){\r\n var itemQty = document.getElementById(\"addItemQty\");\r\n var itemQtyMsg = document.getElementById(\"addQtyValidationMessage\");\r\n \r\n if (itemQty.value.length > 0) {\r\n if (itemQty.value > 0) {\r\n itemQtyMsg.style.color = \"black\";\r\n itemQtyMsg.innerHTML = \"\";\r\n itemQty.style.border = \"\";\r\n itemQty.style.background = \"\";\r\n return true;\r\n } else {\r\n itemQtyMsg.style.color = \"red\";\r\n itemQtyMsg.innerHTML = \"Value must be positive\";\r\n itemQty.style.border = \"1px solid #dc3545\";\r\n } \r\n } else {\r\n itemQtyMsg.style.color = \"red\";\r\n itemQtyMsg.innerHTML = \"Field Required\";\r\n itemQty.style.border = \"1px solid #dc3545\";\r\n }\r\n \r\n return false;\r\n }",
"function checkPrice(field, rules, i, options) {\r\n\t\tvar price = parseInt(field.val().replace(/[^0-9]/g, '')); //Strip off the decimal\r\n\t\tvar priceRegex = /^\\d+(\\.\\d{2})?$/;\r\n\t\t\r\n\t\tif (price >= 0 && price <= 99999 && priceRegex.test(field.val())) {\r\n\t\t\t//No problem!\r\n\t\t} else {\r\n\t\t\treturn '* Valid prices range from $0.00 to $999.99';\r\n\t\t}\r\n\t}",
"function validateMarginCostForm(frm)\n{ \n if(frm.frmMarginCost.value==''){\n alert(MARGIN_COST_REQ);\n frm.frmMarginCost.focus();\n return false;\n }else if(AcceptDecimal(frm.frmMarginCost.value)==false){\n alert(ENTER_NUMRIC);\n frm.frmMarginCost.focus();\n return false; \n }else return true;\n \n}",
"function validateShippingCostForm(formID)\n{\n if(validateForm(formID, 'frmCountry', 'Country Name', 'R','frmShippingCostState','State Name','R','frmShippingCost','Shipping Cost','R'))\n { \n if($('#frmShippingCostType').val() == 'Percentage')\n {\n if($('#frmShippingCost').val() > 100)\n {\n alert(SHIPP_COST_PERCEN);\n $('#frmShippingCost').focus();\n return false;\n }\n }\n\t\t\n return true;\n } \n else \n {\n return false;\n }\n}",
"function checkDecimal()\n{\n let re = /^([0-9]*|[0-9]*\\.[0-9]*)$/;\n let number = this.value.trim();\n setErrorFlag(this, re.test(number) && number > 0);\n}",
"function validateAmortization(errorMsg) {\n var tempAmortization = document.mortgage.amortization.value;\n tempAmortization = tempAmortization.trim();\n var tempAmortizationLength = tempAmortization.length;\n var tempAmortizationMsg = \"Please enter Amortization!\";\n\n if (tempAmortizationLength == 0) {\n errorMsg += \"<p><mark>No. of years field: </mark>Field is empty <br />\" + tempAmortizationMsg + \"</p>\";\n } else {\n if (isNaN(tempAmortization) == true) {\n errorMsg += \"<p><mark>No. of years field: </mark>Must be numeric <br />\" + tempAmortizationMsg + \"</p>\";\n } else {\n if (tempAmortization < 5 || tempAmortization > 20) {\n errorMsg += \"<p><mark>No. of years field: </mark>Must be values: 5 thru 20 inclusive <br />\" + tempAmortizationMsg + \"</p>\";\n }\n }\n }\n return errorMsg;\n}",
"function checkTotals(){\n var iconUrl= 'http://localhost/feemaster/assets/images/icons/warning.png';\n var grandsale = parseFloat($(\"#totalsaletxt\").val());\n console.log(\"total sale is: \"+grandsale);\n var cash = parseFloat($(\"#cashtxt\").val());\n \n if($.isNumeric(grandsale) && grandsale>0){\n if($.isNumeric(cash)){\n if(cash >= grandsale){\n Confirm.render('Execute Transaction?','execute_sale','cancel');\n }else{\n Alert.render(\"Cash issued is insufficient!\",\"Alert\",iconUrl);\n //$(\"#cashtxt\").focus();\n } \n }else{\n Alert.render(\"Enter a valid cash amount!\",\"Alert\",iconUrl);\n // $(\"#cashtxt\").focus();\n }\n \n }else{\n Alert.render('Add at least a single item to sell!',\"Notification\",iconUrl);\n $(\"#searchtxt\").focus();\n }\n}",
"function validateIntRate(errorMsg) {\n var tempIntRate = document.mortgage.intRate.value;\n tempIntRate = tempIntRate.trim();\n var tempIntRateLength = tempIntRate.length;\n var tempIntRateMsg = \"Please enter Interest Rate!\";\n\n if (tempIntRateLength == 0) {\n errorMsg += \"<p><mark>Interest rate field: </mark>Field is empty <br />\" + tempIntRateMsg + \"</p>\";\n } else {\n if (isNaN(tempIntRate) == true) {\n errorMsg += \"<p><mark>Interest rate field: </mark>Must be numeric <br />\" + tempIntRateMsg + \"</p>\";\n } else {\n if (parseFloat(tempIntRate) < 2.000 || parseFloat(tempIntRate) > 11.000) {\n errorMsg += \"<p><mark>Interest rate field: </mark>Must be values: 2.000 thru 11.000 inclusive <br />\" + tempIntRateMsg + \"</p>\";\n } \n }\n }\n return errorMsg;\n}",
"function guessValidation () {\n if (+($(\"#userGuess\").val()) > 100 || +($(\"#userGuess\").val()) < 1) {\n alert(\"Please enter a number between 1 - 100\");\n }\n }",
"validateInputs() {\n\t\tif(isNaN(this.billAmount) || this.billAmount <= 0 || this.totalPerson == 0) return false;\n\t\treturn true;\n\t}",
"function check_input_fields() {\n var name = $('#student_name').val().replace(/\\s+/g, '');\n var course = $('#course_name').val().replace(/\\s+/g, '');\n var grade = parseFloat($('#student_grade').val());\n if (name == '' || course == '' || grade < 0 || grade > 100 || grade == '' || isNaN(grade) == true) {\n var message = 'All input fields must contain at least one non-space character. Grade must be a number between 0 and 100.';\n display(message);\n return true;\n }\n}",
"validate(value) {\n if (value < 0) throw new Error('Valor negativo para preço');\n }",
"function validFloatinRange(formField,fieldLabel,required,valueMin,valueMax)\r\n\t{\r\n\tvar result = true;\r\n\tif (!validFloat(formField,fieldLabel,required)) result = false;\t\r\n\tif (result)\r\n \t\t{\r\n \t\tif(formField.value < valueMin || formField.value > valueMax)\r\n\t\t\t{\r\n \t\t\talert('Please enter a number for: ' + fieldLabel +' which is greater than or equal to ' + valueMin + ' and less than or equal to ' + valueMax + '.');\r\n\t\t\tformField.focus();\t\t\r\n\t\t\tresult = false;\r\n\t\t\t}\r\n\t\t} \r\n\treturn result;\r\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prepare5secSegmentsCMD function agreggates the commands for each resolution/bitrate for the 5 seconds segments into one command Command outputs are surpressed, except for the frame information | function prepare5secSegmentsCMD(inputFilePath, renditionsArray, audioCodec, videoCodec, audioSampleRate) {
let durationString = "segment_5";
let assetFolder = "hls_assets";
let cmd = `${ffmpegPath} -i ${inputFilePath} -hide_banner -y -loglevel quiet -stats `;
for (let rendition of renditionsArray) {
let renditionDir = `./${assetFolder}/${durationString}/${rendition.name}`;
cmd +=
`-vf scale=w=${rendition.resolution_width}:h=${rendition.resolution_height}\
-c:a ${audioCodec} -ar ${audioSampleRate} -c:v ${videoCodec} -profile:v main -crf 20 -sc_threshold 0 \
-keyint_min ${rendition.frame_rate*5} -hls_time 5 -hls_playlist_type vod -b:v ${rendition.bitrate}k \
-maxrate ${rendition.bitrate*max_bitrate_ratio}k -bufsize ${rendition.bitrate*rate_monitor_buffer_ratio}k \
-b:a ${rendition.audio_bitrate}k -r ${rendition.frame_rate}\
-hls_segment_filename ${renditionDir}/${rendition.name}_%03d.ts ${renditionDir}/${rendition.name}.m3u8 `;
masterManifest5sec += `#EXT-X-STREAM-INF:BANDWIDTH=${rendition.bitrate*1000},AVERAGE-BANDWIDTH=${rendition.bitrate*1000},RESOLUTION=${rendition.resolution_width}X${rendition.resolution_height},CODECS="aac,h264",FRAME-RATE=${rendition.frame_rate}\n${durationString}/${rendition.name}/${rendition.name}.m3u8\n`;
}
cmd +=
`-c:a ${audioCodec} -ar 48000 -vn -hls_time 5 -hls_playlist_type vod -b:a 192k -keyint_min ${24*5} \
-hls_segment_filename ./${assetFolder}/${durationString}/audio/audio_%03d.ts ./${assetFolder}/${durationString}/audio/audio.m3u8 `;
masterManifest5sec += `#EXT-X-STREAM-INF:BANDWIDTH=192000,AVERAGE-BANDWIDTH=192000,CODECS="aac"\n${durationString}/audio/audio.m3u8\n`;
return cmd;
} | [
"async function run() {\n\n var cmd_6sec = \"\";\n var cmd_5sec = \"\";\n\n\n await prepareEnvironment(renditions);\n\n try {\n cmd_6sec = prepare6secSegmentsCMD(inputFilePath, renditions, audioCodec, videoCodec, audioSampleRate);\n cmd_5sec = prepare5secSegmentsCMD(inputFilePath, renditions, audioCodec, videoCodec, audioSampleRate);\n } catch (e) {\n console.log(\"Error: \", e);\n return;\n }\n\n\n console.log('Creating Multi bit rate segments for 6 seconds rendition...');\n var proc6 = exec(cmd_6sec);\n\n proc6.stdout.on('data', function(data) {\n console.log(\"[6 Seconds Renditions]\", data);\n });\n\n proc6.stderr.setEncoding(\"utf8\")\n proc6.stderr.on('data', function(data) {\n console.log(\"[6 Seconds Renditions]\", data);\n });\n\n proc6.on('close', function() {\n console.log(\"[6 Seconds Renditions] Finished creating segments for 6 seconds rendition\");\n\n console.log(\"Creating master playlist: master_6sec.m3u8\");\n fs.writeFile('hls_assets/master_6sec.m3u8', masterManifest6sec, (err) => {\n if (err) {\n\n console.log(\"Error while creating master_6sec.m3u8\", err.message);\n }\n });\n console.log(\"Created Master playlist(master_6sec.m3U8) successfully\");\n\n });\n\n\n\n console.log('Creating Multi bit rate segments for 5 seconds rendition...');\n var proc5 = exec(cmd_5sec);\n\n proc5.stdout.on('data', function(data) {\n console.log(\"[5 Seconds Renditions]\", data);\n });\n\n proc5.stderr.setEncoding(\"utf8\")\n proc5.stderr.on('err', function(data) {\n console.log(\"[5 Seconds Renditions]\", data);\n });\n\n proc5.on('close', function() {\n console.log(\"[5 Seconds Renditions] Finished creating segments for 5 seconds rendition\");\n\n console.log(\"Creating master playlist: master_5sec.m3u8\");\n\n fs.writeFile('hls_assets/master_5sec.m3u8', masterManifest5sec, (err) => {\n if (err) {\n\n console.log(\"Error while creating master_5sec.m3u8\", err.message);\n }\n });\n console.log(\"Created Master playlist(master_5sec.m3U8) successfully\");\n });\n\n\n}",
"function y4mcal(i,length,breadth,outputVideoFile,y4mOutput,psnrBitrateCounter) {\n var y4mConversion = ffmpeg(outputVideoFile)\n .addOption('-pix_fmt')\n .addOption('yuv420p')\n .addOptions('-vsync', '0', '-s', resolution) //need to change the resolution everytime;cant hardcode\n .outputOption('-sws_flags lanczos')\n .on('start', function (commandLine) {\n console.log('Spawned Ffmpeg with command: ' + commandLine);\n })\n .on('progress', function (progress) {\n console.log(JSON.stringify(progress));\n })\n .on('data', function (data) {\n var frame = new Buffer(data).toString('base64');\n console.log(frame);\n })\n .on('error', function (err) {\n console.log('An error occurred: ' + err.message);\n })\n .on('end', function (err, stdout, stderr) {\n console.log('Processing CRF encoding finished !');\n console.log(JSON.stringify(stdout, null, \" \"));\n rawTomp4(i,length,breadth,y4mOutput,outputVideoFile,psnrBitrateCounter);\n })\n\n .save(y4mOutput);\n}",
"function processSlowVideo(src, leadTime, slowTime, stretch){\n\n var chunkStates = ['notReady', 'notReady', 'notReady'];\n var srcName = path.parse(src).name;\n console.log(srcName + ': Start Processing');\n guiLog('Video Processing Started: '+srcName);\n //convert chunk 0\n convertToMP4(src, 'intermediate/'+srcName+'_chunk0.mp4', null, leadTime, null, function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 0 to mp4 failed: \" + err);\n chunkStates[0] = 'failed';\n }\n else{\n convertToStream(dst, 'intermediate/'+srcName+'_chunk0.ts', function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 0 to ts failed: \" + err);\n chunkStates[0] = 'failed';\n }\n else{\n console.log(srcName + \": Chunk 0 to Stream complete\");\n chunkStates[0] = 'done';\n }\n });\n }\n });\n\n //convert chunk 1\n convertToMP4(src, 'intermediate/'+srcName+'_chunk1.mp4', leadTime, slowTime, stretch, function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 1 to mp4 failed: \" + err);\n chunkStates[1] = 'failed';\n }\n else{\n convertToStream(dst, 'intermediate/'+srcName+'_chunk1.ts', function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 1 to ts failed: \" + err);\n chunkStates[1] = 'failed';\n }\n else{\n console.log(srcName + \": Chunk 1 to Stream complete\");\n chunkStates[1] = 'done';\n }\n });\n }\n });\n\n //convert chunk 2\n convertToMP4(src, 'intermediate/'+srcName+'_chunk2.mp4', leadTime+slowTime, null, null, function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 2 to mp4 failed: \" + err);\n chunkStates[2] = 'failed';\n }\n else{\n convertToStream(dst, 'intermediate/'+srcName+'_chunk2.ts', function(err, src, dst){\n if(err){\n console.log(srcName + \": Chunk 2 to ts failed: \" + err);\n chunkStates[2] = 'failed';\n }\n else{\n console.log(srcName + \": Chunk 2 to Stream complete\");\n chunkStates[2] = 'done';\n }\n });\n }\n });\n\n //funciton that will be looped until the chunks are converted to streams\n function processTick(){\n var ready = true;\n var failed = false;\n for (var i = 0; i < chunkStates.length; i++) {\n if(chunkStates[i] != 'done') ready = false;\n if(chunkStates[i] == 'failed') failed = true;\n }\n\n if(ready){\n clearInterval(pTick);\n assembleVideo(srcName, 'intermediate/'+srcName+'_assembeled.mp4', function(err, dst){\n if(err){\n deleteIntermediateFiles(srcName);\n }\n else{\n console.log(srcName + ': Assembly Complete');\n replaceAudio(srcName, function(err){\n if(err){\n\n }\n else{\n console.log(srcName + ': Processing Complete');\n guiLog('Video Processing Complete: ' + srcName);\n }\n deleteIntermediateFiles(srcName);\n })\n }\n });\n }\n\n if(failed){\n clearInterval(pTick);\n console.log('video conversion failed');\n deleteIntermediateFiles(srcName)\n guiLog('Video Conversion Failed: ' + srcName);\n }\n\n }\n\n var pTick = setInterval(processTick, 100);\n\n}",
"function _split5bytesBy5bits(arr) {\n const len = arr.length;\n //console.log('_split5bytesBy5bits len=', len)\n if (len > 5) {\n console.warn('WARN: _split5bytesBy5bits() more than 5 bytes, cut 5 bytes only')\n }\n const b0 = (len > 0) ? arr[0] : 0;\n const b1 = (len > 1) ? arr[1] : 0;\n const b2 = (len > 2) ? arr[2] : 0;\n const b3 = (len > 3) ? arr[3] : 0;\n const b4 = (len > 4) ? arr[4] : 0;\n\n // ---- split by 5bits --> 8bytes ---\n const r0 = (b0 & 0b11111000) >> 3;\n const r1 = ((b0 & 0b00000111) << 2) | ((b1 & 0b11000000) >> 6);\n const r2 = (b1 & 0b00111110) >> 1;\n const r3 = ((b1 & 0b00000001) << 4) | ((b2 & 0b11110000) >> 4);\n const r4 = ((b2 & 0b00001111) << 1) | ((b3 & 0b10000000) >> 7);\n const r5 = ((b3 & 0b01111100) >> 2);\n const r6 = ((b3 & 0b00000011) << 3) | ((b4 & 0b11100000) >> 5);\n const r7 = (b4 & 0b00011111);\n\n // --- double check with another logic ---\n _dubleCheckSplit(r0, r1, r2, r3, r4, r5, r6, r7, b0, b1, b2, b3, b4);\n\n // --- pack to array ---\n let newArr = null;\n if (len >= 5) {\n newArr = new Uint8Array([r0, r1, r2, r3, r4, r5, r6, r7]);\n }\n else if (len === 4) {\n newArr = new Uint8Array([r0, r1, r2, r3, r4, r5, r6]);\n }\n else if (len === 3) {\n newArr = new Uint8Array([r0, r1, r2, r3, r4]);\n }\n else if (len === 2) {\n newArr = new Uint8Array([r0, r1, r2, r3]);\n }\n else if (len === 1) {\n newArr = new Uint8Array([r0, r1]);\n }\n else {\n newArr = new Uint8Array([]);\n }\n\n return newArr;\n}",
"function y4mcal(i,length,breadth,outputVideoFile,y4mOutput,psnrBitrateCounter) {\n var y4mConversion = ffmpeg(outputVideoFile)\n .addOption('-pix_fmt')\n .addOption('yuv420p')\n .addOptions('-vsync', '0', '-s', resolution)\n .outputOption('-sws_flags lanczos')\n .on('start', function (commandLine) {\n console.log('Spawned Ffmpeg with command: ' + commandLine);\n })\n .on('progress', function (progress) {\n console.log(JSON.stringify(progress));\n })\n .on('data', function (data) {\n var frame = new Buffer(data).toString('base64');\n console.log(frame);\n })\n .on('error', function (err) {\n console.log('An error occurred: ' + err.message);\n })\n .on('end', function (err, stdout, stderr) {\n console.log('Processing raw file conversion finished !');\n console.log(JSON.stringify(stdout, null, \" \"));\n psnrcal(i,length,breadth,outputVideoFile,y4mOutput,psnrBitrateCounter);\n })\n .save(y4mOutput);\n}",
"createClip(options, cb) {\n let filePath = options.filePath;\n let fileName = StringHelper.randomString(5) + '_clip_' + StringHelper.getFileName(filePath, true) + '.mp4';\n let savePath = path.join(StringHelper.getFilePath(filePath), fileName);\n\n let command = new ffmpeg(filePath)\n // set target codec\n // https://gist.github.com/nikhan/26ddd9c4e99bbf209dd7\n //ffmpeg -i in.mkv -pix_fmt yuv420p -vcodec libx264 -vf scale=640:-1 -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -ac 2 -strict experimental -r 30 out.mp4\n //ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4s\n .videoCodec('libx264')\n .addOption('-ss', options.fromTime || '0')\n .addOption('-t', '20')\n .addOption('-pix_fmt', 'yuv420p')\n .addOption('-vf', 'scale=640:-1')\n .addOption('-acodec', 'aac')\n .addOption('-vb', '1024k')\n .addOption('-minrate', '1024k')\n .addOption('-maxrate', '1024k')\n .addOption('-bufsize', '1024k')\n .addOption('-ar', '44100')\n .addOption('-ac', '2')\n .addOption('-r', '24')\n .size('360x?')\n .outputOptions('-strict experimental')\n .on('end', function() {\n cb(null, fileName);\n })\n .on('error', cb)\n .toFormat('mp4');\n if (options.size) {\n command.size(options.size);\n }\n // save to file\n command.save(savePath);\n }",
"function TinySegmenter() {\n var patterns = {\n \"[一二三四五六七八九十百千万億兆]\":\"M\",\n \"[一-龠々〆ヵヶ]\":\"H\",\n \"[ぁ-ん]\":\"I\",\n \"[ァ-ヴーア-ン゙ー]\":\"K\",\n \"[a-zA-Za-zA-Z]\":\"A\",\n \"[0-90-9]\":\"N\"\n }\n this.chartype_ = [];\n for (var i in patterns) {\n var regexp = new RegExp(i);\n this.chartype_.push([regexp, patterns[i]]);\n }\n\n this.BIAS__ = -332\n this.BC1__ = {\"HH\":6,\"II\":2461,\"KH\":406,\"OH\":-1378};\n this.BC2__ = {\"AA\":-3267,\"AI\":2744,\"AN\":-878,\"HH\":-4070,\"HM\":-1711,\"HN\":4012,\"HO\":3761,\"IA\":1327,\"IH\":-1184,\"II\":-1332,\"IK\":1721,\"IO\":5492,\"KI\":3831,\"KK\":-8741,\"MH\":-3132,\"MK\":3334,\"OO\":-2920};\n this.BC3__ = {\"HH\":996,\"HI\":626,\"HK\":-721,\"HN\":-1307,\"HO\":-836,\"IH\":-301,\"KK\":2762,\"MK\":1079,\"MM\":4034,\"OA\":-1652,\"OH\":266};\n this.BP1__ = {\"BB\":295,\"OB\":304,\"OO\":-125,\"UB\":352};\n this.BP2__ = {\"BO\":60,\"OO\":-1762};\n this.BQ1__ = {\"BHH\":1150,\"BHM\":1521,\"BII\":-1158,\"BIM\":886,\"BMH\":1208,\"BNH\":449,\"BOH\":-91,\"BOO\":-2597,\"OHI\":451,\"OIH\":-296,\"OKA\":1851,\"OKH\":-1020,\"OKK\":904,\"OOO\":2965};\n this.BQ2__ = {\"BHH\":118,\"BHI\":-1159,\"BHM\":466,\"BIH\":-919,\"BKK\":-1720,\"BKO\":864,\"OHH\":-1139,\"OHM\":-181,\"OIH\":153,\"UHI\":-1146};\n this.BQ3__ = {\"BHH\":-792,\"BHI\":2664,\"BII\":-299,\"BKI\":419,\"BMH\":937,\"BMM\":8335,\"BNN\":998,\"BOH\":775,\"OHH\":2174,\"OHM\":439,\"OII\":280,\"OKH\":1798,\"OKI\":-793,\"OKO\":-2242,\"OMH\":-2402,\"OOO\":11699};\n this.BQ4__ = {\"BHH\":-3895,\"BIH\":3761,\"BII\":-4654,\"BIK\":1348,\"BKK\":-1806,\"BMI\":-3385,\"BOO\":-12396,\"OAH\":926,\"OHH\":266,\"OHK\":-2036,\"ONN\":-973};\n this.BW1__ = {\",と\":660,\",同\":727,\"B1あ\":1404,\"B1同\":542,\"、と\":660,\"、同\":727,\"」と\":1682,\"あっ\":1505,\"いう\":1743,\"いっ\":-2055,\"いる\":672,\"うし\":-4817,\"うん\":665,\"から\":3472,\"がら\":600,\"こう\":-790,\"こと\":2083,\"こん\":-1262,\"さら\":-4143,\"さん\":4573,\"した\":2641,\"して\":1104,\"すで\":-3399,\"そこ\":1977,\"それ\":-871,\"たち\":1122,\"ため\":601,\"った\":3463,\"つい\":-802,\"てい\":805,\"てき\":1249,\"でき\":1127,\"です\":3445,\"では\":844,\"とい\":-4915,\"とみ\":1922,\"どこ\":3887,\"ない\":5713,\"なっ\":3015,\"など\":7379,\"なん\":-1113,\"にし\":2468,\"には\":1498,\"にも\":1671,\"に対\":-912,\"の一\":-501,\"の中\":741,\"ませ\":2448,\"まで\":1711,\"まま\":2600,\"まる\":-2155,\"やむ\":-1947,\"よっ\":-2565,\"れた\":2369,\"れで\":-913,\"をし\":1860,\"を見\":731,\"亡く\":-1886,\"京都\":2558,\"取り\":-2784,\"大き\":-2604,\"大阪\":1497,\"平方\":-2314,\"引き\":-1336,\"日本\":-195,\"本当\":-2423,\"毎日\":-2113,\"目指\":-724,\"B1あ\":1404,\"B1同\":542,\"」と\":1682};\n this.BW2__ = {\"..\":-11822,\"11\":-669,\"――\":-5730,\"−−\":-13175,\"いう\":-1609,\"うか\":2490,\"かし\":-1350,\"かも\":-602,\"から\":-7194,\"かれ\":4612,\"がい\":853,\"がら\":-3198,\"きた\":1941,\"くな\":-1597,\"こと\":-8392,\"この\":-4193,\"させ\":4533,\"され\":13168,\"さん\":-3977,\"しい\":-1819,\"しか\":-545,\"した\":5078,\"して\":972,\"しな\":939,\"その\":-3744,\"たい\":-1253,\"たた\":-662,\"ただ\":-3857,\"たち\":-786,\"たと\":1224,\"たは\":-939,\"った\":4589,\"って\":1647,\"っと\":-2094,\"てい\":6144,\"てき\":3640,\"てく\":2551,\"ては\":-3110,\"ても\":-3065,\"でい\":2666,\"でき\":-1528,\"でし\":-3828,\"です\":-4761,\"でも\":-4203,\"とい\":1890,\"とこ\":-1746,\"とと\":-2279,\"との\":720,\"とみ\":5168,\"とも\":-3941,\"ない\":-2488,\"なが\":-1313,\"など\":-6509,\"なの\":2614,\"なん\":3099,\"にお\":-1615,\"にし\":2748,\"にな\":2454,\"によ\":-7236,\"に対\":-14943,\"に従\":-4688,\"に関\":-11388,\"のか\":2093,\"ので\":-7059,\"のに\":-6041,\"のの\":-6125,\"はい\":1073,\"はが\":-1033,\"はず\":-2532,\"ばれ\":1813,\"まし\":-1316,\"まで\":-6621,\"まれ\":5409,\"めて\":-3153,\"もい\":2230,\"もの\":-10713,\"らか\":-944,\"らし\":-1611,\"らに\":-1897,\"りし\":651,\"りま\":1620,\"れた\":4270,\"れて\":849,\"れば\":4114,\"ろう\":6067,\"われ\":7901,\"を通\":-11877,\"んだ\":728,\"んな\":-4115,\"一人\":602,\"一方\":-1375,\"一日\":970,\"一部\":-1051,\"上が\":-4479,\"会社\":-1116,\"出て\":2163,\"分の\":-7758,\"同党\":970,\"同日\":-913,\"大阪\":-2471,\"委員\":-1250,\"少な\":-1050,\"年度\":-8669,\"年間\":-1626,\"府県\":-2363,\"手権\":-1982,\"新聞\":-4066,\"日新\":-722,\"日本\":-7068,\"日米\":3372,\"曜日\":-601,\"朝鮮\":-2355,\"本人\":-2697,\"東京\":-1543,\"然と\":-1384,\"社会\":-1276,\"立て\":-990,\"第に\":-1612,\"米国\":-4268,\"11\":-669};\n this.BW3__ = {\"あた\":-2194,\"あり\":719,\"ある\":3846,\"い.\":-1185,\"い。\":-1185,\"いい\":5308,\"いえ\":2079,\"いく\":3029,\"いた\":2056,\"いっ\":1883,\"いる\":5600,\"いわ\":1527,\"うち\":1117,\"うと\":4798,\"えと\":1454,\"か.\":2857,\"か。\":2857,\"かけ\":-743,\"かっ\":-4098,\"かに\":-669,\"から\":6520,\"かり\":-2670,\"が,\":1816,\"が、\":1816,\"がき\":-4855,\"がけ\":-1127,\"がっ\":-913,\"がら\":-4977,\"がり\":-2064,\"きた\":1645,\"けど\":1374,\"こと\":7397,\"この\":1542,\"ころ\":-2757,\"さい\":-714,\"さを\":976,\"し,\":1557,\"し、\":1557,\"しい\":-3714,\"した\":3562,\"して\":1449,\"しな\":2608,\"しま\":1200,\"す.\":-1310,\"す。\":-1310,\"する\":6521,\"ず,\":3426,\"ず、\":3426,\"ずに\":841,\"そう\":428,\"た.\":8875,\"た。\":8875,\"たい\":-594,\"たの\":812,\"たり\":-1183,\"たる\":-853,\"だ.\":4098,\"だ。\":4098,\"だっ\":1004,\"った\":-4748,\"って\":300,\"てい\":6240,\"てお\":855,\"ても\":302,\"です\":1437,\"でに\":-1482,\"では\":2295,\"とう\":-1387,\"とし\":2266,\"との\":541,\"とも\":-3543,\"どう\":4664,\"ない\":1796,\"なく\":-903,\"など\":2135,\"に,\":-1021,\"に、\":-1021,\"にし\":1771,\"にな\":1906,\"には\":2644,\"の,\":-724,\"の、\":-724,\"の子\":-1000,\"は,\":1337,\"は、\":1337,\"べき\":2181,\"まし\":1113,\"ます\":6943,\"まっ\":-1549,\"まで\":6154,\"まれ\":-793,\"らし\":1479,\"られ\":6820,\"るる\":3818,\"れ,\":854,\"れ、\":854,\"れた\":1850,\"れて\":1375,\"れば\":-3246,\"れる\":1091,\"われ\":-605,\"んだ\":606,\"んで\":798,\"カ月\":990,\"会議\":860,\"入り\":1232,\"大会\":2217,\"始め\":1681,\"市\":965,\"新聞\":-5055,\"日,\":974,\"日、\":974,\"社会\":2024,\"カ月\":990};\n this.TC1__ = {\"AAA\":1093,\"HHH\":1029,\"HHM\":580,\"HII\":998,\"HOH\":-390,\"HOM\":-331,\"IHI\":1169,\"IOH\":-142,\"IOI\":-1015,\"IOM\":467,\"MMH\":187,\"OOI\":-1832};\n this.TC2__ = {\"HHO\":2088,\"HII\":-1023,\"HMM\":-1154,\"IHI\":-1965,\"KKH\":703,\"OII\":-2649};\n this.TC3__ = {\"AAA\":-294,\"HHH\":346,\"HHI\":-341,\"HII\":-1088,\"HIK\":731,\"HOH\":-1486,\"IHH\":128,\"IHI\":-3041,\"IHO\":-1935,\"IIH\":-825,\"IIM\":-1035,\"IOI\":-542,\"KHH\":-1216,\"KKA\":491,\"KKH\":-1217,\"KOK\":-1009,\"MHH\":-2694,\"MHM\":-457,\"MHO\":123,\"MMH\":-471,\"NNH\":-1689,\"NNO\":662,\"OHO\":-3393};\n this.TC4__ = {\"HHH\":-203,\"HHI\":1344,\"HHK\":365,\"HHM\":-122,\"HHN\":182,\"HHO\":669,\"HIH\":804,\"HII\":679,\"HOH\":446,\"IHH\":695,\"IHO\":-2324,\"IIH\":321,\"III\":1497,\"IIO\":656,\"IOO\":54,\"KAK\":4845,\"KKA\":3386,\"KKK\":3065,\"MHH\":-405,\"MHI\":201,\"MMH\":-241,\"MMM\":661,\"MOM\":841};\n this.TQ1__ = {\"BHHH\":-227,\"BHHI\":316,\"BHIH\":-132,\"BIHH\":60,\"BIII\":1595,\"BNHH\":-744,\"BOHH\":225,\"BOOO\":-908,\"OAKK\":482,\"OHHH\":281,\"OHIH\":249,\"OIHI\":200,\"OIIH\":-68};\n this.TQ2__ = {\"BIHH\":-1401,\"BIII\":-1033,\"BKAK\":-543,\"BOOO\":-5591};\n this.TQ3__ = {\"BHHH\":478,\"BHHM\":-1073,\"BHIH\":222,\"BHII\":-504,\"BIIH\":-116,\"BIII\":-105,\"BMHI\":-863,\"BMHM\":-464,\"BOMH\":620,\"OHHH\":346,\"OHHI\":1729,\"OHII\":997,\"OHMH\":481,\"OIHH\":623,\"OIIH\":1344,\"OKAK\":2792,\"OKHH\":587,\"OKKA\":679,\"OOHH\":110,\"OOII\":-685};\n this.TQ4__ = {\"BHHH\":-721,\"BHHM\":-3604,\"BHII\":-966,\"BIIH\":-607,\"BIII\":-2181,\"OAAA\":-2763,\"OAKK\":180,\"OHHH\":-294,\"OHHI\":2446,\"OHHO\":480,\"OHIH\":-1573,\"OIHH\":1935,\"OIHI\":-493,\"OIIH\":626,\"OIII\":-4007,\"OKAK\":-8156};\n this.TW1__ = {\"につい\":-4681,\"東京都\":2026};\n this.TW2__ = {\"ある程\":-2049,\"いった\":-1256,\"ころが\":-2434,\"しょう\":3873,\"その後\":-4430,\"だって\":-1049,\"ていた\":1833,\"として\":-4657,\"ともに\":-4517,\"もので\":1882,\"一気に\":-792,\"初めて\":-1512,\"同時に\":-8097,\"大きな\":-1255,\"対して\":-2721,\"社会党\":-3216};\n this.TW3__ = {\"いただ\":-1734,\"してい\":1314,\"として\":-4314,\"につい\":-5483,\"にとっ\":-5989,\"に当た\":-6247,\"ので,\":-727,\"ので、\":-727,\"のもの\":-600,\"れから\":-3752,\"十二月\":-2287};\n this.TW4__ = {\"いう.\":8576,\"いう。\":8576,\"からな\":-2348,\"してい\":2958,\"たが,\":1516,\"たが、\":1516,\"ている\":1538,\"という\":1349,\"ました\":5543,\"ません\":1097,\"ようと\":-4258,\"よると\":5865};\n this.UC1__ = {\"A\":484,\"K\":93,\"M\":645,\"O\":-505};\n this.UC2__ = {\"A\":819,\"H\":1059,\"I\":409,\"M\":3987,\"N\":5775,\"O\":646};\n this.UC3__ = {\"A\":-1370,\"I\":2311};\n this.UC4__ = {\"A\":-2643,\"H\":1809,\"I\":-1032,\"K\":-3450,\"M\":3565,\"N\":3876,\"O\":6646};\n this.UC5__ = {\"H\":313,\"I\":-1238,\"K\":-799,\"M\":539,\"O\":-831};\n this.UC6__ = {\"H\":-506,\"I\":-253,\"K\":87,\"M\":247,\"O\":-387};\n this.UP1__ = {\"O\":-214};\n this.UP2__ = {\"B\":69,\"O\":935};\n this.UP3__ = {\"B\":189};\n this.UQ1__ = {\"BH\":21,\"BI\":-12,\"BK\":-99,\"BN\":142,\"BO\":-56,\"OH\":-95,\"OI\":477,\"OK\":410,\"OO\":-2422};\n this.UQ2__ = {\"BH\":216,\"BI\":113,\"OK\":1759};\n this.UQ3__ = {\"BA\":-479,\"BH\":42,\"BI\":1913,\"BK\":-7198,\"BM\":3160,\"BN\":6427,\"BO\":14761,\"OI\":-827,\"ON\":-3212};\n this.UW1__ = {\",\":156,\"、\":156,\"「\":-463,\"あ\":-941,\"う\":-127,\"が\":-553,\"き\":121,\"こ\":505,\"で\":-201,\"と\":-547,\"ど\":-123,\"に\":-789,\"の\":-185,\"は\":-847,\"も\":-466,\"や\":-470,\"よ\":182,\"ら\":-292,\"り\":208,\"れ\":169,\"を\":-446,\"ん\":-137,\"・\":-135,\"主\":-402,\"京\":-268,\"区\":-912,\"午\":871,\"国\":-460,\"大\":561,\"委\":729,\"市\":-411,\"日\":-141,\"理\":361,\"生\":-408,\"県\":-386,\"都\":-718,\"「\":-463,\"・\":-135};\n this.UW2__ = {\",\":-829,\"、\":-829,\"〇\":892,\"「\":-645,\"」\":3145,\"あ\":-538,\"い\":505,\"う\":134,\"お\":-502,\"か\":1454,\"が\":-856,\"く\":-412,\"こ\":1141,\"さ\":878,\"ざ\":540,\"し\":1529,\"す\":-675,\"せ\":300,\"そ\":-1011,\"た\":188,\"だ\":1837,\"つ\":-949,\"て\":-291,\"で\":-268,\"と\":-981,\"ど\":1273,\"な\":1063,\"に\":-1764,\"の\":130,\"は\":-409,\"ひ\":-1273,\"べ\":1261,\"ま\":600,\"も\":-1263,\"や\":-402,\"よ\":1639,\"り\":-579,\"る\":-694,\"れ\":571,\"を\":-2516,\"ん\":2095,\"ア\":-587,\"カ\":306,\"キ\":568,\"ッ\":831,\"三\":-758,\"不\":-2150,\"世\":-302,\"中\":-968,\"主\":-861,\"事\":492,\"人\":-123,\"会\":978,\"保\":362,\"入\":548,\"初\":-3025,\"副\":-1566,\"北\":-3414,\"区\":-422,\"大\":-1769,\"天\":-865,\"太\":-483,\"子\":-1519,\"学\":760,\"実\":1023,\"小\":-2009,\"市\":-813,\"年\":-1060,\"強\":1067,\"手\":-1519,\"揺\":-1033,\"政\":1522,\"文\":-1355,\"新\":-1682,\"日\":-1815,\"明\":-1462,\"最\":-630,\"朝\":-1843,\"本\":-1650,\"東\":-931,\"果\":-665,\"次\":-2378,\"民\":-180,\"気\":-1740,\"理\":752,\"発\":529,\"目\":-1584,\"相\":-242,\"県\":-1165,\"立\":-763,\"第\":810,\"米\":509,\"自\":-1353,\"行\":838,\"西\":-744,\"見\":-3874,\"調\":1010,\"議\":1198,\"込\":3041,\"開\":1758,\"間\":-1257,\"「\":-645,\"」\":3145,\"ッ\":831,\"ア\":-587,\"カ\":306,\"キ\":568};\n this.UW3__ = {\",\":4889,\"1\":-800,\"−\":-1723,\"、\":4889,\"々\":-2311,\"〇\":5827,\"」\":2670,\"〓\":-3573,\"あ\":-2696,\"い\":1006,\"う\":2342,\"え\":1983,\"お\":-4864,\"か\":-1163,\"が\":3271,\"く\":1004,\"け\":388,\"げ\":401,\"こ\":-3552,\"ご\":-3116,\"さ\":-1058,\"し\":-395,\"す\":584,\"せ\":3685,\"そ\":-5228,\"た\":842,\"ち\":-521,\"っ\":-1444,\"つ\":-1081,\"て\":6167,\"で\":2318,\"と\":1691,\"ど\":-899,\"な\":-2788,\"に\":2745,\"の\":4056,\"は\":4555,\"ひ\":-2171,\"ふ\":-1798,\"へ\":1199,\"ほ\":-5516,\"ま\":-4384,\"み\":-120,\"め\":1205,\"も\":2323,\"や\":-788,\"よ\":-202,\"ら\":727,\"り\":649,\"る\":5905,\"れ\":2773,\"わ\":-1207,\"を\":6620,\"ん\":-518,\"ア\":551,\"グ\":1319,\"ス\":874,\"ッ\":-1350,\"ト\":521,\"ム\":1109,\"ル\":1591,\"ロ\":2201,\"ン\":278,\"・\":-3794,\"一\":-1619,\"下\":-1759,\"世\":-2087,\"両\":3815,\"中\":653,\"主\":-758,\"予\":-1193,\"二\":974,\"人\":2742,\"今\":792,\"他\":1889,\"以\":-1368,\"低\":811,\"何\":4265,\"作\":-361,\"保\":-2439,\"元\":4858,\"党\":3593,\"全\":1574,\"公\":-3030,\"六\":755,\"共\":-1880,\"円\":5807,\"再\":3095,\"分\":457,\"初\":2475,\"別\":1129,\"前\":2286,\"副\":4437,\"力\":365,\"動\":-949,\"務\":-1872,\"化\":1327,\"北\":-1038,\"区\":4646,\"千\":-2309,\"午\":-783,\"協\":-1006,\"口\":483,\"右\":1233,\"各\":3588,\"合\":-241,\"同\":3906,\"和\":-837,\"員\":4513,\"国\":642,\"型\":1389,\"場\":1219,\"外\":-241,\"妻\":2016,\"学\":-1356,\"安\":-423,\"実\":-1008,\"家\":1078,\"小\":-513,\"少\":-3102,\"州\":1155,\"市\":3197,\"平\":-1804,\"年\":2416,\"広\":-1030,\"府\":1605,\"度\":1452,\"建\":-2352,\"当\":-3885,\"得\":1905,\"思\":-1291,\"性\":1822,\"戸\":-488,\"指\":-3973,\"政\":-2013,\"教\":-1479,\"数\":3222,\"文\":-1489,\"新\":1764,\"日\":2099,\"旧\":5792,\"昨\":-661,\"時\":-1248,\"曜\":-951,\"最\":-937,\"月\":4125,\"期\":360,\"李\":3094,\"村\":364,\"東\":-805,\"核\":5156,\"森\":2438,\"業\":484,\"氏\":2613,\"民\":-1694,\"決\":-1073,\"法\":1868,\"海\":-495,\"無\":979,\"物\":461,\"特\":-3850,\"生\":-273,\"用\":914,\"町\":1215,\"的\":7313,\"直\":-1835,\"省\":792,\"県\":6293,\"知\":-1528,\"私\":4231,\"税\":401,\"立\":-960,\"第\":1201,\"米\":7767,\"系\":3066,\"約\":3663,\"級\":1384,\"統\":-4229,\"総\":1163,\"線\":1255,\"者\":6457,\"能\":725,\"自\":-2869,\"英\":785,\"見\":1044,\"調\":-562,\"財\":-733,\"費\":1777,\"車\":1835,\"軍\":1375,\"込\":-1504,\"通\":-1136,\"選\":-681,\"郎\":1026,\"郡\":4404,\"部\":1200,\"金\":2163,\"長\":421,\"開\":-1432,\"間\":1302,\"関\":-1282,\"雨\":2009,\"電\":-1045,\"非\":2066,\"駅\":1620,\"1\":-800,\"」\":2670,\"・\":-3794,\"ッ\":-1350,\"ア\":551,\"グ\":1319,\"ス\":874,\"ト\":521,\"ム\":1109,\"ル\":1591,\"ロ\":2201,\"ン\":278};\n this.UW4__ = {\",\":3930,\".\":3508,\"―\":-4841,\"、\":3930,\"。\":3508,\"〇\":4999,\"「\":1895,\"」\":3798,\"〓\":-5156,\"あ\":4752,\"い\":-3435,\"う\":-640,\"え\":-2514,\"お\":2405,\"か\":530,\"が\":6006,\"き\":-4482,\"ぎ\":-3821,\"く\":-3788,\"け\":-4376,\"げ\":-4734,\"こ\":2255,\"ご\":1979,\"さ\":2864,\"し\":-843,\"じ\":-2506,\"す\":-731,\"ず\":1251,\"せ\":181,\"そ\":4091,\"た\":5034,\"だ\":5408,\"ち\":-3654,\"っ\":-5882,\"つ\":-1659,\"て\":3994,\"で\":7410,\"と\":4547,\"な\":5433,\"に\":6499,\"ぬ\":1853,\"ね\":1413,\"の\":7396,\"は\":8578,\"ば\":1940,\"ひ\":4249,\"び\":-4134,\"ふ\":1345,\"へ\":6665,\"べ\":-744,\"ほ\":1464,\"ま\":1051,\"み\":-2082,\"む\":-882,\"め\":-5046,\"も\":4169,\"ゃ\":-2666,\"や\":2795,\"ょ\":-1544,\"よ\":3351,\"ら\":-2922,\"り\":-9726,\"る\":-14896,\"れ\":-2613,\"ろ\":-4570,\"わ\":-1783,\"を\":13150,\"ん\":-2352,\"カ\":2145,\"コ\":1789,\"セ\":1287,\"ッ\":-724,\"ト\":-403,\"メ\":-1635,\"ラ\":-881,\"リ\":-541,\"ル\":-856,\"ン\":-3637,\"・\":-4371,\"ー\":-11870,\"一\":-2069,\"中\":2210,\"予\":782,\"事\":-190,\"井\":-1768,\"人\":1036,\"以\":544,\"会\":950,\"体\":-1286,\"作\":530,\"側\":4292,\"先\":601,\"党\":-2006,\"共\":-1212,\"内\":584,\"円\":788,\"初\":1347,\"前\":1623,\"副\":3879,\"力\":-302,\"動\":-740,\"務\":-2715,\"化\":776,\"区\":4517,\"協\":1013,\"参\":1555,\"合\":-1834,\"和\":-681,\"員\":-910,\"器\":-851,\"回\":1500,\"国\":-619,\"園\":-1200,\"地\":866,\"場\":-1410,\"塁\":-2094,\"士\":-1413,\"多\":1067,\"大\":571,\"子\":-4802,\"学\":-1397,\"定\":-1057,\"寺\":-809,\"小\":1910,\"屋\":-1328,\"山\":-1500,\"島\":-2056,\"川\":-2667,\"市\":2771,\"年\":374,\"庁\":-4556,\"後\":456,\"性\":553,\"感\":916,\"所\":-1566,\"支\":856,\"改\":787,\"政\":2182,\"教\":704,\"文\":522,\"方\":-856,\"日\":1798,\"時\":1829,\"最\":845,\"月\":-9066,\"木\":-485,\"来\":-442,\"校\":-360,\"業\":-1043,\"氏\":5388,\"民\":-2716,\"気\":-910,\"沢\":-939,\"済\":-543,\"物\":-735,\"率\":672,\"球\":-1267,\"生\":-1286,\"産\":-1101,\"田\":-2900,\"町\":1826,\"的\":2586,\"目\":922,\"省\":-3485,\"県\":2997,\"空\":-867,\"立\":-2112,\"第\":788,\"米\":2937,\"系\":786,\"約\":2171,\"経\":1146,\"統\":-1169,\"総\":940,\"線\":-994,\"署\":749,\"者\":2145,\"能\":-730,\"般\":-852,\"行\":-792,\"規\":792,\"警\":-1184,\"議\":-244,\"谷\":-1000,\"賞\":730,\"車\":-1481,\"軍\":1158,\"輪\":-1433,\"込\":-3370,\"近\":929,\"道\":-1291,\"選\":2596,\"郎\":-4866,\"都\":1192,\"野\":-1100,\"銀\":-2213,\"長\":357,\"間\":-2344,\"院\":-2297,\"際\":-2604,\"電\":-878,\"領\":-1659,\"題\":-792,\"館\":-1984,\"首\":1749,\"高\":2120,\"「\":1895,\"」\":3798,\"・\":-4371,\"ッ\":-724,\"ー\":-11870,\"カ\":2145,\"コ\":1789,\"セ\":1287,\"ト\":-403,\"メ\":-1635,\"ラ\":-881,\"リ\":-541,\"ル\":-856,\"ン\":-3637};\n this.UW5__ = {\",\":465,\".\":-299,\"1\":-514,\"E2\":-32768,\"]\":-2762,\"、\":465,\"。\":-299,\"「\":363,\"あ\":1655,\"い\":331,\"う\":-503,\"え\":1199,\"お\":527,\"か\":647,\"が\":-421,\"き\":1624,\"ぎ\":1971,\"く\":312,\"げ\":-983,\"さ\":-1537,\"し\":-1371,\"す\":-852,\"だ\":-1186,\"ち\":1093,\"っ\":52,\"つ\":921,\"て\":-18,\"で\":-850,\"と\":-127,\"ど\":1682,\"な\":-787,\"に\":-1224,\"の\":-635,\"は\":-578,\"べ\":1001,\"み\":502,\"め\":865,\"ゃ\":3350,\"ょ\":854,\"り\":-208,\"る\":429,\"れ\":504,\"わ\":419,\"を\":-1264,\"ん\":327,\"イ\":241,\"ル\":451,\"ン\":-343,\"中\":-871,\"京\":722,\"会\":-1153,\"党\":-654,\"務\":3519,\"区\":-901,\"告\":848,\"員\":2104,\"大\":-1296,\"学\":-548,\"定\":1785,\"嵐\":-1304,\"市\":-2991,\"席\":921,\"年\":1763,\"思\":872,\"所\":-814,\"挙\":1618,\"新\":-1682,\"日\":218,\"月\":-4353,\"査\":932,\"格\":1356,\"機\":-1508,\"氏\":-1347,\"田\":240,\"町\":-3912,\"的\":-3149,\"相\":1319,\"省\":-1052,\"県\":-4003,\"研\":-997,\"社\":-278,\"空\":-813,\"統\":1955,\"者\":-2233,\"表\":663,\"語\":-1073,\"議\":1219,\"選\":-1018,\"郎\":-368,\"長\":786,\"間\":1191,\"題\":2368,\"館\":-689,\"1\":-514,\"E2\":-32768,\"「\":363,\"イ\":241,\"ル\":451,\"ン\":-343};\n this.UW6__ = {\",\":227,\".\":808,\"1\":-270,\"E1\":306,\"、\":227,\"。\":808,\"あ\":-307,\"う\":189,\"か\":241,\"が\":-73,\"く\":-121,\"こ\":-200,\"じ\":1782,\"す\":383,\"た\":-428,\"っ\":573,\"て\":-1014,\"で\":101,\"と\":-105,\"な\":-253,\"に\":-149,\"の\":-417,\"は\":-236,\"も\":-206,\"り\":187,\"る\":-135,\"を\":195,\"ル\":-673,\"ン\":-496,\"一\":-277,\"中\":201,\"件\":-800,\"会\":624,\"前\":302,\"区\":1792,\"員\":-1212,\"委\":798,\"学\":-960,\"市\":887,\"広\":-695,\"後\":535,\"業\":-697,\"相\":753,\"社\":-507,\"福\":974,\"空\":-822,\"者\":1811,\"連\":463,\"郎\":1082,\"1\":-270,\"E1\":306,\"ル\":-673,\"ン\":-496};\n \n return this;\n }",
"_sendPossibleCommands() {\n const active_ids = new Set(Array.from(this._currently_allocated_ids).map(k => parseInt(k, 10)))\n Object.keys(this._current_row_major_mapping).forEach(logical_id => active_ids.add(parseInt(logical_id, 10)))\n\n let new_stored_commands = []\n for (let i = 0; i < this._stored_commands.length; ++i) {\n const cmd = this._stored_commands[i]\n if (len(active_ids) === 0) {\n new_stored_commands = new_stored_commands.concat(this._stored_commands.slice(i))\n break\n }\n if (cmd.gate instanceof AllocateQubitGate) {\n const qid = cmd.qubits[0][0].id\n if (qid in this._current_row_major_mapping) {\n this._currently_allocated_ids.add(qid)\n const mapped_id = this._current_row_major_mapping[qid]\n const qb = new BasicQubit(this, this._mapped_ids_to_backend_ids[mapped_id])\n const new_cmd = new Command(this, new AllocateQubitGate(), tuple([qb]), [], [new LogicalQubitIDTag(qid)])\n this.send([new_cmd])\n } else {\n new_stored_commands.push(cmd)\n }\n } else if (cmd.gate instanceof DeallocateQubitGate) {\n const qid = cmd.qubits[0][0].id\n if (active_ids.has(qid)) {\n const mapped_id = this._current_row_major_mapping[qid]\n const qb = new BasicQubit(this, this._mapped_ids_to_backend_ids[mapped_id])\n const new_cmd = new Command(this, new DeallocateQubitGate(), tuple([qb]), [], [new LogicalQubitIDTag(qid)])\n this._currently_allocated_ids.delete(qid)\n active_ids.delete(qid)\n delete this._current_row_major_mapping[qid]\n delete this._currentMapping[qid]\n this.send([new_cmd])\n } else {\n new_stored_commands.push(cmd)\n }\n } else {\n let send_gate = true\n const mapped_ids = new Set()\n\n for (let k = 0; k < cmd.allQubits.length; ++k) {\n const qureg = cmd.allQubits[k]\n for (let j = 0; j < qureg.length; ++j) {\n const qubit = qureg[j]\n if (!active_ids.has(qubit.id)) {\n send_gate = false\n break\n }\n mapped_ids.add(this._current_row_major_mapping[qubit.id])\n }\n }\n\n\n // Check that mapped ids are nearest neighbour on 2D grid\n if (len(mapped_ids) === 2) {\n const [qb0, qb1] = Array.from(mapped_ids).sort((a, b) => a - b)\n send_gate = false\n if (qb1 - qb0 === this.num_columns) {\n send_gate = true\n } else if (qb1 - qb0 === 1 && (qb1 % this.num_columns !== 0)) {\n send_gate = true\n }\n }\n if (send_gate) {\n // Note: This sends the cmd correctly with the backend ids\n // as it looks up the mapping in this.currentMapping\n // and not our internal mapping\n // this._current_row_major_mapping\n this.sendCMDWithMappedIDs(cmd)\n } else {\n cmd.allQubits.forEach(qureg => qureg.forEach(qubit => active_ids.delete(qubit.id)))\n new_stored_commands.push(cmd)\n }\n }\n }\n\n this._stored_commands = new_stored_commands\n }",
"function nextCommand() {\n\t\t\tvar command = header.readByte();\n\n\t\t\t// Short waits\n\t\t\tif((command & 0xF0) == 0x70) {\n\t\t\t\treturn (command & 0x0F);\n\t\t\t}\n\n\t\t\t// Everything else\n\t\t\tswitch(command) {\n\t\t\t\tcase 0x4f:\t// GameGear PSG stereo register\n\t\t\t\t\theader.skipByte();\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x50:\t// PSG\n\t\t\t\t\tpsg.write(header.readByte());\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x51:\t// YM2413\n\t\t\t\t\theader.skipShort();\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x52:\t// YM2612 port 0\n\t\t\t\t\theader.skipShort();\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x53:\t// YM2612 port 1\n\t\t\t\t\theader.skipShort();\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x54:\t// YM2151\n\t\t\t\t\theader.skipShort();\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0x61:\t// Wait a number of samples\n\t\t\t\t\treturn header.readShort();\n\t\t\t\tcase 0x62:\t// Wait one frame (NTSC - 1/60th of a second)\n\t\t\t\t\treturn 735;\n\t\t\t\tcase 0x63:\t// Wait one frame (PAL - 1/50th of a second)\n\t\t\t\t\treturn 882;\n\t\t\t\tcase 0x66:\t// END\n\t\t\t\t\tif(settings.loop_samples > 0) {\n\t\t\t\t\t\theader.seek(settings.loop_offset);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisPlaying = false;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\tcase 0xe0: // Seek\n\t\t\t\t\theader.skipLong();\n\t\t\t\t\treturn 0;\n\t\t\t\tdefault:\n\t\t\t\t\tif((command > 0x30) && (command <= 0x4e)) {\n\t\t\t\t\t\theader.skipByte();\n\t\t\t\t\t} else if((command > 0x55) && (command <= 0x5f)) {\n\t\t\t\t\t\theader.skipShort();\n\t\t\t\t\t} else if((command > 0xa0) && (command <= 0xbf)) {\n\t\t\t\t\t\theader.skipShort();\n\t\t\t\t\t} else if((command > 0xc0) && (command <= 0xdf)) {\n\t\t\t\t\t\theader.skipByte();\n\t\t\t\t\t\theader.skipShort();\n\t\t\t\t\t} else if((command > 0xe1) && (command <= 0xff)) {\n\t\t\t\t\t\theader.skipLong();\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}",
"function queueStrums(sequenceN, blockStartTime, chordIndex, precacheTime) {\n var chords = [\n Guitar.C_MAJOR,\n Guitar.G_MAJOR,\n Guitar.A_MINOR,\n Guitar.E_MINOR\n ];\n\n var playState = document.getElementById(\"playState\").value;\n if (playState == \"stopped\") {\n return;\n }\n\n var curStrumStartTime;\n\n var chord = chords[chordIndex];\n switch(sequenceN % 14) {\n case 0:\n curStrumStartTime = blockStartTime + timeUnit * 0;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 1:\n curStrumStartTime = blockStartTime + timeUnit * 4;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 2:\n curStrumStartTime = blockStartTime + timeUnit * 6;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 3:\n curStrumStartTime = blockStartTime + timeUnit * 10;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 4:\n curStrumStartTime = blockStartTime + timeUnit * 12;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 5:\n curStrumStartTime = blockStartTime + timeUnit * 14;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 6:\n curStrumStartTime = blockStartTime + timeUnit * 16;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 7:\n curStrumStartTime = blockStartTime + timeUnit * 20;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 8:\n curStrumStartTime = blockStartTime + timeUnit * 22;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 9:\n curStrumStartTime = blockStartTime + timeUnit * 26;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 10:\n curStrumStartTime = blockStartTime + timeUnit * 28;\n guitar.strumChord(curStrumStartTime, true, 1.0, chord);\n break;\n case 11:\n curStrumStartTime = blockStartTime + timeUnit * 30;\n guitar.strumChord(curStrumStartTime, false, 0.8, chord);\n break;\n case 12:\n\n curStrumStartTime = blockStartTime + timeUnit * 31;\n guitar.strings[2].pluck(curStrumStartTime, 0.7, chord[2]);\n\n curStrumStartTime = blockStartTime + timeUnit * 31.5;\n guitar.strings[1].pluck(curStrumStartTime, 0.7, chord[1]);\n\n chordIndex = (chordIndex + 1) % 4;\n blockStartTime += timeUnit*32;\n\n break;\n\n\n case 13:\n\n curStrumStartTime = blockStartTime + timeUnit * 31;\n guitar.strings[2].pluck(curStrumStartTime, 0.7, chord[5]);\n\n curStrumStartTime = blockStartTime + timeUnit * 31.5;\n guitar.strings[1].pluck(curStrumStartTime, 0.7, chord[1]);\n\n chordIndex = (chordIndex + 1) % 4;\n blockStartTime += timeUnit*32;\n\n break;\n\n\n\n default:\n break;\n }\n sequenceN++;\n\n // if we're only generating the next strum 200 ms ahead of the current time,\n // we might be falling behind, so increase the precache time\n if (curStrumStartTime - audioCtx.currentTime < 0.2) {\n precacheTime += 0.1;\n }\n document.getElementById(\"precacheTime\").innerHTML =\n precacheTime.toFixed(1) + \" seconds\";\n\n // we try to main a constant time between when the strum\n // has finished generated and when it actually plays\n // the next strum will be played at curStrumStartTime; so start\n // generating the one after the next strum at precacheTime before\n var generateIn = curStrumStartTime - audioCtx.currentTime - precacheTime;\n if (generateIn < 0)\n generateIn = 0;\n\n nextGenerationCall = function() {\n queueStrums(sequenceN, blockStartTime, chordIndex, precacheTime);\n };\n setTimeout(nextGenerationCall, generateIn * 1000);\n}",
"function psnrcal(i,length,breadth,y4mOutput,finalOutput,psnrBitrateCounter) {\n\n var psnrAfter = ffmpeg(inputVideoFile)\n .input(y4mOutput)\n .complexFilter(['psnr'])\n .addOption('-f', 'null')\n .on('start', function (commandLine) {\n console.log('Spawned Ffmpeg with command: ' + commandLine);\n })\n .on('progress', function (progress) {\n console.log(JSON.stringify(progress));\n })\n .on('data', function (data) {\n var frame = new Buffer(data).toString('base64');\n console.log(frame);\n })\n .on('error', function (err) {\n console.log('An error occurred: ' + err.message);\n })\n .on('end', function (err, stdout, stderr, metadata) {\n console.log('Processing for PSNR finished !');\n\n console.log(JSON.stringify(stdout, null, \" \"));\n var averagePSNR = JSON.stringify(stdout, null, \" \").match(\"average:(.*)min:\");\n var fs = require(\"fs\");\n var psnrFile = \"../resource/reverse/TOS3secPSNR\"+length+\"x\"+breadth+\"_\"+i+\".txt\";\n var jsonstream = fs.createWriteStream(jsonFile, {flags: 'a'});\n ffmpeg.ffprobe(finalOutput, function(err, metadata) {\n psnrBitrateList[psnrBitrateCounter][0] = metadata.streams[0].bit_rate;\n psnrBitrateList[psnrBitrateCounter][1] = parseFloat(averagePSNR[1]);\n jsonstream.write(\"PSNR\"+length+\"x\"+breadth+\"_\"+i+\":\"+psnrBitrateList[psnrBitrateCounter][0] + \"...Bitrate\"+length+\"x\"+breadth+\"_\"+i+\":\"+ psnrBitrateList[psnrBitrateCounter][1] + \"\\n\");\n deleteUnusedFile(y4mOutput);\n if(psnrBitrateCounter==17){\n printHullPoints();\n }\n if (!fs.existsSync(y4mOutput)) {\n keepItRunning(i,length,breadth,psnrBitrateCounter);\n }\n\n });\n\n })\n .output('nowhere')\n .run();\n}",
"function sendCommandsInSequence(socket, roomId, eventTotal, commandName, commandPayload, done) {\n const testRunUniqueId = 'serverPerformanceTest_' + uuid();\n\n console.log(`--- Starting ${testRunUniqueId} with \"${commandName}\", until ${eventTotal} events are received --`);\n\n var isDone = false;\n var eventCount = 0;\n var commandCount = 0;\n\n console.time(testRunUniqueId);\n send();\n\n socket.on('event', () => {\n eventCount++;\n\n if (isDone) {\n // some commands trigger multiple events.\n // make sure to only call \"done\" and \"console.timeEnd\" once per testrun!\n return;\n }\n\n if (eventCount < eventTotal) {\n send();\n } else {\n isDone = true;\n console.log(`Performance test done. sent ${commandCount} commands. Received ${eventCount} events.`);\n console.timeEnd(testRunUniqueId);\n console.log('\\n---');\n done();\n }\n });\n\n function send() {\n commandCount++;\n socket.emit('command', {\n id: uuid(),\n roomId: roomId,\n name: commandName,\n payload: commandPayload\n });\n }\n\n }",
"startEncode() {\n\n var option = indexedApp.getCurrentSelectedExportSizeOption();\n\n var cmdArgs = [];\n cmdArgs.push(\"-y\");\n cmdArgs.push(\"-i\");\n cmdArgs.push(this.file.path);\n if (option.ffmpegArg) {\n cmdArgs.push(\"-s\");\n cmdArgs.push(option.ffmpegArg);\n }\n cmdArgs.push(`${indexedApp.getCurrentPathForSaving()}/${this._fileNameWithoutExtension}.mp4`);\n\n var process = child_process.execFile(Config.ffmpegFile, cmdArgs);\n process.stderr.on(\"data\", data=> {\n\n // console.log(data);\n\n this.checkToGetVideoLength(data);\n let result = this._regExpCurrentTime.exec(data);\n if (result) {\n var currentTime = this.getMsByRegExpResult(result);\n if (currentTime) {\n if (this._videoLength) {\n this._progressBarText.html(`${Math.round(currentTime / this._videoLength * 100)}%`);\n this._progressBar.progressbar({value: currentTime, max: this._videoLength});\n } else {\n this._progressBarText.html(`${result[1]}:${result[2]}:${result[3]}`);\n }\n }\n }\n });\n process.on('close', (code) => {\n console.log(`child process exited with code ${code}`);\n if (!code) {\n this._progressBarText.html(\"完成\");\n }\n });\n }",
"function set_topfive_frames_size()\n{\n // Browser Window width\n var browser_width = $(window).width();\n\n // Frame width in % divided by document width\n var calc_frame_width = 0;\n var calc_frame_height = 0;\n\n // Responsive view\n /* Smartphones */\n if (browser_width < 768)\n {\n calc_frame_width = ((browser_width - ((browser_width/100)*20)) / 5) - 15;\n calc_frame_height = (browser_width / 100) * 10;\n }\n /* Tablets (potrait) */\n else if (browser_width > 768 && browser_width < 1024)\n {\n calc_frame_width = ((browser_width - ((browser_width/100)*10)) / 5) - 20;\n calc_frame_height = (browser_width / 100) * 10;\n }\n /* Tablets (landscape) */\n else if (browser_width > 1024 && browser_width < 1440)\n {\n calc_frame_width = ((browser_width - ((browser_width/100)*10)) / 5) - 20;\n calc_frame_height = (browser_width / 100) * 10;\n }\n /* Desktop and above */\n else if (browser_width > 1440)\n {\n calc_frame_width = ((browser_width - ((browser_width/100)*10)) / 5) - 20;\n calc_frame_height = (browser_width / 100) * 10;\n }\n\n // set Frame width\n $(\".topfive .frame\").css(\"width\", calc_frame_width + \"px\");\n\n // set Top Fives Container height\n $(\".topfive\").css({\n \"height\":calc_frame_height,\n \"min-height\":calc_frame_height\n });\n\n // Top Logo Image size\n $(\".topfive .frame img\").css({\n \"height\":calc_frame_height,\n \"width\":calc_frame_width\n });\n\n // Top Background Video Frame size\n $(\".topfive .frame .bgvideo\").css({\n \"height\":calc_frame_height,\n \"width\":calc_frame_width\n });\n}",
"createPlan() {\n // reset plan\n this._plan.length = 0;\n // reset update plan\n this._updatePlan.length = 0;\n // recalculate total duration time\n this._calcTotalTime();\n\n // frame size (60fps)\n const step = 16;\n\n const { delay, duration } = this._props;\n // current time\n let time = delay;\n\n let periodStart;\n\n while (time <= this._totalTime) {\n const prevPeriod = this._getPeriod(time - step);\n const period = this._getPeriod(time);\n const nextPeriod = this._getPeriod(time + step);\n const prevFrame = this._plan[this._plan.length-1];\n\n let frameSnapshot = 0;\n\n if (period === 'delay') {\n this._plan.push(frameSnapshot);\n time += step;\n periodStart = undefined;\n continue;\n }\n\n // catch the start of `update` period\n if (periodStart === undefined) {\n this._o.isIt && console.log('yep', time, period);\n periodStart = time;\n }\n // calculate current progress\n this._updatePlan.push((time - periodStart) / duration);\n\n // onUpdate\n frameSnapshot = frameSnapshot | (1 << 3);\n\n const isPrevFrame = prevFrame !== undefined;\n\n if (!isPrevFrame) {\n // onStart\n frameSnapshot = frameSnapshot | (1 << 1);\n }\n\n const isPrevDelay = prevPeriod === 'delay';\n // onRepeatStart\n if (!isPrevFrame || isPrevDelay || prevPeriod === period - 1) {\n frameSnapshot = frameSnapshot | (1 << 2);\n }\n\n // onRepeatComplete\n if (nextPeriod === 'delay' || nextPeriod === period + 1) {\n frameSnapshot = frameSnapshot | (1 << 4);\n }\n\n this._plan.push(frameSnapshot);\n\n time += step;\n }\n\n // onComplete\n const lastIndex = this._plan.length - 1;\n this._plan[lastIndex] = this._plan[lastIndex] | (1 << 5);\n if (this._props.isReverse) {\n this.reverse();\n }\n\n this._o.isIt && console.log(this._plan.length);\n\n // the first one should be always 0\n // this._updatePlan[0] = 0;\n // the last one should be always 1\n // this._updatePlan[this._updatePlan.length-1] = 1;\n\n return this._plan;\n }",
"parseChunks(chunk, byteStart) {\r\n if (!this._onError || !this._onMediaInfo || !this._onTrackMetadata || !this._onDataAvailable) {\r\n throw new IllegalStateException('Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified');\r\n }\r\n\r\n let offset = 0;\r\n let le = this._littleEndian;\r\n\r\n if (byteStart === 0) { // buffer with header\r\n let probeData = MP4Demuxer.probe(chunk);\r\n offset = probeData.dataOffset;\r\n if (!probeData.enoughData) {\r\n return 0;\r\n }\r\n }\r\n\r\n\r\n if (this._firstParse) { // parse moov box\r\n this._firstParse = false;\r\n if (byteStart + offset !== this._dataOffset) {\r\n Log.w(this.TAG, 'First time parsing but chunk byteStart invalid!');\r\n }\r\n\r\n let uintarr = new Uint8Array(chunk);\r\n let moov = boxInfo(uintarr, offset);\r\n //moov still not finished, wait for it\r\n if (!moov.fullyLoaded) {\r\n this._firstParse = true;\r\n return 0;\r\n }\r\n let moovData = new Uint8Array(chunk, byteStart + offset, moov.size);\r\n this._parseMoov(moovData);\r\n offset += moov.size;\r\n }\r\n\r\n let chunkOffset;\r\n\r\n while (offset < chunk.byteLength) {\r\n this._dispatch = true;\r\n\r\n let v = new Uint8Array(chunk, offset);\r\n\r\n if (offset + 8 > chunk.byteLength) {\r\n // data not enough for parsing box size\r\n break;\r\n }\r\n\r\n let chunkMap = this._chunkMap;\r\n if (this._mdatEnd > byteStart + offset) {\r\n //find the chunk\r\n let sampleOffset = byteStart + offset;\r\n let dataChunk = null;\r\n if (chunkOffset === undefined) {\r\n // bi search first chunk\r\n chunkOffset = (function () {\r\n let bottom = 0, top = chunkMap.length - 1;\r\n while (bottom <= top) {\r\n let mid = Math.floor((bottom + top) / 2);\r\n let result = (function (mid) {\r\n if (sampleOffset < chunkMap[mid].offset) return -1;\r\n if (chunkMap[mid + 1] && sampleOffset >= chunkMap[mid + 1].offset) return 1;\r\n return 0;\r\n })(mid);\r\n if (result == 0) return mid;\r\n if (result < 0) top = mid - 1;\r\n else bottom = mid + 1;\r\n }\r\n })();\r\n dataChunk = chunkMap[chunkOffset];\r\n } else {\r\n // sequal search other chunk\r\n for (; chunkOffset < chunkMap.length; chunkOffset++) {\r\n dataChunk = chunkMap[chunkOffset];\r\n if (sampleOffset < dataChunk.offset) {\r\n dataChunk = chunkMap[chunkOffset - 1];\r\n break;\r\n }\r\n }\r\n if (!dataChunk) {\r\n dataChunk = chunkMap[chunkMap.length - 1];\r\n }\r\n }\r\n\r\n //find out which sample\r\n sampleOffset -= dataChunk.offset;\r\n let sample;\r\n for (let i = 0; i < dataChunk.samples.length; i++) {\r\n if (sampleOffset == 0) {\r\n sample = dataChunk.samples[i];\r\n break;\r\n }\r\n sampleOffset -= dataChunk.samples[i].size;\r\n }\r\n\r\n if (sample === undefined) {\r\n //extra unused data, drop it\r\n let chunkOffset = chunkMap.indexOf(dataChunk);\r\n let nextChunk = chunkMap[chunkOffset + 1];\r\n let droppedBytes = (nextChunk != undefined ? nextChunk.offset : this._mdatEnd) - byteStart - offset;\r\n if (offset + droppedBytes <= chunk.byteLength) {\r\n Log.w(this.TAG, `Found ${droppedBytes} bytes unused data in chunk #${chunkOffset} (type: ${dataChunk.type}), dropping. `);\r\n offset += droppedBytes;\r\n continue;\r\n } else {\r\n break; //data not enough wait next time\r\n }\r\n }\r\n\r\n let sampleSize;\r\n if (dataChunk.type == 'video') {\r\n sampleSize = sample.size;\r\n if (offset + sampleSize > chunk.byteLength) {\r\n break;\r\n }\r\n this._parseAVCVideoData(chunk, offset, sampleSize, sample.ts, byteStart + offset, sample.isKeyframe, sample.cts, sample.duration);\r\n } else if (dataChunk.type == 'audio') {\r\n sampleSize = sample.size;\r\n if (offset + sampleSize > chunk.byteLength) {\r\n break;\r\n }\r\n let track = this._audioTrack;\r\n let dts = this._timestampBase / 1e3 * this._audioMetadata.timescale + sample.ts;\r\n let accData = v.subarray(0, sampleSize);\r\n let aacSample = { unit: accData, length: accData.byteLength, dts: dts, pts: dts };\r\n track.samples.push(aacSample);\r\n track.length += aacSample.length;\r\n }\r\n\r\n offset += sampleSize;\r\n } else {\r\n let box = boxInfo(v, 0);\r\n if (box.name == 'mdat') {\r\n this._mdatEnd = byteStart + offset + box.size - 8;\r\n offset += box.headSize;\r\n } else {\r\n if (box.fullyLoaded) {\r\n //not mdat box, skip\r\n offset += box.size;\r\n } else {\r\n //not mdat box, not fully loaded, break out\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // dispatch parsed frames to consumer (typically, the remuxer)\r\n if (this._isInitialMetadataDispatched()) {\r\n if (this._dispatch && (this._audioTrack.length || this._videoTrack.length)) {\r\n this._onDataAvailable(this._audioTrack, this._videoTrack);\r\n }\r\n }\r\n\r\n return offset; // consumed bytes, just equals latest offset index\r\n }",
"function ZGW_MAM30_DG5_PIA_CODES_T3Dg5CodeCB(data) {\r\n \r\n if(data.length>0){\r\n if(syncReferenceDetsUpdated){\r\n localStorage.setItem('LastSyncReferenceDetails',localStorage.getItem('LastSyncReferenceDetails')+', DG5CODES:'+String(data.length));\r\n }else{\r\n localStorage.setItem('LastSyncReferenceDetails',localStorage.getItem('LastSyncReferenceDetails')+'DG5CODES:'+String(data.length));\r\n }\r\n \r\n \r\nopMessage(\"Deleting Existing DG5CODES\");\r\n opMessage(\"Loading\"+data.length+\" DG5CODES\");\r\n \r\n var myarray = [{ 'sql': 'DELETE FROM DG5CODES', 'data': [] }];\r\n for(var cntx=0; cntx < data.length ; cntx++)\r\n {\r\n \r\n myarray.push({\r\n \r\n'sql': 'INSERT INTO DG5CODES (type , level , coderef , description,code,codedesc,parenttype,parentcode) VALUES (?,?,?,?,?,?,?,?)', 'data':\r\n [data[cntx].type,data[cntx].level,data[cntx].coderef, data[cntx].description,\r\n data[cntx].code,data[cntx].codedesc,data[cntx].parenttype, data[cntx].parentcode]\r\n })\r\n \r\n \r\n }\r\n \r\n \r\n html5sql.process(\r\n myarray\r\n ,\r\n function(){\r\n },\r\n function(error, statement){\r\n opMessage(\"Error: \" + error.message + \" when inserting DG5CODES\" + statement);\r\n } \r\n );\r\n \r\n \r\n \r\n \r\n }\r\n }",
"function frameInserter() {\n self.dispatch('frameinserted');\n while (isRunning && tasks.length && routine()) {}\n\n if (!isRunning || !tasks.length) {\n stopTasks();\n } else {\n startTime = (new Date()).getTime();\n framesCount++;\n delay = effectiveTime - frameTime;\n correctedFrameTime = frameTime - delay;\n\n self.dispatch('insertframe');\n insertFrame(frameInserter);\n }\n }",
"readPort(comName) {\n for(let i=0; i<this.parsers.length; i++) {\n if(this.parsers[i].comName !== comName) continue;\n let parser = this.parsers[i];\n parser.on('data', (data) => {\n console.log(data);\n /*\n let dataPoints = data.split(',');\n let packet = {};\n for(let j=0; j<dataPoints.length; j++) {\n packet[this.packetStructure[j]] = dataPoints[j];\n }\n this.emit('data', packet);\n */\n });\n parser.once('data', (data) => {\n /*\n let dataPoints = data.split(',');\n let packet = {};\n for(let j=0; j<dataPoints.length; j++) {\n packet[this.packetStructure[j]] = dataPoints[j];\n }\n for(let j=0; j<this.loadedPorts.length; j++) {\n if(this.loadedPorts[j].path !== this.parsers[i].comName) continue;\n this.loadedPorts[j].chipId = packet.chipId;\n }\n this.parsers[i].chipId = packet.chipId;\n */\n })\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Extract the pii for ScienceDirect articles and use it to form a new URL | function get_ScienceDirect(theURL) {
var searchfor = "piikey%3D"
var mypiiTMPi = theURL.indexOf(searchfor)
var mypiiTMP = theURL.substring(mypiiTMPi+searchfor.length,theURL.length)
var mypiiTMPi = mypiiTMP.indexOf("%26")
var mypii = mypiiTMP.substring(0,mypiiTMPi)
var theNewURL = "http://www.sciencedirect.com/science/article/pii/" + mypii
return theNewURL
} | [
"function makeExtractURL(numPages, pageParams) {\n var extractURL = 'http://en.wikipedia.org/w/api.php?action=query&' +\n 'prop=extracts&format=json&exsentences=3&explaintext=&exintro=&' +\n 'exlimit=' + numPages + '&titles=' + pageParams + '&callback=?';\n return extractURL;\n}",
"function scrape(urlList) {\n\tfor (index in urlList) {\n\t\tvar url = urlList[index];\n\t\tvar pubID = url.match(/\\/detail\\/(\\d+)/)[1];\n\t\t\n\t\tvar apiUrl = \"https://academic.microsoft.com/api/browse/GetEntityDetails?entityId=\" +\n\t\t\tpubID + \"&correlationId=undefined\";\n\t\t\n\t\tZU.doGet(apiUrl, function(text) {\n\t\t\tvar data = JSON.parse(text);\n\t\t\tvar type;\n\t\t\tif (data.entity.c) {\n\t\t\t\ttype = \"conferencePaper\";\n\t\t\t} else if (data.entity.j) {\n\t\t\t\ttype = \"journalArticle\";\n\t\t\t} else {\n\t\t\t\ttype = \"book\";\n\t\t\t}\n\t\t\tvar item = new Zotero.Item(type);\n\t\t\titem.itemID = pubID;\n\t\t\titem.title = data.entityTitle;\n\t\t\titem.date = data.entity.d;//alternatively ZU.strToISO(data.date);\n\t\t\titem.abstractNote = data.abstract;\n\t\t\t\n\t\t\tif (data.authors) {\n\t\t\t\tfor (var i=0; i<data.authors.length; i++) {\n\t\t\t\t\titem.creators.push(ZU.cleanAuthor(data.authors[i].lt, \"author\"));\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\titem.publicationTitle = data.entity.extended.vfn;\n\t\t\titem.journalAbbreviation = data.entity.extended.vsn;\n\t\t\titem.volume = data.entity.extended.v;\n\t\t\titem.issue = data.entity.extended.i;\n\t\t\titem.pages = data.entity.extended.fp;\n\t\t\tif (data.entity.extended.lp) {\n\t\t\t\titem.pages += \"–\" + data.entity.extended.lp;\n\t\t\t}\n\t\t\titem.DOI = data.entity.extended.doi;\n\t\t\t\n\t\t\tif (data.fieldsOfStudy) {\n\t\t\t\tfor (var i=0; i<data.fieldsOfStudy.length; i++) {\n\t\t\t\t\titem.tags.push(data.fieldsOfStudy[i].lt);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Save all links to the source in one HTML note.\n\t\t\tvar sourcesNote = \"<p>Data sources found by Microsoft Academic search engine:</p>\";\n\t\t\tif (data.sources) {\n\t\t\t\tfor (var i=0; i<data.sources.length; i++) {\n\t\t\t\t\tsourcesNote += '<a href=\"' +data.sources[i].u+ '\">'+data.sources[i].u+'</a><br/>';\n\t\t\t\t}\n\t\t\t}\n\t\t\titem.notes.push({note: sourcesNote});\n\t\t\t\n\t\t\titem.attachments.push({\n\t\t\t\turl: \"https://academic.microsoft.com/#/detail/\"+data.entity.id,\t\n\t\t\t\tsnapshot: false\n\t\t\t});\n\t\t\t\n\t\t\t/*\n\t\t\tdelete data.references;\n\t\t\tdelete data.citations;\n\t\t\tZ.debug(data);\n\t\t\t*/\n\t\t\t\n\t\t\titem.complete();\n\t\t});\n\t}\n}",
"function GetDetailsUrlFromHref(href) {\n var pieces = /([0-9]+).+(JSS[^']*).+([0-9]+)/.exec(href);\n var docId = pieces[1];\n var rootUrl = \"https://ees.elsevier.com/jss/\";\n var url = rootUrl + \"EMDetails.aspx?docid=\" + pieces[1] + \"&ms_num=\" + pieces[2] + \"§ionID=\" + pieces[3];\n return {\n url: url,\n docId: docId\n };\n}",
"function formatCitationLink(metaData, link) {\n\n\t\t//return immediately if link\n\t\tif (link == null) return \"\";\n\n\t\t//get ids, return if not valid\n\t\tconst ids = link.replace(/(?:^.*\\/document\\/|\\/.*$)/g,\"\").replace(/[^0-9]/g,\"\");\n\n\t\tif (ids == \"\") return \"\";\n\n\t\t//set download method to POST\n\t\tmetaData[\"citation_download_method\"] = \"POST\";\n\n\t\t//return download link with ids obtained from abstract page url\n\t\treturn (metaData[\"citation_url_nopath\"] + \"/xpl/downloadCitations?citations-format=citation-only&download-format=download-ris&recordIds=\" + ids);\n\t}",
"function get_Nature(theURL,mycompstr) {\r\n var theDOI = theURL.substring(mycompstr.length,theURL.length+1);\r\n return theDOI;\r\n}",
"function parsonStudentWork() {\n request({\n method: 'GET',\n url: 'http://www.newschool.edu/parsons/student-work/'\n }, function(err, response, body) {\n if (err) return console.error(err);\n\n $ = cheerio.load(body);\n\n // $('div.small-up-1').each(function() {\n // var href = $('a', this).attr('href');\n // if (href.lastIndexOf('/') > 0) {\n // console.log($('h3', this).text()); // student name\n // }\n // });\n // $('div.column').each(function() {\n // var img = $('h3');\n // console.log(img.text());\n // });\n\n $('div.column').each(function() {\n var img = $('img', this).attr('src');\n var majorName = $('p.profile-program-name', this).text();\n\n // console.log(''); // markdown images\n // console.log('http://www.newschool.edu' + img + ' , ' + majorName); // csv output\n console.log('http://www.newschool.edu' + img); // just links\n\n });\n\n });\n}",
"function formatCitationLink(metaData, link) {\n\t\tif (link == null || (link = link.trim()) == \"\") return \"\";\n\t\tmetaData[\"citation_download_method\"] = \"POST\";\n\t\tlet myForm = new FormData();\n\t\tmyForm.append('articles',link);\n\t\tmyForm.append('ArticleAction',\"export_endnote\");\n\t\tmetaData[\"citation_download_requestbody\"] = myForm;\n\t\tlink = (metaData[\"citation_url_nopath\"] + \"/custom_tags/IB_Download_Citations.cfm\");\n\t\treturn link;\n\t}",
"function get_eLife(theURL) {\r\n // http://elife.elifesciences.org/cgi/content/short/3/0/e01539?rss=1\r\n var myDOITMPi = theURL.lastIndexOf(\"/\")\r\n var myDOITMP = theURL.substring(myDOITMPi+2,theURL.length) // +2 to get rid of /e\r\n var myDOITMPi = myDOITMP.indexOf(\"?\")\r\n var myDOI = myDOITMP.substring(0,myDOITMPi)\r\n var theDOI = \"10.7554/eLife.\" + myDOI\r\n return theDOI\r\n}",
"function getFallbackURL(url) {\n if (url.search(/osapublishing\\.org\\/DirectPDFAccess/i) == -1) return null;\n\n //get base url\n let baseurl = url.replace(/osapublishing\\.org.*/gi,\"osapublishing.org\");\n\n //get id\n let id = url.replace(/\\.pdf\\?.*$/gi,\"\").replace(/^.*\\//gi,\"\");\n if (id == \"\") return null;\n return (baseurl + \"/fulltext.cfm?uri=\" + id);\n }",
"function build_pintrest_link(img_src,domain) {\n\n // https://pinterest.com/pin/create/button/?url=http://hopetracker.com/inspiration/?og_img=/site/public/images/quotes/quote.choosing_peace.jpg&media=http://hopetracker.com/site/public/images/quotes/quote.choosing_peace.jpg\n /** base part of the pintrest share url */\n var returnValue = \"https://pinterest.com/pin/create/button/?url=\" + domain + \"/inspiration/?og_img=\";\n\n /** add the current image slide to the share link*/\n returnValue += img_src;\n\n /** add final part of the pintrest url */\n returnValue += \"&media=\" + domain + \"/\" + img_src;\n\n /** Sets the pintrest share link value */\n $(pintrest_link).attr('href',returnValue);\n\n }",
"function getIntroHtml(data, pageid) {\n const cityDetails = {\n name : data[`query`][`pages`][pageid][`title`] ,\n introHtml : data[`query`][`pages`][pageid][`extract`]\n };\n displayWikipediaInfo(cityDetails);\n }",
"function momaPS1() {\n var baseURL = 'http://www.momaps1.org';\n\n request({\n method: 'GET',\n url: 'http://www.momaps1.org/exhibitions/'\n }, function(err, response, body) {\n if (err) return console.error(err);\n\n var $ = cheerio.load(body);\n\n $('div.exhibitionsublist ul li').each(function() {\n var link = $('a', this);\n console.log('Going into: ' + baseURL + link.attr('href'));\n\n // go to the link of the exibition\n request({\n method: 'GET',\n url: baseURL + link.attr('href')\n }, function(err, response, bod) {\n if (err) return console.error(err);\n\n var exPage = cheerio.load(bod);\n\n var title = exPage('h3.exhibit-title', bod);\n var img = exPage('div#slides img', bod);\n // console.log(title.text());\n console.log(baseURL + img.attr('src'));\n\n var command = 'wget \"' + baseURL + img.attr('src') + '\" -P ./ps1-img-scrapes';\n if (img.attr('src') != null) {\n exec(command, (err, stdout, stderr) => {\n if (err) {\n console.error(err);\n return;\n }\n console.log(stdout);\n });\n }\n });\n\n });\n });\n}",
"function getPathExtracts(numPages, pageParams) {\n var extractURL = makeExtractURL(numPages, pageParams);\n $.getJSON(\n extractURL,\n function(data) {\n var extracts = data.query.pages;\n Object.keys(extracts).forEach(function(key) {\n var text = extracts[key].extract;\n var code = getPathCode(extracts[key].title);\n queryInfo[code].extract = text;\n });\n });\n}",
"wiki(title, elClass = \"wiki\"){\r\n const url = `https://en.wikipedia.org/w/api.php?action=query&titles=${title}&prop=extracts&explaintext=1&exintro&exlimit=2&format=json&formatversion=2&origin=*`;\r\n fetch(url)\r\n .then(data => data.json())\r\n .then(function (data){\r\n const wikiNodes = document.getElementsByClassName(elClass);\r\n //iterate over HTMLCollection javascript https://stackoverflow.com/questions/22754315/for-loop-for-htmlcollection-elements\r\n [].forEach.call(wikiNodes, function(wikiNode) {\r\n wikiNode.innerHTML = data.query.pages[0].extract\r\n });\r\n // alert(data.query.pages[0].extract)\r\n console.log(data)\r\n return true\r\n })\r\n .catch(function(err){\r\n alert('Error on Loadin Wikipedia data')\r\n return false}); \r\n\r\n\r\n \r\n}",
"function getProductId(url){\n let id = url.match(/p-[0-9]+/g)\n let lastIndex = id.length -1\n return id[lastIndex].slice(2)\n}",
"function _getCourseURL (courseID) {\n url = `https://academic-calendar.wlu.ca/search.php?s_text=${courseID}&cal=1&y=${year}&s_levels%5B%5D=1&s_levels%5B%5D=2&s_levels%5B%5D=3&s_levels%5B%5D=4&submit.x=8&submit.y=10`;\n\n return new Promise((resolve, reject) => {\n axios.get(url).then((response) => {\n const courseHTML = response.data;\n const $ = cheerio.load(courseHTML);\n\n // If the course showed up at the top of the search, return its URL.\n\t// UPDATE: 2020/21 calendar uses strong instead of b tags\n if ($('.res > dl > dt > a > strong').eq(0).text().toLowerCase().includes(courseID.toLowerCase())) {\n resolve(\"https://academic-calendar.wlu.ca/\" + $('.res > dl > dt > a').eq(0).attr('href'));\n }\n\n reject(\"Course was unable to be found.\");\n });\n });\n}",
"getURL() {\n return EHUrls.getDegree(this._code, this._school);\n }",
"function prepareArticle(article) {\n if (\"field_image\" in article && \"und\" in article.field_image) {\n angular.forEach(article.field_image.und, function(value, key) {\n var imgPath = article.field_image.und[key].uri\n .split(\"//\")[1]\n .replace(/^\\/+/, \"\");\n article.field_image.und[key].imgPath =\n DrupalHelperService.getPathToImgByStyle(\n DrupalApiConstant.imageStyles.medium\n ) + imgPath;\n article.nid = parseInt(article.nid);\n });\n }\n\n return article;\n }",
"function find_alt_plot(link) {\n if (base_url.indexOf('portal')>0) {\n Run.clusterRef = 'IHEP';\n return link.replace('http://portal.nersc.gov/project/dayabay/dybprod', 'http://202.122.37.74/odmfile');\n }\n else {\n Run.clusterRef = 'PDSF';\n return link.replace('http://202.122.37.74/odmfile', 'http://portal.nersc.gov/project/dayabay/dybprod');\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decodes the specified string by replacing all _ with it's original value \" \' etc It will also decode the \" \' if keep_slashes is set to fale or omitted | function decode(str, keep_slashes) {
if (isEncoded) {
str = str.replace(/\uFEFF[0-9]/g, function(str) {
return encodingLookup[str];
});
}
if (!keep_slashes)
str = str.replace(/\\([\'\";:])/g, "$1");
return str;
} | [
"function parsestr (c, s) {\n var encodeUtf8 = function (s) {\n return unescape(encodeURIComponent(s));\n };\n var decodeUtf8 = function (s) {\n return decodeURIComponent(escape(s));\n };\n var decodeEscape = function (s, quote) {\n var d3;\n var d2;\n var d1;\n var d0;\n var c;\n var i;\n var len = s.length;\n var ret = \"\";\n for (i = 0; i < len; ++i) {\n c = s.charAt(i);\n if (c === \"\\\\\") {\n ++i;\n c = s.charAt(i);\n if (c === \"n\") {\n ret += \"\\n\";\n }\n else if (c === \"\\\\\") {\n ret += \"\\\\\";\n }\n else if (c === \"t\") {\n ret += \"\\t\";\n }\n else if (c === \"r\") {\n ret += \"\\r\";\n }\n else if (c === \"b\") {\n ret += \"\\b\";\n }\n else if (c === \"f\") {\n ret += \"\\f\";\n }\n else if (c === \"v\") {\n ret += \"\\v\";\n }\n else if (c === \"0\") {\n ret += \"\\0\";\n }\n else if (c === '\"') {\n ret += '\"';\n }\n else if (c === '\\'') {\n ret += '\\'';\n }\n else if (c === \"\\n\") /* escaped newline, join lines */ {\n }\n else if (c === \"x\") {\n d0 = s.charAt(++i);\n d1 = s.charAt(++i);\n ret += String.fromCharCode(parseInt(d0 + d1, 16));\n }\n else if (c === \"u\" || c === \"U\") {\n d0 = s.charAt(++i);\n d1 = s.charAt(++i);\n d2 = s.charAt(++i);\n d3 = s.charAt(++i);\n ret += String.fromCharCode(parseInt(d0 + d1, 16), parseInt(d2 + d3, 16));\n }\n else {\n // Leave it alone\n ret += \"\\\\\" + c;\n // goog.asserts.fail(\"unhandled escape: '\" + c.charCodeAt(0) + \"'\");\n }\n }\n else {\n ret += c;\n }\n }\n return ret;\n };\n\n //print(\"parsestr\", s);\n\n var quote = s.charAt(0);\n var rawmode = false;\n var unicode = false;\n\n // treats every sequence as unicodes even if they are not treated with uU prefix\n // kinda hacking though working for most purposes\n if((c.c_flags & Parser.CO_FUTURE_UNICODE_LITERALS || Sk.python3 === true)) {\n unicode = true;\n }\n\n if (quote === \"u\" || quote === \"U\") {\n s = s.substr(1);\n quote = s.charAt(0);\n unicode = true;\n }\n else if (quote === \"r\" || quote === \"R\") {\n s = s.substr(1);\n quote = s.charAt(0);\n rawmode = true;\n }\n goog.asserts.assert(quote !== \"b\" && quote !== \"B\", \"todo; haven't done b'' strings yet\");\n\n goog.asserts.assert(quote === \"'\" || quote === '\"' && s.charAt(s.length - 1) === quote);\n s = s.substr(1, s.length - 2);\n if (unicode) {\n s = encodeUtf8(s);\n }\n\n if (s.length >= 4 && s.charAt(0) === quote && s.charAt(1) === quote) {\n goog.asserts.assert(s.charAt(s.length - 1) === quote && s.charAt(s.length - 2) === quote);\n s = s.substr(2, s.length - 4);\n }\n\n if (rawmode || s.indexOf(\"\\\\\") === -1) {\n return strobj(decodeUtf8(s));\n }\n return strobj(decodeEscape(s, quote));\n}",
"encodeSpecials() {\n const value = this.value;\n const regex = /(\\'|\"|\\\\x00|\\\\\\\\(?![\\\\\\\\NGETHLnlr]))/g;\n return value.replace(regex, '\\\\\\\\$0');\n }",
"function unescape(object) {\n return transform(object, _.unescape)\n}",
"function TagDecode(str){\r\n\tvar temp;\r\n\ttemp = str.replace(/"/gi,\"\\\"\")\r\n\ttemp = temp.replace(/'/gi,\"\\'\")\r\n\ttemp = temp.replace(/</gi,\"<\")\r\n\ttemp = temp.replace(/>/gi,\">\")\r\n\ttemp = temp.replace(/<br>/gi,\"\\n\")\r\n\ttemp = temp.replace(/&/gi,\"&\")\r\n\treturn temp;\r\n}",
"function replaceSpecialCharactors(str){\n return str.replace(/[\\.\\$\\[\\]\\#\\/]/g, \"_\");\n}",
"function decode (string) {\n\n var body = Buffer.from(string, 'base64').toString('utf8')\n return JSON.parse(body)\n}",
"function replaceEscapeSequences(string) {\n return string\n .replace(/[\\b]/g, \"\\\\b\")\n .replace(/\\f/g, \"\\\\f\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/\\v/g, \"\\\\v\")\n .replace(\n /[\\x00-\\x1f\\x7f-\\x9f]/g,\n (c) => \"\\\\x\" + c.charCodeAt(0).toString(16).padStart(2, \"0\"),\n );\n }",
"function jsParseSpChr(argString) {\n var parsedString = argString.replace(/[']/g,\"\\'\");\n parsedString = argString.replace(/[\"]/g,\"\\\"\");\n return parsedString;\n }",
"function unescape_smiley(smiley)\r\n{\r\n var res = \"\";\r\n for (var i = 0; i < smiley.length; i++)\r\n {\r\n if (smiley.charAt(i) == \"\\\\\" && i != smiley.length-1)\r\n {\r\n switch (smiley.charAt(i+1))\r\n {\r\n case \"n\":\r\n res += \"\\n\";\r\n break;\r\n case \"t\":\r\n res += \"\\t\";\r\n break;\r\n case \"\\\\\":\r\n res += \"\\\\\";\r\n break;\r\n default:\r\n res += \"\\\\\" + smiley.charAt(i+1);\r\n break;\r\n }\r\n i++;\r\n }\r\n else\r\n {\r\n res += smiley.charAt(i);\r\n }\r\n } \r\n return res;\r\n}",
"handleUTF8() {\n var decodeParamType = support.uint8array ? \"uint8array\" : \"array\";\n if (this.useUTF8()) {\n this.fileNameStr = utf8decode(this.fileName);\n this.fileCommentStr = utf8decode(this.fileComment);\n } else {\n var upath = this.findExtraFieldUnicodePath();\n if (upath !== null) {\n this.fileNameStr = upath;\n } else {\n // ASCII text or unsupported code page\n var fileNameByteArray = transformTo(decodeParamType, this.fileName);\n this.fileNameStr = this.loadOptions.decodeFileName(fileNameByteArray);\n }\n\n var ucomment = this.findExtraFieldUnicodeComment();\n if (ucomment !== null) {\n this.fileCommentStr = ucomment;\n } else {\n // ASCII text or unsupported code page\n var commentByteArray = transformTo(decodeParamType, this.fileComment);\n this.fileCommentStr = this.loadOptions.decodeFileName(commentByteArray);\n }\n }\n }",
"function escape(s) {\n let result = \"\";\n _.each(s, function (ch) {\n switch (ch) {\n case \":\":\n result += \"\\\\:\";\n break;\n case \"\\\\\":\n result += \"\\\\\\\\\";\n break;\n default:\n result += ch;\n }\n });\n return result;\n}",
"function replaceApici(text,charToSubst)\n{\n\t/*if (!charToSubst) return text;\n\t// Trasforma \" in ''\n\tif (charToSubst==\"\\\"\")\n\t\treturn strReplace(text,\"\\\"\",\"''\");\n\t// Trasforma ' in \"\n\telse\n\t\treturn strReplace(text,\"'\",\"\\\"\");*/\n\t\t\n\tif (!charToSubst) return text;\n\t// Trasforma \" in ''\n\tif (charToSubst==\"\\\"\")\n\t\treturn strReplace(text,\"\\\"\",\"''\");\n\t// Trasforma ' in \"\n\telse\n\t\treturn strReplace(text,\"'\",\"''\");\n\t\n\n\t\t\n\t\t\n}",
"function unescapeIdentifier(identifier) {\r\n return identifier.startsWith('___') ? identifier.substr(1) : identifier;\r\n }",
"function escapeCodeString(str) {\n const escapeCodeStringTable = { 39: '\\\\\\'', 34: '\\\\\"', 92: '\\\\\\\\', 8: '\\\\b', 12: '\\\\f', 10: '\\\\n', 13: '\\\\r', 9: '\\\\t' };\n var r = '', c, cr, table;\n for (var i = 0; i < str.length; i++) {\n c = str[i];\n cr = c.charCodeAt(0);\n table = escapeCodeStringTable[cr];\n if (table != null) { r += table; } else { if ((cr >= 32) && (cr <= 127)) { r += c; } }\n }\n return r;\n}",
"function decode(queryStr, shouldTypecast) {\n\tvar queryArr = (queryStr || '').replace('?', '').split('&'),\n\t n = queryArr.length,\n\t obj = {},\n\t item, val;\n\twhile (n--) {\n\t item = queryArr[n].split('=');\n\t val = shouldTypecast === false? item[1] : typecast(item[1]);\n\t obj[item[0]] = isString(val)? decodeURIComponent(val) : val;\n\t}\n\treturn obj;\n }",
"function addunderscores( str ){ return str.replace(/\\'|\\\"| /g, '_'); }",
"function doubleBackwardSlashes(path) {\r\n\treturn path.replace(/\\\\/g, \"\\\\\\\\\");\r\n}",
"function manipulateString(string) {\n\t//alertrnf(\"from backup in manipulateString(): string received = \" + string);\n\t//alertrnf(\"renamedFileName = \" + renamedFileName);\nif(budgetSheet && !(renamedFileName.includes(\"bs\"))) {\n//restore.bs to filename //if backing up a budgetsheet after edit renamedFileName might already end in .bs\nrenamedFileName = renamedFileName + \".bs\";\n//protocolFileName = renamedFileName + \".bs\";\n//protocolFileName = renamedFileName + \".bs\";\n}//end if(budgetSheet) {\n\tposition = string.indexOf(\"_os\");\n\t//alertrnf(\"position = \" + position);\n\tpart = string.slice(position);\n\t//alertrnf(\"part = \" + part);\n\t//newPartString = \"{\\\"\" + protocolFileName;\n\tnewPartString = \"{\\\"\" + renamedFileName;\n\t//alertrnf(\"newPartString = \" + newPartString);\n\t//string.splice position = 17\n\t//string = \"This is a test of rename db filename!\"\n\tstring = newPartString+part;\n\t//alertrnf(\"Now string = \" + string);\n\t// dbTitle.textContent = renamedFileName;\n\t return string;\n}//end function manipulateString",
"function quoteString(string) {\n const quote = QUOTES.find((c) => !string.includes(c)) ?? QUOTES[0];\n const escapePattern = new RegExp(`(?=[${quote}\\\\\\\\])`, \"g\");\n string = string.replace(escapePattern, \"\\\\\");\n string = replaceEscapeSequences(string);\n return `${quote}${string}${quote}`;\n }",
"function decodeUtf8ToString(bytes) {\n // XXX do documentation\n return encodeCodePointsToString(decodeUtf8ToCodePoints(bytes));\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This fx will reset a specific position of the current tab | reloadTabPosition(position = null) {
if (typeof this.asset.resetOutlet === 'function')
this.asset.resetOutlet(position);
} | [
"reset(){\n this.setSpeed();\n this.setStartPosition();\n }",
"function resetTabs(){\n var homeTabs = $(\".section-tab__item\");\n homeTabs.each(function(){\n $(this).css(\"background-color\", \"#D5D7D8\");\n })\n }",
"function setRovingTabindex(active)\n\t{\n\t\tvar passive = (active == 'dragitems' ? 'droptargets' : 'dragitems');\n\t\t\n\t\tutils.forevery($this[active], function(i, target)\n\t\t{\n\t\t\ttarget.setAttribute('tabindex', '0');\n\t\t});\n\n\t\tutils.forevery($this[passive], function(i, target)\n\t\t{\n\t\t\ttarget.removeAttribute('tabindex');\n\t\t});\n\t}",
"function resetSlider() {\n currentSlideIndex = 0\n }",
"resetPosition() {\n if (this.hasGoneOffScreen()) {\n this.x = this.canvas.width;\n }\n }",
"resetPosition(){\n this.speed = 0;\n this.deltaT = 0;\n this.rotation = 0;\n this.position[0] = this.startingPos[0];\n this.position[1] = this.startingPos[1];\n this.position[2] = this.startingPos[2];\n }",
"function clearTab() {\n removeAllChildren(getMainTab());\n}",
"function resetAnimation(){\n animationSteps = [];\n step = 0;\n resetFlowCounter();\n resetTraceback();\n animationSteps.push({\n network: TOP,\n action: \"reveal\",\n pStep: 0\n });\n}",
"function reset($target, start_pos, width) { \n $target.css(start_pos);\n //$target.css({'left': start_pos.left + 'px', 'top': start_pos.top + 'px'});\n if(width > 0) $target.width(width);\n $target.removeClass('disabled_bg');\n $('.cal-tip').hide('fast');\n $('#cal_messages').css('top', '0px').hide('fast');\n}",
"_focusFirstTab () {\n this.tabs[0].focus()\n }",
"function resetStepForm() {\n editingStep = -1;\n stepType = 'script';\n clearStepForm();\n $('#script-form').addClass('hidden');\n }",
"_resetPosition() {\n this._monitor = this._getMonitor();\n\n this._updateSize();\n\n this._updateAppearancePreferences();\n this._updateBarrier();\n }",
"reset() {\r\n\t\tthis.changeState(this.initial);\r\n\t}",
"function resetCurrentFlight() {\r\n $('#'+currentFlight).removeClass('active');\r\n clearMap();\r\n}",
"focusFirst(){\r\n const tab = this.tabControl.querySelector('.glu_verticalTabs-tab');\r\n if (!tab)\r\n return;\r\n\r\n this.focusTab(tab);\r\n }",
"resetIndex() {\n this._offset = 0;\n }",
"move_horseProfile_TabsHeader(){\n browser.touchAction('//android.widget.ScrollView/android.view.ViewGroup/android.view.ViewGroup[12]/android.widget.HorizontalScrollView', ['longPress',\n { action: 'moveTo', x: 0, y: (this.horseProfile_Y_Location_TabHeader-500)}, 'release'\n ])\n }",
"function reset(){\n\t\t\t\n\t\t\ttitle.text = _title;\n\t\t\ttitle.updateCache();\n\t\t\ttitle.x = -title.getMeasuredWidth() / 2;\n\t\t\ttitle.y = titleYPOS;\n\t\t\ttitle.alpha = 1;\n\t\t\t\n\t\t\tTweenMax.to([circleOver, smallCircleOver], 0, {scaleX:0, scaleY:0});\n\t\t\tTweenMax.to(title, 0, {y:titleYPOS, x:titleXPOS, alpha:1});\n\t\t}",
"reset() {\r\n\t\tthis.number = this.props.index + 1\r\n\t\tthis.counters = {\r\n\t\t\tfigure: 0\r\n\t\t}\r\n\t\t// TODO: Incorporate equation numbers.\r\n\t}",
"setCurrentTab(tabName) {\n this.currentTab = tabName;\n\n MapLayers.nuts3.renderLayer();\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds "a" or "an" to a word for readability. | function a(word) {
if (word === 'undefined' || word === 'null') return word;
return `${('aeiou').includes(word[0]) ? 'an' : 'a'} ${word}`;
} | [
"function insert_a(text, script) {\r\n const a = (script == Script.CYRL) ? '\\u0430' : 'a'; // roman a or cyrl a\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\n text = text.replace(new RegExp(`([ක-ෆ])([^\\u0DCF-\\u0DDF\\u0DCA${a}])`, 'g'), `$1${a}$2`);\r\n return text.replace(/([ක-ෆ])$/g, `$1${a}`); // conso at the end of string not matched by regex above\r\n}",
"function acronym(words) {\n return words.reduce(function (acc, currentVal) {\n return acc + currentVal.slice(0,1)\n }, '')\n}",
"function addLetterToCurrentWord(editableDiv, letter) {\n\tvar oldStr = editableDiv.textContent;\n\tvar curPos = getCaretPositionInDiv(editableDiv);\n\tvar firstPos = getStartingPositionOfCurrentWord(editableDiv);\n\tvar lastPos = getLastPositionOfCurrentWord(editableDiv);\n\tvar newWord = oldStr.substr(firstPos, curPos-firstPos)+letter+oldStr.substr(curPos, lastPos-curPos+1);\n\treturn newWord;\n}",
"function addWord () {\n if (guide.choices().length > 0) {\n var choices = guide.choices();\n var choice = choices[Math.floor(Math.random() * choices.length)];\n guide.choose(choice);\n $scope.sentence += ' ' + choice;\n } else {\n $interval.cancel(sentenceInterval);\n if (guide.isComplete()) {\n $scope.sentence += '.'; // if complete, add period.\n }\n }\n }",
"function addExtraLetter() {\n const word = document.querySelector('.word.active') || wordsContainer.firstChild\n const prevLength = word.children.length\n if (letterIndex >= prevLength) {\n const span = document.createElement('span')\n span.className = 'extra';\n span.innerHTML = textarea.value\n word.appendChild(span)\n }\n\n slashCoords()\n}",
"function acronym(phrase) {\n let acr = phrase\n .split(\" \")\n .reduce((a, b) => a + b.charAt(0).toUpperCase(), \"\");\n return acr;\n}",
"function replaceThe(str) {\n\tconst a = [];\n\tfor (let i = 0; i < str.split(\" \").length; i++) {\n\t\tif (str.split(\" \")[i] === \"the\" && /[aeiou]/.test(str.split(\" \")[i+1][0])) {\n\t\t\ta.push(\"an\");\n\t\t} else if (str.split(\" \")[i] === \"the\" && /([b-df-hj-np-tv-z])/.test(str.split(\" \")[i+1][0])) {\n\t\t\ta.push(\"a\");\n\t\t} else a.push(str.split(\" \")[i])\n\t}\n\treturn a.join(\" \");\n}",
"function addNextWord() {\n let words = controller.words.split(\", \"),\n nextWord = words[controller.currentWordIndex]\n\n // Create Points\n pnts = createPoints(nextWord)\n\n // Add Word\n drawingLetters = new Letter(nextWord, pnts)\n\n if (words.length - 1 > controller.currentWordIndex) {\n controller.currentWordIndex++\n } else {\n controller.currentWordIndex = 0\n }\n}",
"function tooManyWords(){\n\t\n\tanswer = prompt(\"Please enter a phrase...\");\n\t\n\tif (answer == null || typeof answer == undefined) {\n\t return;\n\t}\n\t // if empty string pass display message\n\t answer.trim();\n\t if (answer.length == 0) {\n\t \talert(\"Acronym can not be created using empty string\");\n\t }\t\n\t // copy split data to temp variable \n\t var temp_line = answer.split(\" \");\n\t \n\t var acronym =\"\";\n\t var acronym_line =\"\";\n\t \n\t for ( var i = 0; i <temp_line.length; i++){\n\t\t // create acronym \n\t\t acronym += temp_line[i].charAt(0).toUpperCase(); \n\t\t \n\t\t //copy acronym line with first letter upper case\n\t\t acronym_line += temp_line[i].charAt(0).toUpperCase();\n\t\t acronym_line += temp_line[i].substring(1, temp_line[i].length);\n\t\t acronym_line += \" \";\n\t\t \n\t }\t \n\t // display acronym to user\n\t alert (acronym + \" stands for \" + acronym_line);\n\t \n\t // count number of acronym created by user\n acronyms++;\n\t \n}",
"function owofied(sentence) {\n\tconst a = sentence.replace(/i/g, \"wi\");\n\tconst b = a.replace(/e/g, \"we\");\n\treturn b + \" owo\";\n}",
"function fillDisplayWord (letter) {\n\n}",
"function dash(currentWord){\n\tfor (var dashi = 0; dashi < currentWord.length; dashi++) {\n\t\tword.push(\"_ \");\n}\n}",
"function translate (phrase) {\n var newPhrase = \" \";\n for (var count = 0; count < phrase.length; count++) {\n var letter = phrase[count];\n if (cleanerIsVowel(letter) || letter === \" \") {\n newPhrase += letter;\n } else {\n newPhrase += letter + \"o\" + letter;\n }\n return newPhrase;\n}\n\n translate(\"these are some words\");\n}",
"function aCounter(word) {\n let count = 0;\n let index = 0\n while (index < word.length) {\n let char = word[index];\n if (char === \"a\" || char === \"A\") {\n count += 1;\n }\n index++\n }\n return count;\n }",
"function capitalWords(word) {\n word = word.charAt(0).toUpperCase() + word.slice(1);\n return word;\n\n}",
"function encodeConsonantWord(word) {\n\n \n word = word.toLowerCase();\n let firstletter = word[0];\n let cons_phrase = \"-\";\n \n\n while\n (firstletter !== \"a\" || \n firstletter !== \"e\" || \n firstletter !== \"i\" || \n firstletter !== \"o\" || \n firstletter !== \"u\")\n {\n \n cons_phrase += word[0];\n word = word.slice(1);\n firstletter = word[0];\n \n\n if(firstletter == \"a\" || \n firstletter == \"e\" || \n firstletter == \"i\" || \n firstletter == \"o\" || \n firstletter == \"u\" ){\n\n return word + cons_phrase + \"ay\";\n\n\n }\n\n \n }\n\n return word; // replace this!\n}",
"function newWord(txt) {\n\treturn txt.slice(1);\n}",
"function pastTensifyWord({ word }) {\n let pastTense = toIkForm(word); // get the word's ik form\n const suffixWithTe = [...'sftktchp'.split('')];\n \n // If the last letter in the verb en form (before \"en\") is included\n // in SoFTKeTCHup (ok this is a bit bullshit just imagine\n // \"ch\" is also a letter lol) then add \"te\" otherwise \"de\"\n if (suffixWithTe.includes(toEnForm(word).stripEn().lastLetter)) {\n pastTense + 'te';\n } else {\n pastTense + 'de';\n }\n\n return pastTense;\n}",
"function nextWord() {\n\n //Agrega la siguiente palabra en un string, seguido por un espacio\n text.text = text.text.concat(line[wordIndex] + \" \");\n\n //Avanza el indice de la palabra\n wordIndex++;\n\n //Si es la ultima palabra...\n if (wordIndex === line.length)\n {\n //Agrega un salto de linea\n text.text = text.text.concat(\"\\n\");\n\n //Obtiene la siguiente linea \n game.time.events.add(lineDelay, nextLine, this);\n }\n\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show all readings saved by user | function index(req, res){
Reading.find({user: req.user.name}, function(err, readings){
res.render(`readings/index`, {
user: req.user,
readings
});
});
} | [
"function getReadings(token) {\n\t\tvar readingsURL = \"https://api.readmill.com/v2/users/\"+userObj.id+\"/readings?states=reading,finished,abandoned&access_token=\"+token;\n\t\t$.getJSON( 'functions.php', { url: readingsURL, apiRequest: true, clientId: true }, function(data) {\n\t\t\t\treadingsObj = data.requestedObj.items;\n\t\t\t\t\n\t\t\t\t// get length of reading Object\n\t\t\t\tvar objLength = readingsObj.length;\n\t\t\t\t\n\t\t\t\t// setup an array of book objects with book id, title, and total reading time\n\t\t\t\t// loop through object of readings and create a custom object for use later\n\t\t\t\tfor(i=0; i<objLength; ++i) {\n\t\t\t\t\tif(readingsObj[i].reading.duration > 3600) {\n\t\t\t\t\t\tthisBook = new Object();\n\t\t\t\t\t\tthisBook.readingId = readingsObj[i].reading.id;\n\t\t\t\t\t\tthisBook.bookId = readingsObj[i].reading.book.id;\n\t\t\t\t\t\tthisBook.title = readingsObj[i].reading.book.title;\n\t\t\t\t\t\tthisBook.author = readingsObj[i].reading.book.author;\n\t\t\t\t\t\tthisBook.duration = readingsObj[i].reading.duration;\n\t\t\t\t\t\tbookArray.push(thisBook);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// create data set for pie graph based off bookArray\n\t\t\t\tpieData = setupPieData(bookArray);\n\t\t\t\t\n\t\t\t\tcreatePie('overviewPie', pieData);\n\t\t\t}\n\t\t);\n\t}",
"function showBookings() {\n var localBookings = loadLocalBookings();\n if (localBookings.length > 0) {\n localBookings.forEach(function (booking) {\n $(\"#bookingList\").append($(\"<li>\").text(booking.name + ': ' + booking.number + ' from ' + booking.checkin + ' to ' + booking.checkout));\n });\n $(\"#currentBookings\").show();\n } else {\n $(\"#currentBookings\").hide();\n }\n }",
"function getAll() {\n\t'use strict';\n\tds.historics.get(function(err, response) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\t\telse {\n\t\t\tconsole.log('Historic queries: ' + JSON.stringify(response));\n\t\t\tcheckStatus();\n\t\t}\n\t});\n}",
"function ReadingList()\n{\n\n var book={};\n\n book.read = 0;\n book.unread = 0;\n book.toRead = [];\n book.currentRead = undefined;\n book.readBooks = [];\n book.addBook = addBook;\n book.finishCurrentBook = finishCurrentBook;\n return book;\n }",
"function ReadingList(){\n var read = 0, unRead = 0, toRead = [], currentBook, readBooks = [];\n return{\n read : read,\n unRead : unRead,\n toRead : toRead,\n currentBook : currentBook,\n readBooks : readBooks,\n addBook : addBook,\n finishCurrentBook : finishCurrentBook\n }\n}",
"printAvailableReadAndWrite() {\n const currentRead = Atomics.load(this.states, this.States.READ);\n const currentWrite = Atomics.load(this.states, this.States.WRITE);\n console.log(this, {\n availableRead: this._getAvailableRead(currentRead, currentWrite),\n availableWrite: this._getAvailableWrite(currentRead, currentWrite),\n });\n }",
"function showAll(request){\n\tnamesDB.getAll(gotNames);\n\tfunction gotNames(names){\n\t\tnamesText = \"\";\n\t\tif (names.length > 0){\n\t\t\tfor (i =0; i < names.length; i++) {\n\t\t\t\t// create a link like: <a href=\"/view/1DlDQu55m85dqNQJ\">Joe</a><br/>\n\t\t\t namesText += '<a href=\"/view/' + names[i]._id + '\">' + names[i].name + \"</a><br/>\";\n\t\t\t}\n\t\t} else {\n\t\t\tnamesText = \"No people in the database yet.\";\n\t\t}\n\t\t\n\t\t//console.log(namesText);\n\t\tvar footerText = '<hr/><p><a href=\"/search\">Search</a>';\n\t\trequest.respond( namesText + footerText);\n\t}\t\n}",
"showStandings(callback) {\n standing_schema_1.default.find(callback);\n }",
"function viewItems() {\n console.clear();\n for (var i = 0; i < stockItems.length; i++) {\n console.log(stockItems[i].itemDetails());\n }\n viewItemsVisual();\n console.log(space);\n viewItemsOption();\n}",
"function listScores() {\n\n\tdb.query(readTable, function(err, rows) {\n\t\tif(err) {\n\t\t\tthrow err;\n\t\t\tconsole.log('Listing failed');\n\t\t} else {\n\t\t\tfor(var i; i < rows.length; i++) {\n\t\t\t\tconsole.log(rows[i].username);\n\t\t\t}\n\t\t}\n\t});\n}",
"function seeAllStories() {\n vm.storyLimit = vm.newsDetails.length - 1;\n }",
"function renderUserWatchlist() {\n var dbPath = appUser.getWatchPath();\n\n // empty out stock-ticker content\n $(\"#stock-ticker-content\").empty();\n\n console.log(\"in renderUserWatchList() appUser.getWatchPath: \" + appUser.getWatchPath());\n\n database.ref(dbPath).once(\"value\", (snapshot) => {\n snapshot.forEach((data) => {\n console.log(\"The \" + data.key + \" is \" + data.val());\n // get current price of stock symbol\n buildBatchURL(data.key, \"watch\");\n\n // get yesterday's close price of stock symbol\n buildTimeSeriesURL(data.key);\n\n // add row to watchListTable\n renderWatchTable(data.key);\n });\n }, (errorObject) => {\n console.log(\"Errors handled in renderWatchTable: \" + JSON.stringify(errorObject));\n });\n\n }",
"function getSaves(loginInfo){\n $.get(\"/api/users\", loginInfo, function(data){\n console.log(data);\n var displayName = data.displayName;\n var titleHeadline = $(\"<h2>\");\n titleHeadline.text(`${displayName}'s Saved Searches`);\n $(\"#hikingDiv\").empty();\n $(\"#hikingDiv\").append(titleHeadline);\n data.SearchParams.forEach(function(item){\n createSavesList(item);\n });\n });\n }",
"function listAll() {\n $scope.voters = VoterService.listAllVoters();\n }",
"function show(req, res){\n Listing.findById(req.params.id).populate('listing'){\n if(err) return console.log(err)\n res.json(listing)\n }\n }",
"list() {\n\t\tif (this.watchList.length) {\n\t\t\tchannel.appendLocalisedInfo('watched_paths');\n\n\t\t\tthis.watchList.forEach((item) => {\n\t\t\t\tchannel.appendLine(\n\t\t\t\t\ti18n.t('path_with_trigger_count', item.path, item.data.triggers)\n\t\t\t\t);\n\t\t\t});\n\n\t\t\tchannel.appendLine('');\n\t\t} else {\n\t\t\tchannel.appendLocalisedInfo('no_paths_watched');\n\t\t}\n\n\t\tchannel.show();\n\t}",
"listRooms() {\n /** List Current Existing Rooms */\n \n /**\n * Notify user that there are no existing rooms.\n */\n if (this._rooms.length === 0) {\n console.warn('\\nNo existing rooms.');\n }\n \n /**\n * Print every element of the this._rooms array to list the\n * existing rooms.\n */\n else {\n console.log('\\nExisting rooms: ');\n for (let i = 0; i < this._rooms.length; i++) {\n console.log(this._rooms[i]);\n }\n }\n \n /**\n * Ask for user input again.\n */\n this.printPrompt();\n }",
"function Listing() {\n this.feeds = {}; \n this.sortIDs = {};\n this.folders = {};\n this.max = 1000;\n this.openFolders = {};\n this.scroll = false;\n this.show = 'all';\n this.init = true;\n}",
"function showRecordings(myCId, myPermissions) {\r\n var myURL = \"RecordingsLister.php?CId=\" + myCId;\r\n if (myPermissions) {\r\n compilationPermissions.isAdmin = myPermissions[\"IsAdmin\"];\r\n compilationPermissions.canUpload = myPermissions[\"CanUpload\"];\r\n compilationPermissions.canAnnotate = myPermissions[\"CanAnnotate\"];\r\n compilationPermissions.canDownload = myPermissions[\"CanDownload\"];\r\n compilationPermissions.canAdd = myPermissions[\"CanAdd\"];\r\n compilationPermissions.canModify = myPermissions[\"CanModify\"];\r\n }\r\n // Reset the looping controls...\r\n autoLoop = 0;\r\n currentTrack = 0;\r\n\r\n // Put the record in the columnLeft div...\r\n clearDiv(\"columnLeft\");\r\n processAjax (myURL, \"columnLeft\");\r\n setBlockVis(\"columnLeft\", \"block\");\r\n return true;\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the content element placement. | get placement() {
return this.skeleton.placement;
} | [
"get positionStrategy() {\n if (this._positionStrategy) {\n return this._positionStrategy;\n }\n if (!this.position) {\n return undefined;\n }\n const positionList = [...this.position];\n const positionStrategy = this._positionStrategy = [];\n while (positionList.length) {\n const position = positionList.shift();\n if (!position) {\n continue;\n }\n const strategy = position.split('-');\n if (!strategy[1]) {\n const defaultAlign = DEFAULT_ALIGN.get(strategy[0]);\n if (!defaultAlign) {\n throw new Error(`ef-overlay: incorrect position provided: ${strategy[0]}`);\n }\n strategy.push(defaultAlign);\n }\n positionStrategy.push(strategy);\n }\n return positionStrategy;\n }",
"function getTop(content){\n\t\tvar imageWidth;\n\t\tvar imageHeight;\n\t\timageWidth = 200;\n\t\timageHeight = (200/content.Width) * content.Height;\n\n\t\tvar bottomHeight = 80;\n\t\tvar contentHeight = imageHeight + bottomHeight;\n\t\tvar theString = '<div class=\"item Wide\" style=\"height:' + contentHeight \n\t\t\t+'px; width: +' + imageWidth + ';\"><img class=\"contentImg\" id=\"ContentImage_'+content.ContentID \n\t\t\t+'\" width=\"'+ imageWidth +'\" src=\"' + getContentImageString(content) + '\"/><br />' \n\t\t\t+'<b><a href=\"/content/'+content.ContentID+'\">'+ content.Title+'</a></b>';\n\t\treturn theString;\n\t}",
"function positionMode() {\n var attachment = ($attrs.mdPositionMode || 'target').split(' ');\n\n // If attachment is a single item, duplicate it for our second value.\n // ie. 'target' -> 'target target'\n if (attachment.length == 1) {\n attachment.push(attachment[0]);\n }\n\n return {\n left: attachment[0],\n top: attachment[1]\n };\n }",
"get documentTop() {\n return (\n this.contentDOM.getBoundingClientRect().top +\n this.viewState.paddingTop\n )\n }",
"function tooltip_placement(context, source) {\n\t\tvar $source = $(source);\n\t\tvar $parent = $source.closest('table')\n\t\tvar off1 = $parent.offset();\n\t\tvar w1 = $parent.width();\n\n\t\tvar off2 = $source.offset();\n\t\t//var w2 = $source.width();\n\n\t\tif( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';\n\t\treturn 'left';\n\t}",
"get(x, y) {\n return this.content[y * this.width + x];\n }",
"function getPositions() {\n\t\t\t\t\t// Calculate the width, height, top and left values for the image\n\t\t\t\t\t// Available width and height takes into account space for navigation buttons if in a group\n\t\t\t\t\tvar windowHeight = window.innerHeight || document.documentElement.clientHeight,\n\t\t\t\t\t\twindowWidth = window.innerWidth || document.documentElement.clientWidth,\n\t\t\t\t\t\tavailableHeight = windowHeight - settings.spacing * 2 - (group ? 40 : 0),\n\t\t\t\t\t\tavailableWidth = windowWidth - settings.spacing * 2 - (group ? 50 : 0),\n\t\t\t\t\t\t// Get the size of the image borders\n\t\t\t\t\t\tborderHeight = (parseInt($figure.css(\"borderTopWidth\") + parseInt($figure.css(\"borderBottomWidth\")))),\n\t\t\t\t\t\tborderWidth = (parseInt($figure.css(\"borderLeftWidth\") + parseInt($figure.css(\"borderRightWidth\")))),\n\t\t\t\t\t\t// Get the value to scale the image by (we want to divide by the largest side)\n\t\t\t\t\t\tscale = Math.max((imageHeight+borderHeight) / availableHeight, (imageWidth+borderWidth) / availableWidth),\n\t\t\t\t\t\tfittedHeight = imageHeight / scale,\n\t\t\t\t\t\tfittedWidth = imageWidth / scale;\n\t\t\t\t\t\n\t\t\t\t\tif(fittedWidth > imageWidth || fittedHeight > imageHeight) {\n\t\t\t\t\t\tfittedWidth = imageWidth;\n\t\t\t\t\t\tfittedHeight = imageHeight;\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\treturn {\n\t\t\t\t\t\t\"width\": Math.floor(fittedWidth-borderWidth),\n\t\t\t\t\t\t\"height\": Math.floor(fittedHeight-borderHeight),\n\t\t\t\t\t\t\"top\": Math.floor(windowHeight/2 - (fittedHeight+borderHeight)/2 + $(window).scrollTop() - (group ? 20 : 0)),\n\t\t\t\t\t\t\"left\": Math.floor(windowWidth/2 - (fittedWidth+borderWidth)/2 + $(window).scrollLeft())\n\t\t\t\t\t};\n\t\t\t\t}",
"function getTitlePosition() {\n var center = this.center, chart = this.chart, titleOptions = this.options.title;\n return {\n x: chart.plotLeft + center[0] + (titleOptions.x || 0),\n y: (chart.plotTop +\n center[1] -\n ({\n high: 0.5,\n middle: 0.25,\n low: 0\n }[titleOptions.align] *\n center[2]) +\n (titleOptions.y || 0))\n };\n }",
"function getElementPos(event)\n{\n //Get the event target element\n event = event || window.event;\n var target = event.target || event.srcElement;\n\n var x;\n var y;\n\n //Check if the element has position data\n if(target.posX !== undefined && target.posY !== undefined)\n //Return the data\n return {\"x\": target.posX, \"y\": target.posY};\n else if(target.parentElement.posX !== undefined && target.parentElement.posY !== undefined)\n //Return the data\n return {\"x\": target.parentElement.posX, \"y\": target.parentElement.posY};\n //Return null in case of failure to find any position data\n else return null;\n}",
"function GetPosition(elementRef, direction, iconDimension, calendarDimension) {\n\tvar position = 0;\n\tvar offset = 0;\n\tvar element = elementRef;\n\t\n\twhile (element) {\n\t\toffset = element[\"offset\" + direction];\n\t\tposition += offset;\n\t\telement = element.offsetParent;\n\t}\n\t\n\tif (iconDimension && calendarDimension) {\n\t\tposition += iconDimension;\n\t\t\n\t\tif (position + calendarDimension > document.body.offsetHeight) {\n\t\t\tposition -= (iconDimension + calendarDimension);\n\t\t}\n\t}\n\t\n\treturn position;\n}",
"function getCenter()\n{\n var center = document.createElement(\"center\");\n return center;\n}",
"get position() {\n const now = this.now();\n\n const ticks = this._clock.getTicksAtTime(now);\n\n return new _Ticks.TicksClass(this.context, ticks).toBarsBeatsSixteenths();\n }",
"function getContentItemOnMousePosition() {\r\n // Search through all content items\r\n var length = _contentItems.length;\r\n for (var i = 0; i < length; i++) {\r\n // Check if content item collides\r\n _collidedContentItem = checkCollision(_contentItems[i]);\r\n if (_collidedContentItem !== undefined) {\r\n return _collidedContentItem;\r\n }\r\n }\r\n\r\n // Nothing collides\r\n return undefined;\r\n }",
"getPosition(width, height) {\n let twidth = window.innerWidth;\n let config = document.getElementById(\"config\");\n const margin = 10;\n if (config !== null) twidth -= config.offsetWidth + margin;\n\n // Make sure that if width > twidth we place it anyway\n twidth = Math.max(this.parent_.offsetLeft + 1, twidth - width);\n let grid_size = 20;\n let divs = [];\n for (let id in this.windows_) {\n if (this.windows_[id].style.display === \"none\") continue;\n divs.push(this.windows_[id]);\n }\n // Loop through a grid of position until we reach an empty spot.\n for (let y = 0;; y += grid_size) {\n for (let x = this.parent_.offsetLeft; x <= twidth; x += grid_size) {\n let free = true;\n for (let div of divs) {\n const box = div.getBoundingClientRect();\n if (box.top >= margin + y + height) continue;\n if (box.bottom + margin <= y) continue;\n if (box.left >= x + width + margin) continue;\n if (box.right + margin <= x) continue;\n free = false;\n break;\n }\n if (free) return {x: x + margin - this.parent_.offsetLeft, y: y + margin};\n }\n // Increase the speed of the search\n if (y > 100 * grid_size) grid_size += margin;\n }\n }",
"__getBottomPosition(node) {\n const positionClassName = this.__getClassStartingWith(node, 'y');\n return this.__parseCSSValueToInt(\n cssTree[`.${positionClassName}`].bottom\n );\n }",
"function positionElementBottom(){\n\t\t\n\t\tvar totalTextHeight = getTotalTextHeight();\n\t\tvar startY = g_objTextWrapper.height() - totalTextHeight - g_options.slider_textpanel_padding_bottom;\n\t\t\n\t\tpositionElementsTop(false, startY);\n\t}",
"function getPlace(pageDiv) {\n if (!p.initialized) {\n console.warn('Attempt to access place before initialization.');\n }\n return p.flipper.getPlace(pageDiv);\n }",
"get positionTargetConfig() {\n const { viewHeight, viewWidth, viewOffsetTop, viewOffsetLeft } = this.viewAreaInfo;\n let left;\n let top;\n if (this.fullScreen) { /* keep it for caching only to not break other algorithms */\n return {\n rect: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n height: viewHeight,\n width: viewWidth\n },\n position: [['center', 'middle']]\n };\n }\n if (this.positionTarget instanceof HTMLElement) {\n const positionTargetElRect = this.positionTarget.getBoundingClientRect();\n return {\n rect: {\n top: positionTargetElRect.top - viewOffsetTop,\n right: positionTargetElRect.right - viewOffsetLeft,\n bottom: positionTargetElRect.bottom - viewOffsetTop,\n left: positionTargetElRect.left - viewOffsetLeft,\n width: positionTargetElRect.width,\n height: positionTargetElRect.height\n },\n position: [...(this.positionStrategy || DEFAULT_TARGET_STRATEGY)]\n };\n }\n const x = this.x || 0;\n const y = this.y || 0;\n let positionTarget = `${typeof this.x === 'number' && this.x >= 0 ? 'left' : 'center'} ${typeof this.y === 'number' && this.y >= 0 ? 'top' : 'center'}`;\n if (typeof this.positionTarget === 'string') {\n positionTarget = this.positionTarget.trim() || positionTarget;\n const positionTargetList = positionTarget.split(' ').slice(0, 2);\n if (positionTargetList.length === 1) {\n positionTargetList.push('center');\n }\n positionTarget = positionTargetList.join(' ');\n }\n let defaultPosition;\n /* istanbul ignore next */\n switch (positionTarget) {\n case 'top left':\n case 'left top':\n left = x;\n top = y;\n defaultPosition = ['bottom', 'start'];\n break;\n case 'top center':\n case 'center top':\n left = viewWidth / 2 + x;\n top = y;\n defaultPosition = ['bottom', 'middle'];\n break;\n case 'top right':\n case 'right top':\n left = viewWidth - x;\n top = y;\n defaultPosition = ['bottom', 'end'];\n break;\n case 'center left':\n case 'left center':\n left = x;\n top = viewHeight / 2 + y;\n defaultPosition = ['right', 'middle'];\n break;\n case 'center right':\n case 'right center':\n left = viewWidth - x;\n top = viewHeight / 2 + y;\n defaultPosition = ['left', 'middle'];\n break;\n case 'bottom left':\n case 'left bottom':\n left = x;\n top = viewHeight - y;\n defaultPosition = ['top', 'start'];\n break;\n case 'bottom center':\n case 'center bottom':\n left = viewWidth / 2 + x;\n top = viewHeight - y;\n defaultPosition = ['top', 'middle'];\n break;\n case 'bottom right':\n case 'right bottom':\n left = viewWidth - x;\n top = viewHeight - y;\n defaultPosition = ['top', 'end'];\n break;\n case 'center center':\n default:\n left = viewWidth / 2 + x;\n top = viewHeight / 2 + y;\n defaultPosition = ['center', 'middle'];\n }\n return {\n rect: {\n top,\n bottom: top,\n left,\n right: left,\n height: 0,\n width: 0\n },\n position: [...(this.positionStrategy || [defaultPosition])]\n };\n }",
"assertPosition_() {\n const layoutBox = this.element.getLayoutBox();\n const viewport = this.getViewport();\n const viewportHeight = viewport.getHeight();\n // TODO(jridgewell): This should really be the parent scroller, not\n // necessarily the root. But, flying carpet only works as a child of the\n // root scroller, for now.\n const docHeight = viewport.getScrollHeight();\n // Hmm, can the page height change and affect us?\n const minTop = viewportHeight * 0.75;\n const maxTop = docHeight - viewportHeight * 0.95;\n userAssert(\n layoutBox.top >= minTop,\n '<amp-fx-flying-carpet> elements must be positioned after the 75% of' +\n ' first viewport: %s Current position: %s. Min: %s',\n this.element,\n layoutBox.top,\n minTop\n );\n userAssert(\n layoutBox.top <= maxTop,\n '<amp-fx-flying-carpet> elements must be positioned before the last ' +\n 'viewport: %s Current position: %s. Max: %s',\n this.element,\n layoutBox.top,\n maxTop\n );\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when mouse enters video | function mouse_in_video()
{
$(".chalk_player .media_controls").addClass("media_show");
if($(".chalk_player video").attr("data-diy")=="1")
$(".chalk_player .diy_wrapper .steps_container").removeClass("hidden");
setTimeout(function() {
if($(".chalk_player .media_controls").attr("data-mouse-in")=="0")
if(Date.now()-$(".chalk_player .media_controls").attr("data-prev-hide")>4000)
{
$(".chalk_player .media_controls").attr("data-prev-hide",Date.now());
mouse_out_video();
}
}, 4000);
} | [
"function mouse_move_video()\n{\n\t$(\".chalk_player .media_controls\").addClass(\"media_show\");\n\tif($(\".chalk_player video\").attr(\"data-diy\")==\"1\")\n\t\t$(\".chalk_player .diy_wrapper .steps_container\").removeClass(\"hidden\");\n\tsetTimeout(function() {\n\t\tif($(\".chalk_player .media_controls\").attr(\"data-mouse-in\")==\"0\")\n\t\t\tif(Date.now()-$(\".chalk_player .media_controls\").attr(\"data-prev-hide\")>4000)\n\t\t\t{\n\t\t\t\t$(\".chalk_player .media_controls\").attr(\"data-prev-hide\",Date.now());\n\t\t\t\tmouse_out_video();\n\t\t\t}\n\t}, 4000);\n}",
"function mousePressed() {\n if (mouseY < dSlider.y) { // if you clicked above the slider,\n trackColor = video.get(mouseX,mouseY); // get the color you clicked\n }\n}",
"function mousePressed() {\n playing = true;\n}",
"function mouseoverhandler(event) {\n mouseIn = event.target.id;\n //console.log(\"the mouse is over canvas:: \" + mouseIn);\n }",
"function OnMouseEnter() {\n guiTexture.texture = hoverTexture;\n mouseOver = true;\n}",
"function videoMouseoverHandler(e) {\n const { target } = e;\n allVideos.forEach(video => {\n if (video !== target) {\n video.muted = true;\n video.style.borderColor = '#fff';\n }\n target.style.borderColor = '#f00';\n target.muted = false;\n });\n}",
"function mouseReleased(){\n\n shocked = false;\n\n}",
"function mousePressed() {\n // Check if the mouse is in the x range of the target\n if (mouseX > targetX - targetImage.width/2 && mouseX < targetX + targetImage.width/2) {\n // Check if the mouse is also in the y range of the target\n if (mouseY > targetY - targetImage.height/2 && mouseY < targetY + targetImage.height/2) {\n //add in victory music\n winningSound.play();\n gameOver = true;\n }\n }\n}",
"function mouseReleased() {\n console.log('released!');\n cursorColor = 'rgb(0,0,0)';\n cursorDia = 60;\n}",
"function mouseOut() {\n\tif (vid.paused === false) {\n controls.style.visibility = \"hidden\";\n seekslider.style.transform = \"translateY(30px)\";\n }\n}",
"function mouseouthandler(event) {\n //console.log(\"the mouse is no longer over canvas:: \" + event.target.id);\n mouseIn = 'none';\n }",
"onLayerMouseMove() {}",
"function mouseReleased() {\n helmet.released();\n}",
"function onSelectStart(event){\n\n if (event instanceof MouseEvent && !renderer.xr.isPresenting()){\n\t// Handle mouse click outside of VR.\n\t// Determine screen coordinates of click.\n\tvar mouse = new THREE.Vector2();\n\tmouse.x = (event.clientX / window.innerWidth) * 2 - 1;\n\tmouse.y = - (event.clientY / window.innerHeight) * 2 + 1;\n\t// Create raycaster from the camera through the click into the scene.\n\tvar raycaster = new THREE.Raycaster();\n\traycaster.setFromCamera(mouse, camera);\n\n\t// Register the click into the GUI.\n\tGUIVR.intersectObjects(raycaster);\n }\n\n}",
"function mouse_out_controls()\n{\n\t$(\".chalk_player .media_controls\").attr(\"data-mouse-in\",\"0\");\n}",
"function mousemove(e) {\n var ifrPos = eventXY(e) // mouse from iframe origin\n var xyOI = iframeXY(iframe) // iframe from window origin\n var xySW = scrollXY(window) // window scroll\n var xySI = scrollXY(iwin) // iframe scroll\n // mouse in iframe viewport\n var xyMouse = xy.subtract(ifrPos, xySI)\n // mouse in window viewport\n var winPos = xy.subtract(xy.add(xyMouse, xyOI), xySW)\n lastMousePos = xyMouse\n coords.show(xy.str(ifrPos), xy.add(winPos, deltaXY))\n }",
"static isVideoPlaying(video){return video.currentTime>0&&!video.paused&&video.readyState>2;}",
"function play_video_on_hover()\n{\n $(\".topfive .frame\").hover(function()\n {\n // get Frame Id\n var id = $(this).attr(\"id\");\n \n $(\".topfive .frame#\"+id+\" img\").hide();\n\n // Video Container\n var video = $(\".topfive .frame#\"+id+\" video.bgvideo\");\n\n // show Background Video\n video.css(\"display\", \"inline-block\");\n\n // Load Video\n /*\n var video_name = $(\".topfive .frame#\"+id+\" video\").attr(\"id\");\n var vid = document.getElementById(video_name);\n if (vid)\n {\n vid.pause();\n vid.load();\n vid.play();\n }\n */\n }, function() {\n // hide Background Video\n $(\"video.bgvideo\").hide();\n $(\".topfive .frame img\").show();\n });\n}",
"function video_click(e) {\n\t//console.log(e);\n\t//console.log(this);\n\tif (this.paused == true) {\n\t\tthis.play();\n\t} else {\n\t\tthis.pause();\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grab a connection, run the query via the MySQL streaming interface, and pass that through to the stream we've sent back to the client. | _stream(connection, obj, stream, options) {
options = options || {}
return new Promise((resolver, rejecter) => {
stream.on('error', rejecter)
stream.on('end', resolver)
connection.query(obj.sql, obj.bindings).stream(options).pipe(stream)
})
} | [
"function src(pretendFilePath, options) {\n let result;\n try {\n let conn = mysql.createConnection(options.connection);\n let vinylFile;\n // create a file wrapper that will pretend to gulp that it came from the path represented by pretendFilePath\n vinylFile = new Vinyl({\n base: path.dirname(pretendFilePath),\n path: pretendFilePath,\n });\n result = from2.obj([vinylFile]);\n let fileStream = conn.query(options.sql)\n .on('end', function () {\n log.debug('all rows have been received');\n })\n .stream({});\n vinylFile.contents = fileStream;\n log.debug('closing connection when all rows are received');\n conn.end();\n // TODO: Figure out how to deal with errors here\n // this does not trigger parent stream's error handling\n // result.emit(new PluginError(PLUGIN_NAME, 'No problem'))\n // this creates an error that can be caught if the parent stream is wrapped in a try/catch\n // throw new PluginError(PLUGIN_NAME, 'No problem')\n result = result.pipe(tapMysql({}));\n // buffer mode: stream through gulpBuffer to convert vinylFile to isBuffer(true)\n if (options.buffer !== false) {\n result = result.pipe(gulpBuffer());\n // gulp-buffer issues:\n // - requires data to be buffers (gulp-etl uses strings and objects)\n // - files silently upon error (such as passing strings instead of buffers)\n }\n }\n catch (err) {\n // emitting here causes some other error: TypeError: Cannot read property 'pipe' of undefined\n // result.emit(new PluginError(PLUGIN_NAME, err))\n // For now, bubble error up to calling function\n throw new PluginError(PLUGIN_NAME, err);\n }\n return result;\n}",
"function executeQuery(query, closure) {\n sqlConnection.execute(query, (err, result) => {\n if (err) {\n logMessage(err);\n } else {\n logMessage(result);\n if (closure != null) { closure(); }\n };\n });\n }",
"stream() {\n this.log.trace(\"DfuseBlockStreamer.stream()\");\n if (!this.apolloClient) {\n this.apolloClient = this.getApolloClient();\n }\n this.getObservableSubscription({\n apolloClient: this.apolloClient\n }).subscribe({\n start: () => {\n this.log.trace(\"DfuseBlockStreamer GraphQL subscription started\");\n },\n next: (value) => {\n this.onTransactionReceived(value.data.searchTransactionsForward);\n },\n error: (error) => {\n // TODO should we be doing anything else?\n this.log.error(\"DfuseBlockStreamer GraphQL subscription error\", error.message);\n },\n complete: () => {\n // TODO: how to handle completion? Will we ever reach completion?\n this.log.error(\"DfuseBlockStreamer GraphQL subscription completed\");\n }\n });\n }",
"function sendOutputAndCloseConnection(client, output, res) {\n if (output && res) {\n res.json(output)\n }\n\n // close the database connection after sending the response\n client.close()\n}",
"runQuery() {\n this.state.running = true;\n if (!this.props.query || this.props.query.trim() === \"\") {\n this.state = {}\n this.state.running = false;\n this.state.data = null;\n return\n }\n this.session\n .run(this.props.query, this.props.params)\n .then(result => {\n let error = \"A query returned over 1000 rows. Only the first 1000 results have been rendered. \\n\\n\" +\n \"Consider adding a LIMIT clause to the end of your query: \\n \\n \\\"\" +\n this.props.query + \" LIMIT 100\\n \\n \\n\\\"\";\n\n let records = result.records;\n if (error !== this.prevError && records.length > 1000) {\n this.props.stateChanged({\n label: \"CreateError\",\n value: error\n })\n this.prevError = error;\n }\n this.state.data = records.slice(0, 1000).map((record, i) => {\n var row = {};\n record[\"keys\"].map((key, index) => {\n row[key] = record[\"_fields\"][index];\n });\n return row;\n });\n\n })\n .catch(error => {\n this.props.stateChanged({\n label: \"CypherError\"\n })\n let newline = '\\n'\n this.state.data = [{error: error['stack']}];\n\n })\n .then(() => {\n this.state.running = false;\n this.setState(this.state);\n this.props.stateChanged({\n label: \"CypherSuccess\"\n })\n })\n }",
"_open(rs) {\n this._resultSet = rs;\n\n // trigger the event listener that may have been added in _read() now that\n // the result set is ready\n this.emit('open');\n\n // emit a metadata event as a convenience to users\n this.emit('metadata', rs.metaData);\n }",
"queryRunner(data,callback){\n /*\n Function required to run all the queries.\n */\n const query=data.query;\n const insert_data=data.insert_data;\n const that = this;\n this.connection.getConnection(function(err,con){\n if(err){\n con.release();\n }else{\n that.connection.query(String(query),insert_data,function(err,rows){\n con.release();\n if(err){\n callback({\"status\": 500, \"error\": err, \"data\": null});\n } else {\n callback({\"status\": 200, \"error\": null, \"data\": rows});\n }\n });\n }\n });\n }",
"_query(connection, obj) {\n if (!obj || typeof obj === 'string') obj = {sql: obj}\n return new Promise(function(resolver, rejecter) {\n let { sql } = obj\n if (!sql) return resolver()\n if (obj.options) sql = assign({sql}, obj.options)\n connection.query(sql, obj.bindings, function(err, rows, fields) {\n if (err) return rejecter(err)\n obj.response = [rows, fields]\n resolver(obj)\n })\n })\n }",
"function selectRows(sql, args, callback){\n // Claim connection from pool\n pool.getConnection(function(err, connection){\n if(err){ console.error(err); callback(true); return; }\n\n console.log('connected with id ' + connection.threadId);\n\n // Execute query\n connection.query(sql, args, function(err, results){\n if(err){ console.error(err); callback(true); return; }\n\n // Release connection back to pool\n connection.release();\n console.log('connection released.');\n callback(false, results);\n });\n\n });\n}",
"async function submitQuery() {\n\n var credentials = await Auth.currentCredentials();\n\n const redshiftDataClient = new RedshiftData({\n region: state.clusterRegion,\n credentials: Auth.essentialCredentials(credentials)\n });\n\n var params = {\n ClusterIdentifier: state.clusterIdentifier,\n Sql: state.sql,\n Database: state.database,\n //DbUser: state.dbUser,\n SecretArn: state.secretArn,\n StatementName: state.statementName,\n WithEvent: state.withEvent,\n };\n\n console.log('Submitting query to Redshift...');\n var response = await redshiftDataClient.executeStatement(params).promise();\n console.log(`Submission accepted. Statement ID:`, response);\n setTimeout(updateStatementHistory, 2000); // Seems we need to wait a second or two before calling the ListStatements() API, otherwise results don't show latest query:\n}",
"connect(output) {\n\t\tthis.handleOutputConnection(output)\n\t}",
"function query(input) {\n const _defaults = {\n params: []\n };\n const {sql, params, autorollback} = Object.assign(_defaults, input);\n \n return new Promise((resolve, reject) => {\n connection.query(sql, params, (err, resp) => {\n if(err && autorollback) {\n return resolve(rollback(err));\n }\n else if (err) {\n return reject(err);\n }\n resolve(resp);\n });\n });\n}",
"_updateConnection(\n updateId: UpdateId,\n objectId: Schema.ObjectId,\n fieldname: Schema.Fieldname,\n queryResult: ConnectionFieldResult\n ): void {\n _inTransaction(this._db, () => {\n this._nontransactionallyUpdateConnection(\n updateId,\n objectId,\n fieldname,\n queryResult\n );\n });\n }",
"function querySolrServer(query, position, total, rows, querystring){\n\n\tvar that = this;\n\tvar serverUrl = \"http://\" + location.host + \"/solr/select/\";\n\tjQuery.get(\tserverUrl,\n\t\t\tquery, \n\t\t\tfunction(data){ that.addLinearBrowseHTML(data, position, total, rows, querystring); }, \n\t\t\t\"xml\");\n\n}",
"function compileStream() {\n\t'use strict';\n\tds.compile({\n\t\t'csdl': 'interaction.content contains \"datasift\"'\n\t}, function(err, response) {\n\t\tif (err)\n\t\t\tconsole.log(err);\n\t\telse {\n\t\t\tconsole.log('Compiled filter hash: ' + response.hash);\n\t\t\tprepareQuery(response.hash);\n\t\t}\n\t});\n}",
"async function query(sql, pool) {\n let con;\n let result;\n try {\n con = await pool.getConnection();\n result = await con.query(sql);\n } catch (queryError) {\n throw queryError;\n } finally {\n if (con) {\n con.release();\n }\n }\n return result;\n}",
"function connect(upload, download) {\n var length = upload.req.headers['content-length'];\n if (length) {\n download.res.setHeader('Content-Length', length);\n }\n download.res.writeHead(200);\n\n upload.req.pipe(download.res);\n upload.req.resume();\n\n delete uploads[upload.req.url];\n delete downloads[download.req.url];\n\n upload.req.once('close', function() {\n download.res.end();\n });\n\n download.res.once('close', function() {\n upload.res.end();\n });\n\n console.log('streams connected', upload.req.url);\n}",
"function connQueryRunSanity(){\n}",
"function insertRows(sql, args, callback){\n // Claim connection from pool\n pool.getConnection(function(err, connection){\n if(err){ console.error(err); callback(true); return; }\n\n console.log('connected with id ' + connection.threadId);\n\n // Execute query\n connection.query(sql, [args], function(err, results){\n if(err){ console.error(err); callback(true); return; }\n\n // Release connection back to pool\n connection.release();\n console.log('connection released.');\n callback(false, results);\n });\n\n });\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets a map containing resources of a specified name from all drawable folders in a directory. | function mapImageResources(rootDir, subDir, type, resourceName) {
var pathMap = {};
shell.ls(path.join(rootDir, subDir, type + '-*'))
.forEach(function (drawableFolder) {
var imagePath = path.join(subDir, path.basename(drawableFolder), resourceName);
pathMap[imagePath] = null;
});
return pathMap;
} | [
"loadCubemap(name, directory) {\n\t\treturn new Promise(resolve => {\n\t\t\tlet upImage = this.loadImage(directory + \"posy.jpg\");\n\t\t\tlet bottomImage = this.loadImage(directory + \"negy.jpg\");\n\t\t\tlet rightImage = this.loadImage(directory + \"posx.jpg\");\n\t\t\tlet leftImage = this.loadImage(directory + \"negx.jpg\");\n\t\t\tlet backImage = this.loadImage(directory + \"posz.jpg\");\n\t\t\tlet frontImage = this.loadImage(directory + \"negz.jpg\");\n\n\t\t\treturn Promise.all([\n\t\t\t\tupImage,\n\t\t\t\tbottomImage,\n\t\t\t\trightImage,\n\t\t\t\tleftImage,\n\t\t\t\tbackImage,\n\t\t\t\tfrontImage\n\t\t\t]).then(values => {\n\t\t\t\tthis.createCubemap(\n\t\t\t\t\tname,\n\t\t\t\t\tvalues[0],\n\t\t\t\t\tvalues[1],\n\t\t\t\t\tvalues[2],\n\t\t\t\t\tvalues[3],\n\t\t\t\t\tvalues[4],\n\t\t\t\t\tvalues[5]\n\t\t\t\t);\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}",
"function importAll(r) {\n var images = [];\n r.keys().map((item) => \n { \n var src = item.replace('./',''); // DRY stuff\n images.push(\n {\n src: src, // E.g. Glasses/glasses1.png\n img: r(item), // The image\n type: src.substr(0,src.indexOf('/')), // e.g. Glasses\n fileName: src.substr(src.indexOf('/')+1,src.length) // E.g. glasses1.png\n }); \n });\n return images;\n}",
"function copyAndroidIcons(dir) {\n console.log('Copying Android icons ...');\n let copyPromises = [];\n ['drawable-hdpi', 'drawable-mdpi', 'drawable-xhdpi', 'drawable-xxhdpi', 'drawable-xxxhdpi'].forEach((drawableDir) => {\n let src = path.join(dir, 'android', drawableDir, getIcFilename('png', program.color, program.size));\n let dest = path.join(program.dir, 'Sources\\\\HipMobileUI.Droid\\\\Resources', drawableDir, getIcFilename('png'));\n copyPromises.push(copyFile(src, dest));\n });\n return Promise.all(copyPromises)\n .then(() => { \n console.log('Copying Android icons finished.'); \n return dir;\n });\n}",
"function getImagesByTheme() {\n const themes = ['dogs', 'cats', 'cars', 'motorcycles', 'beach', 'california', 'new-york'];\n const randTheme = Math.floor(Math.random() * themes.length);\n return getImageData(themes[randTheme]);\n}",
"getResources(includeTs) {\n const resources = this.data.manifest.control.resources;\n let pathsCollection = [];\n Object.keys(resources).forEach(resourceType => {\n let paths;\n if (resourceType !== constants.LIBRARY_ELEM_NAME) {\n paths = (resourceType === constants.CODE_ELEM_NAME && !includeTs) ? [] : resources[resourceType].map((resource) => resource.$.path);\n }\n else {\n paths = flatMap(resources[resourceType], (resource) => resource['packaged_library'] ? resource['packaged_library'].map((packagedLib) => packagedLib.$.path) : []);\n }\n pathsCollection.push(...paths);\n });\n return pathsCollection;\n }",
"static readdir (dir) {\n return fs.readdirAsync(dir).map( entry => {\n let entry_path = path.join(dir, entry)\n // `stat` the entry\n return fs.lstatAsync(entry_path).then( stat => {\n // Recurse for a directory, return a file\n if ( stat.isDirectory() ) return Walk.readdir(entry_path)\n return entry_path\n })\n\n // `readdirAsync().map` concurrency\n }, { concurrency: 2})\n\n // Promise recursion produces an array of array entries, flatten them\n .reduce((entries, result) => entries.concat(result), [])\n }",
"async function getSourceImages(projectDir, buildPlatforms, resourceTypes) {\n const resourceDir = path.resolve(projectDir, 'resources'); // TODO: hard-coded\n const srcDirList = buildPlatforms\n .map(platform => ({ platform, path: path.resolve(resourceDir, platform) }))\n .concat({ platform: 'global', path: resourceDir });\n const sourceImages = [];\n for (const srcImgDir of srcDirList) {\n const srcImageDirContents = await utils_fs_1.readdirSafe(srcImgDir.path);\n for (const srcImage of srcImageDirContents) {\n const ext = path.extname(srcImage);\n const resType = path.basename(srcImage, ext);\n if (SUPPORTED_SOURCE_EXTENSIONS.includes(ext) && resourceTypes.includes(resType)) {\n sourceImages.push({\n ext,\n resType,\n platform: srcImgDir.platform,\n path: path.join(srcImgDir.path, srcImage),\n vector: false,\n height: 0,\n width: 0,\n });\n }\n }\n }\n const sourceImageChecksums = await Promise.all(sourceImages.map(async (img) => {\n const [md5, cachedMd5] = await utils_fs_1.getFileChecksums(img.path);\n if (cachedMd5) {\n debug(`${color_1.ancillary('getSourceImages')}: ${color_1.strong(format_1.prettyPath(img.path))} cache md5: ${color_1.strong(cachedMd5)}`);\n img.cachedId = cachedMd5;\n }\n return md5;\n }));\n return sourceImages.map((img, i) => ({\n ...img,\n imageId: sourceImageChecksums[i],\n }));\n}",
"loadTilesetImages() {\n\n // Load all the required tileset images\n for(let tilesetId in this.tilemapJson.tilesets) {\n\n let tilesetJson = this.tilemapJson.tilesets[tilesetId];\n let assetName = tilesetJson.name;\n let assetPath = 'assets/' + tilesetJson.image.substring(3);\n\n this.game.load.image(assetName, assetPath);\n }\n }",
"getEntryNames(dir = \".\") {\n return (new fs.Dir(this.dst, dir)).getEntryNames();\n }",
"static readdirSync (dir) {\n return fs.readdirSync(dir)\n .map( entry => {\n let entry_path = path.join(dir, entry)\n let entry_stat = fs.lstatSync(entry_path)\n if ( entry_stat.isDirectory() ) return Walk.readdirSync(entry_path)\n return entry_path\n })\n .reduce((entries, result) => entries.concat(result), [])\n }",
"function getRoutes(folderName, file) {\n fs.readdirSync(folderName).forEach(function(file) {\n\n var fullName = path.join(folderName, file);\n var stat = fs.lstatSync(fullName);\n\n if (stat.isDirectory()) {\n getRoutes(fullName);\n } else if (file.toLowerCase().indexOf('.js')) {\n require('./' + fullName)(app);\n console.log(\"require('\" + fullName + \"')\");\n }\n });\n}",
"async loadImages() {\n const resources = Array.from(this._resources.entries());\n\n console.info(`[ImageManager] Loading ${resources.length} image assets.`);\n\n await Promise.all(resources.map(([iKey, iValue]) => {\n console.info(`[ImageManager] Loading image ${iValue}.`);\n\n const img = new Image();\n img.src = iValue;\n\n return new Promise((resolve) => img.addEventListener('load', () => {\n this._images.set(iKey, img);\n resolve();\n }))\n }));\n\n this._loaded = true;\n\n console.info('[ImageManager] Images loaded.');\n }",
"function getShapeFiles(directory, callback){\n var shapeFiles = [];\n fs.readdir(directory, function(err, files){\n if (err) {\n console.log(\"Error: \", err);\n callback(err, null);\n }\n else{\n files.forEach(function(file, index){\n\n if(path.extname(file) == \".shp\") {\n shapeFiles.push(file);\n }\n });\n callback(null, shapeFiles);\n }\n });\n\n}",
"getResources (itemId, portalOpts) {\n const args = this.addOptions({}, portalOpts);\n return getItemResources(itemId, args)\n .catch(handleError);\n }",
"function search(directory) {\n let yamlFiles = []\n let directories = []\n let subf = fs.readdirSync(directory);\n for (let index in subf) {\n let file = subf[index];\n let fullPath = directory + '/' + file\n if (fs.statSync(fullPath).isDirectory()) {\n directories.push(fullPath);\n } else if (file.match(regexs['yaml'])) {\n yamlFiles.push(fullPath);\n }\n }\n\n while (directories.length != 0) {\n // console.log(yamlFiles);\n yamlFiles = yamlFiles.concat(search(directories.pop()));\n }\n\n // console.log(yamlFiles);\n return yamlFiles;\n\n}",
"getPaths(projectName, imagesCount) {\n const srcsetWidths = [320, 480, 640, 960, 1280];\n const fallbackWidth = 640;\n\n let imagesPaths = [];\n\n // This would build the images path for how they appear in the folder\n // The assumption is that the cloudinary folder contains images that are sequenced\n // the way we want them. And, that they share the same name as the folder they are placed\n // in\n for (i = 1; i < imagesCount + 1; i++) {\n imagesPaths.push(`${projectName}\\/${projectName}-${i}`);\n }\n\n // We grab and set the srcset widths for all the images we want to show\n const finalPaths = [];\n imagesPaths.forEach((path) => {\n const fetchBase = `https://res.cloudinary.com/yesh/image/upload/`;\n const src = `${fetchBase}q_auto,f_auto,w_${fallbackWidth}/${path}.jpg`;\n\n const srcset = srcsetWidths\n .map((w) => {\n return `${fetchBase}q_auto:eco,f_auto,w_${w}/${path}.jpg ${w}w`;\n })\n .join(', ');\n finalPaths.push(\n `<img src=\"${src}\" srcset=\"${srcset}\" sizes=\"(max-width: 400px) 320px, 480px\" alt=\"images for project ${projectName}\">`\n );\n });\n\n return finalPaths;\n }",
"loadPalettes(){\n return [PIXI.Texture.from(resources[\"sprites/color_map_1.png\"].data),\n PIXI.Texture.from(resources[\"sprites/color_map_2.png\"].data),\n PIXI.Texture.from(resources[\"sprites/color_map_3.png\"].data)];\n }",
"function getAllAssets() {\n return new Promise((resolve, reject) => {\n if (!process.env.API_URL_LIST) {\n console.log(process.env.API_URL_LIST);\n reject('No URL found to get all Assets.');\n }\n\n request(process.env.API_URL_LIST, (error, response, body) => {\n if (!error && response.statusCode === 200) {\n const json = JSON.parse(body);\n resolve(json);\n } else {\n reject(error);\n }\n });\n });\n}",
"async function getWorkspaceLocations(workspaces, rootDir) {\n const resolvedWorkspaces = await Promise.all(workspaces.map((pattern) => glob(pattern, { cwd: rootDir })));\n return resolvedWorkspaces.flat();\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: deployCFC DESCRIPTION: ARGUMENTS: RETURNS: | function deployCFC()
{
invokeMethodOnCurrentCFC("deploy");
} | [
"function deployChaincode() {\n\t// Construct the deploy request\n\tvar deployRequest = {\n\t\t// Path (under $GOPATH/src) required for deploy in network mode\n\t\tchaincodePath: \"crowd_fund_chaincode\",\n\t\t// Function to trigger\n\t\tfcn: \"init\",\n\t\t// Arguments to the initializing function\n\t\targs: [\"key1\", \"key_value_1\"],\n\t};\n\n\t// Trigger the deploy transaction\n\tvar deployTx = app_user.deploy(deployRequest);\n\n\t// Print the successfull deploy results\n\tdeployTx.on('complete', function (results) {\n\t\t// Set the chaincodeID for subsequent tests\n\t\tchaincodeID = results.chaincodeID;\n\t\tconsole.log(util.format(\"Successfully deployed chaincode: request=%j, \" +\n\t\t\t\"response=%j\" + \"\\n\", deployRequest, results));\n\t\t// The chaincode is successfully deployed, start the listener port\n\t\tstartListener();\n\t});\n\tdeployTx.on('error', function (err) {\n\t\t// Deploy request failed\n\t\tconsole.log(util.format(\"ERROR: Failed to deploy chaincode: request=%j, \" +\n\t\t\t\"error=%j\", deployRequest, err));\n\t\tprocess.exit(1);\n\t});\n}",
"function createCFC()\n{\n\tMM.CFCfileToOpen = \"\";\n\n\tdw.runCommand(\"Create Component.htm\");\n\n\t// If all went well in this command, then we are told (through a MM variable) the\n\t// path to the new CFC file... which we can now open. We avoid opening this CFC\n\t// file in the command itself because doing so tickles a problem in the internal\n\t// mechanism the Kojak uses for suspending/continuing edit ops.\n\n\tif (MM.CFCfileToOpen.length > 0)\n\t{\n\t\tvar newDOM = dreamweaver.openDocumentFromSite(MM.CFCfileToOpen);\n\n\t\t// There is no longer any need to switch into code view here because we have fixed\n\t\t// Dreamweaver to automatically switch into code view whenever a CFC file is opened\n\t\t// regardless of how that file is opened.\n\t\t/***********************************\n\t\tif (newDOM != null)\n\t\t{\n\t\t newDOM.setView(\"code\");\n\t\t}\n\t\t***********************************/\n\n\t\tFWLaunch.bringDWToFront();\n\t\tMM.CFCfileToOpen = \"\";\n\n\t\tclickedRefresh();\n\t}\n}",
"function editCFC()\n{\n\tvar returnVal = false;\n\tvar strAppServerAccessType = new String(site.getAppServerAccessType());\n\tvar strLocalPathToFiles = new String(site.getLocalPathToFiles());\n\tvar strAppServerPathToFiles = new String(site.getAppServerPathToFiles());\n\n\tstrLocalPathToFiles = convertForwardToBackSlashes(strLocalPathToFiles);\n\tstrAppServerPathToFiles = convertForwardToBackSlashes(strAppServerPathToFiles);\n\n\tif (!caseInsensitiveCompare(strAppServerAccessType, \"local/network\"))\n\t{\n\t\talert(MM.MSG_CFC_LocalAndAppServerPathsNotSame + dwscripts.getNewline() + MM.MSG_CFC_AppServerAccessType + strAppServerAccessType);\n\t}\n\telse if (!caseInsensitiveCompare(strLocalPathToFiles, strAppServerPathToFiles))\n\t{\n\t\tvar strLocal = new String(site.getLocalPathToFiles());\n\t\tstrLocal = strLocal.replace(/\\//g, \"\\\\\");\n\n\t\tvar strAppServer = new String(site.getAppServerPathToFiles());\n\t\tstrAppServer = strAppServer.replace(/\\//g, \"\\\\\");\n\n\t\talert(MM.MSG_CFC_LocalAndAppServerPathsNotSame + dwscripts.getNewline() + MM.MSG_CFC_AppServerAccessType + strAppServerAccessType + dwscripts.getNewline() + MM.MSG_CFC_LocalPathToFiles + strLocal + dwscripts.getNewline() + MM.MSG_CFC_AppServerPathToFile + strAppServer);\n\t}\n\telse\n\t{\n\t\tvar componentRec = dw.serverComponentsPalette.getSelectedNode();\n\n\t\tif (componentRec)\n\t\t{\n\t\t\tvar packageComponentRec = getCurrentPackageComponentRec();\n\t\t\tvar CFCComponentRec = getCurrentCFCComponentRec();\n\t\t\tvar tagNameToFind = new String(\"\");\n\t\t\tvar attributeToFind = \"\";\n\t\t\tvar valueToFind = \"\";\n\n\t\t\tif ((packageComponentRec != null) && (CFCComponentRec != null))\n\t\t\t{\n\t\t\t\tvar aCFC = getParsedCFCinfo(CFCComponentRec);\n\t\t\t\tvar fullPhysicalPath = aCFC.physicalPath;\n\n\t\t\t\tswitch (componentRec.objectType)\n\t\t\t\t{\n\t\t\t\t\tcase PACKAGE_OBJECT_TYPE:\n\t\t\t\t\t\t// Do nothing; you can't edit a package per se because it corresponds to\n\t\t\t\t\t\t// a disk path, not a file.\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CFC_OBJECT_TYPE:\n\t\t\t\t\t\ttagNameToFind = \"cfcomponent\";\n\t\t\t\t\t\tattributeToFind = \"\";\n\t\t\t\t\t\tvalueToFind = CFCComponentRec.getName();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PROPERTIES_OBJECT_TYPE:\n\t\t\t\t\t\t// This is just an intermediary node in the tree. Interpret it to mean\n\t\t\t\t\t\t// that we want to edit the CFC tag.\n\t\t\t\t\t\ttagNameToFind = \"cfcomponent\";\n\t\t\t\t\t\tattributeToFind = \"\";\n\t\t\t\t\t\tvalueToFind = CFCComponentRec.getName();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PROPERTY_OBJECT_TYPE:\n\t\t\t\t\t\ttagNameToFind = \"cfproperty\";\n\t\t\t\t\t\tattributeToFind = \"name\";\n\t\t\t\t\t\tvalueToFind = componentRec.propertyName;\n\n\t\t\t\t\t\tif (aCFC.properties.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (var i=0; i < aCFC.properties.length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar aProperty = aCFC.properties[i];\n\t\t\t\t\t\t\t\tif (aProperty.name == componentRec.propertyName)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (aProperty.inherited)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfullPhysicalPath = getPhysicalPath(aProperty.implementedIn);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase METHOD_OBJECT_TYPE:\n\t\t\t\t\t\ttagNameToFind = \"cffunction\";\n\t\t\t\t\t\tattributeToFind = \"name\";\n\t\t\t\t\t\tvalueToFind = componentRec.methodName;\n\n\t\t\t\t\t\tif (aCFC.methods.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (var i=0; i < aCFC.methods.length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar aMethod = aCFC.methods[i];\n\t\t\t\t\t\t\t\tif (aMethod.name == componentRec.methodName)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (aMethod.inherited)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfullPhysicalPath = getPhysicalPath(aMethod.implementedIn);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ARGUMENT_OBJECT_TYPE:\n\t\t\t\t\t\ttagNameToFind = \"cfargument\";\n\t\t\t\t\t\tattributeToFind = \"name\";\n\t\t\t\t\t\tvalueToFind = componentRec.argumentName;\n\n\t\t\t\t\t\tif (aCFC.methods.length)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor (var i=0; i < aCFC.methods.length; i++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvar aMethod = aCFC.methods[i];\n\t\t\t\t\t\t\t\tif (aMethod.name == componentRec.parent.methodName)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif (aMethod.inherited)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfullPhysicalPath = getPhysicalPath(aMethod.implementedIn);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tagNameToFind != \"\")\n\t\t\t{\t\t\t\n\t\t\t\tvar cfcDOM = dreamweaver.openDocumentFromSite(fullPhysicalPath);\n\t\t\t\tif (cfcDOM != null)\n\t\t\t\t{\n\t\t\t\t\tcfcDOM.setView(\"code\");\n\n\t\t\t\t\tvar snoopedNode = snoopForNode(cfcDOM, tagNameToFind, attributeToFind, valueToFind, true);\n\t\t\t\t\tif (snoopedNode != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar offsetArr = cfcDOM.nodeToOffsets(snoopedNode);\n\t\t\t\t\t\tcfcDOM.source.setSelection(offsetArr[0], offsetArr[1]);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\talert(MM.MSG_CFC_CannotFindEntityToEdit);\n\t\t\t\t\t}\n\n\t\t\t\t\treturnVal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn returnVal;\n}",
"async function deployIBM(params, func, funcFirstUpperCase, testName) {\n\treturn new Promise(async (resolve, reject) => {\n\n\t\tlet start = now();\n\n\t\tcurrentLogStatusIBM += '<h5>IBM Cloud (sequential deployment)</h5>';\n\t\tcurrentLogStatusIBM += '<ul stlye=\"list-style-position: outside\">';\n\t\tcurrentLogStatusIBMEnd += '</ul>';\n\t\trunningStatusIBM = true;\n\n\t\tif(params.node == 'true') {\n\t\t\tawait deployFunction(constants.IBM, constants.NODE, func, 'node_' + func, 'node_' + func, '', 'nodejs:10', '', '', '/ibm/src/node/' + func + '/', 'Node.js', ' ', 'json', params.ram, params.timeout);\n\t\t}\n\t\tif(params.python == 'true') {\n\t\t\tawait deployFunction(constants.IBM, constants.PYTHON, func, 'python_' + func, 'python_' + func, '', 'python:3.7', '', '', '/ibm/src/python/' + func + '/main.py', 'Python', ' ', 'json', params.ram, params.timeout);\n\t\t}\n\t\tif(params.go == 'true') {\n\t\t\tawait deployFunction(constants.IBM, constants.GO, func, 'go_' + func, 'go_' + func, '', 'go:1.11', '', '', '/ibm/src/go/' + func + '/' + func + '.go', 'Go', ' ', 'json', params.ram, params.timeout);\n\t\t}\n\t\tif(params.dotnet == 'true') {\n\t\t\tawait deployFunction(constants.IBM, constants.DOTNET, func, 'dotnet_' + func, 'dotnet_' + func, '', 'dotnet:2.2', '', '', '/ibm/src/dotnet/' + funcFirstUpperCase + '/', '.NET', ' --main ' + funcFirstUpperCase + '::' + funcFirstUpperCase + '.' + funcFirstUpperCase + 'Dotnet::Main', 'json', params.ram, params.timeout)\n\t\t}\n\n\t\tlet end = now();\n\t\tcurrentLogStatusIBM += 'Completed ' + millisToMinutesAndSeconds((end-start).toFixed(3));\n\n\t\trunningStatusIBM = false;\n\t\tresolve();\n\t});\n}",
"function deploy(cb) {\n console.log(\"deploying with the role name 'assigner' in metadata ...\");\n var req = {\n fcn: \"init\",\n args: [],\n metadata: new Buffer(\"assigner\")\n };\n if (devMode) {\n req.chaincodeName = chaincodeName;\n } else {\n req.chaincodePath = \"github.com/asset_management_with_roles/\";\n }\n var tx = deployer.deploy(req);\n tx.on('submitted', function (results) {\n console.log(\"deploy submitted: %j\", results);\n });\n tx.on('complete', function (results) {\n console.log(\"deploy complete: %j\", results);\n chaincodeID = results.chaincodeID;\n console.log(\"chaincodeID:\" + chaincodeID);\n return cb();\n });\n tx.on('error', function (err) {\n console.log(\"deploy error: %j\", err.toString());\n return cb(err);\n });\n}",
"_initializeDeploy(config) {\n\n // Configure and instantiate S3\n this._initializeS3(this.s3Config, (error) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n // Get last character of build path\n let lastCharOfPath = this.buildPath.slice(-1);\n\n /**\n * If buildpath does not have a trailing slash, add it.\n */\n if (lastCharOfPath !== '/') {\n this.buildPath += '/';\n }\n\n // Grab the files, then go to the _uploadFiles method\n glob(this.options.pathGlob, {cwd: this.buildPath}, (error, files) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log('Deployer is now running.', 'SUCCESS');\n\n // Set the version variables for the files.\n this._setVersionVars((error, hash) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log(`Setting deployment to version: ${this.version}`);\n\n // Upload files to S3\n this._uploadFiles(files, (done, fileNum) => {\n\n if (done) {\n\n // Change cloudfront root object\n this._cloudfrontInvalidateEntryHtml((error) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log(`Deployment finished successfully. ${fileNum} files uploaded.`, 'SUCCESS');\n\n // Check for slack notifs:\n this._configureSlack(config.options.slack, (success) => {\n\n if (success) {\n this.log('Slack has been notified.', 'SUCCESS');\n }\n });\n });\n }\n });\n });\n });\n });\n }",
"registerHooks() {\n S.addHook(this._hookPostFunctionDeploy.bind(this), {\n action: 'functionDeploy',\n event: 'post'\n });\n\n return BbPromise.resolve();\n }",
"function deploy(cb) {\n console.log(\"deploying with the role name 'assigner' in metadata ...\");\n var req = {\n fcn: \"init\",\n args: [],\n metadata: \"assigner\"\n };\n if (networkMode) {\n req.chaincodePath = \"github.com/asset_management_with_roles/\";\n } else {\n req.chaincodeName = \"asset_management_with_roles\";\n }\n var tx = admin.deploy(req);\n tx.on('submitted', function (results) {\n console.log(\"deploy submitted: %j\", results);\n });\n tx.on('complete', function (results) {\n console.log(\"deploy complete: %j\", results);\n chaincodeID = results.chaincodeID;\n return assign(cb);\n });\n tx.on('error', function (err) {\n console.log(\"deploy error: %j\", err.toString());\n return cb(err);\n });\n}",
"function deploy(params, cb) {\n params.resourcePath = config.addURIParams(constants.FORMS_BASE_PATH + \"/data_sources/:id/deploy\", params);\n params.method = \"POST\";\n params.data = params.dataSource;\n\n mbaasRequest.admin(params, cb);\n}",
"function removeCFC()\n{\n\tinvokeMethodOnCurrentCFC(\"remove\");\n}",
"function deployAllDependentContracts() {\n return new Promise(async (resolve, reject) => {\n try {\n await deployContractX('BCToken', BCTokenJSON)\n await deployContractX('TokenRegistry', TokenRegistryJSON)\n await deployContractX('TokenTransferProxy', TokenTransferProxyJSON)\n await deployContractX('DebtRegistry', DebtRegistryJSON)\n await deployContractX('EscrowRegistry', EscrowRegistryJSON)\n await deployContractX('DebtKernel', DebtKernelJSON)\n await deployContractX('RepaymentRouter', RepaymentRouterJSON)\n await deployContractX('DebtToken', DebtTokenJSON)\n await deployContractX('Collateralizer', CollateralizerJSON)\n await deployContractX('ContractRegistry', ContractRegistryJSON)\n await deployContractX('CollateralizedSimpleInterestTermsContract', CollateralizedSimpleInterestTermsContractJSON)\n await deployContractX('Escrow', EscrowJSON)\n await deployContractX('Borrower', BorrowerJSON)\n } catch(error) {\n console.log('error in deployAllDependentContracts: ', error)\n reject({\n status: 'failure',\n message: error.message,\n data: []\n })\n }\n })\n}",
"async function deployGoogle(params, func, funcFirstUpperCase, testName) {\n\treturn new Promise(async (resolve, reject) => {\n\n\t\tlet start = now();\n\n\t\tcurrentLogStatusGoogle += '<h5>Google Cloud (parallel deployment)</h5>';\n\t\tcurrentLogStatusGoogle += '<ul stlye=\"list-style-position: outside\">';\n\t\tcurrentLogStatusGoogleEnd += '</ul>';\n\t\trunningStatusGoogle = true;\n\n\t\tvar promises = [];\n\n\t\tif(params.node == 'true') {\n\t\t\tlet p = deployFunction(constants.GOOGLE, constants.NODE, func, 'node_' + func, '', '', 'nodejs10', '', '', '/google/src/node/' + func, 'Node.js', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.python == 'true') {\n\t\t\tlet p = deployFunction(constants.GOOGLE, constants.PYTHON, func, 'python_' + func, '', '', 'python37', '', '', '/google/src/python/' + func, 'Python', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.go == 'true') {\n\t\t\tlet p = deployFunction(constants.GOOGLE, constants.GO, func, 'Go_' + func, '', '', 'go111', '', '', '/google/src/go/' + func, 'Go', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.dotnet == 'true') {\n\t\t\tcurrentLogStatusGoogle += '<li><span style=\"color:orange\">SKIP:</span> No .NET runtime</li>';\n\t\t}\n\n\t\tawait Promise.all(promises);\n\n\t\tlet end = now();\n\t\tcurrentLogStatusGoogle += 'Completed ' + millisToMinutesAndSeconds((end-start).toFixed(3));\n\n\t\trunningStatusGoogle = false;\n\t\tresolve();\n\t});\n}",
"async function deployAWS(params, func, funcFirstUpperCase, testName) {\n\treturn new Promise(async (resolve, reject) => {\n\n\t\tlet start = now();\n\n\t\tcurrentLogStatusAWS += '<h5>Amazon Web Services (parallel deployment)</h5>';\n\t\tcurrentLogStatusAWS += '<ul stlye=\"list-style-position: outside\">';\n\t\tcurrentLogStatusAWSEnd += '</ul>';\n\t\trunningStatusAWS = true;\n\n\t\tvar promises = [];\n\n\t\tif(params.node == 'true') {\n\t\t\tlet p = deployFunction(constants.AWS, constants.NODE, func, 'node_' + func, 'node_' + func, 'node_' + func, 'nodejs10.x', '', 'index.handler', '/aws/src/node/node_' + func + '/', 'Node.js', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.python == 'true') {\n\t\t\tlet p = deployFunction(constants.AWS, constants.PYTHON, func, 'python_' + func, 'python_' + func, 'python_' + func, 'python3.7', '', 'function.my_handler', '/aws/src/python/python_' + func + '/', 'Python', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.go == 'true') {\n\t\t\tlet p = deployFunction(constants.AWS, constants.GO, func, 'go_' + func, 'go_' + func, 'go_' + func, 'go1.x', '', func, '/aws/src/go/go_' + func + '/', 'Go', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\t\tif(params.dotnet == 'true') {\n\t\t\tlet p = deployFunction(constants.AWS, constants.DOTNET, func, 'dotnet_' + func, 'dotnet_' + func, 'dotnet_' + func, 'dotnetcore2.1', '', funcFirstUpperCase + '::' + funcFirstUpperCase + '.' + funcFirstUpperCase + 'Handler::HandleFunction', '/aws/src/dotnet/' + funcFirstUpperCase + '/', '.NET', '', '', params.ram, params.timeout);\n\t\t\tpromises.push(p);\n\t\t}\n\n\t\tawait Promise.all(promises);\n\n\t\tlet end = now();\n\t\tcurrentLogStatusAWS += 'Completed ' + millisToMinutesAndSeconds((end-start).toFixed(3));\n\n\t\trunningStatusAWS = false;\n\t\tresolve();\n\t});\n}",
"function deployApplication(envName, shouldDeploy, cb){\n if(shouldDeploy){\n mess.warning(\"EB deployment can take time - will timeout after 30 minutes if incomplete\");\n mess.load(\"Deploying release branch to EB Environment: \" + envName);\n perf.start(\"EB Deploy\");\n eb.deploy(envName, (success) => {\n mess.stopLoad(true);\n perf.end(\"EB Deploy\");\n if(success){\n mess.success(\"Finished deploying to elastic beanstalk!!\");\n return cb(true);\n }else{\n mess.error(\"Failed to deploy to elastic beanstalk --OR-- timed out\");\n return cb(false);\n }\n })\n }else{\n mess.load(\"Simulating EB deployment process - 2 secs\")\n setTimeout(() => {\n mess.stopLoad(true);\n mess.success(\"Successfully simulated eb deployment\");\n return cb(true);\n }, 2000);\n }\n}",
"function createDeployment_() {\r\n progress = cli.progress('Creating VM');\r\n utils.doServiceManagementOperation(channel, 'createDeployment', dnsPrefix, dnsPrefix,\r\n role, deployOptions, function(error, response) {\r\n progress.end();\r\n if (!error) {\r\n logger.info('OK');\r\n } else {\r\n cmdCallback(error);\r\n }\r\n });\r\n }",
"static async deployStack(templateFilePath, stackName, bucketName) {\n await this.createBucketIfNotExists(bucketName);\n await KelchCommon.exec('aws cloudformation package --template-file ' + templateFilePath + ' --output-template-file ' + templateFilePath + ' --s3-bucket ' + bucketName + ' --use-json');\n await KelchCommon.exec('aws cloudformation deploy --template-file ' + templateFilePath + ' --stack-name ' + stackName + ' --capabilities CAPABILITY_IAM');\n }",
"run(config, compilerOptions) {\n\n let Uploader = this;\n\n // Set output to compiler output object.\n this.output = compilerOptions.output;\n\n // If options are passed, sync with class options.\n if (config.options) {\n this._syncOptions(config.options);\n }\n\n if (!this.options.autoRun && !argv.deploy) {\n return;\n }\n\n // Sync build path:\n this._syncBuildPath();\n\n // Display Header for Deployer\n this.log('', 'HEADER');\n\n // Check aws config\n this._checkEnvironmentConfig(config.environments, (error, env) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n // Display environment they are deploying to:\n this.log(`You are deploying to the ${env} environment`);\n\n // If deploying, prompt for a deploy message.\n promptly.prompt(\n '[Deployer]: What is this deploy about? ',\n {'default': 'No deploy message specified.'},\n (error, value) => {\n\n this.deployMessage = '[' + this.env + '] ' + value;\n this._createDeployFile();\n this._createRobotsFile();\n this._initializeDeploy(config);\n }\n );\n });\n }",
"function deploy(opts) {\n if (argv._.includes('deploy')) {\n return kubeDeploy(opts);\n }\n return Promise.resolve();\n}",
"_createDeployFile() {\n\n if (this.options.generateDeployFile) {\n\n // Write the deploy message to the deploy.txt\n fs.writeFile(`${this.buildPath}/deploy.txt`, this.deployMessage, (error) => {\n\n if (error) {\n this.log(error, 'ERROR');\n this.log(`deploy.txt was unable to be created.`, 'ERROR');\n process.exit(0);\n }\n\n this.log('deploy.txt was created.');\n });\n }\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Take the jiffserver base instance and options for this extension, and use them to construct an instance for this extension. | function make_jiff(base_instance, options) {
var jiff = base_instance;
// Parse options
if (options == null) {
options = {};
}
/* socketMaps now stores a reference directly to a socket rather than a socketId
To avoid naming confusion, this is still referred to as socketId
*/
jiff.socketMaps = {
socketId: {},
computationId: {},
partyId: {},
clientSocket: {}
}
/* Edit initComputation and freeComputation to use the new socketMaps structure */
jiff.initComputation = function (computation_id, party_id, party_count) {
if (this.computationMaps.clientIds[computation_id] == null) {
this.computationMaps.clientIds[computation_id] = [];
this.computationMaps.maxCount[computation_id] = party_count;
this.computationMaps.freeParties[computation_id] = {};
this.computationMaps.keys[computation_id] = {};
this.socketMaps.socketId[computation_id] = {};
this.mailbox[computation_id] = {};
this.cryptoMap[computation_id] = {};
if (this.computation_instances_deferred[computation_id] == null) {
this.computation_instances_deferred[computation_id] = $.Deferred();
}
}
if (this.computationMaps.clientIds[computation_id].indexOf(party_id) === -1) {
this.computationMaps.clientIds[computation_id].push(party_id);
}
};
jiff.freeComputation = function (computation_id) {
this.hooks.log(this, 'free computation', computation_id);
delete this.socketMaps.socketId[computation_id];
delete this.computationMaps.clientIds[computation_id];
delete this.computationMaps.spareIds[computation_id];
delete this.computationMaps.maxCount[computation_id];
delete this.computationMaps.freeParties[computation_id];
delete this.computationMaps.keys[computation_id];
delete this.computationMaps.secretKeys[computation_id];
delete this.mailbox[computation_id];
delete this.computation_instances_deferred[computation_id];
delete this.computation_instances_map[computation_id];
delete this.cryptoMap[computation_id];
};
/* Functions that overwrite server/socket.js functionality */
/**
* initSocket's '.on' functions needed to be replaced since ws does
* not have as many protocols. Instead these functions are routed to
* when a message is received and a protocol is manually parsed.
*/
jiff.initSocket = function () {
var jiff = this;
// create socket server and listen to connection
let wss = new WebSocket.Server({ server: this.http, clientTracking: true });
// cannot just use this.io because scope of this changes inside of connections
this.io = wss;
this.io.on('connection', function (socket, req) {
jiff.hooks.log(jiff, 'user connected');
socket.id = req.headers['sec-websocket-key'];
function initialization(msg) {
// START OF SOCKET SPECIFIC SETUP
// read message
var computation_id = msg['computation_id'];
var party_id = msg['party_id'];
var party_count = msg['party_count'];
// END OF SOCKET SPECIFIC SETUP
msg.clients = wss.clients;
// COMPUTATION: independent from socket
msg.socket = socket;
var output = jiff.handlers.initializeParty(computation_id, party_id, party_count, msg, false);
// END OF COMPUTATION
// START OF SOCKET SPECIFIC OUTPUT/CLEANUP
if (output.success) {
jiff.socketMaps.socketId[computation_id][output.message.party_id] = socket;
jiff.socketMaps.computationId[socket.id] = computation_id;
jiff.socketMaps.partyId[socket.id] = output.message.party_id;
party_id = output.message.party_id;
output.message = JSON.stringify(output.message);
socket.send(JSON.stringify({ socketProtocol: 'initialization', data: output.message }));
// Now that party is connected and has the needed public keys,
// send the mailbox with pending messages to the party.
jiff.resend_mailbox(computation_id, party_id);
} else {
// Change error to its own protocol type since ws does not support error messages natively
/* Messages sent over socket.io are now under the label 'data' while previously used protocols are sent under 'socketProtocol' */
socket.send(JSON.stringify({ socketProtocol: 'error', data: JSON.stringify({ errorProtocol: 'initialization', error: output.error }) }));
}
// END OF SOCKET SPECIFIC OUTPUT/CLEANUP
}
function share(msg, callback) {
var computation_id = jiff.socketMaps.computationId[socket.id];
var from_id = jiff.socketMaps.partyId[socket.id];
var output = jiff.handlers.share(computation_id, from_id, msg);
if (!output.success) {
var errorMsg = JSON.stringify({ label: 'share', error: output.error });
jiff.emit('error', errorMsg, computation_id, from_id);
}
}
function socketOpen(msg, callback) {
var computation_id = jiff.socketMaps.computationId[socket.id];
var from_id = jiff.socketMaps.partyId[socket.id];
var output = jiff.handlers.open(computation_id, from_id, msg);
if (!output.success) {
var errorMsg = JSON.stringify({ label: 'open', error: output.error });
jiff.emit('error', errorMsg, computation_id, from_id);
}
}
function socketCustom(msg, callback) {
var computation_id = jiff.socketMaps.computationId[socket.id];
var from_id = jiff.socketMaps.partyId[socket.id];
var output = jiff.handlers.custom(computation_id, from_id, msg);
if (!output.success) {
var errorMsg = JSON.stringify({ label: 'custom', error: output.error });
jiff.emit('error', errorMsg, computation_id, from_id);
}
}
function crypto_provider(msg, callback) {
var computation_id = jiff.socketMaps.computationId[socket.id];
var from_id = jiff.socketMaps.partyId[socket.id];
var res = jiff.handlers.crypto_provider(computation_id, from_id, msg);
if (!res.success) {
var errorMsg = JSON.stringify({ label: 'crypto_provider', error: res.error });
jiff.emit('error', errorMsg, computation_id, from_id);
}
}
function disconnect(reason) {
var computation_id = jiff.socketMaps.computationId[socket.id];
if (computation_id) {
var from_id = jiff.socketMaps.partyId[socket.id];
jiff.hooks.log(jiff, 'user disconnected', computation_id, from_id, 'Reason:', reason);
jiff.hooks.execute_array_hooks('onDisconnect', [jiff, computation_id, from_id], -1);
if (jiff.computationMaps.freeParties[computation_id] == null || jiff.computationMaps.freeParties[computation_id][from_id]) {
delete jiff.socketMaps.computationId[socket.id];
delete jiff.socketMaps.partyId[socket.id];
} else {
socket.__jiff_cleaned = true;
}
}
}
function free(msg, callback) {
var computation_id = jiff.socketMaps.computationId[socket.id];
var from_id = jiff.socketMaps.partyId[socket.id];
var output = jiff.handlers.free(computation_id, from_id, msg);
if (!output.success) {
var errorMsg = JSON.stringify({ label: 'free', error: output.error });
jiff.emit('error', errorMsg, computation_id, from_id);
}
if (socket.__jiff_cleaned) {
delete jiff.socketMaps.computationId[socket];
delete jiff.socketMaps.partyId[socket];
delete socket.__jiff_cleaned;
}
}
/* close is one protocol that is contained in the ws library for when a socket disconnects */
socket.on('close', function (reason, callback) {
disconnect(reason);
});
/**
* In every message sent over ws, we will send along with it a socketProtocol string
* that will be parsed by the receiver to route the request to the correct function. The
* previous information sent by socket.io will be untouched, but now sent inside of msg.data.
*/
socket.on('message', function (msg, callback) {
msg = JSON.parse(msg);
msg.data = JSON.parse(msg.data);
switch (msg.socketProtocol) {
case 'initialization':
initialization(msg.data);
break;
case 'share':
share(msg.data, callback);
break;
case 'open':
socketOpen(msg.data, callback);
break;
case 'custom':
socketCustom(msg.data, callback);
break;
case 'crypto_provider':
crypto_provider(msg.data, callback);
break;
case 'disconnect':
disconnect(msg.data);
break;
case 'close':
disconnect(msg.data);
break;
case 'free':
free(msg.data, callback);
break;
default:
console.log("Unknown protocol received");
}
});
});
};
/* Changes made to the hooks functionality */
jiff.hooks.onInitializeUsedId = function (jiff, computation_id, party_id, party_count, msg) {
/* socketID structure is replaced with just a reference to the socket */
var previous_socket = jiff.socketMaps.socketId[computation_id][party_id];
if (previous_socket !== msg.socket && msg.clients.has(previous_socket)) {
throw new Error(party_id + ' is already taken');
}
return party_id;
};
/* Replace changes made to mailbox.js */
jiff.emit = function (label, msg, computation_id, to_id, callback) {
if (this.socketMaps.socketId[computation_id] == null) {
return;
}
// get the appropriate socket for the receiving party
var socket_to_use = this.socketMaps.socketId[computation_id][to_id]; // socket to use
if (socket_to_use == null) {
return;
}
var socket = socket_to_use;
var message = { socketProtocol: label, data: msg };
if (socket != null) {
if (callback == null) {
socket.send(JSON.stringify(message));
} else {
// emit the message, if an acknowledgment is received, remove it from mailbox
socket.send(JSON.stringify(message), null, function () {
callback();
});
}
}
};
/** Make sure that our socket is closed in case one was created
* before the exension was able to execute. Then, open the server
* for connections to clients.
*/
jiff.io.close();
jiff.initSocket();
return jiff;
} | [
"function buildExtension() {\n return {\n name: 'extension',\n entry: './server/src/index.ts',\n output: {\n filename: 'extension.js',\n path: path.resolve(__dirname),\n\n // Important; this needs to be a umd library or it won't export a function\n // and nodecg will poop its pants.\n library: {\n type: 'umd',\n }\n },\n\n ...rootConfig\n }\n}",
"createExtensionManager() {\n const coreExtensions = this.options.enableCoreExtensions\n ? Object.values(extensions)\n : [];\n const allExtensions = [...coreExtensions, ...this.options.extensions].filter(extension => {\n return ['extension', 'node', 'mark'].includes(extension === null || extension === void 0 ? void 0 : extension.type);\n });\n this.extensionManager = new ExtensionManager(allExtensions, this);\n }",
"function Workman_Options() {\n this.initialize.apply(this, arguments);\n}",
"constructor(server, id, setup) {\n this.id = id;\n this.setup = setup;\n this._config = server.config;\n this._notify = server.notify;\n\n this._connectPromise = null;\n }",
"extend(extension) {\n const data = {\n style: this.style,\n size: this.size,\n textSize: this.textSize,\n color: this.color,\n phantom: this.phantom,\n font: this.font,\n fontFamily: this.fontFamily,\n fontWeight: this.fontWeight,\n fontShape: this.fontShape,\n maxSize: this.maxSize\n };\n\n for (const key in extension) {\n if (extension.hasOwnProperty(key)) {\n data[key] = extension[key];\n }\n }\n\n return new Options(data);\n }",
"static init(port) {\n return new Server(port);\n }",
"constructor(context, notifier) {\n super();\n this.context = context;\n this.notifier = notifier;\n }",
"static createServer() {\n if (!Server.instance) {\n Server.instance = new Server();\n }\n return Server.instance;\n }",
"constructor(options) {\n // Proxy options\n this.options = Object.assign({\n serverAddress: '127.0.0.1',\n serverPort: 16567,\n // proxyAddress: 'THIS CAN NOT HAVE SENSIBLE DEFAULT',\n socketTimeout: 10000,\n banTimeout: 10 * 60000\n }, options);\n // Component logger\n this.logger = new Logger('PROXY', this.options.debug);\n // Public proxy SOCKET\n this.socket = null;\n // Local client SOCKETs\n this.clients = {};\n // IP bans\n this.bans = {};\n }",
"writeBundle() {\n // Validate that there's no instance already running.\n if (!this._instance) {\n // Get the server basic options.\n const { https: httpsSettings, port } = this._options;\n // Create the server instance.\n this._instance = httpsSettings ?\n createHTTPSServer(httpsSettings, this._handler) :\n createHTTPServer(this._handler);\n\n // Start listening for requests.\n this._instance.listen(port);\n // Log some information messages.\n this._logger.warning(`Starting on ${this.url}`);\n this._logger.warning('waiting for Rollup...');\n // Start listening for process events that require the sever instance to be terminated.\n this._startListeningForTermination();\n // Open the browser.\n this._open();\n // Invoke the `onStart` callback.\n this._options.onStart(this);\n }\n }",
"$registerHttpServer() {\n this.$container.singleton('Adonis/Core/Server', () => {\n const Logger = this.$container.use('Adonis/Core/Logger');\n const Profiler = this.$container.use('Adonis/Core/Profiler');\n const Config = this.$container.use('Adonis/Core/Config');\n const Encryption = this.$container.use('Adonis/Core/Encryption');\n const config = Object.assign({ secret: Config.get('app.appKey') }, Config.get('app.http', {}));\n return new Server_1.Server(this.$container, Logger, Profiler, Encryption, config);\n });\n }",
"get options() {\n if (typeof MI === 'undefined') {\n window.MI = { options: {} };\n }\n const { options } = MI;\n return options;\n }",
"static init() {\n\n JuspayEnvironment.DEVELOPMENT_BASE_URL = \"https://localapi.juspay.in\";\n JuspayEnvironment.SANDBOX_BASE_URL = \"https://sandbox.juspay.in\";\n JuspayEnvironment.PRODUCTION_BASE_URL = \"https://api.juspay.in\";\n\n if (JuspayEnvironment.thisObj != undefined) {\n return JuspayEnvironment.thisObj;\n } else {\n JuspayEnvironment.apiKey = \"\";\n JuspayEnvironment.apiVersion = \"2016-10-27\";\n JuspayEnvironment.baseUrl = JuspayEnvironment.SANDBOX_BASE_URL;\n JuspayEnvironment.connectTimeout = 15;\n JuspayEnvironment.readTimeout = 30;\n JuspayEnvironment.sdkVersion = \"1.0.3\";\n JuspayEnvironment.thisObj = new JuspayEnvironment();\n return JuspayEnvironment.thisObj;\n }\n }",
"function Passenger(options) {\n if (!_singleton) {\n this.config = $.extend(true, {}, DEFAULTS, options); // overrides config defaults\n this.setupConnections();\n this.user = {};\n _singleton = this;\n }\n return _singleton;\n }",
"function initServer() {\n var options = {\n dataAdapter: new DataAdapter(config.api),\n errorHandler: mw.errorHandler(),\n appData: config.rendrApp\n };\n server = rendr.createServer(app, options);\n}",
"constructor({ source, size = config.avatarSize, interval = config.avatarInterval, tracking = 'tiny', onAvatar }) {\n this.source = source\n this.size = size\n this.interval = Math.round(parseDuration(interval))\n this.onAvatar = onAvatar\n \n this.tracking = tracking\n this.trackingZoom = 1.0\n this.trackingPan = { x: 0, y: 0.0 }\n this.trackingZoomCorrection = 1.0\n this.trackingPanCorrection = { x: 0, y: 0.0 }\n this.getCanvas.cache = html`<canvas></canvas>`\n }",
"constructor(component, options = {}) {\n this.component = component;\n this.options = options;\n this.tracer = null;\n this.network = null;\n if (this.options.cache !== true) {\n this.options.cache = false;\n }\n\n if (this.options.loader) {\n this.loader = this.options.loader;\n } else {\n if (this.options.baseDir) {\n this.baseDir = this.options.baseDir;\n } else if (process.env.NOFLO_TEST_BASEDIR) {\n this.baseDir = process.env.NOFLO_TEST_BASEDIR;\n } else {\n this.baseDir = process.cwd();\n }\n this.loader = new noflo.ComponentLoader(this.baseDir, {\n cache: this.options.cache,\n });\n }\n\n if (this.options.flowtrace) {\n // Use Flowtrace provided via settings\n this.tracer = this.options.flowtrace;\n } else if (this.options.debug) {\n // Use internal Flowtrace\n this.tracer = new Flowtrace();\n }\n\n this.componentName = this.options.componentName || 'wrapper/Wrapped';\n if (typeof this.component === 'string') {\n this.componentName = this.component;\n }\n }",
"_setSimpleGitInstance() {\n this._simpleGit = Git._getSimpleGitInstance(this.localPath);\n }",
"startNew(options) {\n let serverSettings = this.serverSettings;\n return session_1.Session.startNew(Object.assign({}, options, { serverSettings })).then(session => {\n this._onStarted(session);\n return session;\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a slider change object from the specified value. | _createChangeEvent(value = this.value) {
let event = new MatSliderChange();
event.source = this;
event.value = value;
return event;
} | [
"function createSlider() {\n\n //the value that we'll give the slider - if it's a range, we store our value as a comma separated val but this slider expects an array\n var sliderVal = null;\n\n //configure the model value based on if range is enabled or not\n if ($scope.model.config.enableRange == true) {\n //If no value saved yet - then use default value\n //If it contains a single value - then also create a new array value\n if (!$scope.model.value || $scope.model.value.indexOf(\",\") == -1) {\n var i1 = parseFloat($scope.model.config.initVal1);\n var i2 = parseFloat($scope.model.config.initVal2);\n sliderVal = [\n isNaN(i1) ? $scope.model.config.minVal : (i1 >= $scope.model.config.minVal ? i1 : $scope.model.config.minVal),\n isNaN(i2) ? $scope.model.config.maxVal : (i2 > i1 ? (i2 <= $scope.model.config.maxVal ? i2 : $scope.model.config.maxVal) : $scope.model.config.maxVal)\n ];\n }\n else {\n //this will mean it's a delimited value stored in the db, convert it to an array\n sliderVal = _.map($scope.model.value.split(','), function (item) {\n return parseFloat(item);\n });\n }\n }\n else {\n //If no value saved yet - then use default value\n if ($scope.model.value) {\n sliderVal = parseFloat($scope.model.value);\n }\n else {\n sliderVal = $scope.model.config.initVal1;\n }\n }\n\n // Initialise model value if not set\n if (!$scope.model.value) {\n setModelValueFromSlider(sliderVal);\n }\n\n //initiate slider, add event handler and get the instance reference (stored in data)\n var slider = $element.find('.slider-item').bootstrapSlider({\n max: $scope.model.config.maxVal,\n min: $scope.model.config.minVal,\n orientation: $scope.model.config.orientation,\n selection: $scope.model.config.reversed ? \"after\" : \"before\",\n step: $scope.model.config.step,\n precision: $scope.model.config.precision,\n tooltip: $scope.model.config.tooltip,\n tooltip_split: $scope.model.config.tooltipSplit,\n tooltip_position: $scope.model.config.tooltipPosition,\n handle: $scope.model.config.handle,\n reversed: $scope.model.config.reversed,\n ticks: $scope.model.config.ticks,\n ticks_positions: $scope.model.config.ticksPositions,\n ticks_labels: $scope.model.config.ticksLabels,\n ticks_snap_bounds: $scope.model.config.ticksSnapBounds,\n formatter: $scope.model.config.formatter,\n range: $scope.model.config.enableRange,\n //set the slider val - we cannot do this with data- attributes when using ranges\n value: sliderVal\n }).on('slideStop', function (e) {\n var value = e.value;\n angularHelper.safeApply($scope, function () {\n setModelValueFromSlider(value);\n });\n }).data('slider');\n }",
"onSliderValueChanged() {\n this.setBase();\n const label = `${this.name}: ${JSON.stringify(this.value)}`;\n ChromeGA.event(ChromeGA.EVENT.SLIDER_VALUE, label);\n }",
"function SliderInt2(label, v, v_min, v_max, format = \"%d\") {\r\n const _v = import_Vector2(v);\r\n const ret = bind.SliderInt2(label, _v, v_min, v_max, format);\r\n export_Vector2(_v, v);\r\n return ret;\r\n }",
"function SliderInt3(label, v, v_min, v_max, format = \"%d\") {\r\n const _v = import_Vector3(v);\r\n const ret = bind.SliderInt3(label, _v, v_min, v_max, format);\r\n export_Vector3(_v, v);\r\n return ret;\r\n }",
"addSlider(slider) {\n this.slider = slider;\n }",
"function onSlide(event, ui) {\n\tvar values = ui.values;\n\tCLUB.lowValue = values[0];\n\tCLUB.highValue = values[1];\n\tupdateSliderValues();\n\tsetSelectedData();\n}",
"function SliderFloat2(label, v, v_min, v_max, format = \"%.3f\", power = 1.0) {\r\n const _v = import_Vector2(v);\r\n const ret = bind.SliderFloat2(label, _v, v_min, v_max, format, power);\r\n export_Vector2(_v, v);\r\n return ret;\r\n }",
"function makeYearSlider () {\n\t\tvar select = $( \".select-year\" );\n\t\tvar slider = $( \"<div id='slider'></div>\" ).insertAfter( select ).slider({\n\t\t\tmin: 1,\n\t\t\tmax: 5,\n\t\t\trange: \"min\",\n\t\t\tvalue: select[ 0 ].selectedIndex + 1,\n\t\t\tslide: function( event, ui ) {\n\t\t\t\tselect[ 0 ].selectedIndex = ui.value - 1;\n\t\t\t\tswitch(ui.value) {\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tdisplayYear = \"2011\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tdisplayYear = \"2010\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tdisplayYear = \"2009\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tdisplayYear = \"2008\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tdisplayYear = \"2012\";\n\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t};\n\t\t\t\tupdateDisplayArray()\n\t\t\t}\n\t\t});\n\t\t$( \".select-year\" ).change(function() {\n\t\t\tslider.slider( \"value\", this.selectedIndex + 1 );\n\t\t});\n\t}",
"function useSlider(props) {\n var _getAriaValueText;\n\n var {\n min = 0,\n max = 100,\n onChange,\n value: valueProp,\n defaultValue,\n isReversed,\n orientation = \"horizontal\",\n id: idProp,\n isDisabled,\n isReadOnly,\n onChangeEnd: onChangeEndProp,\n step = 1,\n getAriaValueText: getAriaValueTextProp,\n \"aria-valuetext\": ariaValueText,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n name,\n focusThumbOnChange = true\n } = props,\n htmlProps = _objectWithoutPropertiesLoose(props, [\"min\", \"max\", \"onChange\", \"value\", \"defaultValue\", \"isReversed\", \"orientation\", \"id\", \"isDisabled\", \"isReadOnly\", \"onChangeStart\", \"onChangeEnd\", \"step\", \"getAriaValueText\", \"aria-valuetext\", \"aria-label\", \"aria-labelledby\", \"name\", \"focusThumbOnChange\"]);\n\n var onChangeStart = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallbackRef)(onChangeEndProp);\n var onChangeEnd = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallbackRef)(onChangeEndProp);\n var getAriaValueText = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_1__.useCallbackRef)(getAriaValueTextProp);\n /**\n * Enable the slider handle controlled and uncontrolled scenarios\n */\n\n var [computedValue, setValue] = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_2__.useControllableState)({\n value: valueProp,\n defaultValue: defaultValue != null ? defaultValue : getDefaultValue(min, max),\n onChange\n });\n var [isDragging, setDragging] = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_3__.useBoolean)();\n var [isFocused, setFocused] = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_3__.useBoolean)();\n var isInteractive = !(isDisabled || isReadOnly);\n /**\n * Constrain the value because it can't be less than min\n * or greater than max\n */\n\n var value = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.clampValue)(computedValue, min, max);\n var valueRef = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_5__.useLatestRef)(value);\n var reversedValue = max - value + min;\n var trackValue = isReversed ? reversedValue : value;\n var trackPercent = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.valueToPercent)(trackValue, min, max);\n var isVertical = orientation === \"vertical\";\n /**\n * Let's keep a reference to the slider track and thumb\n */\n\n var trackRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n var thumbRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n var rootRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n /**\n * Generate unique ids for component parts\n */\n\n var [thumbId, trackId] = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_6__.useIds)(idProp, \"slider-thumb\", \"slider-track\");\n /**\n * Get relative value of slider from the event by tracking\n * how far you clicked within the track to determine the value\n *\n * @todo - Refactor this later on to use info from pan session\n */\n\n var getValueFromPointer = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => {\n var _event$touches$, _event$touches;\n\n if (!trackRef.current) return undefined;\n var trackRect = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_7__.getBox)(trackRef.current).borderBox;\n var {\n clientX,\n clientY\n } = (_event$touches$ = (_event$touches = event.touches) == null ? void 0 : _event$touches[0]) != null ? _event$touches$ : event;\n var diff = isVertical ? trackRect.bottom - clientY : clientX - trackRect.left;\n var length = isVertical ? trackRect.height : trackRect.width;\n var percent = diff / length;\n\n if (isReversed) {\n percent = 1 - percent;\n }\n\n var nextValue = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.percentToValue)(percent, min, max);\n\n if (step) {\n nextValue = parseFloat((0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.roundValueToStep)(nextValue, min, step));\n }\n\n nextValue = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.clampValue)(nextValue, min, max);\n return nextValue;\n }, [isVertical, isReversed, max, min, step]);\n var tenSteps = (max - min) / 10;\n var oneStep = step || (max - min) / 100;\n var constrain = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => {\n // bail out if slider isn't interactive\n if (!isInteractive) return;\n value = parseFloat((0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.roundValueToStep)(value, min, oneStep));\n value = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.clampValue)(value, min, max);\n setValue(value);\n }, [oneStep, max, min, setValue, isInteractive]);\n var actions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({\n stepUp: function stepUp(step) {\n if (step === void 0) {\n step = oneStep;\n }\n\n var next = isReversed ? value - step : value + step;\n constrain(next);\n },\n stepDown: function stepDown(step) {\n if (step === void 0) {\n step = oneStep;\n }\n\n var next = isReversed ? value + step : value - step;\n constrain(next);\n },\n reset: () => constrain(defaultValue || 0),\n stepTo: value => constrain(value)\n }), [constrain, isReversed, value, oneStep, defaultValue]);\n /**\n * Keyboard interaction to ensure users can operate\n * the slider using only their keyboard.\n */\n\n var onKeyDown = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(event => {\n var eventKey = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.normalizeEventKey)(event);\n var keyMap = {\n ArrowRight: () => actions.stepUp(),\n ArrowUp: () => actions.stepUp(),\n ArrowLeft: () => actions.stepDown(),\n ArrowDown: () => actions.stepDown(),\n PageUp: () => actions.stepUp(tenSteps),\n PageDown: () => actions.stepDown(tenSteps),\n Home: () => constrain(min),\n End: () => constrain(max)\n };\n var action = keyMap[eventKey];\n\n if (action) {\n event.preventDefault();\n event.stopPropagation();\n action(event);\n }\n }, [actions, constrain, max, min, tenSteps]);\n /**\n * ARIA (Optional): To define a human readable representation of the value,\n * we allow users pass aria-valuetext.\n */\n\n var valueText = (_getAriaValueText = getAriaValueText == null ? void 0 : getAriaValueText(value)) != null ? _getAriaValueText : ariaValueText;\n /**\n * Measure the dimensions of the thumb so\n * we can center it within the track properly\n */\n\n var thumbBoxModel = (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_9__.useDimensions)(thumbRef);\n /**\n * Compute styles for all component parts.\n */\n\n var {\n thumbStyle,\n rootStyle,\n trackStyle,\n innerTrackStyle\n } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {\n var _thumbBoxModel$border;\n\n var thumbRect = (_thumbBoxModel$border = thumbBoxModel == null ? void 0 : thumbBoxModel.borderBox) != null ? _thumbBoxModel$border : {\n width: 0,\n height: 0\n };\n return (0,_utils__WEBPACK_IMPORTED_MODULE_10__.getPartsStyle)({\n isReversed,\n orientation,\n thumbRect,\n trackPercent\n });\n }, [isReversed, orientation, thumbBoxModel == null ? void 0 : thumbBoxModel.borderBox, trackPercent]);\n var focusThumb = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {\n if (thumbRef.current && focusThumbOnChange) {\n setTimeout(() => (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_11__.focus)(thumbRef.current));\n }\n }, [focusThumbOnChange]);\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_12__.useUpdateEffect)(() => {\n focusThumb();\n }, [value]);\n\n var setValueFromPointer = event => {\n var nextValue = getValueFromPointer(event);\n\n if (nextValue != null && nextValue !== valueRef.current) {\n setValue(nextValue);\n }\n };\n\n (0,_chakra_ui_hooks__WEBPACK_IMPORTED_MODULE_13__.usePanGesture)(rootRef, {\n onPanSessionStart(event) {\n if (!isInteractive) return;\n setValueFromPointer(event);\n focusThumb();\n },\n\n onPanStart() {\n if (!isInteractive) return;\n setDragging.on();\n onChangeStart == null ? void 0 : onChangeStart(valueRef.current);\n },\n\n onPan(event) {\n if (!isInteractive) return;\n setValueFromPointer(event);\n },\n\n onPanEnd() {\n if (!isInteractive) return;\n setDragging.off();\n onChangeEnd == null ? void 0 : onChangeEnd(valueRef.current);\n }\n\n });\n var getRootProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({}, props, htmlProps, {\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_14__.mergeRefs)(ref, rootRef),\n tabIndex: -1,\n \"aria-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.ariaAttr)(isDisabled),\n \"data-focused\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(isFocused),\n style: _extends({}, props.style, rootStyle)\n });\n }, [htmlProps, isDisabled, isFocused, rootStyle]);\n var getTrackProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({}, props, {\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_14__.mergeRefs)(ref, trackRef),\n id: trackId,\n \"data-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(isDisabled),\n style: _extends({}, props.style, trackStyle)\n });\n }, [isDisabled, trackId, trackStyle]);\n var getInnerTrackProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({}, props, {\n ref,\n style: _extends({}, props.style, innerTrackStyle)\n });\n }, [innerTrackStyle]);\n var getThumbProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({}, props, {\n ref: (0,_chakra_ui_react_utils__WEBPACK_IMPORTED_MODULE_14__.mergeRefs)(ref, thumbRef),\n role: \"slider\",\n tabIndex: 0,\n id: thumbId,\n \"data-active\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(isDragging),\n \"aria-valuetext\": valueText,\n \"aria-valuemin\": min,\n \"aria-valuemax\": max,\n \"aria-valuenow\": value,\n \"aria-orientation\": orientation,\n \"aria-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.ariaAttr)(isDisabled),\n \"aria-readonly\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.ariaAttr)(isReadOnly),\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabel ? undefined : ariaLabelledBy,\n style: _extends({}, props.style, thumbStyle),\n onKeyDown: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_15__.callAllHandlers)(props.onKeyDown, onKeyDown),\n onFocus: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_15__.callAllHandlers)(props.onFocus, setFocused.on),\n onBlur: (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_15__.callAllHandlers)(props.onBlur, setFocused.off)\n });\n }, [ariaLabel, ariaLabelledBy, isDisabled, isDragging, isReadOnly, max, min, onKeyDown, orientation, setFocused.off, setFocused.on, thumbId, thumbStyle, value, valueText]);\n var getMarkerProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n var isInRange = !(props.value < min || props.value > max);\n var isHighlighted = value >= props.value;\n var markerPercent = (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_4__.valueToPercent)(props.value, min, max);\n\n var markerStyle = _extends({\n position: \"absolute\",\n pointerEvents: \"none\"\n }, orient({\n orientation,\n vertical: {\n bottom: isReversed ? 100 - markerPercent + \"%\" : markerPercent + \"%\"\n },\n horizontal: {\n left: isReversed ? 100 - markerPercent + \"%\" : markerPercent + \"%\"\n }\n }));\n\n return _extends({}, props, {\n ref,\n role: \"presentation\",\n \"aria-hidden\": true,\n \"data-disabled\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(isDisabled),\n \"data-invalid\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(!isInRange),\n \"data-highlighted\": (0,_chakra_ui_utils__WEBPACK_IMPORTED_MODULE_8__.dataAttr)(isHighlighted),\n style: _extends({}, props.style, markerStyle)\n });\n }, [isDisabled, isReversed, max, min, orientation, value]);\n var getInputProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (props, ref) {\n if (props === void 0) {\n props = {};\n }\n\n if (ref === void 0) {\n ref = null;\n }\n\n return _extends({}, props, {\n ref,\n type: \"hidden\",\n value,\n name\n });\n }, [name, value]);\n return {\n state: {\n value,\n isFocused,\n isDragging\n },\n actions,\n getRootProps,\n getTrackProps,\n getInnerTrackProps,\n getThumbProps,\n getMarkerProps,\n getInputProps\n };\n}",
"function SliderScalar(label, v, v_min, v_max, format = null, power = 1.0) {\r\n if (v instanceof Int8Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.S8, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Uint8Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.U8, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Int16Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.S16, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Uint16Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.U16, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Int32Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.S32, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Uint32Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.U32, v, v_min, v_max, format, power);\r\n }\r\n // if (v instanceof Int64Array) { return bind.SliderScalar(label, ImGuiDataType.S64, v, v_min, v_max, format, power); }\r\n // if (v instanceof Uint64Array) { return bind.SliderScalar(label, ImGuiDataType.U64, v, v_min, v_max, format, power); }\r\n if (v instanceof Float32Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.Float, v, v_min, v_max, format, power);\r\n }\r\n if (v instanceof Float64Array) {\r\n return bind.SliderScalar(label, ImGuiDataType.Double, v, v_min, v_max, format, power);\r\n }\r\n throw new Error();\r\n }",
"function setDifference() {\n differenceThreshold = dSlider.value();\n}",
"function slider_equation(val)\n{\n return (4.5 * Math.pow(val,2) - (0.75 * val) + 0.25);\n}",
"function sliderMove()\r\n{\r\n var offset = 0\r\n for (var t = 0; t < sliders.length; t++)\r\n {\r\n var slid = map(sin(angle+offset), -1, 1, 0, 255)\r\n sliders[t].value(slid)\r\n offset += vTest;\r\n } \r\n}",
"function changeHue(value) {\n Caman(\"#photo\", imgUrl, function (test) {\n if (value == 0) {\n this.revert();\n }\n console.log(value - previousValue);\n this.hue(value - previousValue);\n previousValue = value;\n this.render();\n });\n}",
"static from(type, value) {\n return new Typed(_gaurd, type, value);\n }",
"function SliderFloat(label, v, v_min, v_max, format = \"%.3f\", power = 1.0) {\r\n const _v = import_Scalar(v);\r\n const ret = bind.SliderFloat(label, _v, v_min, v_max, format, power);\r\n export_Scalar(_v, v);\r\n return ret;\r\n }",
"function SliderFloat3(label, v, v_min, v_max, format = \"%.3f\", power = 1.0) {\r\n const _v = import_Vector3(v);\r\n const ret = bind.SliderFloat3(label, _v, v_min, v_max, format, power);\r\n export_Vector3(_v, v);\r\n return ret;\r\n }",
"function enumCycleFunction(name, value) {\n\n const enumDefinition = value.enumDefinition();\n const valueCount = enumDefinition.getValueCount();\n\n let showPopup = false;\n let onChangeFn = (newValue) => { if (showPopup) popup(`${name}: ${enumDefinition.valueDefinitionFor(newValue).getDisplayName()}`); showPopup = false; };\n\n value.addValueObserver(onChangeFn);\n\n return (status, data1, data2) => {\n if (data2 !== 0) {\n // let me know if there's a less convoluted way to do this..........\n const currentId = value.get();\n const valueDefinition = enumDefinition.valueDefinitionFor(currentId);\n const currentIndex = valueDefinition.getValueIndex();\n const nextIndex = (currentIndex + 1) % valueCount;\n const nextValue = enumDefinition.valueDefinitionAt(nextIndex);\n const nextId = nextValue.getId();\n\n showPopup = true;\n value.set(nextId);\n }\n }\n}",
"makeZoomControls() {\n const label = document.createElement(\"label\");\n label.innerText = \"Zoom: \";\n const input = document.createElement(\"input\");\n input.type = \"range\";\n label.appendChild(input);\n // We want to flip this horizontally, so make the slider's value\n // the negative of the real zoom.\n input.min = (-this.maxZoom).toString();\n input.max = \"0\";\n this.onMaxZoom.subscribe(maxZoom => input.min = (-maxZoom).toString());\n this.onZoom.subscribe(zoom => input.value = (-zoom).toString());\n input.addEventListener(\"input\", () => {\n this.setZoom(-parseInt(input.value));\n });\n return label;\n }",
"_updateHandleAndProgress(newValue) {\n const max = this._effectiveMax;\n const min = this._effectiveMin;\n\n // The progress (completed) percentage of the slider.\n this._progressPercentage = (newValue - min) / (max - min);\n // How many pixels from the left end of the slider will be the placed the affected by the user action handle\n this._handlePositionFromStart = this._progressPercentage * 100;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scene_DvLyonPromo The scene class for showing the DvLyon Games splash screen. | function Scene_DvLyonPromo() {
this.initialize.apply(this, arguments);
} | [
"function show(splash) {\n var extendedSplashImage = document.getElementById(\"extendedSplashImage\");\n\n // Position the extended splash screen image in the same location as the system splash screen image.\n extendedSplashImage.style.top = splash.imageLocation.y + \"px\";\n extendedSplashImage.style.left = splash.imageLocation.x + \"px\";\n extendedSplashImage.style.height = splash.imageLocation.height + \"px\";\n extendedSplashImage.style.width = splash.imageLocation.width + \"px\";\n\n // Position the extended splash screen's progress ring. Note: In this sample, the progress ring is not used.\n ////\n // var extendedSplashProgress = document.getElementById(\"extendedSplashProgress\");\n // extendedSplashProgress.style.marginTop = splash.imageLocation.y + splash.imageLocation.height + 32 + \"px\";\n ////\n\n // Once the extended splash screen is setup, apply the CSS style that will make the extended splash screen visible.\n var extendedSplashScreen = document.getElementById(\"extendedSplashScreen\");\n WinJS.Utilities.removeClass(extendedSplashScreen, \"hidden\");\n }",
"function init() {\n \"use strict\";\n \n var game = new Phaser.Game(384, 640, Phaser.AUTO);\n game.state.add('splashscreen', splashScreen);\n game.state.add('screen1', screen1);\n game.state.add('detailscreen1', detailScreen1);\n game.state.add('detailscreen2', detailScreen2);\n game.state.add('detailscreen3', detailScreen3);\n\n document.addEventListener('deviceready', onDeviceReady.bind(this), false);\n\n function onDeviceReady() { \n game.state.start('splashscreen');\n };\n\n \n}",
"splashLink() {\n\t\t\treturn 'https://www.adidas.com/' + this.config.locale.id.toLowerCase() + '/apps/yeezy/';\n\t\t}",
"function showGameScene() {\n gameStartScene.visible = false;\n clearDownCurrentBallons();\n gameScene.visible = true;\n\n createNewEquation();\n }",
"function drawSplash() {\n image(splash, 0, 0, imgSize, imgSize*5/9);\n\n}",
"function QuestBoard_Scene () {\n this.initialize.apply (this, arguments);\n }",
"function initUIElements() {\n document.getElementById('splash_image').src = SPLASH_SCREEN_SRC;\n document.getElementById('logo_image').src = LOGO_IMAGE_SRC;\n\n promoImageElement = document.getElementById('promo_image');\n titleElement = document.getElementById('loading_title');\n descriptionElement = document.getElementById('loading_description');\n\n splashScreen = document.querySelector(\"#splash_screen\");\n loadingScreen = document.querySelector(\"#loading_screen\");\n playerScreen = document.querySelector(\"#player\");\n errorScreen = document.querySelector(\"#error_screen\");\n screens = [ splashScreen, loadingScreen, playerScreen, errorScreen ];\n screenController = new _ScreenController(screens);\n }",
"hideSplashScreen()\n {\n this.changeView(\"appMainViews\", \"app-view-app\")\n }",
"function enterPage(){\n const mainPage = document.getElementById(\"mainPage\");\n mainPage.classList.remove(\"disappear\")\n const splashPage = document.getElementById(\"splashPage\");\n splashPage.classList.add(\"disappear\");\n splashPage.removeAttribute(\"id\");\n\n}",
"constructor() {\n super('TitleScene');\n }",
"shop() {\n // this sets the current scene to \"shop\"\n this.current = \"shop\";\n \n // this draws the floor\n background(148, 82, 52);\n \n //this draws the shelves\n for (let i = 0; i < 4; i++) {\n this.vShelf(50 + this.pxl * 3 * i, 400);\n }\n \n for (let i = 0; i < 2; i++) {\n this.hShelf(25 + this.pxl * 4 * i, 0);\n }\n \n // this draws the welcome mat\n this.mat(2, height/2 - this.pxl);\n \n // this draws a counter\n stroke(191, 179, 157);\n strokeWeight(4);\n for (let i = 0; i < 4; i++) {\n fill(204, 191, 169);\n rect(400 + this.pxl * i, 125, this.pxl, this.pxl);\n }\n \n // this makes Janine\n janine.makeRight();\n }",
"function startIntro(){\n\tvar intro = introJs();\n\t\tintro.setOptions({\n\t\t\tsteps: [\n\t\t\t\t{\n\t\t\t\t\tintro: \"Welcome! This webpage will help you explore unemployment data in different areas of Münster.\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#settingsBox',\n\t\t\t\t\tintro: \"Use this sidebar to customize the data that is displayed on the map.\",\n\t\t\t\t\tposition: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#yearSection',\n\t\t\t\t\tintro: \"You can move this slider to get data from 2010 to 2014.\",\n\t\t\t\t\tposition: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#criteriaSection',\n\t\t\t\t\tintro: \"Choose a criterion to select a specific group of unemployed.\",\n\t\t\t\t\tposition: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#boundarySection',\n\t\t\t\t\tintro: \"You can also switch to districts to get finer granularity.\",\n\t\t\t\t\tposition: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#legendBox',\n\t\t\t\t\tintro: \"This legend will tell how many unemployed are represented by each color.\",\n\t\t\t\t\tposition: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\telement: '#map',\n\t\t\t\t\tintro: \"Check the map to view your selected data! You can also click on all boundaries. A popup will show you a timeline to compare data of recent years and links to additional information.\",\n\t\t\t\t\tposition: 'left'\n\t\t\t\t}\n\t\t\t]\n\t\t});\n\n\t\tintro.start();\n}",
"function Slide() {\nreturn(\n<ParallaxProvider>\n<Container className=\"top\">\n<h1>Manzanillo Beach Costa Rica</h1> \n<ParallaxBanner\nclassName=\"cr-beach\"\nlayers ={[\n {\n image: crBeach,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner> \n<h1>Arches National Park</h1>\n<ParallaxBanner\nclassName=\"arches-road\"\nlayers ={[\n {\n image: archesRoad,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1> Crested Butte, Colorado</h1>\n<ParallaxBanner\nclassName=\"crested-butte\"\nlayers ={[\n {\n image: crestedButte,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1>Huntington Beach</h1>\n<ParallaxBanner\nclassName=\"ca-beach\"\nlayers ={[\n {\n image: caBeach,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1>Moab, Utah</h1>\n<ParallaxBanner\nclassName=\"moab-road\"\nlayers ={[\n {\n image: moabRoad,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1>Monarch Pass Colorado</h1>\n<ParallaxBanner\nclassName=\"monarch-pass\"\nlayers ={[\n {\n image: monarchPass,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1>Bozeman, Montana</h1>\n<ParallaxBanner\nclassName=\"montana-road\"\nlayers ={[\n {\n image: montanaRoad,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n<h1>Mystic Island</h1>\n<ParallaxBanner\nclassName=\"mystic-island\"\nlayers ={[\n {\n image: mysticIsland,\n amount: 0.4,\n }\n]}\n> \n</ParallaxBanner>\n </Container>\n</ParallaxProvider>\n\n);\n\n}",
"create () {\n this.game.switchScene(this.game.postSetupScene);\n }",
"function loadingScreen() {\r\n textAlign(CENTER);\r\n textSize(40);\r\n image(player, width/4, width/4, width/2, width/2);\r\n text(\"LOADING. . .\", width/2, width/2);\r\n}",
"function giveInstructions()\n{\n startScene.visible = false;\n instructionScene.visible = true;\n gameScene.visible = false;\n pauseMenu.visible = false;\n gameOverScene.visible = false;\n screenButtonSound.play();\n}",
"function playLevel1() {\n ga('send', 'event', 'Jeu', 'Niveau 1', 'Début');\n //console.log('Jeu - Niveau 1 - Début');\n\n /**\n * Prepare information if the board is resolved.\n */\n informationBoardIsResolved = {\n category: \"Jeu\",\n action: \"Niveau 1\",\n timeLabel: \"playMinSceneActiveTime\",\n }\n\n // Activate the timer.\n $(document).trigger('startTime', currentGame.scenes.play_min_scene.scene);\n\n $(\"body\").closeAllDialogs(function() {\n\n // Active input for play_min_scene\n currentGame.iaPlay = true;\n currentGame.scenes.play_min_scene.scene.setPaused(false);\n currentGame.playMinSceneActive = true;\n });\n }",
"async hideSplashScreen() {\n\t\ttry {\n\t\t\tif (!this.splashScreenWindow) return;\n\t\t\tthis.splashScreenWindow.close();\n\t\t\tthis.splashScreenWindow = null;\n\t\t} catch (err) {\n\t\t\tlogger.error(`Unable to hide splash screen ${err.message}`);\n\t\t\tconst error = new Error('Error hiding splash screen.');\n\t\t\tthrow (error);\n\t\t}\n\t}",
"function showTitleScene(errorMsg)\n{\n\t// Show title scene\n\t// (see src/scenes/title.js)\n cc.director.runScene(new TitleScene(username, errorMsg));\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
chain() connects an array of `soundNodes` into a chain. If there are three nodes in `soundNodes`, the output of the first will be the input to the second, and the output of the second will be the input to the third. | function chain(soundNodes) {
for (var i = 0; i < soundNodes.length - 1; i++) {
soundNodes[i].connect(soundNodes[i + 1]);
}
} | [
"connectEffectLeft(...nodes) {\n this._split.connect(nodes[0], 0, 0);\n\n (0, _ToneAudioNode.connectSeries)(...nodes);\n (0, _ToneAudioNode.connect)(nodes[nodes.length - 1], this._merge, 0, 0);\n }",
"connectEffectRight(...nodes) {\n this._split.connect(nodes[0], 1, 0);\n\n (0, _ToneAudioNode.connectSeries)(...nodes);\n (0, _ToneAudioNode.connect)(nodes[nodes.length - 1], this._merge, 0, 1);\n }",
"function LineMixer(ins) {\n\t\t\tthis.inputs = [];\n\n\t\t\tfor (var i = 0; i < ins; i++) {\n\t\t\t\tthis.inputs[i] = audioContext.createGainNode();\n\t\t\t}\n\t\t}",
"function WeightedSound(loop,sounds,weights){var _this=this;/** When true a Sound will be selected and played when the current playing Sound completes. */this.loop=false;this._coneInnerAngle=360;this._coneOuterAngle=360;this._volume=1;/** A Sound is currently playing. */this.isPlaying=false;/** A Sound is currently paused. */this.isPaused=false;this._sounds=[];this._weights=[];if(sounds.length!==weights.length){throw new Error('Sounds length does not equal weights length');}this.loop=loop;this._weights=weights;// Normalize the weights\nvar weightSum=0;for(var _i=0,weights_1=weights;_i<weights_1.length;_i++){var weight=weights_1[_i];weightSum+=weight;}var invWeightSum=weightSum>0?1/weightSum:0;for(var i=0;i<this._weights.length;i++){this._weights[i]*=invWeightSum;}this._sounds=sounds;for(var _a=0,_b=this._sounds;_a<_b.length;_a++){var sound=_b[_a];sound.onEndedObservable.add(function(){_this._onended();});}}",
"syncChains() {\n this.sockets.forEach(socket => this.sendChain(socket));\n }",
"function SoundBites(audioParams, templates) {\n\n\t\tthis.templates = templates;\n\n\t\tthis.original = this.templates.map(function (temp) {\n\t\t\ttemp.type = 'dockedInSoundSelector';\n\t\t\ttemp.audioParams = audioParams;\n\t\t\treturn new SoundBite(temp);\n\t\t});\n\n\t\tthis.inuse = [];\n\t\tthis.all = [];\n\t\tthis.getAllBites();\n\t}",
"function createGuitarSoundArray() {\n var sound_srcs = [\n [ // String 1\n \"sound_files/guitar/1_0_E3.mp3\", // String 1, Fret 0\n \"sound_files/guitar/1_1_F3.mp3\", // String 1, Fret 1\n \"sound_files/guitar/1_2_Fs3.mp3\", // ...\n \"sound_files/guitar/1_3_G3.mp3\",\n \"sound_files/guitar/1_4_Gs3.mp3\"\n ],\n [ // String 2\n \"sound_files/guitar/2_0_A3.mp3\",\n \"sound_files/guitar/2_1_As3.mp3\",\n \"sound_files/guitar/2_2_B3.mp3\",\n \"sound_files/guitar/2_3_C4.mp3\",\n \"sound_files/guitar/2_4_Cs4.mp3\"\n ],\n [ // String 3\n \"sound_files/guitar/3_0_D4.mp3\",\n \"sound_files/guitar/3_1_Ds4.mp3\",\n \"sound_files/guitar/3_2_E4.mp3\",\n \"sound_files/guitar/3_3_F4.mp3\",\n \"sound_files/guitar/3_4_Fs4.mp3\"\n ],\n [ // String 4\n \"sound_files/guitar/4_0_G4.mp3\",\n \"sound_files/guitar/4_1_Gs4.mp3\",\n \"sound_files/guitar/4_2_A4.mp3\",\n \"sound_files/guitar/4_3_As4.mp3\",\n \"sound_files/guitar/4_4_B4.mp3\"\n ],\n [ // String 5\n \"sound_files/guitar/5_0_B4.mp3\",\n \"sound_files/guitar/5_1_C5.mp3\",\n \"sound_files/guitar/5_2_Cs5.mp3\",\n \"sound_files/guitar/5_3_D5.mp3\",\n \"sound_files/guitar/5_4_Ds5.mp3\"\n ],\n [ // String 6\n \"sound_files/guitar/6_0_E5.mp3\",\n \"sound_files/guitar/6_1_F5.mp3\",\n \"sound_files/guitar/6_2_Fs5.mp3\", // ...\n \"sound_files/guitar/6_3_G5.mp3\", // String 6, Fret 3\n \"sound_files/guitar/6_4_Gs5.mp3\" // String 6, Fret 4\n ]\n ];\n\n return sound_srcs;\n}",
"function playNotes() {\r\n\tnotes[firstNote].sound.play();\r\n\tconsole.log(notes[firstNote].sound);\r\n\tsetTimeout(function() {\r\n notes[secondNote].sound.play();\r\n console.log(notes[secondNote].sound); \r\n\t}, 700);\r\n}",
"function sounds(soundlist, between, onComplete) {\r\n\t\tvar soundIdx = 0;\r\n\t\tif(!between){\r\n\t\t\tbetween = 0;\r\n\t\t}\r\n\t\twaitSoundInit(function() {\r\n\t\t\tvar playNext = function () {\r\n\t\t\t\tif (soundIdx < soundlist.length) {\r\n\t\t\t\t\tvar soundpath = soundlist[soundIdx];\r\n\t\t\t\t\tvar sound;\r\n\t\t\t\t\tif (soundpath in _preloadedSounds) {\r\n\t\t\t\t\t\tsound = _preloadedSounds[soundpath];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsound = soundManager.createSound(soundpath, soundpath);\r\n\t\t\t\t\t\tsound.load();\r\n\t\t\t\t\t\t_preloadedSounds[soundpath] = sound;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsound.play({\r\n\t\t\t\t\t\tonfinish: function () {\r\n\t\t\t\t\t\t\twindow.setTimeout(function () {\r\n\t\t\t\t\t\t\t\twindow.setTimeout(playNext, between);\r\n\t\t\t\t\t\t\t }, 50); //add padding of 50ms; onfinish completes early\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t\tsoundIdx += 1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (typeof(onComplete) == 'function') {\r\n\t\t\t\t\t\tonComplete();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tplayNext();\r\n\t\t});\r\n\t}",
"static fromArray (as) {\n return new Signal(emit => {\n as.map(apply(emit.next))\n emit.complete()\n })\n }",
"zip (...ss) {\n // Allow the signals to be given as an array.\n if (ss.length === 1 && Array.isArray(ss[0])) {\n ss = ss[0]\n }\n\n return zip([this].concat(ss))\n }",
"function getNodesChain(node) {\n var chain = [];\n var currentNode = node;\n while (currentNode && currentNode.type === \"treeviewnode\") {\n currentNodePath = {\n href: currentNode.bindingContext.href(),\n text: currentNode.bindingContext.name\n };\n \n chain = [currentNodePath].concat(chain);\n currentNode = currentNode.parent;\n }\n return chain;\n }",
"function Instrument (options) {\n\tvar i, waveForm, array, mod;\n\toptions = options || {};\n\n\tif (options.context) {\n\t\tthis.context = options.context;\n\t} else if (options.destination) {\n\t\tthis.context = options.destination.context;\n\t} else {\n\t\tthis.context = new AudioContext();\n\t}\n\tthis.mainGain = this.context.createGain();\n\tthis.mainGain.connect(options.destination || this.context.destination);\n\tthis.nextTime = 0;\n\n\twaveForm = options.waveForm;\n\tif (Array.isArray(waveForm)) {\n\t\twaveForm = {r: waveForm};\n\t}\n\tif (waveForm && (Array.isArray(waveForm.r) || Array.isArray(waveForm.i))) {\n\t\tif (waveForm.r) {\n\t\t\tarray = waveForm.r.slice();\n\t\t\tarray.unshift(0);\n\t\t\twaveForm.r = new Float32Array(array);\n\t\t}\n\t\tif (waveForm.i) {\n\t\t\tarray = waveForm.i.slice();\n\t\t\tarray.unshift(0);\n\t\t\twaveForm.i = new Float32Array(array);\n\t\t}\n\t\tif (!waveForm.r) {\n\t\t\twaveForm.r = new Float32Array(waveForm.i.length);\n\t\t}\n\t\tif (!waveForm.i) {\n\t\t\twaveForm.i = new Float32Array(waveForm.r.length);\n\t\t}\n\t\twaveForm = this.context.createPeriodicWave(waveForm.r, waveForm.i);\n\t}\n\n\tmod = this.context.createOscillator();\n\tmod.frequency.value = 5;\n\tmod.start();\n\tthis.mod = this.context.createGain();\n\tthis.mod.gain.value = 5;\n\tmod.connect(this.mod);\n\n\tthis.nodes = [];\n\tfor (i = 0; i < (options.c || 2); i++) {\n\t\tthis.nodes.push(this.createNode(waveForm, 5));\n\t}\n\tthis.currentNode = 0;\n\n\tthis.baseVolume = options.baseVolume || 1;\n\tthis.duration = options.duration || 0.5;\n\tthis.envelope = options.envelope || [0.3, 0.6, 1.2];\n}",
"function loadAllTones(numSwitches) {\n\tfor (var i = 0; i < numSwitches; i++) {\n\t\tlowTones[i] = new Audio(tonesDir + lowTones[i] + tonesExt);\n\t\thighTones[i] = new Audio(tonesDir + highTones[i] + tonesExt);\n\t}\n}",
"function convertReferenceChainToString(chain) {\n return chain.join(' → ');\n }",
"static createArray(curves) {\n const result = new Loop();\n for (const curve of curves) {\n result.children.push(curve);\n }\n return result;\n }",
"function HTMLto3DConverter() {\n\n\tEventEmitter.call(this);\n\n\tvar self = this;\n\n\tthis.process = function(elements, options, audioContext) {\n\t\t\n\t\tvar slideObjects = [];\n\t\tvar index = 0;\n\t\tvar delay = 10;\n\t\tvar slideConverter = new HTMLto3DSlideConverter();\n\t\tslideConverter.on('processing_end', finishSlide);\n\n\t\tconsole.log('Converting', elements.length + ' HTML slides to 3D');\n\n\t\tself.emit('processing_start', {\n\t\t\tnumElements: elements.length\n\t\t});\n\n\t\tfunction processNextSlide() {\n\t\t\tvar el = elements[index];\n\n\t\t\tself.emit('slide_processing_start', {\n\t\t\t\tindex: index,\n\t\t\t\telement: el\n\t\t\t});\n\n\t\t\tslideConverter.process(el, options, audioContext);\n\t\t}\n\n\t\tfunction finishSlide(ev) {\n\t\t\n\t\t\tconsole.log('slide processor finished', ev, index);\n\t\t\t\n\t\t\tself.emit('slide_processing_end', {\n\t\t\t\tindex: index\n\t\t\t});\n\n\t\t\tslideObjects.push(ev.slide);\n\n\t\t\tindex++;\n\t\t\t\n\t\t\tif(index < elements.length) {\n\t\t\t\tsetTimeout(processNextSlide, delay);\n\t\t\t} else {\n\t\t\t\tself.emit('processing_end', {\n\t\t\t\t\tslides: slideObjects\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tprocessNextSlide();\n\n\t};\n\n}",
"function loadSounds() {\n confirmSound = new Howl({\n src: ['assets/sounds/confirm.ogg'],\n volume: 0.8\n });\n\n selectSound = new Howl({\n src: ['assets/sounds/select.ogg'],\n volume: 0.8\n });\n thudSound = new Howl({\n src: ['assets/sounds/thud.ogg'],\n volume: 0.8\n });\n moveSound = new Howl({\n src: ['assets/sounds/move.ogg'],\n volume: 0.6\n });\n turnSound = new Howl({\n src: ['assets/sounds/turn.ogg'],\n volume: 0.8\n });\n\n music1 = new Howl({\n src: ['assets/sounds/nesmusic1.mp3','assets/sounds/nesmusic1.ogg'],\n// buffer: true,\n loop:true,\n loaded: false,\n onplay: function() {\n },\n onload: function() {\n musicSelectionField.labels[0].alpha = 1;\n this.loaded = true;\n },\n onloaderror: function() {\n musicSelectionField.labels[0].alpha = 0.1;\n }\n\n });\n\n music2 = new Howl({\n src: ['assets/sounds/nesmusic2.mp3','assets/sounds/nesmusic2.ogg'],\n volume: 0.6,\n// buffer: true,\n loop:true,\n loaded: false,\n onplay: function() {\n },\n onload: function() {\n musicSelectionField.labels[1].alpha = 1;\n this.loaded = true;\n },\n onloaderror: function() {\n musicSelectionField.labels[1].alpha = 0.1;\n }\n\n\n });\n\n music3 = new Howl({\n src: ['assets/sounds/nesmusic3.mp3','assets/sounds/nesmusic3.ogg'],\n volume: 0.5,\n// buffer: true,\n loop: true,\n loaded: false,\n onplay: function() {\n },\n onload: function() {\n musicSelectionField.labels[2].alpha = 1;\n this.loaded = true;\n },\n onloaderror: function() {\n musicSelectionField.labels[2].alpha = 0.1;\n }\n\n });\n// music1Fast = music2Fast = music3Fast = music4Fast = music5Fast = music6Fast = undefined;\n // music1Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n // music2Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n // music3Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n // music4Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n // music5Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n // music6Fast = new Howl({\n // src: ['assets/sounds/g.ogg'],\n // volume: 0.8\n // });\n deathSound = new Howl({\n src: ['assets/sounds/death.ogg'],\n volume: 0.8\n });\n levelUpSound = new Howl({\n src: ['assets/sounds/levelup.ogg'],\n volume: 0.8\n });\n\n lineSound = new Howl({\n src: ['assets/sounds/line.ogg'],\n volume: 0.8\n });\n fourLineSound = new Howl({\n src: ['assets/sounds/fourline.ogg'],\n volume: 0.8\n });\n\n\n musicSelections = [\n {normal:music1,fast:music1},\n {normal:music2,fast:music2},\n {normal:music3,fast:music3},\n ]\n\n\n}",
"function play(notes, duration, gain) {\n var osc = context.createOscillator();\n\n // Change oscillator frequency to change after a specified duration\n osc.frequency.value = notes[0];\n for (var i = 1; i < notes.length; i++) {\n osc.frequency.setValueAtTime(\n notes[i],\n context.currentTime + (i * duration)\n );\n }\n\n osc.start();\n\n // Create gain node to connect the oscillator to. This is used to ramp\n // down volume and avoid the clicking noise at the end of each note\n var ctxGain = context.createGain();\n ctxGain.gain.value = gain;\n ctxGain.connect(context.destination);\n osc.connect(ctxGain);\n\n // Calculate total time (# of notes * duration) and ensure the sequence\n // is stopped properly\n var totalTime = context.currentTime + (notes.length * duration);\n ctxGain.gain.setTargetAtTime(0, totalTime, 0.015);\n osc.stop(totalTime + 0.015);\n}",
"function addSound(params) {\n soundInstance = new SoundInstance();\n soundInstance.initialize(params);\n sounds.push(soundInstance);\n soundsLookup[params.alias] = sounds.length - 1;\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends calls to training api for multiple users | function trainAllUsernames(users) {
//Each call the training api creates a new promise which is appended to this array of promises. Only once all the training promises are resolved is the Markov chain generated
var trainingPromises = [];
for (user of users) {
var trainUrl = "/api/tweets/train/" + user;
console.log("Sent call to training endpoint at " + trainUrl);
if (user) {
$('#error').slideUp();
trainingPromises.push(makeTrainingPromise(trainUrl));
} else {
$('#error').slideDown();
}
}
return trainingPromises;
} | [
"function trainFace(username_email, cb) {\n var trained = false;\n console.log('training started>>>>>');\n // lighting\n var a = 180;\n var a2 = 0;\n var l = setInterval(function() {\n matrix.led([{\n arc: Math.round(180 * Math.sin(a)),\n color: 'blue',\n start: a2\n }, {\n arc: -Math.round(180 * Math.sin(a)),\n color: 'blue',\n start: a2 + 180\n }]).render();\n a = (a < 0) ? 180 : a - 0.1;\n }, 25);\n function stopLights() {\n clearInterval(l);\n }\n\n console.log(username_email);\n // starts training \n matrix.service('recognition').train(''+username_email).then(function(data) {\n stopLights();\n //continue if training is not finished\n if (!trained && data.hasOwnProperty('count')) {\n // means it's partially done\n matrix.led({\n arc: Math.round(360 * (data.count / data.target)),\n color: 'blue',\n start: 0\n }).render();\n }\n //training is finished\n else {\n trained = true;\n matrix.led('green').render();\n console.log('trained!', data);\n matrix.service('recognition').stop();\n setTimeout(function() {\n matrix.led('black').render();\n }, 2000);\n cb();\n //io.emit('TrainSuccess', true); //SEND DATA TO CLIENT\n return true;\n }\n });\n}",
"_sendBatch() {\n if (_.isEmpty(this.events)) return;\n\n const events = Object.assign([], this.events);\n const body = JSON.stringify(events);\n const options = {\n url: `${this.endpoint}/${this.dataSet}`,\n headers: {\n 'X-Honeycomb-Team': this.writeKey,\n },\n body,\n };\n request.post(options, (err, response) => {\n if (err) {\n console.log(err);\n }\n\n if (response) {\n console.log(`Received status ${response.statusCode}`);\n }\n });\n }",
"function getUsers() {\n //get the data from postFactory using API call\n userService.getUsers()\n .then(\n function (data) {\n console.log('getting users data to be used in postController', data);\n postCtrl.postUsers = data;return data;\n },\n function (response) { postCtrl.status = 'unable to load!'; });\n }",
"function trainModel() {\n app.models.train(\"pets\").then(\n (response) => {\n console.log(response);\n },\n (error) => {\n console.error(error);\n } \n );\n}",
"async getPiscineUsers(token) {\n let output = [];\n const response = await request.get({\n url: `https://api.intra.42.fr/v2/cursus/piscine-c/cursus_users?filter[campus_id]=${config.campus_id}&filter[active]=true&filter[end_at]=${config.end_at}&filter[begin_at]=${config.begin_at}&page[size]=100`,\n auth: {\n bearer: token\n },\n resolveWithFullResponse: true\n });\n output = output.concat(JSON.parse(response.body));\n const pages = parseInt(response.headers[\"x-total\"]);\n const amountpages = (Math.floor(pages / 100) + 1);\n await sleep(1000);\n for (let i = 1; i < amountpages; i++) {\n let res = await request.get({\n url: `https://api.intra.42.fr/v2/cursus/piscine-c/cursus_users?filter[campus_id]=${config.campus_id}&filter[active]=true&filter[end_at]=${config.end_at}&filter[begin_at]=${config.begin_at}&page[size]=100&page[number]=${i + 1}`,\n auth: {\n bearer: token\n }\n });\n await sleep(1000);\n output = output.concat(JSON.parse(res));\n }\n this.users = output;\n return output;\n }",
"function serveUsersQueue() {\n\tif (network.usersQueue.length > 0) {\n\t\tvar batch = []\n\t\tfor (var i=0; i < 100 && network.usersQueue.length > 0; i++) {\n\t\t\tbatch.push(network.usersQueue.shift());\n\t\t}\n\t\tauthenticator.cb.__call('users_lookup', {'user_id':batch.join(',')},\n\t\tfunction (reply) {\n\t\t\tconsole.log('retrieved user objects:');\n\t\t\tconsole.log(reply);\n\t\t\tfor (var i=0; i < reply.length; i++) {\n\t\t\t\t// fill the data recieved into the user objects\n\t\t\t\tnetwork.users[reply[i].id].setData(reply[i]);\n\t\t\t\t// update the depth flag, incase it increased unexpectedly\n\t\t\t\tnetwork.users[reply[i].id].setDepth(network.usersAwaiting[reply[i].id]);\n\t\t\t\t// remove user from awaiting\n\t\t\t\tdelete network.usersAwaiting[reply[i].id];\n\t\t\t}\n\t\t});\n\t}\n}",
"function uploadUsers(err, users) {\n if (err) console.log(`Unable to read file. Please check your file path and try again`);\n else {\n axios.all(users.map(buildQueries))\n // Could use some work....\n .then(axios.spread( (stuff, stuff2)=> {\n console.log(stuff, stuff2);\n })).catch(err => console.log(err)); \n }\n}",
"function getUsers(quizes) {\n console.log('getting users');\n for (var i in quizes) {\n _getUserForQuiz(quizes[i]);\n }\n }",
"async index(req, res) {\n // Get all oportunities\n const { data } = await pipedrive_api.get();\n if (data.data) {\n data.data.forEach(async client => {\n // Find WON oportunities\n if (client.status == 'won') {\n const {\n title,\n value,\n person_id: { name },\n creator_user_id: { id },\n } = client;\n\n var nome_cliente = name;\n //var id_venda = Math.ceil(Math.random() * (1000 - 1) + 1);\n var id_venda = id + value;\n var descricao_produto = title;\n var valor_produto = value;\n var valor_parcela = value;\n\n // Create a new Order request in Bling\n await OrderController.store(\n nome_cliente,\n id_venda,\n descricao_produto,\n valor_produto,\n valor_parcela\n );\n }\n });\n }\n return res.json({ saved: true });\n }",
"sendUserlist() {\n this.print('Current Users');\n this.print(JSON.stringify(this.users, null, 2));\n this.namespace.emit('username list', this.getUsernames());\n }",
"async getVeteranFriendRequests() {\n const id = this.state.sessionUser.id;\n const route = APIRoutes.veteranFriendRequestsPath(id);\n try {\n let { json, headers } = await BaseRequester.get(route);\n this.setState({ friendRequests: json });\n } catch (error) {\n console.error(error);\n }\n }",
"function fillVotingContainer(users) {\n for (const key in users) {\n if (users.hasOwnProperty(key)) {\n const userName = users[key];\n consoleLog(\"iterating through users... current user: \" + userName);\n addVoter(userName);\n }\n }\n}",
"function jobOfferGetByStudent(){\n\n var send = {StudentUserId: vm.userData.UserId}\n console.log(send)\n JobService.JobOfferGetByStudent(send)\n .then(function(response){\n\n vm.userData.FinishedJobOffersList = response.data.FinishedJobOffers;\n vm.userData.ActiveJobOffersList = response.data.ActiveJobOffers;\n console.log(response)\n }, function(response){\n\n FlashService.Error(\"Error al traer los trabajos del estudiante\")\n\n });\n\n }",
"async generateSampleUsers() {\n // Create an arbitrary number of user details and add them to an array\n for (let newUsersNumber = 0; newUsersNumber < this.totalNumberOfUsers; newUsersNumber++) {\n this.allUsers.push(\n {\n username: faker.name.firstName(),\n company: faker.company.companyName(),\n phone: faker.phone.phoneNumber(),\n email: faker.internet.email(),\n }\n );\n }\n const usersListContent = JSON.stringify(this.allUsers);\n await fs.writeFile(`${__dirname}/users.json`, usersListContent, 'utf8', function (err) {\n if (err) {\n console.log('An error occured while writing users to File.');\n return console.log(err);\n }\n });\n\n }",
"function servePassengers(passengers)\n{\n for (var i = 0; i<passengers.length; i++)\n {\n serveCustomer(passengers[i])\n }\n}",
"function countAllUsers(req, res) {\n var handlerInfo = {\n \"apiModule\" : \"analytics\",\n \"apiHandler\": \"countAllUsers\"\n };\n countAllUsersHelper(handlerInfo, function(err, result) {\n if(err) {\n return res.send({\n \"log\": err,\n \"flag\": constants.responseFlags.ACTION_FAILED\n });\n }\n res.send({\n \"log\": \"Successfully fetched the requests\",\n \"flag\": constants.responseFlags.ACTION_COMPLETE,\n \"data\": result\n\n });\n\n });\n\n }",
"function batch(requests) {\n // if the batch contains only 1 request or batching is not enabled,\n // send the requests separately\n if (requests.length == 1 || !batcher || !maxBatchSize)\n return Task.wait(requests.map(ajax));\n return endpoint.batch(batcher, requests).then(function (results) {\n for (var _i = 0; _i < results.length; _i++) {\n var r = results[_i];\n Task.wait(r).then(repository.put);\n }\n return results;\n });\n }",
"function setOnlineUser(user) {\n onlineUsers.push(user)\n console.log(`[ ${user.username.toUpperCase()}: IS NOW ONLINE ]`)\n console.log('[ONLINE USERS:]')\n \n function allOnlineUsers(onlineUsers) {\n for (user of onlineUsers) {\n console.log(`* ${user.username}`)\n }\n }\n \n allOnlineUsers(onlineUsers)\n \n }",
"function sendGroupJoinRequests() {\n vm.usersToInvite.forEach(user => {\n massRequest.push({ group_id: vm.group.id, receiver_id: user.id});\n });\n const massRequestObj = {\n mass_requests: massRequest\n };\n Request\n .sendMassRequest(massRequestObj)\n .$promise\n .then(data => {\n $uibModalInstance.close('Requests sent');\n })\n .catch(err => {\n console.log('Something went wrong with the mass request');\n console.log('Error:', err);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Modify the gulp config after construction but before running tasks | cb(config) {
//you have access to the gulp config here for
//any extra customization after merging => don't forget to return config
return merge(config, serverConfig);
} | [
"_applyCustomConfig() {\n\n this._backupSPFXConfig();\n\n // Copy custom gulp file to\n this.fs.copy(\n this.templatePath('gulpfile.js'),\n this.destinationPath('gulpfile.js')\n );\n\n // Add configuration for static assets.\n this.fs.copy(\n this.templatePath('config/copy-static-assets.json'),\n this.destinationPath('config/copy-static-assets.json')\n );\n\n }",
"_backupSPFXConfig() {\n\n // backup default gulp file;\n // Fallback to NodeJS FS Object because otherwise in Yeoman context not possible\n fs.renameSync(\n this.destinationPath('gulpfile.js'),\n this.destinationPath('gulpfile.spfx.js')\n );\n\n }",
"configuring() {\n // creates .yo-rc config file\n this.config.save()\n }",
"static _createConfig() {\n console.log(\"Copying config file\");\n fs.copySync(\"config.dist.json\", \"config.json\");\n }",
"function init() {\n /**\n Project configuration.\n @toc 5.\n */\n grunt.initConfig({\n browserSync: {\n bsFiles: {\n src : [\n 'css/*.css',\n 'index.html',\n 'js/**/*.js'\n ]\n },\n options: {\n watchTask: true,\n port: 1337,\n server: {\n baseDir: \"./\",\n middleware: function (req, res, next) {\n res.setHeader('Access-Control-Allow-Origin', '*');\n next();\n }\n }\n }\n },\n sass: {\n options: {\n sourceMap: true\n },\n dist: {\n files: [{\n expand: true,\n cwd: 'sass/',\n src: ['*.scss'],\n dest: 'css/',\n ext: '.css'\n }],\n }\n },\n watch: {\n options: {\n livereload: true\n },\n sass: {\n files: ['sass/**/*.{scss,sass,js,html}'],\n tasks: ['sass:dist'],\n },\n html: {\n files: ['index.html'],\n },\n js: {\n files: ['js/**/*.js'],\n },\n },\n });\n\n\n /**\n register/define grunt tasks\n @toc 6.\n */\n // Default task(s).\n grunt.registerTask('default', ['browserSync', 'watch']);\n\n }",
"function applyConfig() {\n if (config !== undefined) {\n for (var key in config) {\n plugin[key] = config[key];\n }\n }\n }",
"function run() {\n\n // check if we need to watch\n if(GLOBAL.isWatching) {\n /*\n * watch-less task\n */\n gulp.task('watch-less', function(cb) {\n sequence('less', 'assets', cb);\n });\n\n /*\n * watch-templates task\n */\n gulp.task('watch-templates', function(cb) {\n sequence(['pages', 'markdown', 'db'], 'publish', cb);\n });\n\n gulp.task('watch', function() {\n livereload.listen(35729);\n gulp.watch('/assets/**/*.less', ['watch-less']);\n gulp.watch('/templates/**/*.html', ['watch-templates']);\n gulp.watch('/public/**/*').on('change', livereload.changed);\n });\n }\n\n /*\n * Task sequencing / grouping definition\n *\n * build task\n *\n * 1) preRender stage in parallel\n * 2) render stage in parallel (if anything to render)\n * 3) pipe stage in parallel\n * 4) watch (if watching)\n */\n gulp.task('build', function(cb) {\n var order = []\n , preRender = ['clean','less','sass']\n , render = []\n , pipe = ['publish'];\n\n if(_.contains(availableTasks,'webpack')) preRender.push('webpack');\n if(_.contains(availableTasks,'pages')) render.push('pages');\n if(_.contains(availableTasks,'markdown')) render.push('markdown');\n if(_.contains(availableTasks,'db')) render.push('db');\n\n order.push(preRender);\n if(render.length) order.push(render);\n pipe.push('assets');\n order.push(pipe);\n if(GLOBAL.isWatching) order.push('watch');\n\n order.push(cb);\n\n sequence.apply(sequence, order);\n });\n \n // in lieu of calling gulp from the command line...\n gulp.start('build', function(err) {\n if(!runCount) {\n console.log('- done tasks', err ? (err.stack || err) : '');\n if(err && err.err) console.log(err.err.stack);\n if(GLOBAL.isWatching) console.log(' ... and watching for changes');\n else models.closeDbs();\n var smap = JSON.stringify(sitemap.get(), null, ' ');\n fs.writeFile(cwd + '/sitemapping.json', smap, function(err) {\n if(err) console.warn('! Error writing sitemap: ', err);\n });\n }\n runCount++;\n });\n \n}",
"prepareWebpackConfig() {\r\n this.clientConfig = createClientConfig(this.context).toConfig()\r\n this.serverConfig = createServerConfig(this.context).toConfig()\r\n\r\n const userConfig = this.context.siteConfig.configureWebpack\r\n if (userConfig) {\r\n this.clientConfig = applyUserWebpackConfig(\r\n userConfig,\r\n this.clientConfig,\r\n false\r\n )\r\n this.serverConfig = applyUserWebpackConfig(\r\n userConfig,\r\n this.serverConfig,\r\n true\r\n )\r\n }\r\n }",
"configure() {\n\n console.log('My Trailpack is configured')\n this.sendgrid = sendGrid(this.app.config.sendgrid.apiKey)\n this.app.sendgrid = this\n return Promise.resolve()\n }",
"function initConfig (event) {\n let config = null;\n\n if (!fs.existsSync(configPath)) {\n const fd = fs.openSync(configPath, 'w');\n\n const initialConfig = {\n apiServer: '',\n operator: '',\n notificationsEnabled: true,\n };\n\n fs.writeSync(fd, JSON.stringify(initialConfig, null, ' '), 0, 'utf8');\n fs.closeSync(fd);\n }\n\n config = JSON.parse(fs.readFileSync(configPath).toString());\n event.sender.send('config', config);\n}",
"function setupDistBuild(cb) {\n context.dev = false;\n context.destPath = j('dist', context.assetPath);\n del.sync('dist');\n cb();\n}",
"function build(cb) {\n console.log('Gulp build script.')\n cb();\n}",
"_addExternals() {\n\n // \"handlebars\": \"./node_modules/handlebars/dist/handlebars.amd.min.js\"\n // reading JSON\n let config = this.fs.readJSON(this.destinationPath('config/config.json'));\n\n // Add Handlebars entry\n config.externals.handlebars = \"./node_modules/handlebars/dist/handlebars.amd.min.js\";\n\n // writing json\n fs.writeFileSync(\n this.destinationPath('config/config.json'),\n JSON.stringify(config, null, 2));\n\n\n }",
"function writeConfig () {\n self._repo.config.set(config, (err) => {\n if (err) return callback(err)\n\n addDefaultAssets()\n })\n }",
"function addConfig(prop, value) {\n prop = prop || '';\n value = value || {};\n return grunt.config.set(prop, value);\n }",
"function loadTasks(env, args, shouldDeploy, cb){\n var didLoad = config.load(args.file);\n var tasks = config.getTasks();\n if(!tasks) mess.warning(\"No tasks were found/specified\");\n if(!didLoad || !tasks){\n mess.yesOrNo('Would you like to deploy anyways?', rl, (yes) => {\n if(yes){\n return deployApplication(env, shouldDeploy);\n }else{\n endProcess();\n }\n })\n }else{\n return cb(tasks);\n }\n}",
"_initializeDeploy(config) {\n\n // Configure and instantiate S3\n this._initializeS3(this.s3Config, (error) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n // Get last character of build path\n let lastCharOfPath = this.buildPath.slice(-1);\n\n /**\n * If buildpath does not have a trailing slash, add it.\n */\n if (lastCharOfPath !== '/') {\n this.buildPath += '/';\n }\n\n // Grab the files, then go to the _uploadFiles method\n glob(this.options.pathGlob, {cwd: this.buildPath}, (error, files) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log('Deployer is now running.', 'SUCCESS');\n\n // Set the version variables for the files.\n this._setVersionVars((error, hash) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log(`Setting deployment to version: ${this.version}`);\n\n // Upload files to S3\n this._uploadFiles(files, (done, fileNum) => {\n\n if (done) {\n\n // Change cloudfront root object\n this._cloudfrontInvalidateEntryHtml((error) => {\n\n if (error) {\n this.log(error, 'ERROR');\n process.exit(0);\n }\n\n this.log(`Deployment finished successfully. ${fileNum} files uploaded.`, 'SUCCESS');\n\n // Check for slack notifs:\n this._configureSlack(config.options.slack, (success) => {\n\n if (success) {\n this.log('Slack has been notified.', 'SUCCESS');\n }\n });\n });\n }\n });\n });\n });\n });\n }",
"updateConfig(config) {\n\n if (!config) return;\n\n // Set sPath\n if (config.component) {\n this._config.component = config.component;\n this._config.sPath = SUtils.buildSPath({\n component: config.component\n });\n }\n\n // Make full path\n if (this._S.config.projectPath && this._config.sPath) {\n let parse = SUtils.parseSPath(this._config.sPath);\n this._config.fullPath = path.join(this._S.config.projectPath, parse.component);\n }\n }",
"updateConfig(application) {\n const updatedConfig = { };\n const configs = Array.prototype.slice.call(arguments, 1);\n\n return this.getConfig(application).then(existingConfig => {\n ld.assign.apply(this, [updatedConfig, existingConfig].concat(configs));\n return this.setConfig(application, updatedConfig);\n }).then(() => {\n return this.reloadApp(application);\n });\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
simple industry details card | async IndustryCard(context) {
const card = CardFactory.heroCard(
'Main Business Details',
'Find more about Industry Details.....',
['https://3er1viui9wo30pkxh1v2nh4w-wpengine.netdna-ssl.com/wp-content/uploads/prod/sites/43/2020/06/Fortude-AI4A-Sri-Lanka.jpg'],
[
{
type: ActionTypes.OpenUrl,
title: 'Fashion',
value: 'https://fortude.co/infor-fashion/'
},
{
type: ActionTypes.OpenUrl,
title: 'Food & Beverage',
value: 'https://fortude.co/food-beverage-erp-solutions/'
},
{
type: ActionTypes.OpenUrl,
title: 'Manufacturing & Distribution',
value: 'https://fortude.co/infor-manufacturing/'
},
{
type: ActionTypes.OpenUrl,
title: 'Healthcare',
value: 'https://fortude.co/healthcare/'
}
]
);
await context.sendActivity({ attachments: [card] });
} | [
"function internCard(internObj) {\n var name = internObj.getName();\n var id = internObj.getID();\n var email = internObj.getEmail();\n var school = internObj.getSchool();\n var role = internObj.getRole();\n\n var html = `<div class=\"card\">\n <h4 class=\"card-header\" id=\"name\">`+ name + `</h4>\n <h4 class=\"card-header\" id=\"name\">`+ `<i class=\"fas fa-user-graduate\"></i>` + role + `</h4>\n <div class=\"card-body\">\n <p class=\"card-text\">ID : `+ id + `</p>\n <p class=\"card-text\">Email : <a href=\"mailto:`+email+`\">`+ email +`</a></p>\n <p class=\"card-text\">School : `+ school + `</p>\n </div>\n </div>`;\n return html;\n}",
"function engineerCard(engineerObj) {\n var name = engineerObj.getName();\n var id = engineerObj.getID();\n var email = engineerObj.getEmail();\n var github = engineerObj.getGithub();\n var role = engineerObj.getRole();\n\n var html = `<div class=\"card\">\n <h4 class=\"card-header\" id=\"name\">`+ name + `</h4>\n <h4 class=\"card-header\" id=\"name\">`+ `<i class=\"fas fa-wrench\"></i>` + role + `</h4>\n <div class=\"card-body\">\n <p class=\"card-text\">ID : `+ id + `</p>\n <p class=\"card-text\">Email : <a href=\"mailto:`+email+`\">`+email+`</a></p>\n <p class=\"card-text\">Github : <a href=\"https://github.com/`+github+`\">`+github+`</a></p>\n </div>\n </div>`;\n return html;\n}",
"function getCard() {\n\t\n\t// STUB: this code shows a minmal model for a Card object. You job is to build a better one!\n\tvar card = {\n\t\tisFaceUp : true,\n\t\ttoString : function() { \n\t\t\t\t\t\treturn \"2d\"; \n\t\t\t\t\t},\n\t};\n\t\n\treturn card;\t\n}",
"function displayOnCard() {\n nameDisplay.innerText = nameField.value;\n if (nameField.value.length == 0) {\n nameDisplay.innerText = \"________________\";\n }\n cvvDisplay.innerText = cvvField.value;\n if (cvvField.value.length == 0) {\n cvvDisplay.innerText = \"____\";\n }\n expiresDisplay.innerText = expiresField.value;\n if (expiresField.value.length == 0) {\n expiresDisplay.innerText = \"__ / __\";\n }\n}",
"function managerCard(managerObj) {\n var name = managerObj.getName();\n var id = managerObj.getID();\n var email = managerObj.getEmail();\n var officeNumber = managerObj.getOfficeNumber();\n var role = managerObj.getRole();\n\n var html = `<div class=\"card\">\n <h4 class=\"card-header\" id=\"name\">`+ name + `</h4>\n <h4 class=\"card-header\" id=\"name\">`+ `<i class=\"fas fa-gavel\"></i>` + role + `</h4>\n <div class=\"card-body\">\n <p class=\"card-text\">ID : `+ id + `</p>\n <p class=\"card-text\">Email : <a href=\"mailto:`+email+`\">`+email+`</a></p>\n <p class=\"card-text\">Office # : `+ officeNumber + `</p>\n </div>\n </div>`;\n return html;\n}",
"function cardContent(employee){\n let returner = \"\"\n let role = employee.getRole();\n\n switch (role){\n case \"Manager\":\n returner = `<p class=\"card-text\">Office Number: ${employee.getOfficeNumber()} </p>`;\n break;\n case \"Engineer\":\n returner = `<p class=\"card-text\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" class=\"bi bi-github\" viewBox=\"0 0 16 16\">\n <path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z\"/>\n </svg> Github: <a href=\"https://www.github.com/${employee.getGithub()}\">${employee.getGithub()}</a></p>`\n break;\n case \"Intern\":\n returner = `<p class=\"card-text\">School: ${employee.getSchool()} </p>`\n break;\n }\n return returner\n}",
"function showCardReading(carddiv) {\r\n\t\r\n}",
"function createCard(cardnum, CVC, exp, type){\n if (type == \"Amex\"){\n \n card = new Amex(cardnum, CVC, exp);\n \n }\n \n if (type == \"Visa\"){\n card = new Visa(cardnum, CVC, exp);\n }\n \n if (type == \"MC\"){\n card = new MC(cardnum, CVC, exp);\n }\n \n return card;\n}",
"function createCard() {\n inquirer.prompt(createprompt).then(function(response) {\n if(res.type === 'Cloze') {\n var fc = new flashcard(res.front.trim(), res.back.trim(), true);\n\n if(!fc.valudate()) {\n createCard();\n } else {\n return;\n }\n };\n } else {\n var fc = new flashcard(res.front.trim(), res.back.trim());\n reviewCard(fc);\n }\n});\n}",
"function selectCard(car){\r\n return car.value + \" of \" + car.suit;\r\n}",
"function makeCard(cardNumber, expirationDate, securityCode) {\n var card = {\n cardNumber: cardNumber,\n expirationDate: expirationDate,\n securityCode: securityCode\n }\n return card;\n }",
"function showCard(){\n // insert the card name\n $(\"span.cardName\").text(card.name);\n // insert the image, set the src attribute of the image tag\n $(\"#card\").attr(\"src\", cardImageSrc(card.number));\n}",
"function getCardTemplate(card){\r\n return `\r\n <article class=\"card ${card.suite}\">\r\n <div class=\"top\">\r\n <p class=\"value\">${card.value}</p>\r\n <p class=\"suite\">${getCardSymbol(card.suite)}</p>\r\n </div>\r\n <div class=\"middle\">\r\n <p class=\"suite\">${getCardSymbol(card.suite)}</p>\r\n </div>\r\n <div class=\"bottom\">\r\n <p class=\"value\">${card.value}</p>\r\n <p class=\"suite\">${getCardSymbol(card.suite)}</p>\r\n </div>\r\n </article>\r\n `\r\n}",
"function makeCard(id, data)\n{\n $(\"#\" + id).text(data[0]);\n}",
"renderDescription() {\n const { library, expanded } = this.props;\n\n if (expanded) {\n return (\n <CardSection>\n <Text style={{ flex: 1, paddingLeft: 16, paddingRight: 16, color: '#FA8072' }}>\n {library.description}\n </Text>\n </CardSection>\n );\n }\n }",
"function showCard(card, callback) {\n $(\"#question-content\").html(card.question.replace(/\\n/g, \"<br/>\"));\n $(\"#answer-content\").html(card.answer.replace(/\\n/g, \"<br/>\"));\n\n // Set up answer toggle\n $(\"#answer-placeholder\").show();\n $(\"#answer-content\").hide();\n $(\"#answer-panel\").click(function() {\n $(\"#answer-content\").show();\n $(\"#answer-placeholder\").hide();\n $(this).off();\n });\n\n // set click listener on grade buttons\n $(\"#grade-toolbar button\").on('click.grade', function() {\n $(\"#grade-toolbar button\").off('click.grade');\n callback(card, parseInt($(this).data(\"grade\")));\n });\n }",
"function getClozeCard(){\n\n var data = clozeObject[Math.floor(Math.random() * clozeObject.length)];\n var card = new ClozeCard(data.fullText, data.cloze);\n showClozeCards(card.partial, card.cloze, card.fullText);\n}",
"function gettingCardInfoForModal(e) {\n const cardId = e.target.closest('.card').getAttribute('data-id');\n const listId = e.target.closest('.oneLists').getAttribute('data-id');\n const cardContent = MODEL.returnCardReference(cardId, listId)\n\n const inputInModalContent = document.querySelector('#card-text');\n inputInModalContent.textContent = cardContent.text;\n\n }",
"function fillProductCard(cardId, product){\r\n var prod_img = document.createElement(\"img\");\r\n prod_img.id = cardId + \"_img\";\r\n prod_img.classList.add(\"card-img-top\");\r\n prod_img.src = product.productData.img[0];\r\n\r\n var card_body = document.createElement(\"div\");\r\n card_body.id = cardId + \"_card_body\";\r\n card_body.classList.add(\"card-body\");\r\n\r\n var prod_name = document.createElement(\"h5\");\r\n prod_name.id = cardId + \"_prod_name\";\r\n prod_name.classList.add(\"card-title\");\r\n prod_name.innerHTML = product.productData.name;\r\n\r\n var prod_price = document.createElement(\"p\");\r\n prod_price.id = cardId + \"_prod_price\";\r\n prod_price.classList.add(\"card-text\");\r\n prod_price.innerHTML = product.productData.price + \" RON\";\r\n\r\n var det_btn = document.createElement(\"a\");\r\n det_btn.id = cardId + \"_det_btn\";\r\n det_btn.classList.add(\"btn\", \"btn-primary\", \"stretched-link\");\r\n det_btn.href = \"details.html?id=\" + product.productId;\r\n det_btn.innerHTML = \"Detalii\";\r\n \r\n document.getElementById(cardId).appendChild(prod_img);\r\n document.getElementById(cardId).appendChild(card_body);\r\n document.getElementById(card_body.id).appendChild(prod_name);\r\n document.getElementById(card_body.id).appendChild(prod_price);\r\n document.getElementById(card_body.id).appendChild(det_btn);\r\n removeClass(cardId,\"invisible\");\r\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Init the next planets | function load_next_planet() {
gamer.planet.type = gamer.next.type;
gamer.planet.assigned = false;
gamer.planet.removed = false;
gamer.planet.checked = false;
gamer.planet.x = gamer.x;
gamer.planet.y = gamer.y;
var sun = random(1,100);
if(sun <= 3) {
gamer.next.type = planet_types.sun;
} else if(gamer.available_planets <= 5) {
var types = [];
for(var j = 0; j < map.rows; j++) {
for(var i = 0; i < map.columns; i++) {
var planet = map.planets[i][j];
if(planet.type >= planet_types.mercury
&& planet.type <= planet_types.saturn
&& !planet.removed
&& !planet.assigned) {
types.push(planet.type);
}
}
}
gamer.next.type = types[Math.floor(Math.random() * types.length)];
} else {
gamer.next.type = random(1,6);
}
} | [
"function ResetPlanets()\n\t{\t\n\t\tplanets = new Array();\n\t\tAddPlanets();\n\t}",
"function render_next_planet() {\n var imgNext = new Image();\n imgNext.src = 'assets/img/planets.png';\n imgNext.onload = function() {\n var crop = get_planet_crop(gamer.next.type);\n context_next.clearRect(0, 0, 70, 70);\n context_next.drawImage(imgNext, crop, 0, map.planet_w, map.planet_h, gamer.next.x, gamer.next.y, map.planet_w, map.planet_h);\n }\n }",
"function reset_planets_type() {\n for (var j = 0; j < map.rows; j++) {\n for (var i = 0; i < map.columns; i++) {\n map.planets[i][j].type = planet_types.none;\n }\n }\n }",
"function initPlanetLayer(planetLayer) {\n var i,layer;\n // Add planet WMS background layers\n for (i = 0; i < planetLayer.baseImageries.length; i++) {\n layer = planetLayer.baseImageries[i];\n BackgroundLayersView.addView(layer);\n }\n\n // Add additional layers stored on the given planet layer\n for (i = 0; i < planetLayer.layers.length; i++) {\n layer = planetLayer.layers[i];\n AdditionalLayersView.addView(layer);\n }\n }",
"function create_random_map() {\n var easy = planet_types.none;\n for(var j = 0; j < map.rows - map.downgrade; j++) {\n for(var i = 0; i < map.columns; i++) {\n var planet = map.planets[i][j];\n if(gamer.level <= 2) {\n if(i % 2 == 0) {\n var tmp = random(1, 6);\n while(easy == tmp) {\n tmp = random(1, 6);\n }\n easy = tmp;\n }\n planet.type = easy;\n } else if(gamer.level <= 4) {\n planet.type = random(1, 6);\n } else {\n hardmode = true;\n planet.type = random(1, 6);\n }\n gamer.available_planets++;\n }\n }\n }",
"function prepareTerrain() {\n var seedText = document.getElementById(\"seedText\");\n var sizeSlider = document.getElementById(\"worldSize\");\n var scaleSlider = document.getElementById(\"scale\");\n var octavesSlider = document.getElementById(\"octaves\");\n\n var size = parseInt(sizeSlider.value);\n var scale = parseInt(scaleSlider.value) / 1000;\n var octaves = parseInt(octavesSlider.value);\n var simplex = new NoiseCalculator(seedText.value, octaves, scale);\n\n terrain.mesh = new Mesh(gl, simplex, size);\n terrain.plane = new Plane(gl, simplex, size);\n terrain.lowPoly = new LowPoly(gl, simplex, size);\n}",
"function renderPlanet(planet, index) {\n\t\t var workingPlanetTemplate = planetTemplate.clone();\n\t\t workingPlanetTemplate.find('#name').text(planet.name);\n\t\t workingPlanetTemplate.removeClass('invisible');\n\t\t content.append(workingPlanetTemplate);\n\t\t //We're going to start generating the table that contains the planet definition.\n\t\t var table = workingPlanetTemplate.find('#map').append('<table></table>').children('table'),\n\t\t\t node = 0;\n\t\t //We need to iterate over the height and width of the planet.\n\t\t for (height = 0; height < planet.height; height++) {\n\t\t\tvar row = jQuery('<tr></tr>');\n\t\t\ttable.append(row);\n\t\t\tfor (width = 0; width < planet.width; width++) {\n\t\t\t var cell = jQuery('<td style=\"position: relative;\"></td>'),\n\t\t\t\timg = jQuery('<img />').attr('src', terrainTypes[planet.terrain[height][width].terrainid - 1].image).css('width', '100%').css('height', 'auto'),\n\t\t\t\tmatSelect = materialSelector.clone().css('position', 'absolute').css('top', 0).css('left', 0).attr('name', 'materialGrid[' + height + '][' + width + ']'),\n\t\t\t\tmatQuantity = jQuery('<input style=\"position:absolute; bottom: 0; right: 0; width: 100%\" name=\"quantity[' + height + '][' + width + ']\"></input>');\n\t\t\t matSelect.change(function () {\n\t\t\t\tjQuery(this).css({'background-image': 'url(' + jQuery(this).find(':selected').attr('data-image') + ')', 'background-size': '100% 100%'});\n\t\t\t });\n\t\t\t var terrain = planet.terrain[height][width];\n\t\t\t if (terrain.deposit.length === undefined) {\n\t\t\t\tconsole.log(terrain);\n\t\t\t\tmatSelect.find('[value=' + terrain.deposit[terrain.refid].materialid + ']').attr('selected', true);\n\t\t\t\tmatSelect.trigger('change');\n\t\t\t\tmatQuantity.val(terrain.deposit[terrain.refid].quantity);\n\t\t\t }\n\t\t\t row.append(cell);\n\t\t\t cell.append(img);\n\t\t\t cell.append(matSelect);\n\t\t\t cell.append(matQuantity);\n\t\t\t}\n\t\t }\n\t\t //We need to set the index position.\n\t\t workingPlanetTemplate.find('#index').val(index);\n\t\t workingPlanetTemplate.find('#planetid').val(planet.id);\n\t\t workingPlanetTemplate.find('#delete').click(function deletePlanet() {\n\t\t\tjQuery.ajax({\n\t\t\t accepts: 'application/json',\n\t\t\t async: true,\n\t\t\t url: '?q=/planets/delete/' + planet.id,\n\t\t\t complete: managePlanetsDeleteComplete\n\t\t\t});\n\t\t });\n\t\t workingPlanetTemplate.children('#edit').click(function editPlanet() {\n\t\t\tvar planet = planets[jQuery(this).parent().children('#index').val()];\n\t\t\tplanetEditor.find('#name').val(planet.name);\n\t\t\tplanetEditor.find('#size').val(planet.width);\n\t\t\tplanetEditor.find('#planetid').val(planet.id);\n\t\t\tplanetEditor.find('#size').trigger('change');\n\t\t\taddPlanetClick();\n\t\t });\n\t\t}",
"function planet(x,n,s,t,dt, shading, material) {\n this.xcoord = x;\n this.translateMatrix = translate(x, 0, 0);\n this.sMatrix = scale(s, s, s);\n this.theta = t;\n this.dtheta = dt;\n this.starting = index;\n this.material = material;\n this.shading = shading;\n //create a sphere\n tetrahedron(va, vb, vc, vd, n, shading);\n this.numPoints = index - this.starting;\n}",
"function initTraffic() {\n\tlTraffic = [\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW - canvasW/2),\n\t\t\ty: (canvasH / 2 + laneOffset),\n\t\t\tspeed: 1,\n\t\t\timg: document.getElementById(\"car-slow-right\")\n\t\t},\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW - canvasW/2),\n\t\t\ty: (canvasH / 2 + laneOffset),\n\t\t\tspeed: 3,\n\t\t\timg: document.getElementById(\"car-med-right\")\n\t\t},\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW - canvasW/2),\n\t\t\ty: (canvasH / 2 + laneOffset),\n\t\t\tspeed: 5,\n\t\t\timg: document.getElementById(\"car-fast-right\")\n\t\t}\n\t];\n\trTraffic = [\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW),\n\t\t\ty: (canvasH / 2 - carWidth - laneOffset),\n\t\t\tspeed: 1,\n\t\t\timg: document.getElementById(\"car-slow-left\")\n\t\t},\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW),\n\t\t\ty: (canvasH / 2 - carWidth - laneOffset),\n\t\t\tspeed: 3,\n\t\t\timg: document.getElementById(\"car-med-left\")\n\t\t},\n\t\t{\n\t\t\tx: Math.floor(Math.random()*1.5*canvasW),\n\t\t\ty: (canvasH / 2 -carWidth - laneOffset),\n\t\t\tspeed: 5,\n\t\t\timg: document.getElementById(\"car-fast-left\")\n\t\t}\n\t];\n}",
"function createPlanCircle() {\r\n planCircle = loadCircle(\"#total-plan-completion\");\r\n}",
"function planarGraph(n) {\n var points = [],\n links = [],\n i = -1,\n j;\n while (++i < n) points[i] = [Math.random (), Math.random ()];\n i = -1;\n while (++i < n) {\n addPlanarLink ([points[i], points[~~(Math.random () * n)]], links);\n }\n i = -1;\n while (++i < n) {\n j = i;\n while (++j < n) addPlanarLink ([points[i], points[j]], links);\n }\n return {nodes: points, links: links};\n }",
"function renderPlanetProfile() {\n if (STORE.questionNumber === 0) {\n let output = `<h1>Solar System Quiz</h1>\n <p class=\"planet-profile js-planet-profile\">Journey through the Solar System with this short quiz and learn some cool facts along the way.</p>`;\n $('.js-quiz-intro-planet-profile').append(output);\n }\n else {\n for (let i = 0; i < STORE.planets.length; i++) {\n let planet = Object.keys(STORE.planets[i]).toString();\n for (let j = 0; j < STORE.planets[i][planet].length; j++) {\n let id = STORE.planets[i][planet][j].id;\n if (typeof (id) != 'undefined') {\n if (id === STORE.questionNumber) {\n STORE.currentPlanet = planet;\n let output = `<img class=\"planet-picture js-planet-picture\" src=\"images/${planet}.jpg\" alt=\"Image , picture of ${planet}\">\n <section><h1>${planet}</h1>\n <p class=\"planet-profile js-planet-profile\">\n <span class=\"planet-circumference js-planet-circumference\"><strong>Circumference:</strong> ${STORE.planets[i][planet][2].facts[0].circumference} </span><br />\n <span class=\"planet-distance js-planet-distance\"><strong>Distance from Sun (light minutes):</strong> ${STORE.planets[i][planet][2].facts[1].distance} </span><br />\n <span class=\"planet-type js-planet-type\"><strong>Planet Type:</strong> ${STORE.planets[i][planet][2].facts[2].type} </span><br />\n <span class=\"planet-temp js-planet-temp\"><strong>Daytime Temperature:</strong> ${STORE.planets[i][planet][2].facts[3].temp}</span>\n </p></section>`;\n $('.js-quiz-intro-planet-profile').empty();\n $('.js-quiz-intro-planet-profile').append(output);\n }\n }\n }\n }\n }\n}",
"async _runnerFiller(planItem, currentIndex) {\n const totalRunners = this._plan.plan.filter((_pi) => _pi.size === '2.5x7');\n const findRunnerIndex = totalRunners.findIndex((r) => r.id === planItem.id);\n const findFirstOrderDate = totalRunners.sort((a, b) => {\n return moment(a.order_date) - moment(b.order_date);\n });\n const _getNextRunner = await getNextRunner(\n findFirstOrderDate[0].order_date,\n totalRunners.length + (findRunnerIndex - 1 > -1 ? findRunnerIndex - 1 : 0) - 1\n );\n\n if (_getNextRunner.length > 0) {\n const {id, size, order_date, sku, rush} = _getNextRunner[0];\n return {\n id,\n position: currentIndex,\n order_date: moment(order_date).toISOString(),\n sku,\n rush,\n size,\n };\n }\n\n return null;\n }",
"init() {\n const squaresCopy = this.board.squares.slice(0);\n this.board.placePlayers(this.players, squaresCopy);\n this.board.placeWeapons(this.weapons, squaresCopy);\n this.board.placeWalls(this.nbOfWalls, squaresCopy);\n }",
"function load_planets_image() {\n planets_image.source = new Image();\n planets_image.source.src = 'assets/img/planets.png';\n planets_image.source.onload = function() {\n planets_image.loaded = true;\n };\n }",
"initGameObjets(){\n\t\tlet modele = this.controller.modele;\n\t\t//Init les objets\n\t\tthis.scene.add(modele.table.model);\n\t\tthis.scene.add(modele.environment.model)\n\t\tthis.scene.add(modele.board.model)\t\t\n\t}",
"createPlan() {\n // reset plan\n this._plan.length = 0;\n // reset update plan\n this._updatePlan.length = 0;\n // recalculate total duration time\n this._calcTotalTime();\n\n // frame size (60fps)\n const step = 16;\n\n const { delay, duration } = this._props;\n // current time\n let time = delay;\n\n let periodStart;\n\n while (time <= this._totalTime) {\n const prevPeriod = this._getPeriod(time - step);\n const period = this._getPeriod(time);\n const nextPeriod = this._getPeriod(time + step);\n const prevFrame = this._plan[this._plan.length-1];\n\n let frameSnapshot = 0;\n\n if (period === 'delay') {\n this._plan.push(frameSnapshot);\n time += step;\n periodStart = undefined;\n continue;\n }\n\n // catch the start of `update` period\n if (periodStart === undefined) {\n this._o.isIt && console.log('yep', time, period);\n periodStart = time;\n }\n // calculate current progress\n this._updatePlan.push((time - periodStart) / duration);\n\n // onUpdate\n frameSnapshot = frameSnapshot | (1 << 3);\n\n const isPrevFrame = prevFrame !== undefined;\n\n if (!isPrevFrame) {\n // onStart\n frameSnapshot = frameSnapshot | (1 << 1);\n }\n\n const isPrevDelay = prevPeriod === 'delay';\n // onRepeatStart\n if (!isPrevFrame || isPrevDelay || prevPeriod === period - 1) {\n frameSnapshot = frameSnapshot | (1 << 2);\n }\n\n // onRepeatComplete\n if (nextPeriod === 'delay' || nextPeriod === period + 1) {\n frameSnapshot = frameSnapshot | (1 << 4);\n }\n\n this._plan.push(frameSnapshot);\n\n time += step;\n }\n\n // onComplete\n const lastIndex = this._plan.length - 1;\n this._plan[lastIndex] = this._plan[lastIndex] | (1 << 5);\n if (this._props.isReverse) {\n this.reverse();\n }\n\n this._o.isIt && console.log(this._plan.length);\n\n // the first one should be always 0\n // this._updatePlan[0] = 0;\n // the last one should be always 1\n // this._updatePlan[this._updatePlan.length-1] = 1;\n\n return this._plan;\n }",
"initUnvisited () {\n this.eachDatum((x, y, beta) => {\n beta.source = Unvisited\n beta.towards = Unvisited\n this.set(x, y, beta)\n })\n }",
"function robot_rrt_planner_init() {\n\n // form configuration from base location and joint angles\n q_start_config = [\n robot.origin.xyz[0],\n robot.origin.xyz[1],\n robot.origin.xyz[2],\n robot.origin.rpy[0],\n robot.origin.rpy[1],\n robot.origin.rpy[2]\n ];\n\n q_names = {}; // store mapping between joint names and q DOFs\n\n for (x in robot.joints) {\n q_names[x] = q_start_config.length;\n q_start_config = q_start_config.concat(robot.joints[x].angle);\n }\n\n // set goal configuration as the zero configuration\n var i; \n q_goal_config = new Array(q_start_config.length);\n for (i=0;i<q_goal_config.length;i++) q_goal_config[i] = 0;\n\n // CS148: add necessary RRT initialization here\n\n // make sure the rrt iterations are not running faster than animation update\n cur_time = Date.now();\n\n\n epsilon = 1;\n robot_path_traverse_idx = 0;\n rrt_iterate = true;\n tree1 = tree_init(vertex_init(q_start_config));\n tree2 = tree_init(vertex_init(q_goal_config));\n x_min = robot_boundary[0][0];\n x_max = robot_boundary[1][0];\n y_min = robot_boundary[0][2];\n y_max = robot_boundary[1][2];\n\n rrt_iter_count = 0;\n\n console.log(\"planner initialized\");\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
replace BigNumbers with numbers, returns true if size contained BigNumbers | function _normalize(size) {
var hasBigNumbers = false;
size.forEach(function (value, index, arr) {
if (value && value.isBigNumber === true) {
hasBigNumbers = true;
arr[index] = value.toNumber();
}
});
return hasBigNumbers;
} | [
"function is_large( vp_width ) {\n return vp_width > $(58.75).toCleanPx(); \n}",
"isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }",
"function isThereEnoughChocolateBags(small, big, total){\n const maxBigBoxes = total / 5;\n const bigBoxesWeCanUse = maxBigBoxes < big ? maxBigBoxes : big;\n total -= bigBoxesWeCanUse * 5;\n\n if(small < total)return false;\n else return true;\n}",
"contains (data, size = data.length) {\n for (let i = 0; i < this.nHashes; i++) {\n const idx = hash(i, this.nHashes, data, size) % this.nBits\n if (this.bfMask) {\n if (!this.bfMask.get(idx))\n return false\n }\n else if (this.bfCntr) {\n if (bfGet(this.bfCntr, idx) === 0)\n return false\n }\n }\n return true\n }",
"function checkBigInts(...args) {\n\tfor (var i = args.length - 1; i >= 0; i--) {\n\t\tlet arg = args[i];\n\n\t\tif (arg instanceof bigInt) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (typeof arg === 'object') {\n\t\t\tcheckBigInts(...Object.values(arg));\n\t\t\tcontinue;\n\t\t}\n\n\t\tthrow new TypeError(`object contains something that is not a bigInt (${arg} is of type ${typeof arg})`);\n\t}\n}",
"function contains(num, digits) {\n return num.toString().includes(digits)\n}",
"function millionOrMore(data) {\n return data.romanSearchResults > 1000000;\n}",
"function test (regex, numbers) {\n const append = '8888'\n const res = true\n const rex = new RegExp('^' + regex + '(.*)$')\n\n numbers.forEach(function (n) {\n n = n.replace(/x/g, '0')\n const n1 = n + append\n let res = n1.match(rex)\n\n if (res[1] !== n || res[2] !== append) {\n console.error(n, res)\n res = false\n }\n })\n\n return res\n}",
"function checkForDecimal(arr) {\n return arr.length === new Set(arr).size;\n }",
"function same(arr1, arr2) {\r\n // check if arrays have different length\r\n if (arr1.length !== arr2.length) {\r\n // if they do, return false.\r\n return false;\r\n }\r\n\r\n // loop through first array\r\n for (n of arr1) {\r\n // check if the element squared exists in second array\r\n var nSquaredIdx = arr2.indexOf(n ** 2);\r\n if (nSquaredIdx > -1) {\r\n // if they do\r\n // remove the element squared from the second array\r\n arr2.splice(nSquaredIdx, 1);\r\n }\r\n // if they don't, return false\r\n else {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}",
"function isNumericArray(array) {\n var isal = true;\n for (var i = 0; i < array.length; i++) {\n if (!$.isNumeric(array[i])) {\n isal = false;\n }\n }\n return isal;\n }",
"isFull() {\n return this.size == this.maxSize;\n }",
"isNumType(type) {\n return this.typesAreEquivalent(type, NumType);\n }",
"function smallEnough(a, limit){\n // const isBelowThreshold = (currentValue) => currentValue < limit;\n return a.every(currentValue => currentValue <= limit)\n\n}",
"function longWord (input) {\n return input.some(x => x.length > 10);\n}",
"function equalizeArray(arr) {\n // Write your code here\n let result = [];\n let considered = [];\n let temp = [];\n\n for (let i = 0; i < arr.length; i++) {\n temp = [];\n for (let j of arr) {\n if (!considered.includes(arr[i]) && arr[i] === j) {\n temp.push(j);\n }\n }\n if (temp.length !== 0) result.push(temp);\n considered.push(arr[i]);\n }\n let deleted = 0;\n let maxlen = 0;\n for (let a of result) {\n if (a.length > maxlen) {\n maxlen = a.length;\n }\n }\n let token = true;\n for (let a of result) {\n if (a.length >= maxlen && token) {\n token = false;\n } else {\n deleted += a.length;\n }\n }\n\n return deleted;\n}",
"function Same1(arr1, arr2) {\n //frequency of values must be the same\n if(arr1.length !== arr2.length) {\n return false;\n }\n for(let i = 0; i < arr1.length; i++) {\n let correctIndex = arr2.indexOf(arr1[i] ** 2)\n if(correctIndex === -1) {\n return false;\n }\n arr2.splice(correctIndex, 1)\n }\n\n return true;\n //arr1 should contain values\n\n //arr2 should square all of arr1 values\n\n\n //return True\n}",
"function isValidGridSize(gridSize){\n if(gridSize < 5){\n return false;\n }\n var nMinusOne = gridSize - 1;\n if((nMinusOne & (nMinusOne - 1)) == 0){\n return true;\n } else {\n return false;\n }\n}",
"function superSize(num){\nlet newNum = num + \"\"\nlet rev= newNum.split(\"\").sort().reverse().join(\"\");\nreturn parseInt(rev)\n}",
"function costas_verify ( array ){\n var result;\n var diff_array = array_diff_vector( array );\n var array_set = set_of_values( array );\n var diff_array_set = set_of_values( diff_array );\n //console.log( 'diff_array length', diff_array.length );\n //console.log( 'diff_array_set length', diff_array_set.length );\n return ( diff_array.length === diff_array_set.length && array_set.length === array.length );\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets current theme string | getCurrentTheme() {
return this.isDarkTheme ? 'dark' : 'light';
} | [
"function lookupThemeName() {\n // As a few components (dialog) add their controllers later, we should also watch for a controller init.\n return ctrl && ctrl.$mdTheme || (defaultTheme == 'default' ? '' : defaultTheme);\n }",
"get name () {\n\t\t\treturn app.settings.Theme;\n\t\t}",
"function getTheme(theme = {}) {\n return theme['theme'] || theme\n}",
"function getStoredTheme() {\r\n let theme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;\r\n\r\n // check for user system preference\r\n if (theme == null) {\r\n if (!window.matchMedia) {\r\n theme = null;\r\n } else if (window.matchMedia(\"(prefers-color-scheme: dark)\").matches) {\r\n theme = 'dark';\r\n } else if (window.matchMedia(\"(prefers-color-scheme: light)\").matches) {\r\n theme = 'light';\r\n }\r\n }\r\n return theme;\r\n}",
"get themeData() {\n if (this.manifest) {\n var themeData = {};\n // this is required so better be...\n if (varExists(this.manifest, \"metadata.theme\")) {\n themeData = this.manifest.metadata.theme;\n } else {\n // fallback juuuuust to be safe...\n themeData = {\n \"haxcms-basic-theme\": {\n element: \"haxcms-basic-theme\",\n path: \"@lrnwebcomponents/haxcms-elements/lib/core/themes/haxcms-basic-theme.js\",\n name: \"Basic theme\",\n variables: {\n image: \"assets/banner.jpg\",\n icon: \"icons:record-voice-over\",\n hexCode: \"#da004e\",\n cssVariable: \"pink\",\n },\n },\n };\n }\n // ooo you sneaky devil you...\n if (this.activeItem && varExists(this.activeItem, \"metadata.theme\")) {\n return this.activeItem.metadata.theme;\n }\n return themeData;\n }\n }",
"get themeCSS(){\n\t\t\treturn CURRENT_THEME.BASETHEME_CACHE + CURRENT_THEME.THEME_CACHE;\n\t\t}",
"function getTheme (pageName)\n{\n\tvar theme = doAction ('DATA_GETCONFIGDATA', 'ObjectName', gSITE_ED_FILE, 'RowName', \n\t\t\t\t\t\t\t\t\tpageName, 'ColName', gTHEME);\n\treturn (theme);\n}",
"get actualBaseTheme() {\n return this.i.z;\n }",
"get themeClasses() {\n return baseThemeID + \" \" +\n (this.state.facet(darkTheme) ? \"cm-dark\" : \"cm-light\") + \" \" +\n this.state.facet(theme);\n }",
"function getBubblePopupThemePath() {\n return getConfigParam(kradVariables.APPLICATION_URL) + kradVariables.BUBBLEPOPUP_THEME_PATH;\n}",
"function RetroTheme() {\n if (localStorage.getItem('theme') === 'theme-dark') {\n setTheme('theme-retro');\n } else if (localStorage.getItem('theme') === 'theme-light') {\n setTheme('theme-retro');\n } else {\n setTheme('theme-light');\n }\n}",
"function getThemesList() {\n var themes = initSpriteTypeList();\n console.log('\\n====== Start of list ======\\n');\n for(var key in themes) {\n console.log(key + ': ' + themes[key]);\n }\n return '\\n======= End of list =======\\n';\n }",
"function getThemeNames(options){\n\tvar themes = []\n\tif(options.pkg.theme_names){\n\t\tlog(warning('Using package.json theme_names to create theme(s)'))\n\t\tthemes = options.pkg.theme_names\n\t}else{\n\t\tlog(warning('Using neto-theme-info file to create theme(s)'))\n\t\tvar files = fs.readdirSync(`./${options.TEMPLATES}`)\n\t\tfiles.forEach(file => {\n\t\t\tif(file.indexOf(\"-netothemeinfo.txt\") !== -1){\n\t\t\t\tvar theme = file.replace(/-netothemeinfo.txt*$/, \"\")\n\t\t\t\tthemes.push(theme)\n\t\t\t}\n\t\t})\n\t}\n\treturn themes;\n}",
"function setupTheme() {\n var theme = interactive.theme;\n\n if (arrays[\"a\" /* default */].isArray(theme)) {\n // [\"a\", \"b\"] => \"lab-theme-a lab-theme-b\"\n theme = theme.map(function (el) {\n return 'lab-theme-' + el;\n }).join(' ');\n } else if (theme) {\n theme = 'lab-theme-' + theme;\n } else {\n theme = '';\n }\n\n $interactiveContainer.alterClass('lab-theme-*', theme);\n }",
"get isDarkTheme() {\n if (this._isDarkTheme == null) {\n this._isDarkTheme = localStorage.getItem('theme') === 'dark' || false;\n }\n return this._isDarkTheme;\n }",
"get backgroundColor() {\n let backgroundColor = 0xffffff;\n if (Store.getState()) {\n const tp = Store.getState().theme.options.type;\n if (tp === \"dark\") {\n backgroundColor = 0;\n }\n }\n return backgroundColor;\n }",
"function browseTheme() \n{\n\t//Set lib source folder\n\tvar libFolder = settings.cssType == SPLIT_CSS ? PREF_SPLIT_JQLIB_SOURCE_FOLDER : PREF_JQLIB_SOURCE_FOLDER;\n\t\n\t//Get selected theme folder.\n\tvar browseRoot = dw.getPreferenceString(PREF_SECTION, libFolder, dw.getConfigurationPath()+\"/\"+assetDir);\n\tvar themeFolder = dw.getPreferenceString(PREF_SECTION, PREF_CSS_FILE, browseRoot);\n\t\n\t//Strings for browse file dialog.\n\tvar browseCSS = dw.loadString(\"Commands/jQM/files/alert/browseCSS\");\n\tvar cssFiles = dw.loadString(\"Commands/jQM/files/alert/label/cssFiles\");\n\t\n\tvar jQMThemeFile = dw.browseForFileURL(\"select\", browseCSS, false, true, new Array(cssFiles + \" (*.CSS)|*.css||\"), themeFolder);\n\t\n\tif (jQMThemeFile != \"\") {\n\t\t//Some file was chosen.\n\t\tvar cssName = getFileName(jQMThemeFile);\n\t\tvar cssExt = '.css';\n\t\t\n\t\t//Check to see if it's a CSS file.\n\t\tvar nameSuffix = cssName.substr(-4);\n\t\tif (nameSuffix === cssExt) {\n\t\t\t//Update display input.\n\t\t\tsettings.themeInput.value = jQMThemeFile;\n\t\t\tdw.setPreferenceString(PREF_SECTION, PREF_CSS_FILE, jQMThemeFile);\n\t\t} else {\n\t\t\t//Bad file!\n\t\t\tvar invalidCSSFile = dw.loadString(\"Commands/jQM/files/alert/invalidCSSFile\");\n\t\t\talert(invalidCSSFile);\n\t\t}\n\t}\n}",
"function DarkTheme() {\n var themeNumber = 1;\n /*\n 1 - Light\n 2 - Dark\n 3 - Nocturne\n 4 - Terminal\n 5 - Indigo\n */\n // Your code here\n switch (themeNumber) {\n case 1:\n console.log(\"Light\");\n break;\n case 2:\n console.log(\"Dark\");\n break;\n case 3:\n console.log(\"Nocturne\");\n break;\n case 4:\n console.log(\"Terminal\");\n break;\n case 5:\n console.log(\"Indigo\");\n break;\n }\n}",
"function currentLang() {\n if(window.location.pathname.slice(0, 4) == '/fr/') {\n return 'fr';\n } else {\n return 'en';\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Refresh the height of the list item. | refreshItemHeight() {
this.virtualizationModule.refreshItemHeight();
} | [
"_updateHeight() {\n this._updateSize();\n }",
"function saveListSize() {\n var $this = $(this);\n $this.css('min-height', $this.height());\n }",
"set requestedHeight(value) {}",
"function reduce() {\n $(\".carousel-item\").css(\"height\", \"20vh\");\n }",
"function initializeMegaMenuHeight(currentStatus){\n currentStatus.heights=[]\n max=0;\n //console.log(\"before : \"+currentStatus.heights);\n $(\".data-depth-0>li.selected\").children(\".ul-reset\").each(function() {\n if(max<$(this).find(\".ul-reset\").height()){\n max = $(this).find(\".ul-reset\").height();\n }\n});\n currentStatus.heights.push($(\".data-depth-0>li.selected\").children(\".ul-reset\").height());\n $(\".data-depth-0\").height(currentStatus.heights[currentStatus.heights.length-1]+20);\n //console.log(\"after : \"+currentStatus.heights);\n}",
"_updateYPosition() {\n this._updateSize();\n }",
"function refreshListSize()\n{\t\n\tallListItems = document.querySelectorAll('ul>li');\n\tsizeOfList = allListItems.length;\n}",
"updateMaxHeightState() {\n this.setState(() => ({\n maxHeight: this._refMainContainer.clientHeight - this.state.mainContainerRestHeight,\n }));\n }",
"_updateHeight() {\n this._mirroredTextareaRef.el.value = this.composer.textInputContent;\n this._textareaRef.el.style.height = (this._mirroredTextareaRef.el.scrollHeight) + \"px\";\n }",
"get height() {\n if ( !this.el ) return;\n\n return ~~this.parent.style.height.replace( 'px', '' );\n }",
"function updateItem(){\n\t//Update itemList total item left information\n\t$('#options-num').text(function() {\n\t\tvar n = $(\".list-container li.sl-item\").length;\n\t\treturn \"n\";\n\t});\n\t$('#template-num').text(function() {\n\t\tvar n = $(\".list-template li.sl-item\").length;\n\t\treturn \"n\";\n\t});\n}",
"_calculateHeight() {\n\t\tif (this.options.height) {\n\t\t\treturn this.jumper.evaluate(this.options.height, { '%': this.jumper.getAvailableHeight() });\n\t\t}\n\n\t\treturn this.naturalHeight() + (this.hasScrollBarX() ? 1 : 0);\n\t}",
"setHeight() {\n this.$().outerHeight(this.$(window).height() - this.get('fixedHeight'));\n }",
"function recalcHeight() {\n // each child element will normally take up 2/3 units\n var y = -1;\n for (var obj of children) {\n // each child lives in its own coordinate system that was scaled by\n // one-third\n y += obj.getHeight() * ONE_THIRD;\n }\n\n if (y > 1.0) {\n maxy = y;\n }\n else {\n // the height may have decreased below 1.0\n maxy = 1.0;\n }\n\n if (adjustHeight != null) {\n adjustHeight(); // propogate the change back up to our parent\n }\n }",
"function sizeItem(id, toHeight){\n\n\tvar toShrink = $(id);\n\t\n\tvar oldHeight = toShrink.offsetHeight < 0 ? 0 : toShrink.offsetHeight;\n\t\n\ttoShrink.style.height = \"auto\";\n\t\n\tvar newHeight = toShrink.offsetHeight;\n\t\n\tif (!toHeight){\n\t\ttoHeight = newHeight;\n\t};\n\t\n\ttoShrink.style.height = oldHeight+\"px\";\n\ttoShrink.style.overflow = \"hidden\";\n\t\n\tif (toHeight < oldHeight ) {\n\t\tnew Shrink(id, toHeight, 10);\n\t\treturn false;\n\t} else {\n\t\tnew Grow(id, toHeight, 10);\n\t\treturn false;\n\t};\n}",
"changeMainHeight(event) {\r\n this.mainHeight = Number(event.target.value);\r\n mainGraphCtr.graph.setHeight(this.mainHeight);\r\n }",
"_refresh(){\n this._refreshSize();\n this._refreshPosition();\n }",
"function SetRowHeight() {\n var grid = this.GetGrid();\n var rowHeight = GetRowHeight.call(this);\n var ids = grid.getDataIDs();\n\n for (var i = 0, len = ids.length; i < len; i++) {\n grid.setRowData(ids[i], false, { height: rowHeight });\n }\n }",
"cellHeight(val, update = true) {\r\n let data = utils_1.Utils.parseHeight(val);\r\n if (this.opts.cellHeightUnit === data.unit && this.opts.cellHeight === data.height) {\r\n return this;\r\n }\r\n this.opts.cellHeightUnit = data.unit;\r\n this.opts.cellHeight = data.height;\r\n if (update) {\r\n this._updateStyles(true); // true = force re-create\r\n }\r\n this._resizeNestedGrids(this.el);\r\n return this;\r\n }",
"updateList(){\n\n\t\t//create an empty div to add the items to\n\t\tvar listItemsDOM = $('<div class=\"listItems\"></div>');\n\n\t\tvar top = this.listDOM.scrollTop();\n\n\t\t//loop over our styles and update the dom list\n\t\tfor(var i=0; i<this.styles.length; i++){\n\n\t\t\t//loop over all our items\n\t\t\tvar item = this.styles[i];\n\n\t\t\t//add a row for this item. Auto add in the \"selected\" identifier if the ID's match\n\t\t\tlistItemsDOM.append('<div id=\"style_'+item.ID+'\" class=\"listItem '+((item.ID==this.selectedStyle)?'selectedClassItem':'')+'\">'+item.name); //+' {'+item.getID()+'}</div>');\n\n\t\t}//next i\n\n\t\t//update the list DOM\n\t\t//this.listDOM.find('.listItems').remove();\n\t\tthis.listDOM.html(listItemsDOM);\n\n\t\tthis.listDOM.scrollTop(top);\n\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IBC CRITERIA Now we are matching the RRM with the Sales Order Criteria. | function IBCMatching() {
var asoFilters = new Array();
aSOFilters = ibcCriteria(idrrm, salesOrderCompare);
var aSearchResults = findMatchingRecord(aSOFilters);
if (aSearchResults != null && aSearchResults != '') {
idrrm = aSearchResults[0].getId();
revRec = true;
} else {
revRec = false;
// return;
}
} | [
"function SetAPClerk(vbRec,vbSubs,vbOwner,k) {\t\t\t\n\tvar f3 = new Array();\n\tf3[0] = new nlobjSearchFilter('custrecord_spk_sr_ap_clerk_ons_sub',null,'anyof',vbSubs);\n\tf3[1] = new nlobjSearchFilter('isinactive',null,'is','F');\t\t\t\t\t\n\tvar col3 = new Array();\n\tcol3[0] = new nlobjSearchColumn('custrecord_spk_sr_ap_clerk_onshore_field');\n\tvar searchResult = nlapiSearchRecord('customrecord_spk_sr_ap_clerk_onshore',null,f3,col3);\n\tif(searchResult) {\n\t\tvar apclerkOnshoreRec = searchResult[0];\n\t\tvar apclerkOnshore = apclerkOnshoreRec.getValue('custrecord_spk_sr_ap_clerk_onshore_field');\n\t\tvar delegate_apclerkonshore = getDelegateApprover(apclerkOnshore);\n\t\tnlapiLogExecution('DEBUG', 'apClerkOnshore', delegate_apclerkonshore);\n\t\tvbRec.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n\t\tif(delegate_apclerkonshore) {\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_apclerkonshore);\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof',apclerkOnshore);\n\t\t}\n\t\telse {\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', apclerkOnshore);\n\t\t}\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','Sr. AP Clerk');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n\t\tvbRec.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t}\n}",
"function setHTCReviewer(vbRec,vbSubs,vbOwner,k) {\t\t\t\n\tvar f3 = new Array();\n\tf3[0] = new nlobjSearchFilter('custrecord_spk_sr_ap_clerk_subsidiary',null,'anyof',vbSubs);\n\tf3[1] = new nlobjSearchFilter('isinactive',null,'is','F');\t\t\t\t\t\n\tvar col3 = new Array();\n\tcol3[0] = new nlobjSearchColumn('custrecord_spk_senior_apclerk_field');\n\tvar searchResult = nlapiSearchRecord('customrecord_spk_sr_ap_clerk_offshore',null,f3,col3);\n\tif(searchResult) {\n\t\tvar htcReviewerRec = searchResult[0];\n\t\tvar htcReviewer = htcReviewerRec.getValue('custrecord_spk_senior_apclerk_field');\n\t\tvar delegate_htcReviewer = getDelegateApprover(htcReviewer);\n\t\tnlapiLogExecution('DEBUG', 'HTC Reviewer', delegate_htcReviewer);\n\t\tvbRec.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n\t\tif(delegate_htcReviewer) {\n\t\t\tvbRec.setFieldValue('custbody_spk_inv_apvr',delegate_htcReviewer);\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_htcReviewer);\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof',htcReviewer);\n\t\t}\n\t\telse {\n\t\t\tvar apclerk = vbRec.setFieldValue('custbody_spk_inv_apvr',htcReviewer);\n\t\t\tnlapiLogExecution('DEBUG', 'apclerk', apclerk);\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', htcReviewer);\n\t\t}\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','HTC Reviewer');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n\t\tvbRec.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t}\n}",
"function findMatchingInvoice() {\r\n var idPayer = nlapiGetFieldValue(FLD_PAYER);\r\n var btOLI = nlapiGetFieldValue(FLD_OLI);\r\n var quadexTicket = nlapiGetFieldValue(FLD_QUADAX_TICKET_ID);\r\n\r\n\r\n var aSearchFilters = new Array();\r\n aSearchFilters.push(new nlobjSearchFilter('entity', null, 'is', idPayer));\r\n aSearchFilters.push(new nlobjSearchFilter(FLD_TRANS_OLI, null, 'is', btOLI));\r\n aSearchFilters.push(new nlobjSearchFilter(FLD_TRANS_CLAIM, null, 'is', quadexTicket));\r\n // aSearchFilters.push(new nlobjSearchFilter(FLD_BILLINGEVENTTYPE, null,\r\n // 'anyof', 1)); //either bill\r\n\r\n var aSearchColumns = new Array();\r\n aSearchColumns.push(new nlobjSearchColumn('internalid'));\r\n try {\r\n var aSearchResults = nlapiSearchRecord('transaction', null, aSearchFilters, aSearchColumns);\r\n return aSearchResults;\r\n } catch (e) {\r\n nlapiLogExecution('debug', 'search error', e.message)\r\n }\r\n}",
"function CartsGrid_Command(sender, args) {\n try {\n //if(sender)\n if (args) {\n args.set_cancel(true);\n }\n\n // Getting actual properties from the rad grid.\n var pageSize = sender.get_masterTableView().get_pageSize();\n var filterExpressions = $('#' + txtSearchID).val();\n var currentPageIndex = sender.get_masterTableView().get_currentPageIndex();\n var filterExpressionsAsSQL = filterExpressions.toString();\n var startIndex = currentPageIndex * pageSize;\n var filter = filterExpressions == SearchText ? \"\" : filterExpressions;\n\n var startYearMonth = GetYearMonth(uiStartYearMonthID);\n var endYearMonth = GetYearMonth(uiEndYearMonthID);\n \n var orderStatus = $find(ddlOrderStatusID).get_selectedItem().get_value();\n\n CartsGridGetData(startIndex, pageSize, filter, startYearMonth, endYearMonth, orderStatus);\n }\n catch (ex) {\n alert(ex);\n }\n}",
"function setRestrParameters(){\n\tvar panel = rplmClauseController.abRplmAddEditClausesAmntType;\n\tif(rplmClauseController.itemType == 'BUILDING'){\n\t\tpanel.addParameter('bl_restr', \"bl_amenity.bl_id = '\"+rplmClauseController.selectedId+\"'\");\n\t\tpanel.addParameter('pr_restr', \"prop_amenity.pr_id IN (SELECT pr_id FROM bl WHERE bl.bl_id = '\"+rplmClauseController.itemId+\"')\");\n\t}else{\n\t\tpanel.addParameter('bl_restr', \"bl_amenity.bl_id IN (SELECT bl_id FROM bl WHERE bl.pr_id = '\"+rplmClauseController.itemId+\"')\");\n\t\tpanel.addParameter('pr_restr', \" prop_amenity.pr_id = '\"+rplmClauseController.itemId+\"'\");\n\t}\t\n}",
"LoadCriteres() {\n\t\t//window.console.log('rso load crit : offer Id'+this.selectedOffer);\n\t\tgetCriteres({RecordId: this.selectedOffer})\n\t\t.then(result => {\n\t\t\t\n\t\t\n\t\t\t//window.console.log('rso log crit All 2 '+JSON.stringify(result));\n\t\t\tthis.Sectioncriteres=result;\n\t\t\tthis.criteres=result;\n\t\t\t//indow.console.log('rso log crit All 2');\n\n\t\t\t\n\n\t\t\n\t\t\t/*if(result) {\n\t\t\t\tfor(let key in result) {\n\t\t\t\t\t// Preventing unexcepted data\n\t\t\t\t\tif (result.hasOwnProperty(key)) { // Filtering the data in the loop\n\t\t\t\t\t\tthis.mapData.push({value:result[key], key:key});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t*/\n\t\t\t\n\t\t\t\n\t\t})\n\t\t.catch(error => {\n\t\t\tthis.error = error;\n\t\t});\n\t}",
"function lookupDistributorCommissionRate()\n{\n\tvar partnerRecord = null;\n\tvar retVal = 0;\n\t\n\ttry\n\t{\n\t\tpartnerRecord = nlapiLoadRecord('partner', simPartnerIntID);\n\t\t\n\t\tdistributorName = partnerRecord.getFieldValue('entityid');\n\t\t\n\t\t// 1=physical - 2=paypoint - 3=online - 4=telephone\n\t\t//voucherType = genericSearchColumnReturn('item','itemid',itemIntID,'custitem_vouchertype');\t\n\t\n\t\t//version 1.0.2 , 1.0.3\n\t\t/*********************************\n\t\t * checking for physical voucher commission doesn't need as it is already calculated when the Credit Notes is created.\n\t\t * but if the sim partner and the voucher partner is not the same, then the (0.01 * topup) of commission is paid to the sim partner.\n\t\t * This is done in the createJournalDistributorCommission() function\n\t\t ****************************/\n\t\t\n\t\tswitch(voucherTypeName)\n\t\t{\n\t\tcase 'Paypoint': \n\t\t\tdistribCommission = partnerRecord.getFieldValue('custentity_paypointdisc');\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'On-line' :\n\t\t\tdistribCommission = partnerRecord.getFieldValue('custentity_onlinedisc');\n\t\t\tbreak;\n\t\t\n\t\tcase 'Telephone':\n\t\t\tdistribCommission = partnerRecord.getFieldValue('custentity_telephonedisc');\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\tretVal = distribCommission;\n\t\t\n\t}\n\tcatch(e)\n\t{\n\t\terrorHandler(\"lookupDistributorCommissionRate\", e);\t\t\t\t\n\t} \n\n\treturn retVal;\n\n}",
"function Process() {\n var results = {};\n var arr = request.httpParameters.keySet().toArray();\n arr.filter(function (el) {\n results[el] = request.httpParameters.get(el).toLocaleString();\n return false;\n })\n\n var verificationObj = {\n ref: results.REF,\n returnmac: results.RETURNMAC,\n eci: results.ECI,\n amount: results.AMOUNT,\n currencycode: results.CURRENCYCODE,\n authorizationcode: results.AUTHORISATIONCODE,\n avsresult: results.AVSRESULT,\n cvsresult: results.CVVRESULT,\n fraudresult: results.FRAUDRESULT,\n externalreference: results.FRAUDRESULT,\n hostedCheckoutId: results.hostedCheckoutId\n\n }\n\n var order = session.getPrivacy().pendingOrder;\n var orderNo = session.getPrivacy().pendingOrderNo;\n var returnmac = session.getPrivacy().payment3DSCode;\n\n var cancelOrder = true;\n\n if (verificationObj.returnmac == returnmac) {\n var result = null;\n if(verificationObj.hostedCheckoutId != null){\n result = IngenicoPayments.getHostedPaymentStatus(verificationObj.hostedCheckoutId, true);\n }else if(verificationObj.ref){\n result = IngenicoPayments.getPaymentStatus(verificationObj.ref);\n }else{\n Logger.error(\"Missing verification reference - Params: \" + JSON.stringify(results) + \" VerificationObj: \" + JSON.stringify(verificationObj))\n }\n\n if(!result || result.error){\n Logger.warn(\"Error getting payment status: \" + JSON.stringify(result));\n app.getView({ redirect: URLUtils.url('COVerification-Confirmation', \"error=400\") }).render(\"checkout/3DSredirect\");\n return;\n }\n\n if(result.createdPaymentOutput){\n if(\"tokens\" in result.createdPaymentOutput && result.createdPaymentOutput && result.createdPaymentOutput.payment && result.createdPaymentOutput.payment.paymentOutput && result.createdPaymentOutput.payment.paymentOutput.cardPaymentMethodSpecificOutput){\n IngenicoOrderHelper.processHostedTokens(order.getCustomer(), result.createdPaymentOutput.tokens, result.createdPaymentOutput.payment.paymentOutput.cardPaymentMethodSpecificOutput)\n }\n result = result.createdPaymentOutput.payment;\n }\n \n var updatedOrderOK = UpdateOrder.updateOrderFromCallback(orderNo, result);\n\n if (result && result.status) {\n switch (result.status) {\n case ReturnStatus.REDIRECTED:\n case ReturnStatus.CAPTURE_REQUESTED:\n case ReturnStatus.PENDING_CAPTURE:\n case ReturnStatus.PENDING_PAYMENT:\n case ReturnStatus.AUTHORIZATION_REQUESTED: \n case ReturnStatus.PAID:\n case ReturnStatus.CAPTURED:\n cancelOrder = false;\n app.getView({ redirect: URLUtils.url('COVerification-Confirmation') }).render(\"checkout/3DSredirect\");\n return;\n case ReturnStatus.PENDING_FRAUD_APPROVAL:\n case ReturnStatus.PENDING_APPROVAL:\n cancelOrder = false;\n app.getView({ redirect: URLUtils.url('COVerification-Confirmation') }).render(\"checkout/3DSredirect\");\n return;\n case ReturnStatus.REJECTED:\n case ReturnStatus.REVERSED:\n case ReturnStatus.REJECTED_CAPTURE:\n case ReturnStatus.CANCELLED:\n case ReturnStatus.CHARGEBACKED: // Should never get this status back during checkout process.\n app.getView({ redirect: URLUtils.url('COVerification-COSummary') }).render(\"checkout/3DSredirect\");\n return; \n default:\n break;\n } \n }\n }\n}",
"function getSalesforceAccounts(res, accountProvisioningConditions, utcDate, previousDate, callback) {\n var results = [];\n\n var query = \"\";\n var dynamicQuery = \"\";\n var conditions = accountProvisioningConditions.condition;\n var mapping = accountProvisioningConditions.mapping;\n var mappedFields = \"\";\n\n if (conditions.length) {\n\n if (accountProvisioningConditions.filterLogic != \"\") {\n\n for(var k = 0 ; k < conditions.length ; k++)\n {\n var x = k+1;\n var y = \" \" + conditions[k].field + \" \" + conditions[k].operator + \" '\" + conditions[k].value + \"' \";\n dynamicQuery = accountProvisioningConditions.filterLogic.replace(x,y);\n accountProvisioningConditions.filterLogic = dynamicQuery;\n }\n\n }\n else{\n\n query = \" \" +conditions[0].field + \" \" + conditions[0].operator + \" '\" + conditions[0].value + \"' \";\n\n }\n\n console.log(dynamicQuery);\n query = query + dynamicQuery;\n\n\n // for (var i = 0; i < conditions.length; i++) {\n // if (accountProvisioningConditions.filterLogic != \"\") {\n //\n //\n //\n //\n // if (i != conditions.length - 1) {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"' \" + filterLogic[i] + \" \";\n // }\n // else {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"'\";\n //\n // }\n // }\n // else {\n // query = query + conditions[i].field + \" \" + conditions[i].operator + \" '\" + conditions[i].value + \"'\";\n //\n // }\n //\n // }\n\n }\n\n mapping.forEach(function (result) {\n if (mappedFields.indexOf(result.salesforceField) == -1) {\n if (result.salesforceField != \"Id\") {\n mappedFields = mappedFields + result.salesforceField + \" ,\";\n }\n\n }\n\n\n });\n mappedFields = mappedFields.substring(0, mappedFields.length - 1);\n\n\n if (query != \"\") {\n var accountQuery = \"select Id,\" + mappedFields + \" from Account where LastModifiedDate <= \" + utcDate;\n accountQuery += \" and LastModifiedDate >= \" + previousDate + \" and ( \" + query + \" )\" ;\n\n }\n else {\n var accountQuery = \"select Id,\" + mappedFields + \" from Account where LastModifiedDate <= \" + utcDate;\n accountQuery += \" and LastModifiedDate >= \" + previousDate;\n\n }\n conn.query(accountQuery, function (err, result) {\n if (err) {\n console.log(\"error\", err);\n res.send(\"some error occured\");\n }\n else {\n\n if (result.totalSize != 0) {\n\n console.log(result.records);\n accountProvisioningConditions.data = result.records;\n callback(null, accountProvisioningConditions);\n\n }\n else {\n res.send(\"no accounts matching\");\n }\n }\n\n });\n\n}",
"function lookupItemToInvoiceAndVoucherCommissionRateToUse()\n{\n\tvar lookupTypeIntID = 0;\n\tvar lookupTypeRecord = null;\n\t\n\ttry\n\t{\n\t\t//version 1.0.4 - getting the 'top up type' using 'voucher type' instead of using 'top up type'\n\t\tlookupTypeIntID = genericSearch('customrecord_topuptypelookup','custrecord_topuptype',voucherType);\n\t\t\n\t\t//version 1.0.4 - adding the validations for few functions\n\t\tif(lookupTypeIntID >0)\n\t\t{\n\t\t\tlookupTypeRecord = nlapiLoadRecord('customrecord_topuptypelookup', lookupTypeIntID);\n\t\t\n\t\t\titemIntID = lookupTypeRecord.getFieldValue('custrecord_invoiceitem');\n\t\t\tvoucherCommission = lookupTypeRecord.getFieldValue('custrecord_commissionpercent');\n\t\t\tvoucherCommIntID = lookupTypeRecord.getFieldValue('custrecord_commissionaccount');\n\t\t\n\t\t\tcreateInvoice = lookupTypeRecord.getFieldValue('custrecord_createinvoice');\n\t\t\tjournalVoucherDesc = lookupTypeRecord.getFieldValue('custrecord_commissiondesc');\n\t\t}\n\t\telse\n\t\t{\n\t\t\terrorMsg = 'Topup Lookup Type is not found';\n\t\t}\n\t\t\n\t}\n\tcatch(e)\n\t{\n\t\terrorHandler(\"lookupItemToInvoiceAndVoucherCommissionRateToUse\", e);\t\t\t\t\n\t} \n\n}",
"function SetAPManager(vbRec,vbSubs,vbOwner,k) {\t\t\t\n\tvar f3 = new Array();\n\tf3[0] = new nlobjSearchFilter('custrecord_spk_apm_sub',null,'anyof',vbSubs);\n\tf3[1] = new nlobjSearchFilter('isinactive',null,'is','F');\t\t\t\t\t\n\tvar col3 = new Array();\n\tcol3[0] = new nlobjSearchColumn('custrecord_spk_apm_apv');\n\tvar searchResult = nlapiSearchRecord('customrecord_spk_apm_approver',null,f3,col3);\n\tif(searchResult) {\n\t\tvar managerRec = searchResult[0];\n\t\tvar apmanager = managerRec.getValue('custrecord_spk_apm_apv');\n\t\tvar delegate_apmanager = getDelegateApprover(apmanager);\n\t\tvbRec.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n k=k+1;\n\t\tif(delegate_apmanager) {\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_apmanager);\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof',apmanager);\n\t\t}\n\t\telse {\n\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', apmanager);\n\t\t}\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','AP Manager');\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n\t\tvbRec.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t}\n return k;\n}",
"function findSalesOrder(extId) {\r\n\r\n var aSearchFilters = new Array();\r\n aSearchFilters.push(new nlobjSearchFilter('externalid', null, 'is', extId));\r\n aSearchFilters.push(new nlobjSearchFilter('type', null, 'is', 'SalesOrd'));\r\n aSearchFilters.push(new nlobjSearchFilter('mainline', null, 'is', 'T'));\r\n //aSearchFilters.push(new nlobjSearchFilter('internalid', 'item', 'is', prodId));\r\n\r\n var aSearchColumns = new Array();\r\n aSearchColumns.push(new nlobjSearchColumn('internalid'));\r\n aSearchColumns.push(new nlobjSearchColumn('type'));\r\n\r\n var aSearchResults = nlapiSearchRecord('transaction', null, aSearchFilters, aSearchColumns);\r\n if (aSearchResults) {\r\n return aSearchResults[0].getId();\r\n } else {\r\n return 0;\r\n }\r\n\r\n}",
"function update_entityuse_codes() {\n //create an object with all unique customers \n nlapiLogExecution('AUDIT', ' -,-,- update entity/use codes -,-,- ');\n var array_of_customers = [];\n // var filters = [];\n // var columns = [\n // new nlobjSearchColumn('internalid')\n // ];\n // //run SuiteScript function to grab all customer ids and put them into an array\n // var customerSearch = nlapiCreateSearch('customer', filters, columns);\n // var result_set = customerSearch.runSearch();\n array_of_customers = nlapiSearchRecord(\"customer\", null,\n [\n [\"internalidnumber\", \"equalto\", \"894942\"],\n \"OR\",\n [\"internalidnumber\", \"equalto\", \"895145\"],\n \"OR\",\n [\"internalidnumber\", \"equalto\", \"895144\"]\n ],\n [\n new nlobjSearchColumn(\"entityid\").setSort(false)\n ]\n );\n // array_of_customers = getAllResults(result_set);\n checkGovernance(max_governance, 'Create Array of Customers', 0, array_of_customers.length);\n //run SuiteScript function to loop through customer ids, check if stage is equal to lead, prospect, then setting new entity fields\n for (var i = 0; i < array_of_customers.length; i++) {\n checkGovernance(max_governance, 'Set Entity/Use Code for Customer', i, array_of_customers.length);\n set_entityuse_code(array_of_customers[i].id, i, array_of_customers.length);\n }\n}",
"function checkAPAndARAccount(stAccount,stEntityType,stEntityId,stTriggerFrom,stParentSubs)\r\n{\r\n var isValid = true;\r\n \r\n var recAcct = nlapiLoadRecord('account',stAccount);\r\n //var arrAcctSubs = recAcct.getFieldValue('subsidiary');\r\n //arrAcctSubs = (typeof arrAcctSubs=='string') ? arrAcctSubs.split(',') : arrAcctSubs;\r\n var bIsEliminate = recAcct.getFieldValue('eliminate');\r\n var arrEntity = nlapiLookupField(stEntityType,stEntityId,['subsidiary','representingsubsidiary']);\r\n var stEntSubs = arrEntity.subsidiary;\r\n var stEntRepSubs = arrEntity.representingsubsidiary;\r\n \r\n if(stTriggerFrom=='suitelet')\r\n {\r\n var stDestSubs = nlapiGetCurrentLineItemValue('custpage_svb_dist_details','custpage_svb_details_subsidiary');\r\n var stParentId = nlapiGetFieldValue('custpage_svb_schedule_template');\r\n }\r\n else\r\n {\r\n var stDestSubs = nlapiGetFieldValue('custrecord_svb_line_subsidiary');\r\n var stParentId = nlapiGetFieldValue('custrecord_svb_line_parent_link');\r\n }\r\n \r\n if(bIsEliminate!='T')\r\n {\r\n (stEntityType=='customer') ? alert('Intercompany AR Account must have the \"Eliminate Intercompany Transactions\" field checked.') :\r\n alert('Intercompany AP Account must have the \"Eliminate Intercompany Transactions\" field checked.');\r\n return false;\r\n }\r\n \r\n if((!checkWithinSubsidiary('account',stAccount,stEntSubs) || !checkWithinSubsidiary('account',stAccount,stParentSubs)) && stEntityType=='customer')\r\n {\r\n alert(\"Both Intercompany AR Account subsidiary and Intercompany Customer subsidiary must be the same with Source subsidiary\");\r\n isValid = false;\r\n }\r\n else if((!checkWithinSubsidiary('account',stAccount,stEntSubs) || !checkWithinSubsidiary('account',stAccount,stDestSubs)) && stEntityType=='vendor')\r\n {\r\n alert(\"Both Intercompany AP Account subsidiary and Intercompany Vendor subsidiary must be the same with Destination subsidiary\");\r\n isValid = false;\r\n }\r\n else\r\n {\r\n if(stEntRepSubs!=stDestSubs && stEntityType=='customer')\r\n {\r\n alert(\"Intercompany Customer's 'Represents Subsidiary' must be the same with Destination Subsidiary\");\r\n isValid = false;\r\n }\r\n else if(stEntRepSubs!=stParentSubs && stEntityType=='vendor')\r\n {\r\n alert(\"Intercompany Vendor's 'Represents Subsidiary' must be the same with Source Subsidiary\");\r\n isValid = false;\r\n }\r\n }\r\n \r\n return isValid;\r\n}",
"function setSorAttributes(basket, obj) {\n for each (var pli in basket.productLineItems) {\n if (Object.keys(obj).indexOf(pli.productID) >= 0) {\n pli.custom.hasSmartOrderRefill = true;\n pli.custom.SorMonthInterval = obj[pli.productID].SorMonthInterval;\n pli.custom.SorWeekInterval = obj[pli.productID].SorWeekInterval;\n pli.custom.SorPeriodicity = obj[pli.productID].SorPeriodicity;\n }\n }\n}",
"function getRepaymentTerm() {\n let terms = NPER(valueStore.apr, -(conValues.repaymentSum), conValues.balanceSum);\n conValues.term = Math.round(terms);\n }",
"function vbApprovalRouting(type,form) // After submit function\n{\n\ttry {\n\t\tvar fileId = nlapiGetFieldValue('custbody_splunk_attach_bill');\n\t\tif(fileId) {\n\t\t\t//Attaching the file to the record after saving the record.\n\t\t\tnlapiAttachRecord('file', fileId, nlapiGetRecordType(),nlapiGetRecordId()); \n\t\t}\n\t} \n\tcatch (e) {\n\t\tnlapiLogExecution('DEBUG', e.name || e.getCode(), e.message || e.getDetails());\n\t}\n\t/*ENHC0051710-----Start Code for Populating the FP&A Approver Added by Anchana SV*/\n\tvar recordId = nlapiGetRecordId();\n\tvar vbRec = nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId());\n\tvar currentCount = parseInt(vbRec.getLineItemCount('item'));\n\tvar currentCountexpense = parseInt(vbRec.getLineItemCount('expense'));\n\tvar item_department ='';\n\tvar item_amount = new Array();\n\tif(currentCount){\n\tfor(var i=0;i<currentCount;i++){\n\t\titem_amount[i] = vbRec.getLineItemValue('item','amount',i+1);\n\t\tnlapiLogExecution('DEBUG','itemamount',item_amount);\n\t}\n\tvar largest = Math.max.apply(Math, item_amount);//getting Largest of the line item Amount\n\tnlapiLogExecution('DEBUG','Largest',largest);\n\t\n\tfor(var i=0;i<currentCount;i++){\n\t\titem_amount[i] = vbRec.getLineItemValue('item','amount',i+1);\n\t\tif(item_amount[i]==largest){\n\t\titem_department = vbRec.getLineItemValue('item','department',i+1);\n\t\tnlapiLogExecution('DEBUG','depart',item_department);\n\t\t}\n\t}\n\t}\n\telse if(currentCountexpense){\n\t\tfor(var i=0;i<currentCountexpense;i++){\n\t\titem_amount[i] = vbRec.getLineItemValue('expense','amount',i+1);\n\t\tnlapiLogExecution('DEBUG','itemamount',item_amount);\n\t}\n\tvar largest = Math.max.apply(Math, item_amount);\n\tnlapiLogExecution('DEBUG','Largest',largest);\n\t\n\tfor(var i=0;i<currentCountexpense;i++){\n\t\titem_amount[i] = vbRec.getLineItemValue('expense','amount',i+1);\n\t\tif(item_amount[i]==largest){\n\t\titem_department = vbRec.getLineItemValue('expense','department',i+1);\n\t\tnlapiLogExecution('DEBUG','depart',item_department);\n\t\t}\n\t}\n\t}\n\t/*ENHC0051710-----End Added by Anchana SV*/\t\n\tvar poId = nlapiGetFieldValue('custbody_spk_poid');\n\tif (type == 'create') {\n\t\tif(!poId) {\n\t\t\t\n\t\t\tvar k = 0;\n\t\t\t\n\t\t\t// Fetching the Bill amount and the owner information of the bill\n\t\t\tvar vbAmount = exchangerate(vbRec);\n\t\t\tvar vbSubs = vbRec.getFieldValue('subsidiary');\n\t\t\tvar vbOwner = vbRec.getFieldValue('custbody_spk_inv_owner');\n\t\t\tvar excludeSupervisor = vbRec.getFieldValue('custbody_spk_excludesupervisor');\n\t\t\tvar nonPOBillReason = vbRec.getFieldValue('custbody_spk_nonpobillreason');\n\t\t\tvar date = new Date();\n\t\t\tvar requestDate = nlapiDateToString(date,'datetimetz');\n\t\t\tnlapiLogExecution('DEBUG', 'vbOwner is '+vbOwner, 'vbAmount '+vbAmount);\n\t\t\tvbRec.setFieldValue('custbody_spk_inv_converted_amt',vbAmount);\n\t\t\tvar f1 = new Array();\n\t\t\tf1[0] = new nlobjSearchFilter('custrecord_spk_ioa_invown',null,'is',vbOwner);\n\t\t\tf1[1] = new nlobjSearchFilter('isinactive',null,'is','F');\n\t\t\tvar c1 = new Array();\n\t\t\tc1[0] = new nlobjSearchColumn('custrecord_spk_ioa_apvlvl');\n\t\t\tc1[1] = new nlobjSearchColumn('custrecord_spk_ioa_apvr');\n\t\t\tvar records = nlapiSearchRecord('customrecord_spk_inv_own_apvr',null,f1,c1);\t\t\t\n\t\t\tif(records) {\n\t\t\t\t\n\t\t\t\tif(vbSubs) { //ENHC0051710:set HTCREviewer to the Approval matrix added by Anchana SV\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tsetHTCReviewer(vbRec,vbSubs,vbOwner,k); \n\t\t\t\t\t vbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_reqdt',requestDate);\n\t\t\t\t\t vbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_cmnts',nlapiGetFieldValue('custbody_rejection_comments'));\n\t\t\t\t\t vbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvstatus',4);\n\t\t\t\t\t vbRec.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tk = k+1;\n\t\t\t\t\t// Creating Entry of the invoice Owner\n\t\t\t\t\tvar delegate_owner = getDelegateApprover(vbOwner);\n\t\t\t\t\tvbRec.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n\t\t\t\t\tif(delegate_owner) {\n\t\t\t\t\t\t//vbRec.setFieldValue('custbody_spk_inv_apvr',delegate_owner);\n\t\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_owner);\n\t\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof', vbOwner);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//vbRec.setFieldValue('custbody_spk_inv_apvr',vbOwner);\n\t\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', vbOwner);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','Business Owner');\n\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\t\t\t\tvbRec.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n vbRec.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcatch (e) {\n\t\t\t\t\tnlapiLogExecution('ERROR', e.name || e.getCode(), e.message || e.getDetails());\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar approverLevel = records[0].getValue('custrecord_spk_ioa_apvlvl');\n\t\t\t\tvar approver = records[0].getValue('custrecord_spk_ioa_apvr');\n\t\t\t\t//Bills with Amount <= $0\n\t\t\t\t//var nonpoAmtLimit = 0;\n\t\t\t\tif(vbAmount <= parseFloat(nonpoAmtLimit)) {\n\t\t\t\t//Scenario-1: If ‘Exclude Supervisor’ flag is selected\n\t\t\t\t//set 1. Business Owner 2. FP&A 3. AP Manager\n\t\t\t\t\tif(excludeSupervisor == 'T') {\n\t\t\t\t\t\t/**** Setting FP&A Approver on vendor bill ******/\n\t\t\t\t\t\t//k = k+1;\n\t\t\t\t\t\t\n\t\t\t\t\t\tk = SetFPAApprover(vbRec,vbOwner,item_department,k);\n\t\t\t\t\t\t/**** ENHC0051710:Setting Senior AP clerk on vendor bill ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\tSetAPManager(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t} //if(vbSubs)\n\t\t\t\t\t}\n\t\t\t\t\telse { //(excludeSupervisor != 'T')\n\t\t\t\t\t//Scenario-2: If ‘Exclude Supervisor' flag is NOT selected; the program will route the same as the standard process today\n\t\t\t\t\t//set 1. Business Owner 2. Supervisor (s) 3. FP&A 4.\tExecutive (s) [for amount >= $10,000] 5. AP Manager\n\t\t\t\t\t\t/**** Setting Subsequent supervisor based on the Bill Amount ******/\n\t\t\t\t\t\tk = SetSupervisor(vbRec,vbOwner,vbAmount,approverLevel,approver,k);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**** Setting FP&A Approver on vendor bill ******/\n\t\t\t\t\t\t//k = k+1;\n\t\t\t\t\t\t//var dept_Owner = nlapiLookupField('employee',vbOwner,'department');\n\t\t\t\t\t\tk = SetFPAApprover(vbRec,vbOwner,item_department,k);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/**** Setting Executives entry based on the vendor bill amount ******/\n\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'ExecutiveReqAmtLimit '+ExecutiveReqAmtLimit, ' vbAmount '+vbAmount);\n\t\t\t\t\t\tk = SetExecutives(vbRec,vbAmount,vbOwner,k);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**** ENHC0051710 :Setting Senior AP clerk on vendor bill ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\tSetAPManager(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t} //if(vbSubs)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(vbAmount > parseFloat(nonpoAmtLimit)) { //Bills with Amount > $1000\n\t\t\t\t//Scenario-3: If the ‘Non-PO Bill Reason’ has ‘PO Exempt’ selected, \n\t\t\t\t\tif(nonPOBillReason == 1) { //PO Exempt\n\t\t\t\t\t\t/**** Setting FP&A Approver on vendor bill ******/\n\t\t\t\t\t\t//k = k+1;\n\t\t\t\t\t\t//var dept_Owner = nlapiLookupField('employee',vbOwner,'department');\n\t\t\t\t\t\tk = SetFPAApprover(vbRec,vbOwner,item_department,k);\n\t\t\t\t\t\t\n\t\t\t\t\t\t/**** ENHC0051710:Setting Senior AP clerk on vendor bill ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\tSetAPManager(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t} //if(vbSubs)\n\t\t\t\t\t}\n\t\t\t\t\telse if(nonPOBillReason == 2) { //PO Exception\n\t\t\t\t\t//Scenario-4: If the ‘Non-PO Bill Reason’ has ‘PO Exception’ selected & the ‘Exclude Supervisor’ flag is selected\n\t\t\t\t\t//set 1. Business Owner 2. FP&A 3. AP Manager\n\t\t\t\t\t\tif(excludeSupervisor == 'T') {\n\t\t\t\t\t\t\t/**** Setting FP&A Approver on vendor bill ******/\n\t\t\t\t\t\t\t//k = k+1;\n\t\t\t\t\t\t\t//var dept_Owner = nlapiLookupField('employee',vbOwner,'department');\n\t\t\t\t\t\t\tk = SetFPAApprover(vbRec,vbOwner,item_department,k);\n\t\t\t\t\t\t\t/**** ENHC0051710:Setting Senior AP clerk on vendor bill ******/\n\t\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPManager(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t} //if(vbSubs)\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse { //(excludeSupervisor != 'T')\n\t\t\t\t\t\t//Scenario-5: If the ‘Non-PO Bill Reason’ has ‘PO Exception’ selected & the ‘Exclude Supervisor’ flag is NOT selected\n\t\t\t\t\t\t//set 1. Business Owner 2. Supervisor (s) 3. FP&A 4.\tExecutive (s) [for amount >= $10,000] 5. AP Manager\n\n\t\t\t\t\t\t\t/**** Setting Subsequent supervisor based on the Bill Amount ******/\n\t\t\t\t\t\t\tk = SetSupervisor(vbRec,vbOwner,vbAmount,approverLevel,approver,k);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**** Setting FP&A Approver on vendor bill ******/\n\t\t\t\t\t\t\t//k = k+1;\n\t\t\t\t\t\t\t//var dept_Owner = nlapiLookupField('employee',vbOwner,'department');\n\t\t\t\t\t\t\tk = SetFPAApprover(vbRec,vbOwner,item_department,k);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**** Setting Executives entry based on the vendor bill amount ******/\n\t\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'ExecutiveReqAmtLimit '+ExecutiveReqAmtLimit, ' vbAmount '+vbAmount);\n\t\t\t\t\t\t\tk = SetExecutives(vbRec,vbAmount,vbOwner,k);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**** ENHC0051710:Setting Senior AP clerk on vendor bill ******/\n\t\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\t\t\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPManager(vbRec,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t} //if(vbSubs)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tvbRec.setFieldValue('custbody_spk_bill_creator',nlapiGetUser());\n\t\t\t//Submit the Vendor Bill record, along with the Approval Matrix created\n\t\t\tvar vbRecId = nlapiSubmitRecord(vbRec);\n\t\t\tnlapiLogExecution('DEBUG', 'vbRecId is', vbRecId);\n\t\t}\n\t\t/****** If vendor bill is created from a purchase order , check for Service Items and Goods Items for generating Approval Matrix******/\n\t\telse if(poId)\n\t\t{\n\t\t\tvar vbRec_PO = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());\n\t\t\tvar expenseCount = nlapiGetLineItemCount('expense');\n\t\t\tvar vbOwner = vbRec_PO.getFieldValue('custbody_spk_inv_owner');\n\t\t\tvar itemCount = nlapiGetLineItemCount('item');\t\n\t\t\tvar subs = vbRec_PO.getFieldValue('subsidiary');\n\t\t\tvar vbAmount = exchangerate(vbRec_PO);\n\t\t\tvar flag = true;\n\t\t\tvar k = 0;\n\t\t\tif(itemCount) // If Item sublist has any line.\n\t\t\t{\n\t\t\t\tfor(var i=1;i<=itemCount;i++)\n\t\t\t\t{\n\t\t\t\t\tvar itemId = nlapiGetLineItemValue('item','item',i);\n\t\t\t\t\tvar isServiceItem = nlapiLookupField('item',itemId,'isfulfillable');\n\t\t\t\t\tif(isServiceItem == 'F')\n\t\t\t\t\t{\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar vbSubs = vbRec_PO.getFieldValue('subsidiary');\n\t\t\tvbRec_PO.setFieldValue('custbody_spk_inv_converted_amt',vbAmount);\t\t\t\n\t\t\tvar date = new Date();\n\t\t\tvar requestDate = nlapiDateToString(date,'datetimetz');\n\t\t\tif(vbSubs) {//ENHC0051710:set HTCREviewer to the Approval matrix\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tsetHTCReviewer(vbRec_PO,vbSubs,vbOwner,k); \n\t\t\t\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_reqdt',requestDate);\n\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvstatus','4');\n\t\t\t\tvbRec_PO.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\t\t\t\t}\n\t\t\t//For the bills with PO, if the bill contains only goods item in it, the Invoice Business Owner should get auto-populated from the Purchase Requester value of the corresponding Purchase Order\n\t\t\tif(flag == false || expenseCount)\n\t\t\t{\n\t\t\t\tk = k+1;\n\t\t\t\tvar delegate_owner = getDelegateApprover(vbOwner);\n\t\t\t\tnlapiLogExecution('DEBUG', 'delegate_owner is', delegate_owner);\n\t\t\t\tvbRec_PO.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n\t\t\t\tif(delegate_owner)\n\t\t\t\t{\n\t\t\t\t\t//vbRec_PO.setFieldValue('custbody_spk_inv_apvr',delegate_owner);\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_owner);\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof', vbOwner);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//vbRec_PO.setFieldValue('custbody_spk_inv_apvr',vbOwner);\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', vbOwner);\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','Business Owner');\t\t\t\t\t\t\n\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n\t\t\t\tvbRec_PO.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\t/**** ENHC0051710:Setting Senior AP clerk on vendor bill ******/\n\t\t\tif(vbSubs) {\n\t\t\t\t\t\t\t\tk = k+1;\n\t\t\t\t\t\t\t\tSetAPClerk(vbRec_PO,vbSubs,vbOwner,k);\n\t\t\t\t\t\t\t}\n\t\t\t/**** Setting AP Manager Value based on the subsidiary of the vendor selected ******/\n\t\t\tif(subs)\n\t\t\t{\t\t\t\t\t\t\t\n\t\t\t\tk = k+1;\n\t\t\t\tvar f3 = new Array();\n\t\t\t\tf3[0] = new nlobjSearchFilter('custrecord_spk_apm_sub',null,'anyof',subs);\n\t\t\t\tf3[1] = new nlobjSearchFilter('isinactive',null,'is','F');\n\t\t\t\tvar searchResult = nlapiSearchRecord('customrecord_spk_apm_approver',null,f3);\n\t\t\t\tif(searchResult)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\tvar managerRec = nlapiLoadRecord(searchResult[0].getRecordType(),searchResult[0].getId());\n\t\t\t\t\tvar apmanager = managerRec.getFieldValue('custrecord_spk_apm_apv');\n\t\t\t\t\tvar delegate_apmanager = getDelegateApprover(apmanager);\n\t\t\t\t\tvbRec_PO.selectNewLineItem('recmachcustrecord_spk_apvmtx_tranno');\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_seq', k);\n\t\t\t\t\tk=k+1;\n\t\t\t\t\tif(delegate_apmanager)\n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr',delegate_apmanager);\n\t\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_delgtof',apmanager);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvr', apmanager);\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvrl','AP Manager');\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'flag1 is'+flag, 'expenseCount1 is'+expenseCount);\n\t\t\t\t\tif(flag == true && (expenseCount == 0))\n\t\t\t\t\t{\t\n\t\t\t\t\t\tnlapiLogExecution('DEBUG', 'flag is'+flag, 'expenseCount is'+expenseCount);\n\t\t\t\t\t\t//vbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_reqdt',requestDate);\n\t\t\t\t\t\t//vbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apvstatus','4');\n\t\t\t\t\t\t//if(delegate_apmanager)\n\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t//vbRec_PO.setFieldValue('custbody_spk_inv_apvr',delegate_apmanager);\n\t\t\t\t\t\t//}\n\t\t\t\t\t\t//else\n\t\t\t\t\t\t//{\n\t\t\t\t\t\t\t//vbRec_PO.setFieldValue('custbody_spk_inv_apvr',apmanager);\n\t\t\t\t\t\t//}\n\t\t\t\t\t}\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_apmanager',nlapiGetUser());\n\t\t\t\t\tvbRec_PO.setCurrentLineItemValue('recmachcustrecord_spk_apvmtx_tranno', 'custrecord_spk_apvmtx_invown',vbOwner);\n\t\t\t\t\tvbRec_PO.commitLineItem('recmachcustrecord_spk_apvmtx_tranno');\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tthrow nlapiCreateError('User Defined', 'The Ap Manager Record is inactive or there is no approver for the subsidiary. Please contact your Administrator.. Please contact your Administrator.', true);\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tvbRec_PO.setFieldValue('custbody_spk_bill_creator',nlapiGetUser());\n\t\t\t//Submit the Vendor Bill record\n\t\t\tvar vbFromPOId = nlapiSubmitRecord(vbRec_PO);\n\t\t\tnlapiLogExecution('DEBUG','rec id is',vbFromPOId);\n\t\t}\n\t}\n\telse if(type == 'edit') // When editing the amount field, the same gets updated on custom bill as well.\n\t{\n\t\tvar newAmount = parseFloat(nlapiGetFieldValue('usertotal'));\n\t\tvar vbSubs = nlapiGetFieldValue('subsidiary');\n\t\tvar vbCurrency = nlapiGetFieldValue('currency');\t\t\n\t\tif(vbCurrency == '1') // If currency is USD.\n\t\t{\n\t\t\tvar recId = nlapiSubmitField(nlapiGetRecordType(),nlapiGetRecordId(),'custbody_spk_inv_converted_amt',newAmount);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar rate = nlapiExchangeRate(vbCurrency,'USD');\n\t\t\tnewAmount = parseFloat(newAmount * rate) ;\n\t\t\tvar recId = nlapiSubmitField(nlapiGetRecordType(),nlapiGetRecordId(),'custbody_spk_inv_converted_amt',newAmount);\n\t\t}\n\t\tvar filter = new Array();\n\t\tfilter[0] = new nlobjSearchFilter('custrecord_spk_vb_billid',null,'is',nlapiGetRecordId());\n\t\tvar record = nlapiSearchRecord('customrecord_spk_vendorbill',null,filter);\n\t\tif(record)\n\t\t{\n\t\t\tvar customVbId = nlapiSubmitField(record[0].getRecordType(),record[0].getId(),'custrecord_spk_vb_cnvtrd_inv_amnt',newAmount);\n\t\t}\n\t}\n\telse if(type == 'delete') // If deleting any standard bill, corresponding bill should also get deleted.\n\t{\n\t\tvar filter = new Array();\n\t\tfilter[0] = new nlobjSearchFilter('custrecord_spk_vb_billid',null,'is',nlapiGetRecordId());\n\t\tvar record = nlapiSearchRecord('customrecord_spk_vendorbill',null,filter);\n\t\tif(record)\n\t\t{\n\t\t\tvar f1 = new Array();\n\t\t\tf1[0] = new nlobjSearchFilter('custrecord_spk_vb_itemlink',null,'is',record[0].getId());\n\t\t\tvar result = nlapiSearchRecord('customrecord_spk_vb_item',null,f1);\n\t\t\tfor(var i =0;result && i<result.length;i++)\n\t\t\t{\n\t\t\t\tnlapiDeleteRecord(result[i].getRecordType(),result[i].getId());\n\t\t\t}\n\t\t\tvar f2 = new Array();\n\t\t\tf2[0] = new nlobjSearchFilter('custrecord_spk_vb_explink',null,'is',record[0].getId());\n\t\t\tvar recs = nlapiSearchRecord('customrecord_spk_vb_exp',null,f2);\n\t\t\tfor(var j =0;recs && j<recs.length;j++)\n\t\t\t{\n\t\t\t\tnlapiDeleteRecord(recs[j].getRecordType(),recs[j].getId());\n\t\t\t}\n\t\t\tnlapiDeleteRecord(record[0].getRecordType(),record[0].getId());\t\t\t\t\t\t\n\t\t}\n\t}\n}",
"function closeSalesOrder(salesId) {\r\n var context = nlapiGetContext();\r\n nlapiLogExecution('Debug', 'ExecutionContext ' + context.getExecutionContext());\r\n //Open the related sales order\r\n var invSalesOrder = salesId;//nlapiGetFieldValue('custbody_ghi_original_sales_order');\r\n var clSO = nlapiLoadRecord('salesorder', invSalesOrder);\r\n var lineCount = clSO.getLineItemCount('item');\r\n for (var i = 0; i < lineCount; i++) {\r\n clSO.setLineItemValue('item', 'isclosed', i + 1, 'T');\r\n }\r\n nlapiSubmitRecord(clSO);\r\n}",
"function multipleInsurerPremiumCalc(idv) {\n\t\t\t\t\t\tvar details = StorageService.getAll();\n\n\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\"CustomerDetails\" : {\n\t\t\t\t\t\t\t\t\"firstName\" : details.personalInfo.firstName,\n\t\t\t\t\t\t\t\t\"lastName\" : details.personalInfo.lastName,\n\t\t\t\t\t\t\t\t\"mobileNo\" : details.personalInfo.mobileNo,\n\t\t\t\t\t\t\t\t\"email\" : details.personalInfo.email,\n\t\t\t\t\t\t\t\t\"customerType\" : details.vehicleInfo.vehicleRegisteredTo.code,\n\t\t\t\t\t\t\t\t\"aadharNumber\" : details.personalInfo.aadhaarNo1\n\t\t\t\t\t\t\t\t\t\t+ \"-\"\n\t\t\t\t\t\t\t\t\t\t+ details.personalInfo.aadhaarNo2\n\t\t\t\t\t\t\t\t\t\t+ \"-\" + details.personalInfo.aadhaarNo3,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"QuotationData\" : {\n\t\t\t\t\t\t\t\t\"quoteNo\" : angular.isDefined(StorageService\n\t\t\t\t\t\t\t\t\t\t.get(\"quoteNo\")) ? StorageService\n\t\t\t\t\t\t\t\t\t\t.get(\"quoteNo\") : '',\n\t\t\t\t\t\t\t\t\"lineOfBusiness\" : details.productcode,\n\t\t\t\t\t\t\t\t\"subLine\" : details.subProductName,\n\t\t\t\t\t\t\t\t\"productCode\" : details.subProductCode,\n\t\t\t\t\t\t\t\t\"productName\" : \"COMPREHENSIVE\",\n\t\t\t\t\t\t\t\t\"businessType\" : \"Rollover\",\n\t\t\t\t\t\t\t\t\"policyStartDate\" : details.vehicleInfo.policyStartDate,\n\t\t\t\t\t\t\t\t\"expiryDate\" : details.vehicleInfo.policyEndDate,\n\t\t\t\t\t\t\t\t\"userId\" : $rootScope.loginId,\n\t\t\t\t\t\t\t\t\"agentCode\" : $rootScope.profileId,\n\t\t\t\t\t\t\t\t\"oaCode\" : \"\",\n\t\t\t\t\t\t\t\t\"isVipPolicy\" : \"N\",\n\t\t\t\t\t\t\t\t\"agentName\" : $rootScope.username,\n\t\t\t\t\t\t\t\t\"channelType\" : \"POT\",\n\t\t\t\t\t\t\t\t\"branchName\" : \"\",\n\t\t\t\t\t\t\t\t\"branchCode\" : \"\",\n\t\t\t\t\t\t\t\t\"quoteStatus\" : \"QUOTE\",\n\t\t\t\t\t\t\t\t\"PreviousPolicyDetails\" : {\n\t\t\t\t\t\t\t\t\t\"prevPolicyNo\" : \"\",\n\t\t\t\t\t\t\t\t\t\"prevPolicyExp\" : details.vehicleInfo.prevPolicyExpDate,\n\t\t\t\t\t\t\t\t\t\"prevPolicyNcb\" : details.vehicleInfo.ncb.ncbPercentage,\n\t\t\t\t\t\t\t\t\t\"prevPolicyInsurerCode\" : details.vehicleInfo.previousPolicyInsurer.insurerCode,\n\t\t\t\t\t\t\t\t\t\"prevPolicyInsurerName\" : details.vehicleInfo.previousPolicyInsurer.insurerName,\n\t\t\t\t\t\t\t\t\t\"isPrevPolicyClaim\" : details.vehicleInfo.isAnyClaim,\n\t\t\t\t\t\t\t\t\t\"prevPolicyType\" : details.vehicleInfo.policyType.code,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\"VehicleDetails\" : {\n\t\t\t\t\t\t\t\t\"registrationNo\" : details.vehicleInfo.regNo1\n\t\t\t\t\t\t\t\t\t\t+ \"-\" + details.vehicleInfo.regNo2\n\t\t\t\t\t\t\t\t\t\t+ \"-\" + details.vehicleInfo.regNo3\n\t\t\t\t\t\t\t\t\t\t+ \"-\" + details.vehicleInfo.regNo4,\n\t\t\t\t\t\t\t\t\"yearOfMfg\" : details.vehicleInfo.yearOfMfg,\n\t\t\t\t\t\t\t\t\"registrationDate\" : details.vehicleInfo.registrationDate,\n\t\t\t\t\t\t\t\t\"makeCode\" : details.vehicleInfo.manufacturer.code,\n\t\t\t\t\t\t\t\t\"modelCode\" : details.vehicleInfo.model.code,\n\t\t\t\t\t\t\t\t\"makeName\" : details.vehicleInfo.manufacturer.name,\n\t\t\t\t\t\t\t\t\"modelName\" : details.vehicleInfo.model.name,\n\t\t\t\t\t\t\t\t\"subModelName\" : details.vehicleInfo.subModel.subModelName,\n\t\t\t\t\t\t\t\t\"subModelCode\" : details.vehicleInfo.subModel.subModelCode,\n\t\t\t\t\t\t\t\t\"engineCC\" : details.vehicleInfo.engineCC,\n\t\t\t\t\t\t\t\t\"fuelType\" : details.vehicleInfo.fuelType,\n\t\t\t\t\t\t\t\t\"rtoCode\" : details.vehicleInfo.rtoZoneCode,\n\t\t\t\t\t\t\t\t\"rtoName\" : details.vehicleInfo.rtoZoneLocation,\n\t\t\t\t\t\t\t\t\"actualIdv\" : idv,\n\t\t\t\t\t\t\t\t\"vehicleAge\" : vehicleAgeCaluculation(),\n\t\t\t\t\t\t\t\t\"seatingCapacity\" : details.vehicleInfo.seatingCapacity,\n\t\t\t\t\t\t\t\t\"cubicCapacity\" : details.vehicleInfo.engineCC,\n\t\t\t\t\t\t\t\t\"zone\" : details.vehicleInfo.ZoneArea,\n\t\t\t\t\t\t\t\t\"currentNCB\" : details.vehicleInfo.currentNCB.ncbPercentage,\n\t\t\t\t\t\t\t\t\"isInBuilt\" : details.vehicleInfo.inbuilt,\n\t\t\t\t\t\t\t\t\"isCarOwnerChanged\" : details.vehicleInfo.isCarOwnerChanged\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\t/*console\n\t\t\t\t\t\t\t\t.log((\"multipleInsurerPremiumCalcData => \" + JSON\n\t\t\t\t\t\t\t\t\t\t.stringify(data)));*/\n\t\t\t\t\t\tvar deferred = $q.defer();\n\t\t\t\t\t\tvar method=\"POST\";\n\t\t\t\t\t\tvar url = UrlConstants.MIS_CLOUD + UrlConstants.MULTIPLE_INS_PREMIUM_CALC;\n\t\t\t\t\t\tcacheFactory.getJsonWithOutCache(method, url, data).then(function (response) {\n\t\t\t\t\t\t\tpremiumDetailsForAll = response.data;\n\t\t\t\t\t\t\tStorageService.set(\"quoteNo\", response.data.quoteNo);\n\t\t\t\t\t\t\tdeferred.resolve(response);\n\t\t\t\t\t\t},function error(response){\n\t\t\t\t\t\t\tdeferred.reject(response);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn deferred.promise;\n\t\t\t\t\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transform payment mean to payment method. The goal is to have a coherent object structure between api calls (/me/payment/method and /me/paymentMean/) | transformUSPaymentMethodToPaymentMethod(usPaymentMethod) {
const paymentType = get(usPaymentMethod, 'paymentType', null);
const paymentStatus = get(usPaymentMethod, 'status', null);
return {
paymentSubType: get(usPaymentMethod, 'paymentSubType', null),
icon: {
name: null,
data: null,
},
status: this.getFullPaymentStatus(paymentStatus, paymentType),
paymentMethodId: usPaymentMethod.id,
default: get(usPaymentMethod, 'default', false),
description: get(usPaymentMethod, 'description', null),
paymentType: this.getFullPaymentType(paymentType),
billingContactId: get(usPaymentMethod, 'billingContactId', null),
creationDate: get(usPaymentMethod, 'creationDate', null),
lastUpdate: null,
label: get(usPaymentMethod, 'publicLabel', null),
original: usPaymentMethod,
};
} | [
"PayWithAnAlreadyRegisteredPaymentMean(orderId, paymentMean, paymentMeanId) {\n let url = `/me/order/${orderId}/payWithRegisteredPaymentMean`;\n return this.client.request('POST', url, { paymentMean, paymentMeanId });\n }",
"getManualPaymentMethod() {\n const pm = get(this.props.data, 'Collective.host.settings.paymentMethods.manual');\n if (!pm || get(this.state, 'stepDetails.interval')) {\n return null;\n }\n\n return {\n ...pm,\n instructions: this.props.intl.formatMessage(\n {\n id: 'host.paymentMethod.manual.instructions',\n defaultMessage:\n 'Instructions to make the payment of {amount} will be sent to your email address {email}. Your order will be pending until the funds have been received by the host ({host}).',\n },\n {\n amount: formatCurrency(get(this.state, 'stepDetails.totalAmount'), this.getCurrency()),\n email: get(this.props, 'LoggedInUser.email', ''),\n collective: get(this.props, 'loggedInUser.collective.slug', ''),\n host: get(this.props.data, 'Collective.host.name'),\n TierId: get(this.getTier(), 'id'),\n },\n ),\n };\n }",
"static updatePaymentResponseStructure(response) {\n var authResp = response.payment.authentication;\n response.method = authResp.method;\n response.url = authResp.url;\n\n if (response.method == \"POST\") {\n response.params = Array();\n\n for (var key of Object.values(Object.keys(authResp.params))) {\n response.params[key] = authResp.params[key];\n }\n }\n\n delete response.payment;\n return response;\n }",
"calcNettoPayment() {\n if (elements.ageInputWork.checked) {\n this.calcTax();\n this.netAmount = this.payment - this.PIT;\n } else {\n this.netAmountUnderAge = this.payment;\n }\n }",
"RetrieveAvailablePaymentMethod() {\n let url = `/me/payment/availableMethods`;\n return this.client.request('GET', url);\n }",
"ListAvailablePaymentMethodsInThisNicCountry() {\n let url = `/me/availableAutomaticPaymentMeans`;\n return this.client.request('GET', url);\n }",
"function paymentFromComponent(req, res, next) {\n const reqDataObj = JSON.parse(req.form.data);\n if (reqDataObj.cancelTransaction) {\n return handleCancellation(res, next, reqDataObj);\n }\n const currentBasket = BasketMgr.getCurrentBasket();\n let paymentInstrument;\n Transaction.wrap(() => {\n collections.forEach(currentBasket.getPaymentInstruments(), (item) => {\n currentBasket.removePaymentInstrument(item);\n });\n\n paymentInstrument = currentBasket.createPaymentInstrument(\n constants.METHOD_ADYEN_COMPONENT,\n currentBasket.totalGrossPrice,\n );\n const { paymentProcessor } = PaymentMgr.getPaymentMethod(\n paymentInstrument.paymentMethod,\n );\n paymentInstrument.paymentTransaction.paymentProcessor = paymentProcessor;\n paymentInstrument.custom.adyenPaymentData = req.form.data;\n\n if (reqDataObj.partialPaymentsOrder) {\n paymentInstrument.custom.adyenPartialPaymentsOrder =\n session.privacy.partialPaymentData;\n }\n paymentInstrument.custom.adyenPaymentMethod =\n AdyenHelper.getAdyenComponentType(req.form.paymentMethod);\n paymentInstrument.custom[\n `${constants.OMS_NAMESPACE}__Adyen_Payment_Method`\n ] = AdyenHelper.getAdyenComponentType(req.form.paymentMethod);\n paymentInstrument.custom.Adyen_Payment_Method_Variant =\n req.form.paymentMethod.toLowerCase();\n paymentInstrument.custom[\n `${constants.OMS_NAMESPACE}__Adyen_Payment_Method_Variant`\n ] = req.form.paymentMethod.toLowerCase();\n });\n\n handleExpressPayment(reqDataObj, currentBasket);\n\n let order;\n // Check if gift card was used\n if (currentBasket.custom?.adyenGiftCards) {\n const giftCardsOrderNo = currentBasket.custom.adyenGiftCardsOrderNo;\n order = OrderMgr.createOrder(currentBasket, giftCardsOrderNo);\n handleGiftCardPayment(currentBasket, order);\n } else {\n order = COHelpers.createOrder(currentBasket);\n }\n session.privacy.orderNo = order.orderNo;\n\n let result;\n Transaction.wrap(() => {\n result = adyenCheckout.createPaymentRequest({\n Order: order,\n PaymentInstrument: paymentInstrument,\n });\n });\n\n currentBasket.custom.amazonExpressShopperDetails = null;\n currentBasket.custom.adyenGiftCardsOrderNo = null;\n\n if (result.resultCode === constants.RESULTCODES.REFUSED) {\n handleRefusedResultCode(result, reqDataObj, order);\n }\n\n if (AdyenHelper.isApplePay(reqDataObj.paymentMethod?.type)) {\n result.isApplePay = true;\n }\n\n result.orderNo = order.orderNo;\n result.orderToken = order.orderToken;\n res.json(result);\n return next();\n}",
"paymentMethodOptions() {\n const {settings, invoices, setProp} = this.props;\n const selectedPaymentMethod = invoices.get('paymentMethod');\n const achAvailable = settings.getIn(['achInfo', 'accountNumber']);\n const ccAvailable = settings.get(['ccInfo', 'number']);\n // Determine payment options\n const paymentOptions = [];\n if (achAvailable) {\n paymentOptions.push({value: 'bank-account', name: 'Bank account'});\n // ACH only, select it\n if (!ccAvailable && selectedPaymentMethod === 'credit-card') {\n setProp('bank-account', 'paymentMethod');\n }\n }\n if (settings.get('getCcInfoSuccess')) {\n paymentOptions.push({value: 'credit-card', name: 'Credit card'});\n // CC only, select it\n if (!ccAvailable && selectedPaymentMethod === 'bank-account') {\n setProp('credit-card', 'paymentMethod');\n }\n }\n return Immutable.fromJS(paymentOptions);\n }",
"static async getPair(base, other) {\n let data = await this.getAllRates();\n let pair = {};\n pair[base] = data.rates[base];\n pair[other] = data.rates[other];\n return pair;\n }",
"function calculate(obj, buttonName) {\n if (buttonName === 'AC') {\n return {\n total: 0,\n next: '',\n operation: ''\n };\n }\n\n if (isNumber(buttonName)) {\n if (buttonName === '0' && obj.next === '0') {\n return {};\n } // If there is an operation, update next\n\n\n if (obj.operation) {\n if (obj.next) {\n return {\n next: obj.next + buttonName\n };\n }\n\n return _objectSpread({}, obj, {\n next: buttonName\n });\n } // If there is no operation, update next and clear the value\n\n\n if (obj.next) {\n return {\n next: obj.next + buttonName,\n total: ''\n };\n }\n\n return {\n next: buttonName,\n total: ''\n };\n }\n\n if (buttonName === '.') {\n if (obj.next) {\n if (obj.next.includes('.')) {\n return {};\n }\n\n return {\n next: \"\".concat(obj.next, \".\")\n };\n }\n\n if (obj.operation) {\n return {\n next: '0.'\n };\n }\n\n if (obj.total) {\n if (obj.total.includes('.')) {\n return {};\n }\n\n return {\n total: \"\".concat(obj.total, \".\")\n };\n }\n\n return {\n total: '0.'\n };\n }\n\n if (buttonName === '=') {\n if (obj.next && obj.operation) {\n return {\n total: (0, _operate[\"default\"])(obj.total, obj.next, obj.operation),\n next: '',\n operation: ''\n };\n } // '=' with no operation, nothing to do\n\n\n return {};\n }\n\n if (buttonName === '+/-') {\n if (obj.next) {\n return {\n next: (-1 * parseFloat(obj.next)).toString()\n };\n }\n\n if (obj.total) {\n return {\n total: (-1 * parseFloat(obj.total)).toString()\n };\n }\n\n return {};\n } // Button must be an operation\n // When the user presses an operation button without having entered\n // a number first, do nothing.\n\n\n if (!obj.next && !obj.total) {\n return {};\n } // no operation yet, but the user typed one\n // The user hasn't typed a number yet, just save the operation\n\n\n if (!obj.next) {\n return {\n operation: buttonName\n };\n } // User pressed an operation button and there is an existing operation\n\n\n if (obj.operation) {\n return {\n total: (0, _operate[\"default\"])(obj.total, obj.next, obj.operation),\n next: '',\n operation: buttonName\n };\n } // save the operation and shift 'next' into 'total'\n\n\n return {\n total: obj.next,\n next: '',\n operation: buttonName\n };\n}",
"function serializePayment(payment: Payment): Buffer {\n const toData = payment.to.converseToBuffer();\n const data = Buffer.alloc(8 + toData.length);\n data.writeUInt32LE(payment.amount, 0);\n toData.copy(data, 8);\n return data;\n}",
"function processPayment(paymentData) {\n var countryNameFromGoogle = \"\";\n try {\n countryNameFromGoogle = countriesData.filter(function (c) {\n return c.ShortCode === paymentData.paymentMethodData.info.billingAddress.countryCode.toLowerCase()})[0].Name;\n } catch (error) {\n console.error(error);\n\n if (Logger) {\n Logger.Error({ message: \"Getting google pay cc country\", exception: error });\n }\n }\n\n var data = {\n \"CreditCard\": {\n \"Token\": paymentData.paymentMethodData.tokenizationData.token,\n \"Type\": GetCardType(paymentData.paymentMethodData.info.cardNetwork),\n \"LastDigits\": paymentData.paymentMethodData.info.cardDetails,\n \"TokenType\": 2, // GooglePay\n \"CardHolderFirstName\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.name.split(\" \")[0] : \"\",\n \"CardHolderLastName\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.name.split(\" \")[1] : \"\",\n \"CardHolderAddress\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.address1 : \"\",\n \"CardHolderCity\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.locality : \"\",\n \"CardHolderCountry\": countryNameFromGoogle,\n \"CardHolderState\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.administrativeArea : \"\",\n \"CardHolderZip\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.postalCode : \"\",\n \"CardHolderPhone\": typeof paymentData.paymentMethodData.info.billingAddress !== \"undefined\" ? paymentData.paymentMethodData.info.billingAddress.phoneNumber : \"\"\n },\n \"GooglePay\": {\n \"OrderId\": PageParams.GooglePayMerchantOrderId,\n \"ReportGroup\": PageParams.GooglePayMerchantReportGroup\n }\n };\n\n elements.form.valid = true;\n\n submitForm(data, elements, \"GooglePay\");\n}",
"function submitPaymentJSON() {\n var order = Order.get(request.httpParameterMap.order_id.stringValue);\n if (!order.object || request.httpParameterMap.order_token.stringValue !== order.getOrderToken()) {\n app.getView().render('checkout/components/faults');\n return;\n }\n session.forms.billing.paymentMethods.clearFormElement();\n var requestObject = JSON.parse(request.httpParameterMap.requestBodyAsString);\n var form = session.forms.billing.paymentMethods;\n for (var requestObjectItem in requestObject) {\n var asyncPaymentMethodResponse = requestObject[requestObjectItem];\n var terms = requestObjectItem.split('_');\n if (terms[0] === 'creditCard') {\n var value = terms[1] === 'month' || terms[1] === 'year' ? Number(asyncPaymentMethodResponse) : asyncPaymentMethodResponse;\n form.creditCard[terms[1]].setValue(value);\n } else if (terms[0] === 'selectedPaymentMethodID') {\n form.selectedPaymentMethodID.setValue(asyncPaymentMethodResponse);\n }\n }\n if (app.getController('COBilling').HandlePaymentSelection('cart').error || handlePayments().error) {\n app.getView().render('checkout/components/faults');\n return;\n }\n app.getView().render('checkout/components/payment_methods_success');\n}",
"function checkPaymentMethod(paymentMethod) {\n if (paymentMethod === 'credit card') {\n $creditCard.show();\n $paypal.hide();\n $bitcoin.hide();\n $submit.show();\n } else if (paymentMethod === 'paypal') {\n $creditCard.hide();\n $paypal.show();\n $bitcoin.hide();\n $submit.show();\n } else if (paymentMethod === 'bitcoin') {\n $creditCard.hide();\n $paypal.hide();\n $bitcoin.show();\n $submit.show();\n } else {\n $creditCard.hide();\n $paypal.hide();\n $bitcoin.hide();\n $submit.hide();\n }\n return true;\n}",
"function calcRepaymentSum(){\n let arr = ['.js-repayment-input', '.js-balance-input'];\n $(arr).each(function () {\n if(this == '.js-repayment-input'){\n conValues.repaymentSum = getSum($(this));\n }\n else{\n conValues.balanceSum = getSum($(this));\n }\n });\n }",
"ListOfRegisteredPaymentMeanYouCanUseToPayThisOrder(orderId) {\n let url = `/me/order/${orderId}/availableRegisteredPaymentMean`;\n return this.client.request('GET', url);\n }",
"function setupPaymentMethodsObserver16() {\n // Select the node that will be observed for mutations\n const targetNode = document.getElementById('HOOK_PAYMENT');\n\n // In case the targetNode does not exist return early\n if (null === targetNode) {\n return;\n }\n\n // Options for the observer (which mutations to observe)\n const config = {attributes: true, childList: true, subtree: false};\n\n // Callback function to execute when mutations are observed\n const callback = function(mutationsList, observer) {\n // extra check to make sure that we are on 1.6\n if (IS_PRESTA_SHOP_16) {\n // Set which methods have their own button\n componentButtonPaymentMethods = paymentMethodsWithPayButtonFromComponent;\n // Use traditional 'for loops' for IE 11\n for (const mutation of mutationsList) {\n if (mutation.type === 'childList') {\n // The children are being changed so disconnet the observer\n // at first to avoid infinite loop\n observer.disconnect();\n // Render the adyen checkout components\n renderPaymentMethods();\n }\n }\n\n // Connect the observer again in case the checkbox is clicked\n // multiple times\n observer.observe(targetNode, config);\n }\n };\n\n // Create an observer instance linked to the callback function\n const observer = new MutationObserver(callback);\n\n // Start observing the target node for configured mutations\n try {\n observer.observe(targetNode, config);\n } catch (e) {\n // observer exception\n }\n }",
"transform({ getState, action, api }, next) {\n const userId = getState().data.user.currentUser.id\n const state = getState().scenes.codingValidation.coding\n const apiMethods = state.page === 'validation'\n ? { create: api.answerValidatedQuestion, update: api.updateValidatedQuestion }\n : { create: api.answerCodedQuestion, update: api.updateCodedQuestion }\n \n const answerObject = {\n questionId: action.questionId,\n jurisdictionId: action.jurisdictionId,\n projectId: action.projectId\n }\n \n next({\n ...action,\n answerObject,\n apiMethods,\n userId\n })\n }",
"async queryAPIforRate(currency, cryptocurrency){\n\t\t// Query the endpoint\n\t\tconst endpoint = await fetch(`https://api.coinmarketcap.com/v1/ticker/${cryptocurrency}/?convert=${currency}`);\n\n\t\t// Return as json\n\t\tconst result = await endpoint.json();\n\n\t\t// Return the object\n\t\treturn {\n\t\t\tresult\n\t\t}\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Video and Image Product | function fnVideoImage(ProductId,videoProduct,ImagemProdPri,NomeProd){
var replaceNomeProd = NomeProd.replace(/-/g,' ');
if (videoProduct==""){
document.getElementById("id-video-image"+ProductId).innerHTML="<div class='ImgCapaListProd DivListproductStyleImagemZoom'><img src="+ ImagemProdPri +" alt=\""+ replaceNomeProd +"\" onerror='MostraImgOnError(this,0)'"+ sLazy +"></div>";
}else{
document.getElementById("id-video-image"+ProductId).innerHTML="<video id=prodVideo"+ ProductId +" class='videoProd' preload=auto loop src='https://my.mixtape.moe/"+ videoProduct +".mp4'></video>";
function execVideoEvents(){
var oVideo=document.getElementById("prodVideo"+ProductId);
if(FCLib$.isOnScreen(oVideo))oVideo.play();
}
execVideoEvents();
FCLib$.AddEvent(document,"scroll",execVideoEvents);
}
} | [
"function cargarVideo(url,imagen){\r\n var v = document.createElement(\"video\"); \r\n //if ( (!v.play) && (!Liferay.Browser.isSafari())) { // If no, use Flash.\r\n if(!Modernizr.video){\r\n var params = {\r\n allowfullscreen: \"true\",\r\n allowscriptaccess: \"always\",\r\n wmode:\"transparent\"\r\n };\r\n var flashvars = {\r\n config: \"{'playlist':[ {'url': '\"+url+\"','autoPlay':false,'autoBuffering':true}]}&\" \r\n };\r\n //swfobject.embedSWF(\"http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf\", \"video\", \"480\", \"272\", \"9.0.0\", \"expressInstall.swf\", flashvars, params);\r\n swfobject.embedSWF(\"flowplayer-3.2.1.swf\", \"video\", \"480\", \"272\", \"9.0.0\", \"expressInstall.swf\", flashvars, params);\r\n }\r\n}",
"function imageVideoOfTheDayAjax() {\n\n // used to test img \n // https://apodapi.herokuapp.com/api/?date=2020-06-01\n\n $.ajax({\n url: `https://apodapi.herokuapp.com/api/`,\n method: 'GET'\n }).then((response) => {\n\n // console.log(response.url);\n\n // console.log(response.media_type);\n\n if (response.media_type === 'image') {\n // console.log('this is an image')\n // the image has to be reponsive find the correct class for the materialize \n let img = $('<img width=\"420\" height=\"315\"> </img>');\n img.attr('src', response.url);\n img.addClass(\"responsive-img\");\n\n $('.results').append(img);\n\n console.log(img)\n\n\n } else if (response.media_type === 'video') {\n // console.log('this is a video')\n // the image has to be reponsive find the correct class for the materialize \n let video = $('<iframe>');\n video.attr('src', response.url);\n video.addClass('responsive-video');\n\n $('.results').append(video);\n\n console.log(video)\n\n } \n // else {\n // // this is a default image if we dont have an image\n // // let img = $('<img width=\"420\" height=\"315\"> </img>');\n // // img.attr('src', response.url);\n // // img.addClass(\"responsive-img\");\n\n // // $('.results').append(img);\n // }\n\n });\n}",
"function load_video( href ) {\n\t\t\tvar data = {};\n\t\t\t/*var video = '<video width=\"' + data.width + '\" height=\"' + data.height + '\" controls=\"controls\" preload=\"autoplay\" poster=\"' + data.poster + '\">\n\t\t\t\t<source type=\"video/mp4\" src=\"' + href + '\" />\n\t\t\t\t<object width=\"928\" height=\"523\" type=\"application/x-shockwave-flash\" data=\"/wm/release-gq/js/libs/mediaelement/flashmediaelement.swf\">\n\t\t\t\t\t<param name=\"movie\" value=\"/wm/release-gq/js/libs/mediaelement/flashmediaelement.swf\" />\n\t\t\t\t\t<param name=\"flashvars\" value=\"controls=true&poster=/wm/release-gq/sites/gerling-quartier/media/pages/quarter_video/Gerling_Quartier_Hauptfilm_IF_928x522_poster.jpg&file=media/pages/quarter_video/Gerling_Quartier_Hauptfilm_IF_928x522.mp4\" />\n\t\t\t\t\t<img src=\"/wm/release-gq/sites/gerling-quartier/media/pages/quarter_video/Gerling_Quartier_Hauptfilm_IF_928x522_poster.jpg\" width=\"\" height=\"\" title=\"\">\n\t\t\t\t</object>\n\t\t\t</video>'*/\n\t\t}",
"getVideoType() {\n return this.videoType;\n }",
"isVideoTrack() {\n return this.getType() === MediaType.VIDEO;\n }",
"static getUserVideo(userId,res) {\n Media.find({})\n }",
"insertVideos() {\n for(let i = 0; i < this.options.src.length; i++) {\n let videoTypeArr = this.options.src[i].split('.');\n let videoType = videoTypeArr[videoTypeArr.length - 1];\n\n this.addSourceToVideo(this.options.src[i], `video/${videoType}`);\n }\n }",
"static createVideoElement(videoThingy){if(videoThingy instanceof HTMLVideoElement){return videoThingy;}if(typeof videoThingy==='string'){return BrowserCodeReader$1.getMediaElement(videoThingy,'video');}if(!videoThingy&&typeof document!=='undefined'){const videoElement=document.createElement('video');videoElement.width=200;videoElement.height=200;return videoElement;}throw new Error('Couldn\\'t get videoElement from videoSource!');}",
"async function S3PublishMedia(\n\tcatalogProduct,\n\t{ context, product, shop, variants }\n) {\n\tconst { app, collections, rootUrl } = context;\n\tconst { Product } = collections;\n\t// let productObj=await getProductMedia(context,catalogProduct.productId);\n\tcatalogProduct.media = product.media;\n\tcatalogProduct.primaryImage = product.media[0];\n\tcatalogProduct.variants &&\n\t\tcatalogProduct.variants.map(async (catalogVariant) => {\n\t\t\tconst productVariant = variants.find(\n\t\t\t\t(variant) => variant._id === catalogVariant.variantId\n\t\t\t);\n\t\t\t// catalogVariant.uploadedBy = productVariant.uploadedBy || null;\n\t\t\t// catalogVariant.ancestorId = productVariant[\"ancestors\"][0]\n\t\t\t// ? productVariant[\"ancestors\"][0]\n\t\t\t// : null;\n\n\t\t\tcatalogVariant.media = productVariant.media;\n\t\t});\n}",
"function toggleVideo(event) {\n videoGallery = document.querySelector(\".video-gallery\");\n if (!videoGallery) {\n document.querySelector(\n \".flex-control-thumbs\"\n ).lastChild.style.opacity = 1;\n document.querySelector(\".flex-active\").style.opacity = 0.5;\n videoIndex = thumbnails.childNodes.length - 1;\n productImages = document.querySelectorAll(\n \".woocommerce-product-gallery__image\"\n );\n // needs to be in front of current slide\n document\n .querySelector(\".flex-active-slide\")\n .insertAdjacentHTML(\n \"beforebegin\",\n '<div class=\"video-gallery\" style=\"width: 530px; margin-right: 0px; float: left; display: block; position: relative; overflow: hidden;\"> <iframe width=\"530\" height=\"315\" src=\"https://www.youtube.com/embed/pCuZdRN2XpM\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe> </div>'\n );\n\n if (flexViewport === undefined) {\n flexViewport = document.querySelector(\".flex-viewport\");\n }\n flexViewport.classList.add(\"flex-transition\");\n flexViewport.classList.add(\"video-viewport\");\n // productImages.forEach(e => {\n // e.classList.remove(\"flex-active-slide\");\n // });\n\n // need to change back to first slide, then create video in front of first slide\n }\n }",
"domCreation(text) {\n let elt = createTextualElt(\"video\", text, \"video-elt\");\n let srcElt = document.createElement(\"source\");\n srcElt.setAttribute(\"src\", `FishEye_Photos/Video/${this.src}`);\n elt.appendChild(srcElt);\n\n return elt;\n }",
"function VideoListItem({video,onVideoClick}){\n //console.log(video.snippet);\n return <li onClick = { () => onVideoClick(video) }\n className=\"list-group-item\">\n <div className=\"video-list video-item media\">\n <div className=\"media-left\">\n <img src={video.snippet.thumbnails.default.url} className=\"media-object\"/>\n </div>\n\n <div className=\"media-body\">\n <div className=\"media-heading\">{video.snippet.title}</div>\n </div>\n </div>\n </li>\n}",
"function Hero(props) {\n return (\n <div className=\"hero\">\n <video className=\"hero__video\" controls poster={props.thisVideo.image}></video>\n </div>\n )\n}",
"function BackgroundVideo(props) {\n // sets prop for calling component in parent\n const { video, poster } = props;\n\n return (\n <video\n className=\"absolute z-negative1 w-screen h-screen object-cover\"\n autoPlay\n loop\n muted\n poster={poster}\n >\n <source src={video} type=\"video/mp4\" />\n Your browser does not support the video tag\n </video>\n );\n}",
"function Video (dataVideo) { \n this.$el = \"\"; // this will hold the video html element\n this.data = dataVideo;\n this.init = function (videoHtmlEL){ //when creating a new Video object we need to define the html element to connect it to\n\n // create the video in html\n var output = '';\n switch(true){\n case (this.data.type == 'html5') :\n output += '<video id=\"catbearsVideo\" width=\"100%\" height=\"100%\" controls=\"\">'\n output += '<source src=\"../video/'\n output += this.data.fileName\n output += '\" type=\"video/mp4\"/>'\n output += 'Your browser does not support HTML5 video.'\n output += '</video>'\n break;\n case (this.data.type == 'youtube') : \n // embed video\n break; \n\n\n } \n // append the video \n $(videoHtmlEL).append(output);\n this.$el = document.getElementById(\"catbearsVideo\");\n }; \n this.play = function (){\n this.$el.play()\n // $el play\n }\n this.pause = function (){\n this.$el.pause()\n }\n this.togglePlayPause = function () { \n if(this.$el.paused){\n this.$el.play();\n }else{ \n this.$el.pause();\n }; \n };\n this.seekTo = function (second){\n this.$el.currentTime = second;\n }\n}",
"function displayVideo(videoBlob, outerDiv){\n var video = document.createElement(\"video\");\n video.setAttribute(\"class\", \"videoClasses\")\n video.autoplay = true;\n video.controls = false; // optional\n video.loop = true;\n video.height = VIDEO_HEIGHT;\n var source = document.createElement(\"source\");\n source.src = URL.createObjectURL(base64_to_blob(videoBlob));\n source.type = \"video/webm\";\n\n video.appendChild(source);\n if(version === \"A\"){\n outerDiv.innerHTML = \"\";\n }else{\n\n }\n outerDiv.appendChild(video);\n}",
"function MediaVM(mediaAssetId, productId, storeId, path, webPath, webThumbnailPath, previewImagePath, previewImageWebPath, previewImageWebThumbnailPath, title, position, mimeType, mediaTypeIds, defaultVariantImage, defaultBundleImage,\n defaultProgrammeImage, enabled) {\n var self = this;\n self.id = mediaAssetId;\n self.productId = productId;\n self.storeId = storeId;\n self.path = ko.observable(path);\n self.webPath = ko.observable(webPath);\n\n var dPath = webPath + \"?d=true\";\n if (dPath.indexOf(\"http\") == -1) {\n dPath = \"https://\" + dPath;\n }\n\n self.downloadPath = ko.observable(dPath);\n self.webThumbnailPath = ko.observable(webThumbnailPath);\n self.previewImagePath = ko.observable(previewImagePath);\n self.previewImageWebPath = ko.observable(previewImageWebPath);\n self.previewImageWebThumbnailPath = ko.observable(previewImageWebThumbnailPath);\n self.title = ko.observable(title);\n self.position = ko.observable(position);\n self.mimeType = ko.observable(mimeType);\n self.mediaTypeIds = ko.observableArray(mediaTypeIds);\n self.defaultVariantImage = ko.observable(defaultVariantImage);\n self.defaultBundleImage = ko.observable(defaultBundleImage);\n self.defaultProgrammeImage = ko.observable(defaultProgrammeImage);\n self.enabled = ko.observable(enabled);\n\n self.fileExtension = ko.computed(function() {\n return self.path().substring(self.path().lastIndexOf('.') + 1);\n });\n\n self.isVideo = ko.computed(function() {\n return self.mimeType().startsWith('video/');\n });\n\n self.isImage = ko.computed(function() {\n return self.mimeType().startsWith('image/');\n });\n\n self.videoImagePreviewThumbnailPath = ko.computed(function() {\n var previewImageWebThumbnailPath = self.previewImageWebThumbnailPath();\n\n if (!_.isEmpty(previewImageWebThumbnailPath)) {\n return previewImageWebThumbnailPath;\n } else {\n return '/img/folder_images.png';\n }\n });\n }",
"function rexShowMediaPreview() {\n var value, img_type;\n if($(this).hasClass(\"rex-js-widget-media\"))\n {\n value = $(\"input[type=text]\", this).val();\n img_type = \"rex_mediabutton_preview\";\n }else\n {\n value = $(\"select :selected\", this).text();\n img_type = \"rex_medialistbutton_preview\";\n }\n\n var div = $(\".rex-js-media-preview\", this);\n\n var url;\n var width = 0;\n if('.svg' != value.substr(value.length - 4) && $(this).hasClass(\"rex-js-widget-preview-media-manager\"))\n url = './index.php?rex_media_type='+ img_type +'&rex_media_file='+ value;\n else\n {\n url = '../media/'+ value;\n width = 246;\n }\n\n if(value && value.length != 0 && $.inArray(value.split('.').pop(), rex.imageExtensions))\n {\n // img tag nur einmalig einf�gen, ggf erzeugen wenn nicht vorhanden\n var img = $('img', div);\n if(img.length == 0)\n {\n div.html('<img />');\n img = $('img', div);\n }\n img.attr('src', url);\n if (width != 0)\n img.attr('width', width);\n\n div.stop(true, false).slideDown(\"fast\");\n }\n else\n {\n div.stop(true, false).slideUp(\"fast\");\n }\n }",
"function generateHTMLForVideo(node, data)\n\t{\n\t\tvar html = '';\n\t\tvar type = getVideoType(data.video);\n\t\t\n\t\tif (!type) return html;\n\t\t\n\t\tvar AUTOPLAY = auto_play ? 'true' : 'false';\n\t var BACKGROUND = 'transparent';\n\t\tvar CONTROLBAR = '&controlbar=bottom';\n\t\tvar WMODE = 'transparent'; // window, transparent, opaque\n\t\tvar WINDOWLESS = 'true';\n\t\t\n\t\tswitch (type)\n\t\t{\n\t\t\tcase 'flv':\n\t\t\t\thtml = \n\t\t\t\t\t'<object type=\"application/x-shockwave-flash\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\" data=\"' + players_dir + 'mediaplayer_4.0.46.swf\">' +\n\t\t\t\t\t\t'<param name=\"movie\" value=\"' + players_dir + 'pmediaplayer_4.0.46.swf\" />' +\n\t\t\t\t\t\t'<param name=\"quality\" value=\"high\" />' +\n\t\t\t\t\t\t'<param name=\"wmode\" value=\"' + WMODE + '\" />' +\n\t\t\t\t\t\t'<param name=\"bgcolor\" value=\"' + BACKGROUND + '\" />' +\n\t\t\t\t\t\t'<param name=\"autoplay\" value=\"' + AUTOPLAY + '\" />' +\n\t\t\t\t\t\t'<param name=\"allowfullscreen\" value=\"true\" />' +\n\t\t\t\t\t\t'<param name=\"allowscriptaccess\" value=\"always\" />' +\n\t\t\t\t\t\t'<param name=\"flashvars\" value=\"file=' + data.video + (data.b_img ? '&image=' + data.b_img : '') + '&autostart=' + AUTOPLAY + CONTROLBAR + '&fullscreen=true\" />' +\n\t\t\t\t\t'</object>'\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'mp3':\n\t\t\t\thtml =\n\t\t\t\t\t'<object type=\"application/x-shockwave-flash\\\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\" data=\"' + players_dir + 'mediaplayer_4.0.46.swf\">' +\n\t\t\t\t\t\t'<param name=\"movie\" value=\"' + players_dir + 'mediaplayer_4.0.46.swf\" />' +\n\t\t\t\t\t\t'<param name=\"quality\" value=\"high\" />' +\n\t\t\t\t\t\t'<param name=\"wmode\" value=\"' + WMODE + '\" />' +\n\t\t\t\t\t\t'<param name=\"bgcolor\" value=\"' + BACKGROUND + '\" />' +\n\t\t\t\t\t\t'<param name=\"autoplay\" value=\"' + AUTOPLAY + '\" />' +\n\t\t\t\t\t\t'<param name=\"allowfullscreen\" value=\"true\" />' +\n\t\t\t\t\t\t'<param name=\"allowscriptaccess\" value=\"always\" />' +\n\t\t\t\t\t\t'<param name=\"flashvars\" value=\"file=' + data.video + '&autostart=' + AUTOPLAY + '\" />' +\n\t\t\t\t\t'</object>'\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'swf':\n\t\t\t\thtml =\n\t\t\t\t\t'<object type=\"application/x-shockwave-flash\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\" data=\"' + data.video + '\">' +\n\t\t\t\t\t\t'<param name=\"movie\" value=\"' + data.video + '\" />'\n\t\t\t\t\t\t'<param name=\"quality\" value=\"high\" />' +\n\t\t\t\t\t\t'<param name=\"wmode\" value=\"' + WMODE + '\" />' +\n\t\t\t\t\t\t'<param name=\"bgcolor\" value=\"' + BACKGROUND + '\" />' +\n\t\t\t\t\t\t'<param name=\"autoplay\" value=\"' + AUTOPLAY + '\" />' +\n\t\t\t\t\t'</object>'\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'wmv':\n\t\t\t\tvar id = data.video.replace(/[\\/.\\s]/gi, '_');\n\t\t\t\t\n\t\t\t\tif (_use_share_point_silver_light)\n\t\t\t\t{\n\t\t\t\t\thtml =\n\t\t\t\t\t'<span id=\"' + id + '\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\">' +\n\t\t\t\t\t\t'<object data=\"data:application/x-silverlight-2,\" height=\"' + h_preview + '\" type=\"application/x-silverlight-2\" width=\"' + w_preview + '\">' +\n\t\t\t\t\t\t\t'<param name=\"source\" value=\"OVP.xap\" />' +\n\t\t\t\t\t\t\t'<param name=\"minRuntimeVersion\" value=\"2.0.30923.0\" />' +\n\t\t\t\t\t\t\t'<param name=\"onerror\" value=\"onSilverlightError\" />' +\n\t\t\t\t\t\t\t'<param name=\"background\" value=\"black\" />' +\n\t\t\t\t\t\t\t'<param name=\"MaxFrameRate\" value=\"30\" />' +\n\t\t\t\t\t\t\t'<a href=\"http://go.microsoft.com/fwlink/?LinkID=124807\" style=\"text-decoration: none;\">' +\n\t\t\t\t\t\t\t\t'<img alt=\"Get Microsoft Silverlight\" src=\"http://go.microsoft.com/fwlink/?LinkId=108181\" style=\"border-style: none\" />' +\n\t\t\t\t\t\t\t'</a>' +\n\t\t\t\t\t\t\t'<param name=\"initparams\" value=\"showstatistics=false, autoplay=' + AUTOPLAY + ', muted=false, playlistoverlay=false, theme=SmoothHD.xaml, stretchmode=Stretch, stretchmodefullscreen=Stretch, mediasource=' + data.video + '\" />' +\n\t\t\t\t\t\t'</object>' +\n\t\t\t\t\t'</span>'\n\t\t\t\t\t;\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thtml =\n\t\t\t\t\t'<span id=\"' + id + '\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\"></span>' +\n\t\t\t\t\t'<script type=\"text/javascript\">' +\n\t\t\t\t\t\t\"var cnt = document.getElementById('\" + id + \"');\" +\n\t\t\t\t\t\t\"var src = '\" + players_dir + \"wmvplayer.xaml';\" +\n\t\t\t\t\t\t\"var cfg = {\" +\n\t\t\t\t\t\t\t\"file:'\" + data.video + \"',\" +\n\t\t\t\t\t\t\t\"width:'\" + w_preview + \"',\" +\n\t\t\t\t\t\t\t\"height:'\" + h_preview + \"',\" +\n\t\t\t\t\t\t\t\"autostart:'\" + AUTOPLAY + \"',\" +\n\t\t\t\t\t\t\t\"image:'\" + (data.b_img ? data.b_img : '' ) + \"', \" + \n\t\t\t\t\t\t\t\"windowless: '\" + WINDOWLESS + \"'\" +\n\t\t\t\t\t\t\"};\" +\n\t\t\t\t\t\t\"var ply = new jeroenwijering.Player(cnt,src,cfg);\" +\n\t\t\t\t\t'</script>'\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'wma':\n\t\t\t\tvar id = data.video.replace(/[\\/.\\s]/gi, '_');\n\t\t\t\t\n\t\t\t\tif (_use_share_point_silver_light)\n\t\t\t\t{\n\t\t\t\t\thtml =\n\t\t\t\t\t'<span id=\"' + id + '\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\">' +\n\t\t\t\t\t\t'<object data=\"data:application/x-silverlight-2,\" height=\"' + h_preview + '\" type=\"application/x-silverlight-2\" width=\"' + w_preview + '\">' +\n\t\t\t\t\t\t\t'<param name=\"source\" value=\"OVP.xap\" />' +\n\t\t\t\t\t\t\t'<param name=\"minRuntimeVersion\" value=\"2.0.30923.0\" />' +\n\t\t\t\t\t\t\t'<param name=\"onerror\" value=\"onSilverlightError\" />' +\n\t\t\t\t\t\t\t'<param name=\"background\" value=\"black\" />' +\n\t\t\t\t\t\t\t'<param name=\"MaxFrameRate\" value=\"30\" />' +\n\t\t\t\t\t\t\t'<a href=\"http://go.microsoft.com/fwlink/?LinkID=124807\" style=\"text-decoration: none;\">' +\n\t\t\t\t\t\t\t\t'<img alt=\"Get Microsoft Silverlight\" src=\"http://go.microsoft.com/fwlink/?LinkId=108181\" style=\"border-style: none\" />' +\n\t\t\t\t\t\t\t'</a>' +\n\t\t\t\t\t\t\t'<param name=\"initparams\" value=\"showstatistics=false, autoplay=' + AUTOPLAY + ', muted=false, playlistoverlay=false, theme=SmoothHD.xaml, stretchmode=Stretch, stretchmodefullscreen=Stretch, mediasource=' + data.video + '\" />' +\n\t\t\t\t\t\t'</object>' +\n\t\t\t\t\t'</span>'\n\t\t\t\t\t;\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\thtml =\n\t\t\t\t\t'<span id=\"' + id + '\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\"></span>' +\n\t\t\t\t\t'<script type=\"text/javascript\">' +\n\t\t\t\t\t\t\"var cnt = document.getElementById('\" + id + \"');\" +\n\t\t\t\t\t\t\"var src = '\" + players_dir + \"wmvplayer.xaml';\" +\n\t\t\t\t\t\t\"var cfg = {\" +\n\t\t\t\t\t\t\t\"file:'\" + data.video + \"',\" +\n\t\t\t\t\t\t\t\"width:'\" + w_preview + \"',\" +\n\t\t\t\t\t\t\t\"height:'\" + h_preview + \"',\" +\n\t\t\t\t\t\t\t\"autostart:'\" + AUTOPLAY + \"',\" +\n\t\t\t\t\t\t\t\"usefullscreen: 'false'\" + \"',\" +\n\t\t\t\t\t\t\t\"windowless: '\" + WINDOWLESS + \"'\" +\n\t\t\t\t\t\t\"};\" +\n\t\t\t\t\t\t\"var ply = new jeroenwijering.Player(cnt,src,cfg);\" +\n\t\t\t\t\t'</script>'\n\t\t\t\t;\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'mov':\n\t\t\t\thtml = QT_GenerateOBJECTText_XHTML(data.video, w_preview, h_preview, '', 'AUTOPLAY', AUTOPLAY, 'BGCOLOR', BACKGROUND, 'SCALE', 'Aspect');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'mp4':\n\t\t\t\thtml = QT_GenerateOBJECTText_XHTML(data.video, w_preview, h_preview, '', 'AUTOPLAY', AUTOPLAY, 'BGCOLOR', BACKGROUND, 'SCALE', 'Aspect');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase '3gp':\n\t\t\t\thtml = QT_GenerateOBJECTText_XHTML(data.video, w_preview, h_preview, '', 'AUTOPLAY', AUTOPLAY, 'BGCOLOR', BACKGROUND, 'SCALE', 'Aspect');\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase 'divx':\n\t\t\t\thtml =\n\t\t\t\t\t'<object type=\"video/divx\" data=\"' + data.video + '\" style=\"width:' + w_preview + 'px; height:' + h_preview + 'px;\">' +\n\t\t\t\t\t\t'<param name=\"type\" value=\"video/divx\" />' +\n\t\t\t\t\t\t'<param name=\"src\" value=\"' + data.video + '\" />' +\n\t\t\t\t\t\t'<param name=\"data\" value=\"' + data.video + '\" />' +\n\t\t\t\t\t\t'<param name=\"codebase\" value=\"' + data.video + '\" />' +\n\t\t\t\t\t\t'<param name=\"url\" value=\"' + data.video + '\" />' +\n\t\t\t\t\t\t'<param name=\"mode\" value=\"full\" />' +\n\t\t\t\t\t\t'<param name=\"pluginspage\" value=\"http://go.divx.com/plugin/download/\" />' +\n\t\t\t\t\t\t'<param name=\"allowContextMenu\" value=\"true\" />' +\n\t\t\t\t\t\t'<param name=\"previewImage\" value=\"' + (data.b_img ? data.b_img : '' ) + '\" />' +\n\t\t\t\t\t\t'<param name=\"autoPlay\" value=\"' + AUTOPLAY + '\" />' +\n\t\t\t\t\t\t'<param name=\"minVersion\" value=\"1.0.0\" />' +\n\t\t\t\t\t\t'<param name=\"custommode\" value=\"none\" />' +\n\t\t\t\t\t\t'<p>No video? Get the DivX browser plug-in for <a href=\"http://download.divx.com/player/DivXWebPlayerInstaller.exe\">Windows</a> or <a href=\"http://download.divx.com/player/DivXWebPlayer.dmg\">Mac</a></p>' +\n\t\t\t\t\t'</object>'\n\t\t\t\t;\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\thtml = '<p class=\"video_gallery_error\">Unknow format</p>';\n\t\t}\n\t\t\n\t\treturn html;\n\t}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reset pipeline and special nodes cnt data | function resetData() {
specialNodesMap = {};
pipelinedStageInfo = {};
pipelineNodeInfo = [[], []];
pipelineEdgeInfo = [];
} | [
"resetNodes() {\n for (let layer = 0; layer < this.nodes.length; layer++) {\n for (let node = 0; node < this.nodes[layer].length; node++) {\n this.nodes[layer][node].input = 0;\n this.nodes[layer][node].weight = 0;\n }\n }\n this.biasNode.weight = 1;\n }",
"function resetGraphVariables() {\n typeGroups = {};\n typeIndex = 0;\n\n currentGraph = {\n nodes: [],\n edges: []\n }\n labelGraph = {\n nodes: [],\n edges: []\n }\n\n idCache = {};\n}",
"function resetVars() {\n\t\tidArrays = [];\n\t\tdeathArrays = [];\n\t\tfollowUpArrays = [];\n\t\tdataType = \"number\";\n\t\tsources = 0;\n\t\tNs = [];\n\t\thaveFollowUp = false;\n\t\tdataName = \"\";\n\t\tdragZone = {'left':-1, 'top':-1, 'right':-1, 'bottom':-1, 'name':\"\", 'ID':\"\"};\n\t\tlimits = {'minX':0, 'maxX':0, 'minY':0, 'maxY':0};\n\t\tunique = 0; // number of data points with non-null values\n\t\tNULLs = 0;\n\t\tlocalSelections = []; // the data to send to the parent\n\t}",
"reset(){\n this._input = null;\n this._output = null;\n }",
"function resetTrainingData()\n{\n\treInitDataProperties();\n\tpost(\"Data reset for LV = \", dataNameValue, \"\\n\");\n}",
"reset() {\r\n\t\tthis.number = this.props.index + 1\r\n\t\tthis.counters = {\r\n\t\t\tfigure: 0\r\n\t\t}\r\n\t\t// TODO: Incorporate equation numbers.\r\n\t}",
"reset() {\n /**\n * The overall error.\n */\n this.globalError = 0;\n /**\n * The size of a set.\n */\n this.setSize = 0;\n\n this.sum = 0;\n }",
"static resetVerilog() {\n Multiplexer.selSizes = new Set();\n }",
"reset() {\n const _ = this;\n _._counter = _._startCount;\n }",
"function _processNodesCnt() {\n if (firstCntFlag) {\n _processNodesGlobalCnt();\n firstCntFlag = false;\n }\n\n const {nodeMap} = processedGraph;\n Object.keys(nodeMap).forEach((id) => {\n if (isNaN(id)) return;\n const node = nodeMap[id];\n const iterator = node.scope.split(SCOPE_SEPARATOR);\n\n if (!node.parent) return;\n do {\n const name = iterator.join(SCOPE_SEPARATOR);\n const scopeNode = nodeMap[name];\n if (_checkShardMethod(node.parallel_shard)) {\n if (scopeNode.specialNodesCnt.hasOwnProperty('hasStrategy')) {\n scopeNode.specialNodesCnt['hasStrategy']++;\n } else {\n scopeNode.specialNodesCnt['hasStrategy'] = 1;\n }\n }\n if (node.instance_type !== undefined) {\n if (scopeNode.specialNodesCnt.hasOwnProperty(node.instance_type)) {\n scopeNode.specialNodesCnt[node.instance_type]++;\n } else {\n scopeNode.specialNodesCnt[node.instance_type] = 1;\n }\n }\n iterator.pop();\n } while (iterator.length);\n });\n}",
"resetCount() {\n this.setStatistics({\n fetchedDocuments: 0,\n migratedDocuments: 0,\n totalDocuments: 0,\n ignoredDocuments: 0,\n });\n }",
"resetAll () {\n this.data = this.defaults\n }",
"resetNodeCache() {\n this.configs.clear();\n this.attributes.clear();\n this.children.clear();\n }",
"resetEverything() {\n this.resetLoader();\n this.remove(0, Infinity);\n }",
"reset() {\n this.vertices = new Set();\n this.edges = new Set();\n this.faces = new Set();\n }",
"function recess(){\n\tdataSets.forEach(function(d){\n\t\t\n\t\t})//CLOSE dataSets forEach\n\t}//CLOSE recess",
"resetIndexes()\n {\n const self = this;\n self[_reducedIndexes] = null;\n self[_optimizedIndexes] = null;\n self[_naiveIndex] = null;\n self[_keyStatistics] = null;\n }",
"resetStats() {\n\t\tthis.gameDataList = [];\n\t\tthis.curGameData = null;\n\t}",
"function cleansCounters() {\n\tn = 0;\n\tmachinePlay = [];\n\tuserPlay = [];\n\tcount = 0;\n\tcounter = 0;\n\tuserCount = 0;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the margin to be used based on the tooltipElement adds left margin to allow center placement | function getTooltipMargin(tooltipElement) {
var tooltipElementWidth = (jQuery(tooltipElement).width()) / 2;
return "0 0 0 " + (tooltipElementWidth - 20) + "px";
} | [
"function tooltipXposition(d){\n\t\t\treturn x(d)+leftOffset(\"stage_wrapper\")+\"px\";\n\t\t}",
"function tooltip_placement(context, source) {\n\t\tvar $source = $(source);\n\t\tvar $parent = $source.closest('table')\n\t\tvar off1 = $parent.offset();\n\t\tvar w1 = $parent.width();\n\n\t\tvar off2 = $source.offset();\n\t\t//var w2 = $source.width();\n\n\t\tif( parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2) ) return 'right';\n\t\treturn 'left';\n\t}",
"_calculateErrorMsgTooltipPosition(inputElement, errorMsgHolder) {\n const bodyRect = document.body.getBoundingClientRect(),\n elemRect = inputElement.getBoundingClientRect(),\n offsetTop = elemRect.top - bodyRect.top;\n\n errorMsgHolder.style.top = offsetTop + elemRect.height + 'px';\n errorMsgHolder.style.left = elemRect.left + 'px';\n }",
"get titlePadding() {\n\t\treturn this.nativeElement ? this.nativeElement.titlePadding : undefined;\n\t}",
"get spaceBetweenChildren() {\n if (isNull(this.groupStyle)) {\n return 0;\n }\n return this.groupStyle.spaceBetweenChildren;\n }",
"function getTitlePosition() {\n var center = this.center, chart = this.chart, titleOptions = this.options.title;\n return {\n x: chart.plotLeft + center[0] + (titleOptions.x || 0),\n y: (chart.plotTop +\n center[1] -\n ({\n high: 0.5,\n middle: 0.25,\n low: 0\n }[titleOptions.align] *\n center[2]) +\n (titleOptions.y || 0))\n };\n }",
"function setMarginForLevel2(chartOption) {\r\n chartOption.chart.marginLeft = level2MarginLeft;\r\n chartOption.chart.marginRight = level2MarginRight;\r\n// chartOption.yAxis.title.offset = level2yAxisOffset;\r\n}",
"_calculateOverlayOffsetX() {\n const overlayRect = this._overlayDir.overlayRef.overlayElement.getBoundingClientRect();\n const viewportSize = this._viewportRuler.getViewportSize();\n const isRtl = this._isRtl();\n const paddingWidth = this.multiple\n ? SELECT_MULTIPLE_PANEL_PADDING_X + SELECT_PANEL_PADDING_X\n : SELECT_PANEL_PADDING_X * 2;\n let offsetX;\n // Adjust the offset, depending on the option padding.\n if (this.multiple) {\n offsetX = SELECT_MULTIPLE_PANEL_PADDING_X;\n }\n else if (this.disableOptionCentering) {\n offsetX = SELECT_PANEL_PADDING_X;\n }\n else {\n let selected = this._selectionModel.selected[0] || this.options.first;\n offsetX = selected && selected.group ? SELECT_PANEL_INDENT_PADDING_X : SELECT_PANEL_PADDING_X;\n }\n // Invert the offset in LTR.\n if (!isRtl) {\n offsetX *= -1;\n }\n // Determine how much the select overflows on each side.\n const leftOverflow = 0 - (overlayRect.left + offsetX - (isRtl ? paddingWidth : 0));\n const rightOverflow = overlayRect.right + offsetX - viewportSize.width + (isRtl ? 0 : paddingWidth);\n // If the element overflows on either side, reduce the offset to allow it to fit.\n if (leftOverflow > 0) {\n offsetX += leftOverflow + SELECT_PANEL_VIEWPORT_PADDING;\n }\n else if (rightOverflow > 0) {\n offsetX -= rightOverflow + SELECT_PANEL_VIEWPORT_PADDING;\n }\n // Set the offset directly in order to avoid having to go through change detection and\n // potentially triggering \"changed after it was checked\" errors. Round the value to avoid\n // blurry content in some browsers.\n this._overlayDir.offsetX = Math.round(offsetX);\n this._overlayDir.overlayRef.updatePosition();\n }",
"function positionTip(evt) {\r\n\tif (!tipFollowMouse) {\r\n\t\tmouseX = (ns4||ns5)? evt.pageX: window.event.clientX + document.documentElement.scrollLeft;\r\n\t\tmouseY = (ns4||ns5)? evt.pageY: window.event.clientY + document.documentElement.scrollTop;\r\n\t}\r\n\t// tooltip width and height\r\n\tvar tpWd = (ns4)? tooltip.width: (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;\r\n\tvar tpHt = (ns4)? tooltip.height: (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;\r\n\t// document area in view (subtract scrollbar width for ns)\r\n\tvar winWd = (ns4||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;\r\n\tvar winHt = (ns4||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;\r\n\t// check mouse position against tip and window dimensions\r\n\t// and position the tooltip \r\n\r\n\tif ((mouseX+offX+tpWd)>winWd)\r\n\t{\r\n\t\ttipcss.left = (ns4)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+\"px\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\ttipcss.left = (ns4)? mouseX+offX: mouseX+offX+\"px\";\r\n\t}\r\n\tif ((mouseY+offY+tpHt)>winHt)\r\n\t{\r\n\t\ttipcss.top = (ns4)? winHt-(tpHt+offY): winHt-(tpHt+offY)+\"px\";\r\n\t}\r\n\telse\r\n\t{\r\n\t\ttipcss.top = (ns4)? mouseY+offY: mouseY+offY+\"px\";\r\n\t}\r\n\r\n\tif (!tipFollowMouse) t1=setTimeout(\"tipcss.visibility='visible'\",100);\r\n}",
"function calculateTiangleLeft() {\n\t\tvar menuItem = this;\n\t\tvar triangle = menuItem.querySelector('.menu-hover-popup-triangle');\n\t\tif (!triangle) return;\n\t\tvar menuItemLeft = menuItem.offsetLeft;\n\t\tvar menuItemWidth = menuItem.offsetWidth;\n\t\tvar triangleWidth = triangle.offsetWidth;\n\t\tvar triangleLeft = menuItemLeft + menuItemWidth / 2 - triangleWidth / 2;\n\t\ttriangle.style.left = triangleLeft + 'px';\n\t} //",
"function changeLeftMargin(element, changeMode, amount){\n var marginleft = element.style.marginLeft;\n\n\n switch ( changeMode ) {\n case \"add\":\n if(isNaN(marginleft)){\n marginleft = parseInt(marginleft.replace(\"px\",\"\"));\n element.style.marginLeft=(marginleft + amount)+\"px\";\n } else{\n element.style.marginLeft= amount+\"px\";\n }\n\n break;\n\n case \"reduce\":\n if(isNaN(marginleft)){\n marginleft = parseInt(marginleft.replace(\"px\",\"\"));\n element.style.marginLeft=(marginleft - amount)+\"px\";\n } else{\n element.style.marginLeft= \"-\"+amount+\"px\";\n }\n\n break;\n\n default:\n log(\"Chosen case not supported for changeLeftMargin\");\n }\n\n}",
"function horGuideCenter(_horizontalValueCenter) {\n if (selectionCheck(activeDocument)) {\n iselected= app.activeDocument.selection.bounds;\n \n for (i=0; i < iselected.length; i++) {\n iselected[i] = parseInt(iselected[i]);\n }\n horizontalGuide((iselected[3]-iselected[1])/2+iselected[1]+_horizontalValueCenter);\n }\n else {\n var horizontalValue = (activeDocument.height / 2)+_horizontalValueCenter;\n horizontalGuide(horizontalValue);\n }\n}",
"createTooltips() {\n for (let i = 0; i < this.shopItems.length; i++) {\n let tooltipPosition = this.getSelectionPosition(i);\n let tooltipPanel = this.add.nineslice(tooltipPosition.x, tooltipPosition.y,\n 0, 0, 'greyPanel', 7).setOrigin(1, 0);\n // Flip tooltip for lower selections so it doesn't get cut off at the bottom of the screen\n if (i >= tooltipFlipIndex) {\n tooltipPanel.setOrigin(1, 1);\n }\n\n // Create tooltip game objects\n let tooltipTitle = this.add.text(0, 0, \"\", { ...this.tooltipTextStyle, font: \"18px Verdana\" }).setOrigin(0.5, 0);\n let tooltipPrice = this.add.text(0, 0, \"\", { ...this.tooltipTextStyle, font: \"16px Verdana\" }).setOrigin(0.5, 0);\n let tooltipGrowthRate = this.add.text(0, 0, \"\", { ...this.tooltipTextStyle, font: \"16px Verdana\" }).setOrigin(0.5, 0);\n let tooltipClickValue = this.add.text(0, 0, \"\", { ...this.tooltipTextStyle, font: \"16px Verdana\" }).setOrigin(0.5, 0);\n let tooltipDescription = this.add.text(0, 0, \"\", this.tooltipTextStyle).setOrigin(0.5, 0);\n let tooltipTexts = [\n tooltipTitle, \n tooltipPrice, \n tooltipGrowthRate,\n tooltipClickValue,\n tooltipDescription\n ];\n let tooltipTitleBreak = this.add.line(0, 0, 0, 0, 0, 0, 0x999999).setOrigin(0, 0);\n let tooltipPriceBreak = this.add.line(0, 0, 0, 0, 0, 0, 0x999999).setOrigin(0, 0);\n let tooltipRatesBreak = this.add.line(0, 0, 0, 0, 0, 0, 0x999999).setOrigin(0, 0);\n let tooltipBreaks = [\n tooltipTitleBreak,\n tooltipPriceBreak,\n tooltipRatesBreak\n ];\n let tooltip = this.add.group([tooltipPanel].concat(tooltipTexts).concat(tooltipBreaks));\n tooltip.setVisible(false);\n this.tooltips.push(tooltip);\n\n // Set tooltip text values\n if (getType(this.shopItems[i].selection) == ShopSelectionType.DEMOLITION) {\n tooltipTitle.setText(\"Demolish building\");\n tooltipPrice.setText(\"Costs half of the construction cost for the selected building\");\n // Hide unneeded text and breaks\n tooltipPriceBreak.setAlpha(0);\n tooltipRatesBreak.setAlpha(0);\n tooltipGrowthRate.setText(\"\");\n tooltipClickValue.setText(\"\");\n tooltipDescription.setText(\"\");\n } else if (getType(this.shopItems[i].selection) == ShopSelectionType.EXPAND_MAP) {\n tooltipTitle.setText(\"Expand map\");\n formatPhaserCashText(tooltipPrice, getPrice(this.shopItems[i].selection), \"\", false, true);\n this.priceTexts[this.shopItems[i].selection][\"tooltipPriceText\"] = tooltipPrice;\n tooltipGrowthRate.setText(\"Add a set of new tiles to the map\");\n // Hide unneeded text and breaks\n tooltipRatesBreak.setAlpha(0);\n tooltipClickValue.setText(\"\");\n tooltipDescription.setText(\"\");\n } else {\n this.priceTexts[this.shopItems[i].selection][\"tooltipPriceText\"] = tooltipPrice;\n tooltipTitle.setText(this.shopItems[i].selection);\n formatPhaserCashText(tooltipPrice, getPrice(this.shopItems[i].selection), \"\", false, true);\n formatPhaserCashText(tooltipGrowthRate,\n getSelectionProp(this.shopItems[i].selection, 'baseCashGrowthRate'),\n \"/second\", true, false);\n formatPhaserCashText(tooltipClickValue,\n getSelectionProp(this.shopItems[i].selection, 'baseClickValue'),\n \"/click\", true, false);\n tooltipDescription.setText(getSelectionProp(this.shopItems[i].selection, 'description'));\n \n tooltipPriceBreak.setAlpha(1);\n tooltipRatesBreak.setAlpha(1);\n }\n \n // Resize and set positions of tooltip elements\n let panelWidth = 0;\n let panelHeight = tooltipTextMargin;\n let tooltipTextYDiff = [];\n // Resize panel\n for (let i = 0; i < tooltipTexts.length; i++) {\n if (!isBlank(tooltipTexts[i].text)) {\n panelWidth = Math.max(panelWidth, tooltipTexts[i].width + 2 * tooltipTextMargin);\n // No line break is added between the cash growth rates. Also should ignore presence of \"/click\"\n // in the last text, since it is the description, no the click value.\n if (i > 0 && (i == tooltipTexts.length - 1 || !tooltipTexts[i].text.includes(\"/click\"))) {\n panelHeight += tooltipTextBreakYMargin;\n }\n tooltipTextYDiff[i] = panelHeight;\n panelHeight += tooltipTexts[i].height + tooltipTextMargin;\n }\n }\n // There is a bug in Phaser 3 that causes fonts to looks messy after resizing\n // the nineslice. For now using the workaround of creating and immediately\n // deleting a dummy text object after resizing the nineslice.\n // When this is fixed in a future Phaser release this can be removed.\n // See https://github.com/jdotrjs/phaser3-nineslice/issues/16\n // See https://github.com/photonstorm/phaser/issues/5064\n tooltipPanel.resize(panelWidth, panelHeight);\n let dummyText = this.add.text(0, 0, \"\");\n dummyText.destroy();\n \n // Move text and break objects\n for (let i = 0; i < tooltipTexts.length; i++) {\n tooltipTexts[i].setPosition(tooltipPanel.getTopCenter().x, tooltipPanel.getTopCenter().y + tooltipTextYDiff[i]);\n tooltipTexts[i].width = panelWidth - 2 * tooltipTextMargin;\n }\n let breakX = tooltipPanel.getTopLeft().x + tooltipTextBreakXMargin;\n let breakY = tooltipPrice.getTopCenter().y - (tooltipTextBreakYMargin + tooltipTextMargin) / 2;\n tooltipTitleBreak.setTo(breakX, breakY, tooltipPanel.getTopRight().x - tooltipTextBreakXMargin, breakY);\n breakY = tooltipGrowthRate.getTopCenter().y - (tooltipTextBreakYMargin + tooltipTextMargin) / 2;\n tooltipPriceBreak.setTo(breakX, breakY, tooltipPanel.getTopRight().x - tooltipTextBreakXMargin, breakY);\n breakY = tooltipDescription.getTopCenter().y - (tooltipTextBreakYMargin + tooltipTextMargin) / 2;\n tooltipRatesBreak.setTo(breakX, breakY, tooltipPanel.getTopRight().x - tooltipTextBreakXMargin, breakY);\n }\n }",
"calculateBarMargins(width) {\n const marginAlloc = 0.4 * width;\n return marginAlloc / (this.props.numArr.length + 1);\n }",
"getElementX(el) {\n var parent = this.myRef.current;\n var center = parent.clientWidth / 2;\n var left = el.offsetLeft - parent.offsetLeft;\n return left - center;\n }",
"function GetTreeNodeToLabelSpacing() { return bind.GetTreeNodeToLabelSpacing(); }",
"function offsetShouldReturnOffsetsForElementWithMargin() {\n const data = element.offset(fixture.el.querySelector(\".offset\"))\n expect(data)\n .toEqual({\n top: 10,\n right: 10,\n bottom: 10,\n left: 10\n })\n}",
"function getMargin(bed) {\n\tif(!bed.hasOwnProperty('margin') || bed.margin == undefined){\n\t\tbed.margin = 1;\n\t}\n\treturn bed.margin;\n}",
"function createMeasureTooltip() {\n if (measureTooltipElement && measureTooltipElement.parentNode) {\n measureTooltipElement.parentNode.removeChild(measureTooltipElement);\n }\n measureTooltipElement = document.createElement('div');\n measureTooltipElement.className = 'tooltip tooltip-measure';\n measureTooltip = new Overlay({\n element: measureTooltipElement,\n offset: [0, -30],\n positioning: 'bottom-center',\n });\n App4Sea.OpenLayers.Map.addOverlay(measureTooltip);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OG Calls the loadMessages function after the user is logged into firebase. This is to ensure that the loadMessages does not get called prematurely. | function loadMessagedAfterStateChange() {
firebase.auth().onAuthStateChanged(function (somebody) {
if (somebody) {
loadMessages();
}
})
} | [
"setMessagesListener(listener) {\n _messagesDb.collection('messages').orderBy('createdAt', 'desc').limit(10).onSnapshot(listener);\n }",
"_onMessagesChanged() {\n if (!this.thread) {\n return;\n }\n if (this.thread.mainCache !== this) {\n return;\n }\n for (const threadView of this.thread.threadViews) {\n if (threadView.threadCache) {\n threadView.threadCache.update({ isCacheRefreshRequested: true });\n }\n }\n }",
"function loadLogInOffMessages(){\r\n //load settings\r\n logInOffMessages = settings.get('LogInOffMessages',false);\r\n \r\n //add the command\r\n commands.set('addOnSettings',\"LogInOffMessages\",toggleLogInOffMessages);\r\n \r\n // Overwriting Adduser\r\n var oldAddUser = unsafeWindow.addUser,\r\n oldRemoveUser = unsafeWindow.removeUser;\r\n\r\n unsafeWindow.addUser = function(user, css, sort) {\r\n // Only if blackname or mod\r\n if (user.loggedin && logInOffMessages){\r\n unsafeWindow.addMessage('', user.username + ' logged on.', '','hashtext'); \r\n if (user.username === 'JustPassingBy'){\r\n unsafeWindow.addMessage('','Wish him a happy birthday !', '', 'hastext');\r\n }\r\n }\r\n oldAddUser(user,css,sort);\r\n };\r\n\r\n // Overwriting removeUser\r\n\r\n unsafeWindow.removeUser = function(id) {\r\n var user = unsafeWindow.users[getIndexOfUser(id)];\r\n if (user.loggedin && logInOffMessages){\r\n unsafeWindow.addMessage('',user.username + ' logged off.', '','hashtext');\r\n }\r\n oldRemoveUser(id);\r\n };\r\n}",
"function checkIfUserHasMessages() {\n var resultsPromise = messageService.hasNewMessages();\n resultsPromise.then(function (data) {\n // success\n vm.userMessages = data;\n }, function () {\n // an error occurred\n });\n }",
"function userOnload(){\n checkLoginAndSetUp(); \n sidebar();\n fetchOUs();\n}",
"function initializeAuthorization() {\n firebase.auth().onAuthStateChanged(function (user) {\n //exclude silent\n document.getElementById('verify-email').disabled = true;\n if (user) {\n // User is signed in.\n userEmail = user.email;\n userID = user.uid;\n userEmailVerified = user.emailVerified;\n userSignedIn = true;\n displayApplicationOrAuthentication();\n console.log(userID + \" is signed in\");\n document.getElementById('sign-in').textContent = 'Sign out';\n if (!userEmailVerified) {\n document.getElementById('verify-email').disabled = false;\n }\n firebase.database().ref('users/' + userID).set({\n email: userEmail,\n signedIn: true\n });\n } else {\n // User is signed out.\n userSignedIn = false;\n console.log(userID + \" is signed out\");\n displayApplicationOrAuthentication();\n document.getElementById('sign-in').textContent = 'Sign in';\n }\n document.getElementById('sign-in').disabled = false;\n });\n $(document.body).on(\"click\", \"#sign-in\", function () {\n toggleSignIn();\n });\n $(document.body).on(\"click\", \"#sign-up\", function () {\n handleSignUp();\n });\n $(document.body).on(\"click\", \"#verify-email\", function () {\n sendEmailVerification();\n });\n $(document.body).on(\"click\", \"#password-reset\", function () {\n sendPasswordReset();\n });\n }",
"function loadConversationList() {\r\n\tconsole.log('loadConversationList');\r\n\r\n\t// Split redirect Uri\r\n\tconst redirectUri = setupClientAndTokenUri();\r\n\t// Authenticate with PureCloud\r\n\tconsole.log('Login implicit grant w/redirectUri:', redirectUri);\r\n\t// Authenticate with PureCloud\r\n\tclient.loginImplicitGrant(clientId, redirectUri)\r\n\t\t.then(() => {\r\n\t\t\tconsole.log('Logged in');\r\n\t\t\t// Get authenticated user's info\r\n\t\t\treturn usersApi.getUsersMe();\r\n\t\t})\r\n\t\t.then((userMe) => {\r\n\t\t\tconsole.log('userMe: ', userMe);\r\n\t\t\tme = userMe;\r\n\t\t\t//\r\n\t\t\tconsole.log('authData token: ', usersApi.apiClient.authData.accessToken );\r\n const token = usersApi.apiClient.authData.accessToken;\r\n\t\t\t// Load conversation list\r\n\t\t\tconversationList = JSON.parse(localStorage.getItem('conversationList'));\r\n\t\t\tconsole.log('Local storage: ', JSON.parse(localStorage.getItem('conversationList')) );\r\n\t\t})\r\n\t\t.catch((err) => console.error(err));\r\n\r\n\tconsole.log('Finish (loadConversationList)');\r\n}",
"function reloadMessages(){\n if (!scrolling && message_open) {\n $.ajax({\n type: 'GET',\n url: \"/messaging/\" + oid + \"/message\",\n data: $(this).serialize(),\n success: function (response) {\n // console.log(response);\n $('.rightpane-container').html(response);\n $('.message-content').scrollTop(function() { return $('.message-content').scrollHeight; });\n setTimeout(reloadMessages,4000); \n },\n error: function(response) {\n console.log(response);\n }\n })\n } else if (!message_open) {\n clearTimeout(t);\n }\n scrolling = false;\n}",
"function fetchMessages() {\n const url = '/messages?user=' + parameterUsername;\n fetch(url)\n .then((response) => {\n return response.json();\n })\n .then((messages) => {\n const messagesContainer = document.getElementById('message-container');\n if (messages.length == 0) {\n messagesContainer.innerHTML = '<p>This user has no posts yet.</p>';\n } else {\n messagesContainer.innerHTML = '';\n }\n messages.forEach((message) => {\n const messageDiv = buildMessageDiv(message);\n messageDiv.appendChild(buildMessageRepliesDiv(message));\n messagesContainer.appendChild(messageDiv);\n });\n replaceCKEditor();\n });\n}",
"function VueChat () {\n this.initFirebase()\n}",
"function initApp() {\n\t// Listening for auth state changes.\n\t// [START authstatelistener]\n\tconsole.log(\"initApp\");\n\n\tfirebase.auth().onAuthStateChanged(function(user) {\n\t\tif (user) {\n\t\t\t// User is signed in.\n\t\t\tvar displayName = user.displayName;\n\t\t\tvar email = user.email;\n\t\t\tvar emailVerified = user.emailVerified;\n\t\t\tvar photoURL = user.photoURL;\n\t\t\tvar isAnonymous = user.isAnonymous;\n\t\t\tvar uid = user.uid;\n\t\t\tvar providerData = user.providerData;\n\n\t\t\tdocument.getElementById('sign-in-container').style.display = 'none';\n\t\t\tdocument.getElementById('signed-in-container').style.display = 'block';\n\t\t\tdocument.getElementById('user-details-container').style.display = 'block';\n\t\t\tdocument.getElementById('loading').style.display = 'none';\n\t\t\tdocument.getElementById('account-details').style.display = 'block';\n\n\t\t\tdocument.getElementById('current-user').textContent = email;\n\n\t\t\tgetData();\n\n\t\t\t\n\n\t\t} else {\n\t\t\t// User is signed out.\n\n\t\t\tdocument.getElementById('sign-in-container').style.display = 'block';\n\t\t\tdocument.getElementById('signed-in-container').style.display = 'none';\n\t\t\tdocument.getElementById('user-details-container').style.display = 'none';\n\t\t\tdocument.getElementById('loading').style.display = 'block';\n\t\t\tdocument.getElementById('account-details').style.display = 'none';\n\n\t\t\tremoveData();\n\n\t\t\t\n\t\t}\n\t});\n\t// [END authstatelistener]\n\n\tdocument.getElementById('sign-out').addEventListener('click', toggleSignIn, false);\n\tdocument.getElementById('save-data').addEventListener('click', saveData, false);\n\tdocument.getElementById('cancel').addEventListener('click', resetData, false);\n\n\tdocument.getElementById('sign-in').addEventListener('click', toggleSignIn, false);\n\tdocument.getElementById('password-reset1').addEventListener('click', sendPasswordReset, false);\n\tdocument.getElementById('password-reset2').addEventListener('click', sendPasswordReset, false);\n\t\n}",
"function loadWall(email) {\r\n\r\n var token = localStorage.getItem(\"token\");\r\n var to_email;\r\n var data;\r\n var destination_div; // browse or home\r\n\r\n // if function is called from home view, email = 0\r\n // this gives to_email = from_email in server\r\n if(email === 0) {\r\n destination_div = \"wall\";\r\n to_email = serverstub.getUserDataByToken(token).data.email;\r\n data = serverstub.getUserMessagesByToken(token);\r\n }\r\n else {\r\n destination_div = \"browsewall\";\r\n to_email = document.getElementById(\"toEmail\").value;\r\n data = serverstub.getUserMessagesByEmail(token, to_email);\r\n }\r\n\r\n // only display wall when there are messages posted there\r\n if(data.data.length === 0) document.getElementById(destination_div).style.display = \"none\";\r\n else document.getElementById(destination_div).style.display = \"block\";\r\n\r\n // empty wall before reload/insertion\r\n document.getElementById(destination_div).innerHTML = \"\";\r\n\r\n // if messages found then display on wall\r\n if(data.success) {\r\n for(var i= 0; i < data.data.length; i++) {\r\n document.getElementById(destination_div).innerHTML +=\r\n \"<p> To: \" + to_email + \"'s wall From: \" + data.data[i].writer + \"</br>\" + data.data[i].content + \"</p>\";\r\n }\r\n }\r\n}",
"function getData(){\n\n //clear Array and list to avoid double entries\n allTokens=[];\n $('#tokens').empty();\n\n try{\n firebase.auth().signInWithEmailAndPassword(email,password).then(\n\n ref.on('value', function(snapshot){\n var data = (snapshot.val());\n var keys = Object.keys(data);\n\n\n //setting up the list with data from firebase and pushing all Tokens to an array\n for (var i = 0; i<keys.length; i++){\n var k = keys[i];\n var token = data[k].expoToken;\n var mail = data[k].userEmail;\n\n allTokens.push(token);\n\n var li = \"<li>\" + mail + \": \" + token + \"</li>\";\n $('#tokens').append(li);\n $('#tokenContainer').removeClass('hidden');\n }\n },\n function(error){\n alert(\"Keine Berechtigung\");\n console.log(\"The read failed: \" + error.code);\n })\n );\n }\n catch(error){\n alert(\"Keine Berechtigung\");\n console.log(error);\n }\n }",
"function onFlashLoaded() {\n\t\ttrace(\"onFlashLoaded (from Flash)\");\n\t\t\n\t\tset_ready();\n\t}",
"async function initUserStore() {\n console.log('Initiliazing user base...');\n (await slack.users.list()).members\n .filter(user => !user.deleted && !user.is_bot && !user.is_restricted)\n .forEach(async user => {\n const userRef = store.collection('users').doc(user.id);\n if (!(await userRef.get()).exists) {\n console.info(`[USER ADDED] ${user.id} : ${user.name}`);\n userRef.set({ ...user, score: 1, availablePoints: 0 });\n }\n });\n console.log('Done initializing');\n}",
"function loadSlenderEtherMessages() {\n\t\tslenderDB.child('ether').child('messages').once('value', function (snap) {\n\n\t\t\tethers = snap.val()\t\t\n\n\t\t\tvar etherText\n\t\t\t//$('#etherText').html('')\n\n\t\t\t// Function for random descriptions also works for ether messages\n\t\t\t// Select a random either message\n\t\t\trandomEther = getRandomDescription(ethers)\n\n\t\t\tetherFace = \"<img src='/images/face-slenderman.png' class='img-circle' style='height: 40px; width: 40px'> \"\n\n\t\t\t$('#etherText').hide()\n\t\t\t$('#etherFace').hide()\n\t\t\t$('#etherText').html(randomEther)\n\t\t\t$('#etherFace').html(etherFace)\n\t\t\t$('#etherText').fadeIn(2000)\n\t\t\t$('#etherFace').fadeIn(2000)\n\t\t\t$('#etherText').fadeOut(4000)\n\t\t\t$('#etherFace').fadeOut(4000)\n\n\t})\n\n}",
"function endCall() {\n setMessages([]);\n setChatUsers([]);\n socketRef.current.emit(\"leaveRoom\");\n socketRef.current = null;\n }",
"function clear() {\n messages = [];\n }",
"function startFirebase() {\n console.log('[startFirebase]');\n if (fbRef) {\n stopFirebase();\n }\n\n var fbURL = 'https://' + settings.appID + '.firebaseio.com/';\n fbRef = new Firebase(fbURL);\n fbRef.authAnonymously(onFirebaseConnected);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function to set day costs/hours to 0 if no information. | function _resetDayCosts(date) {
for (var department in departments) {
if (!departments.hasOwnProperty(department)) {
continue;
}
var $depRow = $dayCostTable.find("tr[data-dep-id="+department+"]");
var $depHours = $depRow.find("td[data-col=hours]");
var $depOvertime = $depRow.find("td[data-col=overtime]");
var $depCost = $depRow.find("td[data-col=cost]");
$depHours.text(0);
$depOvertime.text(0);
$depCost.text("$0");
}
var $depRow = $dayCostTable.find("tr[data-dep-id=total]");
var $depHours = $depRow.find("td[data-col=hours]");
var $depOvertime = $depRow.find("td[data-col=overtime]");
var $depCost = $depRow.find("td[data-col=cost]");
$depHours.text(0);
$depOvertime.text(0);
$depCost.text("$0");
} | [
"function clearTotals() {\n for (var i = 0; i < numOpenHours; i++){\n totals[i] = 0;\n tosserTotals[i] = 0;\n }\n}",
"function reRenderAllCostsHours() {\r\n var date = $addScheduleDate.val();\r\n renderDayAndWeekCosts(date);\r\n reRenderMonthlyCosts();\r\n }",
"function updateHoursAndCost(hoursAndCostsDelta) {\r\n // Update day hours & costs\r\n var dayCosts = hoursAndCosts['day_hours_costs'];\r\n var dayCostDelta = hoursAndCostsDelta['day_hours_costs'];\r\n for (date in dayCostDelta) {\r\n if (!dayCosts.hasOwnProperty(date)) {\r\n // Case where no schedules previously assigned on date\r\n dayCosts[date] = dayCostDelta[date];\r\n } else {\r\n var hoursAndCostDelta = dayCostDelta[date];\r\n for (var department in hoursAndCostDelta) {\r\n if (!hoursAndCostDelta.hasOwnProperty(department)) { continue; }\r\n var hourDelta = hoursAndCostDelta[department]['hours'];\r\n var overtimeDelta = hoursAndCostDelta[department]['overtime_hours'];\r\n var costDelta = hoursAndCostDelta[department]['cost'];\r\n\r\n dayCosts[date][department]['hours'] += hourDelta;\r\n dayCosts[date][department]['overtime_hours'] += overtimeDelta;\r\n dayCosts[date][department]['cost'] += costDelta;\r\n }\r\n }\r\n }\r\n\r\n // Find workweek to update\r\n var allWorkweekCosts = hoursAndCosts['workweek_hours_costs'];\r\n var weekCosts = {};\r\n var weekCostDelta = hoursAndCostsDelta['workweek_hours_costs'][0];\r\n for (var i=0; i < allWorkweekCosts.length; i++) {\r\n var weekStart = allWorkweekCosts[i]['date_range']['start'];\r\n var weekDeltaStart = weekCostDelta['date_range']['start'];\r\n if (moment(weekDeltaStart).isSame(weekStart)) {\r\n weekCosts = allWorkweekCosts[i]['hours_cost'];\r\n break;\r\n }\r\n }\r\n // Update week hours & costs\r\n var hoursAndCostDelta = weekCostDelta['hours_cost'];\r\n for (var department in hoursAndCostDelta) {\r\n if (!hoursAndCostDelta.hasOwnProperty(department)) { continue; }\r\n var hourDelta = hoursAndCostDelta[department]['hours'];\r\n var overtimeDelta = hoursAndCostDelta[department]['overtime_hours'];\r\n var costDelta = hoursAndCostDelta[department]['cost'];\r\n\r\n weekCosts[department]['hours'] += hourDelta;\r\n weekCosts[department]['overtime_hours'] += overtimeDelta;\r\n weekCosts[department]['cost'] += costDelta;\r\n }\r\n // Update month hours & costs\r\n var monthCosts = hoursAndCosts['month_costs'];\r\n var monthCostDelta = hoursAndCostsDelta['month_costs'];\r\n for (department_key in monthCostDelta) {\r\n // Add cost deltas to hour & cost state\r\n var department = monthCostDelta[department_key];\r\n var costDelta = department['cost'];\r\n monthCosts[department_key]['cost'] += costDelta;\r\n }\r\n }",
"function updateHour() {\n\t\t\tdocument.documentElement.setAttribute(\"stylish-hour\", (new Date()).getHours())\n\t\t}",
"function updateHours()\n{\n let nowHours = new Date();\n let nowHoursString = \"\";\n\n if (nowHours.getHours() === 0 && militaryTime === 0) {\n hoursMath.innerHTML = `1 + 2 = 12`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 1);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, 2);\n }\n\n else if (nowHours.getHours() === 1) {\n hoursMath.innerHTML = `0 + ${nowHours.getHours()} = ${nowHours.getHours()}`;\n hours.innerHTML = \"Hour\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 0);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, nowHours.getHours()*1);\n }\n\n\n else if (nowHours.getHours() < 10 && nowHours.getHours() != 0 && nowHours.getHours() != 1) {\n hoursMath.innerHTML = `0 + ${nowHours.getHours()} = ${nowHours.getHours()}`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 0);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, nowHours.getHours()*1);\n }\n\n else if (nowHours.getHours() === 12) {\n hoursMath.innerHTML = `1 + 2 = 12`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 1);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, 2);\n }\n\n else if (nowHours.getHours() === 13 && militaryTime === 0) {\n hoursMath.innerHTML = `0 + 1 = 1`;\n hours.innerHTML = \"Hour\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 0);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, 1);\n }\n\n else if (nowHours.getHours() > 11 && nowHours.getHours() < 22 && militaryTime === 0) {\n nowHoursString = (nowHours.getHours()-12).toString();\n hoursMath.innerHTML = `0 + ${nowHoursString[0]} = ${nowHoursString[0]}`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, 0);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, nowHoursString[0]*1);\n }\n\n else if (nowHours.getHours() <= 23 && nowHours.getHours() >= 22 && militaryTime === 0) {\n nowHoursString = (nowHours.getHours()-12).toString();\n hoursMath.innerHTML = `${nowHoursString[0]} + ${nowHoursString[1]} = ${nowHoursString}`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, nowHoursString[0]*1);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, nowHoursString[1]*1);\n }\n \n else {\n nowHoursString = nowHours.getHours().toString();\n hoursMath.innerHTML = `${nowHoursString[0]} + ${nowHoursString[1]} = ${nowHoursString}`;\n hours.innerHTML = \"Hours\";\n ledFirst(hours11, hours12, hours14, hourOnLED, hourOffLED, nowHoursString[0]*1);\n ledSecond(hours21, hours22, hours24, hours28, hourOnLED, hourOffLED, nowHoursString[1]*1);\n }\n\n}",
"calTotalCharged(){\n this._totalCharged = this._costPerHour * this._hoursParked;\n }",
"function SetNoOfDaysToExpireAsBlank(cellValue, options, rowObject) {\r\n if (isinvoiceSearch) {\r\n return \"\";\r\n }\r\n else {\r\n return cellValue;\r\n }\r\n }",
"function renderDayAndWeekCosts(date) {\r\n // Check if cost/hour information exists for particular day (If not it's all 0)\r\n if (!hoursAndCosts['day_hours_costs'].hasOwnProperty(date)) {\r\n _resetDayCosts(date);\r\n } else {\r\n // Display day hours and cost\r\n var dayCosts = hoursAndCosts['day_hours_costs'][date];\r\n for (var department in dayCosts) {\r\n if (!dayCosts.hasOwnProperty(department)) {\r\n continue;\r\n }\r\n var $depRow = $dayCostTable.find(\"tr[data-dep-id=\"+department+\"]\");\r\n var $depHours = $depRow.find(\"td[data-col=hours]\");\r\n var $depOvertime = $depRow.find(\"td[data-col=overtime]\");\r\n var $depCost = $depRow.find(\"td[data-col=cost]\");\r\n\r\n $depHours.text(dayCosts[department]['hours']);\r\n $depOvertime.text(dayCosts[department]['overtime_hours']);\r\n commaCost = numberWithCommas(Math.round(dayCosts[department]['cost']));\r\n $depCost.text(\"$\" + commaCost);\r\n }\r\n }\r\n // Find what workweek the day clicked belongs to\r\n var weekCosts = {};\r\n var weekDuration = {};\r\n var allWorkweekCosts = hoursAndCosts['workweek_hours_costs'];\r\n for (var i=0; i < allWorkweekCosts.length; i++) {\r\n var weekStart = allWorkweekCosts[i]['date_range']['start'];\r\n var weekEnd = allWorkweekCosts[i]['date_range']['end'];\r\n if (moment(date).isSameOrAfter(weekStart) && moment(date).isSameOrBefore(weekEnd)) {\r\n weekCosts = allWorkweekCosts[i]['hours_cost'];\r\n weekDuration = allWorkweekCosts[i]['date_range'];\r\n break;\r\n }\r\n }\r\n // Display week hours and cost\r\n for (var department in weekCosts) {\r\n if (!weekCosts.hasOwnProperty(department)) {\r\n continue;\r\n }\r\n var $depRow = $weekCostTable.find(\"tr[data-dep-id=\"+department+\"]\");\r\n var $depHours = $depRow.find(\"td[data-col=hours]\");\r\n var $depOvertime = $depRow.find(\"td[data-col=overtime]\");\r\n var $depCost = $depRow.find(\"td[data-col=cost]\");\r\n\r\n $depHours.text(weekCosts[department]['hours']);\r\n $depOvertime.text(weekCosts[department]['overtime_hours']);\r\n commaCost = numberWithCommas(Math.round(weekCosts[department]['cost']));\r\n $depCost.text(\"$\" + commaCost);\r\n }\r\n // Render day and week titles\r\n var dayTitle = moment(date).format(\"dddd, MMMM Do\");\r\n var weekStart = moment(weekDuration['start']).format(\"MMMM Do\");\r\n var weekEnd = moment(weekDuration['end']).format(\"MMMM Do\");\r\n\r\n $dayCostTitle.text(dayTitle);\r\n $weekCostTitle.text(weekStart + \" - \" + weekEnd);\r\n }",
"function defineDayCapacities(){\n\tvar l = dateSpan.length;\n\t\n\tvar workSchedule = [];\n\tworkSchedule[0] = U.profiles[Profile].workSchedule.su;\n\tworkSchedule[1] = U.profiles[Profile].workSchedule.mo;\n\tworkSchedule[2] = U.profiles[Profile].workSchedule.tu;\n\tworkSchedule[3] = U.profiles[Profile].workSchedule.we;\n\tworkSchedule[4] = U.profiles[Profile].workSchedule.th;\n\tworkSchedule[5] = U.profiles[Profile].workSchedule.fr;\n\tworkSchedule[6] = U.profiles[Profile].workSchedule.sa;\n\t\n\tvar vacationDays = U.profiles[Profile].vacationDays;\n\tvar numberOfVacationDays = vacationDays.length;\n\n\tfor(i=0;i<l;i++){\n\t\tdateSpan[i].capacity = workSchedule[dateSpan[i].dayNumber];\n\t\t\n\t\tif(i == 0){\n\t\t\t//The first day being set is today; see how much time remains before today is over\n\t\t\tvar timeRemainingBeforeMidnight = (new Date(today.toDateString()).getTime() + 86400000) - (new Date().getTime());\n\t\t\t//Floor milliseconds to nearest full minute amount\n\t\t\ttimeRemainingBeforeMidnight = Math.ceil(timeRemainingBeforeMidnight/60000);\n\t\t\t//Translate minutes to hours\n\t\t\ttimeRemainingBeforeMidnight = timeRemainingBeforeMidnight/60;\n\t\t\t\n\t\t\tif(timeRemainingBeforeMidnight + totalTimeSpentToday < dateSpan[i].capacity){\n\t\t\t\t/*If the timeRemainingBeforeMidnight plus the totalTimeSpentToday is less than the day's capacity \n\t\t\t\t(as defined in the workSchedule), it means there is not enough time left in the day to fit in a \n\t\t\t\tfull work day, so the day's capacity is reduced accordingly.*/\n\t\t\t\tif(!dayCapacityAdjustmentMessageShown && U.hasHadTour == true){ //We don't want to show this when someone first signs up\n\t\t\t\t\tshowMessageBar(1,\"Today's Work Schedule has been altered according to the remaining hours in the day.\");\n\t\t\t\t\tdayCapacityAdjustmentMessageShown = true;\n\t\t\t\t}\n\t\t\t\t//console.log(\"Today's workSchedule says we should have \" + dateSpan[i].capacity + \" hours to work, but there are only \" + timeRemainingBeforeMidnight + \" hours left in the day.\");\n\t\t\t\tdateSpan[i].capacity = timeRemainingBeforeMidnight + totalTimeSpentToday;\n\t\t\t\tconsole.log(\"Today's capacity has been adjusted to \" + Math.floor(dateSpan[i].capacity) + \":\" + dateSpan[i].capacity*60 %60);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\t//Check if it is a vacationDay and if so, set its capacity to 0\n\t\tfor(a=0;a<numberOfVacationDays;a++){\n\t\t\tuntestedDate = dateSpan[i].date.toDateString();\n\t\t\tvacationDayToTest = new Date(vacationDays[a]).toDateString();\n\t\t\tif(untestedDate == vacationDayToTest){\n\t\t\t\tdateSpan[i].vacationDay = true;\n\t\t\t\tdateSpan[i].capacity = 0;\n\t\t\t\tbreak;\n\t\t\t}else{\n\t\t\t\tdateSpan[i].vacationDay = false;\n\t\t\t}\n\t\t}\n\t}\n\t//Once the Day Capacities and VacationDay projectStatus are set, flow the projects into the Days\n\t//console.log(\"+ capacity and vacationDay for each Day in the dateSpan has been defined. Now calling flowProjectsIntoDays().\");\n\tflowProjectsIntoDays();\n}",
"function emptyTotaalKosten(){\n OverigeKosten = 0;\n OpenbaarVervoer = 0;\n AutoKM = 0;\n AutoEuro = 0;\n Totaal = 0;\n}",
"get formattedHours() {\n const _hours = this.hours;\n let hours = _hours;\n if (_hours !== null) {\n hours = this.amPm && _hours > HOURS_OF_NOON\n ? _hours - HOURS_OF_NOON : this.amPm && !_hours ? HOURS_OF_NOON : _hours;\n }\n return this.formattedUnit(hours);\n }",
"function setDefault() {\n if (ctrl.rrule.bymonthday || ctrl.rrule.byweekday) return\n ctrl.rrule.bymonthday = ctrl.startTime.getDate()\n }",
"function resetDailyTotal(campaignId) {\n db.updateById(TABLE, KEY, campaignId, {sales_today: 0})\n}",
"function emptyYearUren(){\n YearGewerktUren = 0;\n YearOver100Uren = 0;\n YearOver125Uren = 0;\n YearVerlofUren = 0;\n YearZiekteUren = 0;\n YearTotaalUren = 0;\n}",
"function calcTotalDayAgain() {\n var eventCount = $this.find('.everyday .event-single').length;\n $this.find('.total-bar b').text(eventCount);\n $this.find('.events h3 span b').text($this.find('.events .event-single').length)\n }",
"function calculateCosts() {\n var total_today_cost = 0.0;\n var total_yesterday_cost = 0.0;\n var total_week_cost = 0.0;\n\n Object.keys(applianceResponses).forEach(function(appliance_id) {\n // We exclude solar from our costs.\n if (appliance_id == \"PowerS\") {\n return;\n }\n var week_data_points = applianceResponses[appliance_id];\n var today_data_points = week_data_points.filter(data_point => isToday(data_point.timestamp));\n var yesterday_data_points = week_data_points.filter(data_point => isYesterday(data_point.timestamp));\n var today_cost = calculateCostForDataPoints(today_data_points);\n var yesterday_cost = calculateCostForDataPoints(yesterday_data_points);\n var week_cost = calculateCostForDataPoints(week_data_points);\n\n total_today_cost += today_cost;\n total_yesterday_cost += yesterday_cost;\n total_week_cost += week_cost;\n });\n createCostChart(\n parseFloat(total_today_cost.toFixed(1)),\n parseFloat(total_yesterday_cost.toFixed(1)),\n parseFloat(total_week_cost.toFixed(1)));\n }",
"loadZero()\n\t{\n\t\tvar TcI,TcJ;\n\t\tfor (TcI = 0; TcI < 4; TcI++)\n\t\t{\n\t\t\tfor (TcJ = 0; TcJ < 4; TcJ++)\n\t\t\t{\n\t\t\t\tthis._data[TcI][TcJ] = 0;\n\t\t\t}\n\t\t}\n\t}",
"function Hours() {\n this.hoursPerWeek = 40;\n // Can't make this easily configurable because workwork and liberty both\n // assume Monday to Friday to be working days and Saturday and Sunday to be\n // non-working days\n this.daysPerWeek = 5;\n this.regions = null;\n this.vacationDaysTotal = 0;\n this.vacationDays = [];\n this.estimatedSickDaysTotal = 0;\n this.sickDays = [];\n\n // TODO setting hoursWorked as a simple number is in contrast to vacation days\n // and sick days for which we add the actual, individual days and can\n // calculate the number of vacation days/sick days depending on the date.\n // To have the same for hours/days worked we would need to add the worked\n // hours for each day individually. Maybe allow both?\n this.hoursWorked = 0;\n}",
"function hxh() {\n const lastHxH = new Date(\"2018-11-26\");\n const today = new Date();\n const milliSinceHxH = today - lastHxH;\n // that is what it takes to calculate on js milli, seconds, min, hours\n const daysSinceHxH = Math.ceil(milliSinceHxH / (1000 * 60 * 60 * 24));\n\n const neverForget = `sdds cap, ${daysSinceHxH} dias sem cap`;\n return neverForget;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The person at the head of the line can buy exactly one ticket and must then exit the line. if a person needs to purchase additional tickets,they must reenter the end of the line and wait to be sold their next ticket(assume exit and reentry takes zero seconds). Each ticket sale takes exactly one second. We express initial line of n people as an array, tickets = [tickets0, tickets1 ... ticketsN1], where ticketsi denotes the number of tickets person i wishes to buy. If Jesse is standing at a position p in this line, find out how much time it would take for him to buy all tickets. Complete the waiting time function in the editor below. It has two parameters: An array, tickets, of n positive integers describing initial sequence of people standing in line. Each ticketsi describes number of tickets that a person waiting at initial place. An integer p, denoting Jesse's position in tickets. Sample Input 5 2 6 3 4 5 2 Sample Output 12 Sample Input 4 5 5 2 3 3 Sample Output 11 | function waitingTime(array, p) {
let tickectsAmout = array[p];
let result = 0;
let personLocation = p;
while(tickectsAmout > 0) {
let reducedValue = array.shift();
reducedValue--;
result = result + 1;
if(personLocation === 0) {
personLocation = array.length;
tickectsAmout -= 1;
}else {
personLocation--;
}
if(reducedValue > 0){
array.push(reducedValue)
}
}
return result;
} | [
"function get_time_left() {\n return (total_paid / price_per_second) - time_spent;\n}",
"function scheduleJob(jobs) {\n let sortedByProfit = jobs.sort((a, b) => b[2] - a[2]);\n let time = 1;\n let maxProfit = 0;\n let result = [];\n console.log(sortedByProfit)\n\n for (let i in sortedByProfit) {\n if (sortedByProfit[i][1] >= time) {\n result.push(sortedByProfit[i]);\n maxProfit += sortedByProfit[i][2];\n time++;\n }\n }\n result.push(maxProfit)\n return result\n}",
"calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng/3);\n this.time = periods * 15;\n }",
"function spinTimerTick() {\n timeLeft = timeLeft - 1000;\n console.log(timeLeft);\n if (timeLeft < 0) {\n // Current Spin has officially ended taking in bets\n // 1) call stopTimer() to clear the Interval\n stopTimer();\n // 2) sendBets() will send a user's bets to server. \n // server will respond with spin value\n sendBets();\n // 3) send a GET to get spin results from service\n setTimeout(startSpin, 12000);\n }\n updateTimer();\n }",
"getNextTime (step, time) {\n\t\tlet ret = this.getStepTime(step);\n\t\tlet totalTime = this.getTotalInterval() * 60 * 1000;\n\t\twhile (ret < time)\n\t\t\tret += totalTime;\n\t\treturn ret;\n\t}",
"function getWaitTime(id) {\n\tvar idx;\n\tif (id) {\n\t\tidx = getOrderIdxById(id);\n\t\tif (idx === undefined) {\n\t\t\treturn undefined;\n\t\t}\n\t} else {\n\t\tidx = 0;\n\t}\n\tvar totalWait = 0;\n\tfor (var i = orders.length - 2; i > idx - 1; i--) {\n\t\ttotalWait += orders[i].turnaround;\n\t}\n\tvar now = new Date();\n\tvar daysRemaining = (orders.length > 0) ? (orders[orders.length - 1].turnaround - Math.round((now - orders[orders.length - 1].date) / (24 * 3600 * 1000), 0)) : 0;\n\tdaysRemaining = (daysRemaining > 0) ? daysRemaining : 0; // If days remaining is negative then order time is exceeded and we don't want to count it.\n\ttotalWait += daysRemaining;\n\treturn totalWait;\n}",
"function updateWaitingTimeOfWaitingCallers() {\n var wc;\n for (wc in waitingCallers) {\n waitingCallers[wc].updateWaiting();\n }\n }",
"getWaitTime(t) {\n let _now = new Date();\n let _then = new Date(parseInt(t));\n let _t = (_now - _then) / 1000;\n let _m = Math.floor(_t / 60);\n let _s = _t - (_m * 60);\n\n _m = this._timeDigit(_m); //pretty strings\n _s = this._timeDigit(_s);\n\n return `${_m}:${_s}`; \n }",
"function waitTimes(){\r\n if (times = getTimesFromPage()){\r\n // save the times on this page\r\n saveSetting('waitTimes', times.toString().replace(/,/g, \";\"));\r\n return times;\r\n }\r\n else {\r\n // use known times\r\n times = getSetting('waitTimes', 'times').split(\";\");\r\n if (times != 'times'){\r\n if (getSetting('showTimes', '1') == '1'){\r\n placeTable();\r\n setInterval(countdowns, 1000);\r\n }\r\n return times;\r\n }\r\n else {\r\n checkTimes();\r\n }\r\n }\r\n}",
"function checkDelay(time, dPBacteria, cBNumber) {\n\t\tif (time - spawnTime >= dPBacteria[cBNumber]) {\n\t\t\tcurrentBacteriaNumber++;\n\t\t\tspawnTime = time;\n\t\t}\n\t}",
"function timeCheck(finishCallback, waitingCallback) {\n var d,\n h,\n m,\n s;\n condition = false;\n var interval = setInterval(function () {\n d = new Date();\n h = d.getHours();\n m = d.getMinutes();\n s = d.getSeconds();\n if (condition) {\n clearInterval(interval);\n finishCallback();\n } else {\n if (h === 23 & m >= 57 & s >= 13) {\n condition = true;\n } else {\n waitingCallback();\n }\n }\n }, 250);\n}",
"function calculateParkingFee(inputs) {\n const { arrival, departure, parkingFee} = inputs;\n const timeArrival = new Date(2021, 01, 01, arrival.split(\":\")[0], arrival.split(\":\")[1]);\n const timeDeparture = new Date(2021, 01, 01, departure.split(\":\")[0], departure.split(\":\")[1]);\n\n if (timeDeparture < timeArrival) throw new Error(\"Departure cannot be earlier than arrival.\");\n if (isNaN(timeArrival) || isNaN(timeDeparture)) throw new Error(\"Invalid Date\");\n\n const difference = (timeDeparture - timeArrival) / 1000 / 60;\n\n let timeOfStay;\n if (difference < 60) {\n timeOfStay = 1;\n } else if (difference % 60 > 10) {\n timeOfStay = Math.floor(difference/60) + 1;\n } else {\n timeOfStay = Math.floor(difference/60);\n }\n\n return Math.round(timeOfStay * parkingFee * 100) / 100;\n}",
"function iTri(s){\n let stage = {\n Swim: 2.4,\n Bike: 112,\n Run: 26.2,\n };\n const out = {};\n\n let tmp;\n tmp = stage.Swim + stage.Bike + stage.Run - s;\n tmp = tmp.toFixed(2);\n if (s === 0) { return 'Starting Line... Good Luck!' }\n else if (s > 0 && s <= stage.Swim) {\n out['Swim'] = tmp + ' to go!';\n return out;\n } else if (s > stage.Swim && s <= stage.Bike + stage.Swim) {\n out['Bike'] = tmp + ' to go!';\n return out;\n } else if (s > stage.Bike + stage.Swim && s <= stage.Run + stage.Bike + stage.Swim) {\n if (tmp <= 10) { out['Run'] = 'Nearly there!'; return out; }\n else out['Run'] = tmp + ' to go!';\n return out;\n } else if (tmp < 0) return `You're done! Stop running!`\n}",
"function scheduleNextTrade(){\n setTimeout(makeRandomTrade, 1000);\n}",
"function playClueSequence(){\n guessCounter = 0; // resets clue sequence counter to 0 for every new turn\n let delay = nextClueWaitTime; //set delay to initial wait time\n for(let i=0;i<=progress;i++){ // for each clue that is revealed so far\n console.log(\"play single clue: \" + pattern[i] + \" in \" + delay + \"ms\")\n setTimeout(playSingleClue,delay,pattern[i]) // set a timeout to play that clue\n delay += clueHoldTime \n delay += cluePauseTime;\n }\n}",
"function analyzeTickets (part, inputStr, targetFields) {\n const inputArr = inputStr.split('\\n\\n');\n\n const rules = inputArr[0].split('\\n'); // e.g. \"class: 1-3 or 5-7\"\n const yourTicket = inputArr[1].split('\\n')[1].split(',').map(n => +n); // (used in part 2 only) e.g. [7, 1, 14]\n const nearbyTickets = inputArr[2].split('\\n').slice(1).map(ticket => ticket.split(',').map(n => +n)); // e.g. [[7, 3, 47], [40, 4, 50], [55, 2, 20], [38, 6, 12]]\n\n const rulesMap = {}; // e.g. { class: [[1, 3], [5, 7]], row: [[6, 11], [33, 44]], seat: [[13, 40], [45, 50]] }\n for (const rule of rules) {\n const split = rule.split(': ');\n const name = split[0];\n rulesMap[name] = [];\n const ranges = split[1].split(' or ');\n for (const range of ranges) {\n rulesMap[name].push(range.split('-').map(n => +n));\n }\n }\n\n const knownInvalidNums = new Set(); // optimization: in case an invalid number is repeated, we know it is invalid right away\n const invalidTickets = new Set(); // (used in part 2 only) contains index values of invalid tickets\n let part1Total = 0; // (used in part 1 only)\n for (let i = 0; i < nearbyTickets.length; ++i) {\n const nearbyTicket = nearbyTickets[i];\n let ticketConfirmedInvalid = false; // (used in part 2 only)\n for (const num of nearbyTicket) {\n if (part === 2 && ticketConfirmedInvalid) continue; // optimization for part 2 only - we do not need to find all invalid nums; we only need to identify valid tickets\n if (knownInvalidNums.has(num)) { // see note on knownInvalidNums optimization above\n ticketConfirmedInvalid = true; // (used in part 2 only) the entire ticket is confirmed invalid if it has an invalid num\n part1Total += num; // (used in part 1 only)\n } else {\n let numConfirmedValid = false;\n for (const ranges of Object.values(rulesMap)) {\n if (numConfirmedValid) break;\n for (const [min, max] of ranges) {\n if (numConfirmedValid) break;\n if (min <= num && num <= max) numConfirmedValid = true; // num is confirmed valid if it fits within any range of any rule\n }\n }\n if (!numConfirmedValid) { // only after searching all ranges of all rules can you confirm num is invalid\n knownInvalidNums.add(num);\n ticketConfirmedInvalid = true; // (used in part 2 only) the entire ticket is confirmed invalid if it has an invalid num\n part1Total += num; // (used in part 1 only)\n }\n }\n }\n if (ticketConfirmedInvalid) invalidTickets.add(i); // (used in part 2 only)\n }\n\n if (part === 1) { // PART 1: RETURN THE SUM OF ALL INSTANCES OF ALL INVALID NUMS\n\n return part1Total;\n\n } else { // PART 2: DEDUCE FIELD POSITIONS OF EACH RULE, AND FIND PRODUCT OF TARGET FIELDS FOR YOUR TICKET\n\n const validTickets = nearbyTickets.filter((_, i) => !invalidTickets.has(i)); // start by filtering out invalid tickets\n const rulePositions = {}; // this will contain field positions (indices) for rules as we deduce them, e.g. { row: 0, ... }\n\n function simulate() { // iterate through all nearby ticket data, given all information deduced thus far\n for (let i = 0; i < yourTicket.length; ++i) { // iterate by index position first...\n const possibleRules = Object.keys(rulesMap).filter(rule => !(rule in rulePositions)); // ...the possible rules for this index can only be unsolved rules...\n const invalidRules = [];\n for (const rule of possibleRules) {\n let ruleConfirmedInvalid = false;\n for (const nearbyTicket of validTickets) { // ...now iterate through valid tickets...\n if (ruleConfirmedInvalid) break;\n const num = nearbyTicket[i];\n let ruleConfirmedPossible = false;\n for (const range of rulesMap[rule]) {\n const [min, max] = range;\n if (min <= num && num <= max) { // ...if any num from any range of the rule matches, then that rule is confirmed possible...\n ruleConfirmedPossible = true;\n break;\n }\n }\n if (!ruleConfirmedPossible) ruleConfirmedInvalid = true; // ...only if the rule is not possible can we confirm that it is invalid\n }\n if (ruleConfirmedInvalid) invalidRules.push(rule);\n }\n if (possibleRules.length - invalidRules.length === 1) { // if we can eliminate all but 1 of the candidate rules for this index...\n const validRule = possibleRules.filter(rule => !invalidRules.includes(rule));\n rulePositions[validRule] = i; // ...then we have deduced that the remaining rule must pair with the current index, i\n }\n }\n }\n\n while (Object.keys(rulePositions).length < rules.length) { // while we have not yet solved for every rule...\n simulate(); // ...rerun the simulation\n }\n\n let product = 1; // now that we finally know which rule goes in which position...\n for (const targetField of targetFields) {\n const idx = rulePositions[targetField];\n product *= yourTicket[idx]; // ...find the product of all target fields based on the numbers at the corresponding positions on your ticket\n }\n return product;\n\n }\n\n}",
"findCarByTime(timeInMinutes,callback){\n let index=0\n arr=[]\n for(lotIndex=0; lotIndex < noOfLots; lotIndex++ ){\n for(slotIndex=0; slotIndex < noOfSlots; slotIndex++ ){\n if(this.parking[slotIndex][lotIndex]!=undefined){ \n let parkTime=this.minutesConversion(this.parking[slotIndex][lotIndex].parkTime)\n let currentTime=this.minutesConversion(new Date())\n if((currentTime-parkTime)<=timeInMinutes){\n arr[index]=[slotIndex,lotIndex,this.parking[slotIndex][lotIndex].vehicleNumber]\n index++\n }\n }\n }\n }\n this.checkArrayLength(arr,callback)\n }",
"compute ( size, totalTime ) {\n\n let remainingTime = totalTime\n let t24 = 1000 * 60 * 24\n let t1h = 1000 * 60\n let charges = 0\n\n var hourlyCharge = 0\n\n if ( size == 0 ) {\n hourlyCharge = 20\n } else if ( size == 1 ) {\n hourlyCharge = 60\n } else if ( size == 2 ) {\n hourlyCharge = 100\n }\n\n // For parking that exceeds 24 hours, every full 24 hour chunk is charged 5,000 pesos regardless of parking slot.\n if ( remainingTime > t24 ) {\n let n24 = parseInt(totalTime / t24)\n charges += n24 * 5000\n remainingTime -= ( n24 * t24 )\n }\n\n // First 3 hours has a flat rate of 40\n if ( remainingTime > ( t1h * 3 ) ) {\n remainingTime -= ( t1h * 3 )\n charges += 40\n }\n\n // The exceeding hourly rate beyond the initial three (3) hours will be charged as follows:\n // - 20/hour for vehicles parked in SP;\n // - 60/hour for vehicles parked in MP; and\n // - 100/hour for vehicles parked in LP\n if ( remainingTime > 0 ) {\n let remainingHours = Math.ceil ( remainingTime / t1h )\n charges += remainingHours * hourlyCharge\n }\n\n // return total charges\n return charges\n\n }",
"function getAvailableSeatsWithChoice(screen,numSeats,choice) {\n\n\treturn new Promise(function (resolve, reject) {\n\t\t//console.log(screen);\n\t\tvar availSeats = \n\t\t{\n\t\t}\n\t\tvar rowNo = choice[0]\n\t\tvar preferSeatNo = choice.substr(1, choice.length)\n\t\tconsole.log(rowNo)\n\t\tconsole.log(preferSeatNo)\n\n\t\tvar seatsInRow = []\n\t\tif(rowNo == \"A\") {\n\t\t\tseatsInRow= screen[0].screenInfo.A.rowStatus\n\t\t\tavailSeats = { \"A\":[]}\n\t\t}\n\t\tif(rowNo == \"B\"){\n\t\t seatsInRow= screen[0].screenInfo.B.rowStatus\n\t\t availSeats = { \"B\":[]}\n\t\t}\n\t\tif(rowNo == \"D\"){\n\t\t seatsInRow= screen[0].screenInfo.D.rowStatus\n\t\t availSeats = { \"D\":[]}\n\t\t}\n\t\t\n\n\t\tconsole.log(seatsInRow)\n\n\t\tif(numSeats ==1 && preferSeatNo < seatsInRow.length) {\n\t\t\tconsole.log(seatsInRow[parseInt(preferSeatNo)])\n\t\t\tif(seatsInRow[parseInt(preferSeatNo)].seatStatus == 'unreserved') {\n\t\t\t\tavailSeats[rowNo].push(preferSeatNo)\n\t\t\t\tresolve(availSeats)\n\t\t\t}\n\t\t\telse {\n\t\t\t\treject(\"seats are not available for this choice\") //can give some err\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if(preferSeatNo < seatsInRow.length){\n\n\t\t\tif(seatsInRow[parseInt(preferSeatNo)].seatStatus==\"unreserved\" ) {\n\t\t\t //case 1 starts from prefered seat number\n\t\t\t var count = 0;\n\t\t\t for(var s = parseInt(preferSeatNo) ; s< seatsInRow.length ; s++) {\n\t\t\t\tif(count >= numSeats) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(seatsInRow[s].seatStatus == \"unreserved\" && seatsInRow[s].isAisel == false ) {\n\t\t\t\t\tconsole.log(seatsInRow[s])\n\t\t\t\t\tcount++;\n\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[s].seatNo)\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t }\n\t\t\t console.log(\"count =\" +count)\n\t\t\t console.log(\"after 1st case \" + availSeats)\n\t\t\t if(availSeats[rowNo].length >= numSeats) {\n\t\t\t\tresolve(availSeats)\n\t\t\t }\n\t\t\t //end of case 1\n\n\n\t\t\t //case 2 prefered seat number is the last\n\t\t\t\tcount = 0;\n\t\t\t\tif(rowNo == \"A\") {\n\t\t\t\tseatsInRow= screen[0].screenInfo.A.rowStatus\n\t\t\t\tavailSeats = { \"A\":[]}\n\t\t\t\t}\n\t\t\t\tif(rowNo == \"B\"){\n\t\t\t\tseatsInRow= screen[0].screenInfo.B.rowStatus\n\t\t\t\tavailSeats = { \"B\":[]}\n\t\t\t\t}\n\t\t\t\tif(rowNo == \"D\"){\n\t\t\t\tseatsInRow= screen[0].screenInfo.D.rowStatus\n\t\t\t\tavailSeats = { \"D\":[]}\n\t\t\t\t}\n\n\t\t\t\tfor(var s = parseInt(preferSeatNo) ; s>=0 ; s--) {\n\t\t\t\t\tif(count >= numSeats) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(seatsInRow[s].seatStatus == \"unreserved\" && seatsInRow[s].isAisel == false ) {\n\t\t\t\t\t\tconsole.log(seatsInRow[s])\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[s].seatNo)\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t }\n\t\t\t console.log(\"count =\" +count)\n\t\t\t console.log(\"after 2nd case \" + availSeats)\n\t\t\t if(availSeats[rowNo].length >= numSeats) {\n availSeats[rowNo] = availSeats[rowNo].reverse() // will keep in asc order\n\t\t\t\tresolve(availSeats)\n\t\t\t }\n\n\t\t\t //end of second case\n\n\n\t\t\t //third case is when the prefered seat is in between\n\t\t\t\tcount = 0;\n\t\t\t\tif(rowNo == \"A\") {\n\t\t\t\tseatsInRow= screen[0].screenInfo.A.rowStatus\n\t\t\t\tavailSeats = { \"A\":[]}\n\t\t\t\t}\n\t\t\t\tif(rowNo == \"B\"){\n\t\t\t\tseatsInRow= screen[0].screenInfo.B.rowStatus\n\t\t\t\tavailSeats = { \"B\":[]}\n\t\t\t\t}\n\t\t\t\tif(rowNo == \"D\"){\n\t\t\t\tseatsInRow= screen[0].screenInfo.D.rowStatus\n\t\t\t\tavailSeats = { \"D\":[]}\n\t\t\t\t}\n\t\t\t var start = parseInt(preferSeatNo)\n\t\t\t var end = start+1;\n\t\t\t\n\t\t\t if(seatsInRow[start].isAisel == true) {\n\t\t\t\treject(\"seats are not available\")\n\t\t\t }\n\n\t\t\t while(start>=0 || end < seatsInRow.length) {\n\t\t\t\tif(count >= numSeats) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif(start >=0 && end < seatsInRow.length && seatsInRow[start].seatStatus == \"unreserved\" && seatsInRow[end].seatStatus == \"unreserved\" && seatsInRow[start].isAisel == false && seatsInRow[end].isAisel==false) {\n\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[start].seatNo)\n\t\t\t\t\tstart --;\n\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[end].seatNo)\n\t\t\t\t\tend ++;\n\t\t\t\t\tcount ++;\n\t\t\t\t}\n\t\t\t\telse if(start >=0 && seatsInRow[start].seatStatus == \"unreserved\" && seatsInRow[start].isAisel == false ) {\n\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[start].seatNo)\n\t\t\t\t\tstart --;\n\t\t\t\t\tcount ++;\n\t\t\t\t}\n\n\t\t\t\telse if( end < seatsInRow.length && seatsInRow[end].seatStatus == \"unreserved\" && seatsInRow[end].isAisel==false) {\n\t\t\t\t\tavailSeats[rowNo].push(seatsInRow[end].seatNo)\n\t\t\t\t\tend ++;\n\t\t\t\t\tcount ++;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t }\n\n //end of third case\n\n\t\t\t console.log(\"count =\" +count)\n\t\t\t console.log(\"after 3rd case \" + availSeats)\n\t\t\t if(availSeats[rowNo].length >= numSeats) {\n\t\t\t\tresolve(availSeats)\n\t\t\t }\n\t\t}\n }\n\n\t\tconsole.log(availSeats)\n\t\treject(\"seats are not available for this choice\") \n\t\t\n\t})\n\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gnuplot version 5.2.7 short forms of commands provided by gnuplot_common.js | function DT (dt) {gnuplot.dashtype(dt);} | [
"function plot(func, atts) {\n if (atts==null) { return addCurve(board, func, {strokewidth:2});\n } else { return addCurve(board, func, atts); } \n }",
"function usageString(cmd, style) {\n var com = COMMANDS[cmd];\n var usage = (style ? tt(cmd,'cmd') : cmd)+\" \";\n $.each(com.args, function(i,arg) {\n usage += \"[\"+arg.n+\"] \";\n });\n return usage;\n}",
"_genCmd(p, m, w, s, td, th, l) {\n let cmd;\n\n if (this.template && this.template.tpl) {\n cmd = new Function('p, m, w, s, td, th, l', 'return `' + this.template.tpl + '`').apply(null, [p, m, w, s, td, th, l]);\n }\n else {\n cmd = this.model.substr(0, 2) + this.model.substr(8, 8)\n + p\n + m\n + w\n + s\n + th\n + l\n + this.model.substr(-1);\n }\n\n return cmd;\n }",
"function plot(can,ctx,x,y,xwidth,ywidth,options){\n\n}",
"function drawGexpOverview(i) {\n \n //var gexp = getCol(dataPro,1).map(function(d) { return d.value })\n var gexp = getCol(dataPro,i)\n\n var g = document.getElementById('gexp_panel1'),\n\twindowWidth = g.clientWidth,\n\twindowHeight = g.clientHeight;\n\n var margin = {top: 30, right: 0, bottom: 30, left: 30},\n\twidth = windowWidth - margin.left - margin.right,\n\theight = windowHeight - margin.top - margin.bottom;\n \n var chart1;\n chart1 = makeDistroChart({\n\tdata: gexp,\n\txName:'name',\n\tyName:'value',\n//\taxisLabels: {xAxis: 'Gene', yAxis: 'Values'},\n\tselector:\"#gexp-chart-distro1\",\n\tsvg:\"gexp-chart-distro1-svg\", \n\tchartSize:{height:height, width:width},\n\tmargin:margin,\n\tconstrainExtremes:true});\n chart1.renderBoxPlot();\n chart1.renderDataPlots();\n chart1.renderNotchBoxes({showNotchBox:false});\n chart1.renderViolinPlot({showViolinPlot:false});\n\n var pt = document.getElementById(\"gexp_plottype\").value;\n if(pt == \"box_plot\") {\n\tchart1.boxPlots.show({reset:true});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"notched_box_plot\") {\n\tchart1.notchBoxes.show({reset:true});chart1.boxPlots.show({reset:true, showBox:false,showOutliers:true,boxWidth:20,scatterOutliers:true});chart1.violinPlots.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"violin_plot\") {\t \n\tchart1.violinPlots.show({reset:true, resolution:12});chart1.boxPlots.show({reset:true, showWhiskers:false,showOutliers:false,boxWidth:10,lineWidth:15,colors:['#555']});chart1.notchBoxes.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"bean_plot\") {\t \n\tchart1.violinPlots.show({reset:true, width:100, resolution:12});chart1.dataPlots.show({showBeanLines:true,beanWidth:15,showPlot:false,colors:['#555']});chart1.boxPlots.hide();chart1.notchBoxes.hide()\n }\n if(pt == \"beeswam_plot\") {\t \t \n\tchart1.dataPlots.show({showPlot:true, plotType:'beeswarm',showBeanLines:false, colors:null});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.boxPlots.hide();\n }\n if(pt == \"scatter_plot\") {\t \n\tchart1.dataPlots.show({showPlot:true, plotType:40, showBeanLines:false,colors:null});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.boxPlots.hide();\n }\n}",
"function drawDiffGexp(i) {\n var gexp = getCol(dataPro,i)\n var group = dataPro.map(function(d) { return d.group })\n gexp.map(function(d, i) { d.group = group[i] })\n\n var g = document.getElementById('gexp_panel2'),\n\twindowWidth = g.clientWidth,\n\twindowHeight = g.clientHeight;\n\n var margin = {top: 30, right: 0, bottom: 30, left: 30},\n\twidth = windowWidth - margin.left - margin.right,\n\theight = windowHeight - margin.top - margin.bottom;\n\n var chart1;\n chart1 = makeDistroChart({\n\tdata: gexp,\n\txName:'group',\n\tyName:'value',\n//\taxisLabels: {xAxis: 'Group', yAxis: 'Values'},\n\tselector:\"#gexp-chart-distro2\",\n\tsvg:\"gexp-chart-distro2-svg\", \n\tchartSize:{height:height, width:width},\n\tmargin:margin,\n\tconstrainExtremes:true});\n chart1.renderBoxPlot();\n chart1.renderDataPlots();\n chart1.renderNotchBoxes({showNotchBox:false});\n chart1.renderViolinPlot({showViolinPlot:false});\n \n var pt = document.getElementById(\"gexp_plottype\").value;\n if(pt == \"box_plot\") {\n\tchart1.boxPlots.show({reset:true});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"notched_box_plot\") {\n\tchart1.notchBoxes.show({reset:true});chart1.boxPlots.show({reset:true, showBox:false,showOutliers:true,boxWidth:20,scatterOutliers:true});chart1.violinPlots.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"violin_plot\") {\t \n\tchart1.violinPlots.show({reset:true, resolution:12});chart1.boxPlots.show({reset:true, showWhiskers:false,showOutliers:false,boxWidth:10,lineWidth:15,colors:['#555']});chart1.notchBoxes.hide();chart1.dataPlots.change({showPlot:false,showBeanLines:false})\n }\n if(pt == \"bean_plot\") {\t \n\tchart1.violinPlots.show({reset:true, width:100, resolution:12});chart1.dataPlots.show({showBeanLines:true,beanWidth:15,showPlot:false,colors:['#555']});chart1.boxPlots.hide();chart1.notchBoxes.hide()\n }\n if(pt == \"beeswam_plot\") {\t \t \n\tchart1.dataPlots.show({showPlot:true, plotType:'beeswarm',showBeanLines:false, colors:null});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.boxPlots.hide();\n }\n if(pt == \"scatter_plot\") {\t \n\tchart1.dataPlots.show({showPlot:true, plotType:40, showBeanLines:false,colors:null});chart1.violinPlots.hide();chart1.notchBoxes.hide();chart1.boxPlots.hide();\n }\n\n}",
"function printCommand(cmd) {\r\n\r\n\t// Get the command to show\r\n\tvar command = cmd || submit.value;\r\n\r\n\t// Pull from the global namespace\r\n\tterminal.innerHTML += Filesystem.user + '@' + Filesystem.host + ':' + Filesystem.path + '$ ' + command + '\\n';\r\n\r\n}",
"function plot(p){\n var cell = d3.select(this);\n\n //calculate the slength and position of each axes depending on the size of the hive plot.\n var innerRadius = size*0.06\n var outerRadius = size*0.48\n var radius = d3.scale.linear().range([innerRadius, outerRadius]);\n\n //row labels (when one plotting first column, where p.i=0)\n if (p.i == 0){\n cell.append(\"text\")\n .attr(\"x\", function (d) { return d.i})\n .attr(\"y\", function (d) { return d.j-size/2 -padding/2})\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-family\", FONT)\n .attr(\"font-weight\",\"lighter\")\n .attr(\"font-size\", \"14px\")\n .text(capitalize(p.y+' ('+rowTraitScales[p.y]+')').replace('_',' ')) //add name of property used for node positionning, the rowtrait\n .attr(\"transform\", function (d) { \n return \"rotate(-90)\";\n })\n }\n\n //column labels (when one plotting first row, where p.j=0)\n if (p.j==0){\n cell.append(\"text\")\n .attr(\"x\", function (d) { return d.i;})\n .attr(\"y\", function (d) { return d.j-size/2 - padding/2;})\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-family\", FONT)\n .attr(\"font-weight\",\"lighter\")\n .attr(\"font-size\", \"14px\")\n .text(capitalize(p.x+' ('+columnTraitScales[p.x]+')').replace('_',' ')) //add name of property used for node assignment, the columntrait\n\n }\n\n //creates axis labels\n //some parameters\n var outer_radius = radius.range()[1]\n x_shift = 50\n y_shift = 55\n stagger = 0\n\n cell.selectAll(\".axis\")\n .data(angle)\n .enter().append(\"text\")\n .attr(\"transform\", function(d,i) {\n if (!doubleAxes){\n a = angles(d)\n } else if (i % 2 == 0) {\n a = get_angles(numAxes, false)[i/2]\n } else {a = 0}\n theta = a-Math.PI\n h = outer_radius\n y = h*Math.cos(theta)\n x = -h*Math.sin(theta)\n if (x>20){x = x-x_shift} else if (x<-20) {x = x+x_shift}\n if (y>30){\n //console.log(theta, x, y, stagger)\n y = y+y_shift+stagger\n\n stagger = -stagger\n }\n //console.log(theta, x, y, stagger)\n return \"translate(\"+x+\",\"+y+\")\";\n })\n .attr(\"font-family\", FONT)\n .attr(\"font-weight\",\"lighter\")\n .attr(\"font-size\", \"11px\")\n .attr(\"text-anchor\", function(d,i) {\n if (!doubleAxes){\n a = angles(d)\n } else if (i % 2 == 0) {\n a = get_angles(numAxes, false)[i/2]\n } else {a = 0}\n theta = a-Math.PI\n h = outer_radius*1.04\n y = h*Math.cos(theta)\n x = -h*Math.sin(theta)\n\n if (x>60){\n return \"start\"\n } else if (x<-60) {\n return \"end\"\n } else {\n return \"middle\"\n }\n })\n .text(function (d,i) {\n if (!doubleAxes){return formatAxisLegend(p.x,i)}\n else if (i % 2 == 0){return formatAxisLegend(p.x,i/2)}\n else {return ''}\n })\n\n //build axes\n cell.selectAll(\".axis\")\n .data(angle)\n .enter().append(\"line\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", function (d) { return \"rotate(\" + degrees(angles(d)) + \")\";})\n .attr(\"x1\", radius.range()[0])\n .attr(\"x2\", radius.range()[1])\n .attr(\"stroke-width\",0.7)\n .attr(\"stroke\", \"black\");\n\n if (doubleAxes){\n hiveLinks(0)\n hiveLinks(1)\n hiveNodes(0)\n hiveNodes(1)\n } else {\n hiveLinks(0)\n hiveNodes(0)\n }\n\n\n //plot links as paths between nodes\n function hiveLinks(h){\n var isSource = true\n\n cell//.append(\"g\")\n .selectAll(\".link\")\n .data(links)\n .enter().append(\"path\")\n //.attr(\"class\", \"link\")\n .attr(\"d\", d3.hive.link() //use Mbostocks hive plot library\n .angle(function (l) {\n if (!doubleAxes){\n a = angles(asgScales[p.x](l[p.x]))\n } else if (isSource){ //keep track of source and target to make link\n a = angles(asgScales[p.x](l[p.x])*2+h) //on h==0, want the source to be on the 1st axis but on h==1 we want the source to become the target\n isSource = false\n } else {\n a = angles(asgScales[p.x](l[p.x])*2+1-h)\n isSource = true\n }\n return a\n })\n .radius(function (l) {\n if (rowTraitScales[p.y]==\"rank\"){\n return radius(rankScale[nodes.indexOf(l)])\n } else {\n return radius(posScales[p.y](l[p.y])) //pos\n }\n })\n )\n .attr(\"show\", function (l) { //the 'show' attribute is false when links are between nodes on the same axes\n //or when the link connects nodes that are not on neighboring axes and cross over a third axes.\n s = asgScales[p.x](l.source[p.x])\n t = asgScales[p.x](l.target[p.x])\n if (!doubleAxes){\n if (t == s) {\n return false\n } else if (numAxes > 3 && Math.abs(s-t) >1 ) {\n return false\n } else {\n return true}\n } else {\n s = s*2+h\n t = t*2+1-h\n if (h==0){\n if (t+1 == s) { //from one axes group to another\n show = true\n } else if (s+1 == t) { //within doubled axes link\n show = true\n } else if (t==numAxes*2-1 && s==0) {\n show = true\n } else {\n show = false\n }\n } else if (h==1){ //the second time around, the source plays the role of the target and vice versa\n if (t+1 == s) {\n show = true\n }\n else if (s+1 == t) {\n show = true\n }\n else if (s==numAxes*2-1 && t==0) {\n show = true\n } else {\n show = false\n }\n }\n return show\n }\n })\n .style(\"fill\", linkfill) //linkfill is \"none\" so that only the arc of the path is seen.\n .style(\"stroke-opacity\", oplink)\n .style(\"stroke\", function (l) {\n if (edgeColor){\n return edgeColor} else {\n return \"grey\"\n }\n })\n .style(\"stroke-width\", linkwidth)\n .classed({\"clicked\":false})\n .on(\"click\", function (l){\n if (d3.select(this).classed(\"clicked\")){\n d3.select(this)\n .classed({\"clicked\":false})\n link_mouseout()\n node_mouseout()\n removeReveal()\n } else {\n d3.select(this)\n .classed({\"clicked\":true})\n .call(link_full_reveal,l,l.source.name, l.target.name)\n }\n })\n .on(\"mouseover\", function (l){\n var link = d3.select(this)\n var cx = d3.event.pageX\n var cy = d3.event.pageY\n\n hoverTimer = setTimeout(function (){\n link_tooltip(cx, cy, l, l.source.name, l.target.name);\n //link.call(highlight_links) //not responsive because manipulating the DOM is expensive.\n }, hoverDelay)\n })\n .on(\"mouseout\", function (){\n clearHoverTimer()\n remove_tooltip()\n //if (!d3.select(this).classed(\"clicked\")){\n // d3.select(this).call(link_mouseout)\n //}\n });\n\n };\n\n\n //plot nodes second so they appear on top of links\n function hiveNodes(h){\n\n cell//.append(\"g\")\n .selectAll(\".node\")\n .data(nodes)\n .enter().append(\"circle\")\n //.attr(\"class\", function (d,i) {return \"n\"+String(i)})\n //.attr(\"id\",function(d,i){return d.name}) //can be used to cirles for same nodes and color them at the same time.\n .attr(\"transform\", function (d) { \n if (doubleAxes){ //plot nodes of even axes when h=0 then on odd axes when h=1\n return \"rotate(\" + degrees(angles(asgScales[p.x](d[p.x])*2 + h)) + \")\" //Use ~~ to round values\n } else {\n return \"rotate(\" + degrees(angles(asgScales[p.x](d[p.x]))) + \")\"\n }\n })\n\n .attr(\"cx\", function (d) {\n //console.log(d.name, p.y, d[p.y], posScales[p.y](d[p.y]))\n if (rowTraitScales[p.y]==\"rank\"){\n return radius(rankScale[nodes.indexOf(d)])\n } else {\n return radius(posScales[p.y](d[p.y])) //pos\n }\n })\n .attr(\"r\", nodesize)\n .attr(\"stroke-width\", nodestroke)\n .attr(\"stroke\", nodestrokecolor)\n .style(\"fill-opacity\", opnode)\n .style(\"fill\", function (d) { \n return nodeColor\n })\n .classed({\"clicked\":false})\n .on(\"click\", function (d){\n if (d3.select(this).classed(\"clicked\")){\n d3.select(this).classed({\"clicked\":false})\n node_mouseout()\n link_mouseout()\n removeReveal()\n } else {\n d3.select(this)\n .classed({\"clicked\":true})\n .call(node_full_reveal,d)\n }\n })\n .on(\"mouseover\", function (d){\n clearHoverTimer()\n //var node = d3.select(this)\n var cx = d3.event.pageX\n var cy = d3.event.pageY\n\n hoverTimer = setTimeout(function (){\n node_tooltip(cx, cy, d, p.x,p.y, d[p.x], d[p.y]);\n //node.call(highlight_nodes) //not responsive because manipulating the DOM is expensive.\n }, hoverDelay)\n })\n .on(\"mouseout\", function (d){ \n remove_tooltip() \n clearHoverTimer()\n //if (!d3.select(this).classed(\"clicked\")){\n // d3.select(this)\n // .call(node_mouseout) \n //} \n })\n\n //removes any edges between nodes on same axis.\n cell.selectAll(\"path[show=\"+false+\"]\").remove()\n };\n\n }",
"plotText(midx, midy, lines) {\n var y = midy + (lines.length-1)/2;\n for ( const line of lines ) {\n this.plotString(midx - line.length/2, y--, line);\n }\n }",
"function setBarLine(){\n\tmusicalElements += \"| \";\n}",
"function makeTMRubyScript(aScript) {\n\tlines = aScript.split(\"\\n\");\n command = '';\n\tfor (line in lines) {\n\t\tcommand = command + lines[line] +'\\\\\\n';\n\t}\n\tcommand = command + '\\n';\n\t\n\treturn command;\n}",
"doExport(diagram, format, savePath, bar) {\n if (!this.javeInstalled) {\n let pms = Promise.reject(planuml_1.localize(5, null));\n return { promise: pms };\n }\n //TODO: support custom jar definition once node-plantuml supports it\n // if (!fs.existsSync(config.jar)) {\n // let pms = Promise.reject(localize(6, null, context.extensionPath));\n // return <ExportTask>{ promise: pms };\n // }\n if (bar) {\n bar.show();\n bar.text = planuml_1.localize(7, null, diagram.title + \".\" + format.split(\":\")[0]);\n }\n let opts = {\n format,\n charset: 'utf-8',\n };\n if (path.isAbsolute(diagram.dir))\n opts['include'] = diagram.dir;\n //TODO: support environment vars (e.g. -DPLANTUML_LIMIT_SIZE=8192) once node-plantuml supports them\n //TODO: support misc puml args (e.g. -nometadata) once node-plantuml supports them\n //add user args\n //params.unshift(...config.commandArgs);\n let gen = plantuml.generate(opts);\n if (diagram.content !== null) {\n gen.in.end(diagram.content);\n }\n let pms = new Promise((resolve, reject) => {\n let buffs = [];\n let bufflen = 0;\n let stderror = '';\n if (savePath) {\n let f = fs.createWriteStream(savePath);\n gen.out.pipe(f);\n }\n else {\n gen.out.on('data', function (x) {\n buffs.push(x);\n bufflen += x.length;\n });\n }\n gen.out.on('finish', () => {\n let stdout = Buffer.concat(buffs, bufflen);\n if (!stderror) {\n resolve(stdout);\n }\n else {\n stderror = planuml_1.localize(10, null, diagram.title, stderror);\n reject({ error: stderror, out: stdout });\n }\n });\n //TODO: support stderr once node-plantuml exposes it\n // process.stderr.on('data', function (x) {\n // stderror += x;\n // });\n });\n return { promise: pms };\n }",
"function convert_to_csv (curr_sel, plot_id, header_index, defaultFilename,\r\n use_data_order)\r\n{\r\n\r\n // if selection is empty, use all plots\r\n if (curr_sel.length == 0) {\r\n\r\n // construct current selection as all points\r\n for (var i = 0; i < tot_num_plots; i++) {\r\n curr_sel.push(i);\r\n }\r\n\r\n }\r\n\r\n var num_sel = curr_sel.length;\r\n\r\n // get header values and selection colors\r\n var sel_col_commas = metadata_table.selection_values(header_index, curr_sel, use_data_order);\r\n\r\n // use new table order for data\r\n var curr_sel_table_order = sel_col_commas[2];\r\n\r\n // keep track of extra commas/newlines found\r\n var extra_commas = sel_col_commas[3];\r\n var extra_newlines = sel_col_commas[4];\r\n\r\n // table to return\r\n var csv_output = \"Time,\";\r\n\r\n // construct header row\r\n var sel_plot_ind = plots_selected[plot_id];\r\n for (var i = 0; i < num_sel; i++) {\r\n\r\n // text is \"ID Var (selection color)\"\r\n\r\n // if ID is present then add\r\n if (sel_col_commas[0][i] != \"\") {\r\n csv_output += sel_col_commas[0][i] + \" \";\r\n }\r\n\r\n // add plot name\r\n csv_output += plot_name[sel_plot_ind];\r\n\r\n // add selection color, if available\r\n if (sel_col_commas[1][i] != \"\") {\r\n csv_output += \" (\" + sel_col_commas[1][i] + \")\";\r\n }\r\n\r\n // separated by commas, ended by newline\r\n if (i < num_sel-1) {\r\n csv_output += \",\";\r\n } else {\r\n csv_output += \"\\n\";\r\n }\r\n }\r\n\r\n // call server to get data, no subsampling\r\n client.post_sensitive_model_command(\r\n\t{\r\n\t\tmid: mid,\r\n\t\ttype: \"DAC\",\r\n\t\tcommand: \"subsample_time_var\",\r\n\t\tparameters: {plot_list: [plot_id], \r\n\t\t\t\t\t database_ids: [sel_plot_ind],\r\n\t\t plot_selection: curr_sel_table_order,\r\n\t\t num_subsamples: \"Inf\",\r\n\t\t zoom_x: [plots_selected_zoom_x[plot_id]],\r\n\t\t zoom_y: [plots_selected_zoom_y[plot_id]]},\r\n\t\tsuccess: function (result)\r\n\t\t{\r\n // convert to variable\r\n\t\t result = JSON.parse(result);\r\n\r\n\t\t\t// add data to table, rows are time steps\r\n\t\t\tvar num_time_steps = result[\"time_points\"][0].length;\r\n\t\t\tfor (var i = 0; i < num_time_steps; i++) {\r\n\r\n\t\t\t // time step is first column\r\n\t\t\t csv_output += result[\"time_points\"][0][i] + \",\"\r\n\r\n\t\t\t // next columns are variables\r\n\t\t\t for (var j = 0; j < num_sel-1; j++) {\r\n\t\t\t csv_output += result[\"var_data\"][0][j][i] + \",\"\r\n\t\t\t }\r\n\r\n\t\t\t // last variable\r\n\t\t\t csv_output += result[\"var_data\"][0][num_sel-1][i] + \"\\n\";\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// now write out file\r\n\t\t\tmetadata_table.download_data_table(csv_output, defaultFilename);\r\n\r\n\t\t},\r\n\t\terror: function ()\r\n\t\t{\r\n\t\t\tdialog.ajax_error ('Server failure: could not download variable data.')(\"\",\"\",\"\");\r\n\t\t}\r\n\t});\r\n\r\n\t// produce warning if extra commas were detected\r\n\tif (extra_commas || extra_newlines) {\r\n\t\t dialog.ajax_error(\"Commas and/or newlines were detected in the table data \" +\r\n\t\t \"text and will be removed in the .csv output file.\")\r\n\t\t\t(\"\",\"\",\"\");\r\n\t}\r\n\r\n}",
"function TranscriptTrack(gsvg, data, trackClass, density) {\n var that = Track(gsvg, data, trackClass, \"Selected Gene Transcripts\");\n\n that.createToolTip = function (d) {\n var tooltip = \"\";\n var strand = \".\";\n if (d.getAttribute(\"strand\") == 1) {\n strand = \"+\";\n } else if (d.getAttribute(\"strand\") == -1) {\n strand = \"-\";\n }\n var id = d.getAttribute(\"ID\");\n tooltip = \"ID: \" + id + \"<BR>Location: chr\" + d.getAttribute(\"chromosome\") + \":\" + numberWithCommas(d.getAttribute(\"start\")) + \"-\" + numberWithCommas(d.getAttribute(\"stop\")) + \"<BR>Strand: \" + strand;\n if (new String(d.getAttribute(\"ID\")).indexOf(\"ENS\") == -1) {\n var annot = getFirstChildByName(getFirstChildByName(d, \"annotationList\"), \"annotation\");\n if (annot != null) {\n tooltip += \"<BR>Matching: \" + annot.getAttribute(\"reason\");\n }\n }\n return tooltip;\n };\n\n that.color = function (d) {\n var color = d3.rgb(\"#000000\");\n if (that.gsvg.txType == \"protein\") {\n if ((new String(d.getAttribute(\"ID\"))).indexOf(\"ENS\") > -1) {\n color = d3.rgb(\"#DFC184\");\n } else {\n color = d3.rgb(\"#7EB5D6\");\n }\n } else if (that.gsvg.txType == \"long\") {\n if ((new String(d.getAttribute(\"ID\"))).indexOf(\"ENS\") > -1) {\n color = d3.rgb(\"#B58AA5\");\n } else {\n color = d3.rgb(\"#CECFCE\");\n }\n } else if (that.gsvg.txType == \"small\") {\n if ((new String(d.getAttribute(\"ID\"))).indexOf(\"ENS\") > -1) {\n color = d3.rgb(\"#FFCC00\");\n } else {\n color = d3.rgb(\"#99CC99\");\n }\n } else if (that.gsvg.txType == \"liverTotal\") {\n color = d3.rgb(\"#bbbedd\");\n } else if (that.gsvg.txType == \"heartTotal\") {\n color = d3.rgb(\"#DC7252\");\n } else if (that.gsvg.txType == \"mergedTotal\") {\n color = d3.rgb(\"#9F4F92\");\n }\n return color;\n };\n\n that.drawTrx = function (d, i) {\n var cdsStart = parseInt(d.getAttribute(\"start\"), 10);\n var cdsStop = parseInt(d.getAttribute(\"stop\"), 10);\n if (typeof d.getAttribute(\"cdsStart\") !== 'undefined' && typeof d.getAttribute(\"cdsStop\") !== 'undefined') {\n cdsStart = parseInt(d.getAttribute(\"cdsStart\"), 10);\n cdsStop = parseInt(d.getAttribute(\"cdsStop\"), 10);\n }\n\n var txG = d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass + \" #tx\" + d.getAttribute(\"ID\"));\n exList = getAllChildrenByName(getFirstChildByName(d, \"exonList\"), \"exon\");\n for (var m = 0; m < exList.length; m++) {\n var exStrt = parseInt(exList[m].getAttribute(\"start\"), 10);\n var exStp = parseInt(exList[m].getAttribute(\"stop\"), 10);\n if ((exStrt < cdsStart && cdsStart < exStp) || (exStp > cdsStop && cdsStop > exStrt)) {//need to draw two rect one for CDS and one non CDS\n var xPos1 = 0;\n var xWidth1 = 0;\n var xPos2 = 0;\n var xWidth2 = 0;\n if (exStrt < cdsStart) {\n xPos1 = that.xScale(exList[m].getAttribute(\"start\"));\n xWidth1 = that.xScale(cdsStart) - that.xScale(exList[m].getAttribute(\"start\"));\n xPos2 = that.xScale(cdsStart);\n xWidth2 = that.xScale(exList[m].getAttribute(\"stop\")) - that.xScale(cdsStart);\n } else if (exStp > cdsStop) {\n xPos2 = that.xScale(exList[m].getAttribute(\"start\"));\n xWidth2 = that.xScale(cdsStop) - that.xScale(exList[m].getAttribute(\"start\"));\n xPos1 = that.xScale(cdsStop);\n xWidth1 = that.xScale(exList[m].getAttribute(\"stop\")) - that.xScale(cdsStop);\n }\n txG.append(\"rect\")//non CDS\n .attr(\"x\", xPos1)\n .attr(\"y\", 2.5)\n .attr(\"height\", 5)\n .attr(\"width\", xWidth1)\n .attr(\"title\", function (d) {\n return exList[m].getAttribute(\"ID\");\n })\n .attr(\"id\", function (d) {\n return \"ExNC\" + exList[m].getAttribute(\"ID\");\n })\n .style(\"fill\", that.color)\n .style(\"cursor\", \"pointer\");\n txG.append(\"rect\")//CDS\n .attr(\"x\", xPos2)\n .attr(\"height\", 10)\n .attr(\"width\", xWidth2)\n .attr(\"title\", function (d) {\n return exList[m].getAttribute(\"ID\");\n })\n .attr(\"id\", function (d) {\n return \"Ex\" + exList[m].getAttribute(\"ID\");\n })\n .style(\"fill\", that.color)\n .style(\"cursor\", \"pointer\");\n\n } else {\n var height = 10;\n var y = 0;\n if ((exStrt < cdsStart && exStp < cdsStart) || (exStp > cdsStop && exStrt > cdsStop)) {\n height = 5;\n y = 2.5;\n }\n txG.append(\"rect\")\n .attr(\"x\", function (d) {\n return that.xScale(exList[m].getAttribute(\"start\"));\n })\n .attr(\"y\", y)\n //.attr(\"rx\",1)\n //.attr(\"ry\",1)\n .attr(\"height\", height)\n .attr(\"width\", function (d) {\n return that.xScale(exList[m].getAttribute(\"stop\")) - that.xScale(exList[m].getAttribute(\"start\"));\n })\n .attr(\"title\", function (d) {\n return exList[m].getAttribute(\"ID\");\n })\n .attr(\"id\", function (d) {\n return \"Ex\" + exList[m].getAttribute(\"ID\");\n })\n .style(\"fill\", that.color)\n .style(\"cursor\", \"pointer\");\n }\n /*txG.append(\"rect\")\n\t\t\t.attr(\"x\",function(d){ return that.xScale(exList[m].getAttribute(\"start\")); })\n\t\t\t.attr(\"rx\",1)\n\t\t\t.attr(\"ry\",1)\n\t \t.attr(\"height\",10)\n\t\t\t.attr(\"width\",function(d){ return that.xScale(exList[m].getAttribute(\"stop\")) - that.xScale(exList[m].getAttribute(\"start\")); })\n\t\t\t.attr(\"title\",function(d){ return exList[m].getAttribute(\"ID\");})\n\t\t\t.attr(\"id\",function(d){return \"Ex\"+exList[m].getAttribute(\"ID\");})\n\t\t\t.style(\"fill\",that.color)\n\t\t\t.style(\"cursor\", \"pointer\");*/\n if (m > 0) {\n txG.append(\"line\")\n .attr(\"x1\", function (d) {\n return that.xScale(exList[m - 1].getAttribute(\"stop\"));\n })\n .attr(\"x2\", function (d) {\n return that.xScale(exList[m].getAttribute(\"start\"));\n })\n .attr(\"y1\", 5)\n .attr(\"y2\", 5)\n .attr(\"id\", function (d) {\n return \"Int\" + exList[m - 1].getAttribute(\"ID\") + \"_\" + exList[m].getAttribute(\"ID\");\n })\n .attr(\"stroke\", that.color)\n .attr(\"stroke-width\", \"2\");\n var strChar = \">\";\n if (d.getAttribute(\"strand\") == \"-1\") {\n strChar = \"<\";\n }\n var fullChar = strChar;\n var intStart = that.xScale(exList[m - 1].getAttribute(\"stop\"));\n var intStop = that.xScale(exList[m].getAttribute(\"start\"));\n var rectW = intStop - intStart;\n var alt = 0;\n var charW = 7.0;\n if (rectW < charW) {\n fullChar = \"\";\n } else {\n rectW = rectW - charW;\n while (rectW > (charW + 1)) {\n if (alt == 0) {\n fullChar = fullChar + \" \";\n alt = 1;\n } else {\n fullChar = fullChar + strChar;\n alt = 0;\n }\n rectW = rectW - charW;\n }\n }\n txG.append(\"svg:text\").attr(\"id\", function (d) {\n return \"IntTxt\" + exList[m - 1].getAttribute(\"ID\") + \"_\" + exList[m].getAttribute(\"ID\");\n }).attr(\"dx\", intStart + 1)\n .attr(\"dy\", \"11\")\n .style(\"pointer-events\", \"none\")\n .style(\"opacity\", \"0.5\")\n .style(\"fill\", that.color)\n .style(\"font-size\", \"16px\")\n .text(fullChar);\n\n }\n }\n\n };\n\n that.redraw = function () {\n\n var txG = d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).selectAll(\"g.trx\" + that.gsvg.levelNumber);\n //var txG=that.svg.selectAll(\"g.trx\"+that.gsvg.levelNumber);\n\n txG//.attr(\"transform\",function(d,i){ return \"translate(\"+txXScale(d.getAttribute(\"start\"))+\",\"+i*15+\")\";})\n .each(function (d, i) {\n var cdsStart = parseInt(d.getAttribute(\"start\"), 10);\n var cdsStop = parseInt(d.getAttribute(\"stop\"), 10);\n if (typeof d.getAttribute(\"cdsStart\") !== 'undefined' && typeof d.getAttribute(\"cdsStop\") !== 'undefined') {\n cdsStart = parseInt(d.getAttribute(\"cdsStart\"), 10);\n cdsStop = parseInt(d.getAttribute(\"cdsStop\"), 10);\n }\n exList = getAllChildrenByName(getFirstChildByName(d, \"exonList\"), \"exon\");\n var pref = \"tx\";\n for (var m = 0; m < exList.length; m++) {\n var exStrt = parseInt(exList[m].getAttribute(\"start\"), 10);\n var exStp = parseInt(exList[m].getAttribute(\"stop\"), 10);\n if ((exStrt < cdsStart && cdsStart < exStp) || (exStp > cdsStop && cdsStop > exStrt)) {\n var ncStrt = exStrt;\n var ncStp = cdsStart;\n if (exStp > cdsStop) {\n ncStrt = cdsStop;\n ncStp = exStp;\n exStrt = exStrt;\n exStp = cdsStop;\n } else {\n exStrt = cdsStart;\n exStp = exStp;\n }\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass + \" g#\" + pref + d.getAttribute(\"ID\") + \" rect#ExNC\" + exList[m].getAttribute(\"ID\"))\n .attr(\"x\", function (d) {\n return that.xScale(ncStrt);\n })\n .attr(\"width\", function (d) {\n return that.xScale(ncStp) - that.xScale(ncStrt);\n });\n }\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass + \" g#\" + pref + d.getAttribute(\"ID\") + \" rect#Ex\" + exList[m].getAttribute(\"ID\"))\n .attr(\"x\", function (d) {\n return that.xScale(exStrt);\n })\n .attr(\"width\", function (d) {\n return that.xScale(exStp) - that.xScale(exStrt);\n });\n if (m > 0) {\n var strChar = \">\";\n if (d.getAttribute(\"strand\") == \"-1\") {\n strChar = \"<\";\n }\n var fullChar = strChar;\n var intStart = that.xScale(exList[m - 1].getAttribute(\"stop\"));\n var intStop = that.xScale(exList[m].getAttribute(\"start\"));\n var rectW = intStop - intStart;\n var alt = 0;\n var charW = 7.0;\n if (rectW < charW) {\n fullChar = \"\";\n } else {\n rectW = rectW - charW;\n while (rectW > (charW + 1)) {\n if (alt == 0) {\n fullChar = fullChar + \" \";\n alt = 1;\n } else {\n fullChar = fullChar + strChar;\n alt = 0;\n }\n rectW = rectW - charW;\n }\n }\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass + \" g#tx\" + d.getAttribute(\"ID\") + \" line#Int\" + exList[m - 1].getAttribute(\"ID\") + \"_\" + exList[m].getAttribute(\"ID\"))\n .attr(\"x1\", intStart)\n .attr(\"x2\", intStop);\n\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass + \" g#tx\" + d.getAttribute(\"ID\") + \" #IntTxt\" + exList[m - 1].getAttribute(\"ID\") + \"_\" + exList[m].getAttribute(\"ID\"))\n .attr(\"dx\", intStart + 1).text(fullChar);\n }\n }\n });\n that.redrawSelectedArea();\n };\n\n that.update = function () {\n var txList = getAllChildrenByName(getFirstChildByName(that.gsvg.selectedData, \"TranscriptList\"), \"Transcript\");\n var min = parseInt(that.gsvg.selectedData.getAttribute(\"start\"), 10);\n var max = parseInt(that.gsvg.selectedData.getAttribute(\"stop\"), 10);\n if (typeof that.gsvg.selectedData.getAttribute(\"extStart\") !== 'undefined' && typeof that.gsvg.selectedData.getAttribute(\"extStop\") !== 'undefined') {\n min = parseInt(that.gsvg.selectedData.getAttribute(\"extStart\"), 10);\n max = parseInt(that.gsvg.selectedData.getAttribute(\"extStop\"), 10);\n }\n that.txMin = min;\n that.txMax = max;\n that.svg.attr(\"height\", (1 + txList.length) * 15);\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).selectAll(\".trx\" + that.gsvg.levelNumber).remove();\n var tx = d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).selectAll(\".trx\" + that.gsvg.levelNumber)\n .data(txList, key)\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + that.xScale(d.getAttribute(\"start\")) + \",\" + that.calcY(d, i) + \")\";\n });\n\n tx.enter().append(\"g\")\n .attr(\"class\", \"trx\" + that.gsvg.levelNumber)\n //.attr(\"transform\",function(d,i){ return \"translate(\"+txXScale(d.getAttribute(\"start\"))+\",\"+i*15+\")\";})\n .attr(\"transform\", function (d, i) {\n return \"translate(0,\" + that.calcY(d, i) + \")\";\n })\n .attr(\"id\", function (d) {\n return d.getAttribute(\"ID\");\n })\n //.attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"pointer\")\n .on(\"mouseover\", function (d) {\n if (that.gsvg.isToolTip == 0) {\n d3.select(this).selectAll(\"line\").style(\"stroke\", \"green\");\n d3.select(this).selectAll(\"rect\").style(\"fill\", \"green\");\n d3.select(this).selectAll(\"text\").style(\"opacity\", \"0.3\").style(\"fill\", \"green\");\n tt.transition()\n .duration(200)\n .style(\"opacity\", 1);\n tt.html(that.createToolTip(d))\n .style(\"left\", function () {\n return that.positionTTLeft(d3.event.pageX);\n })\n .style(\"top\", function () {\n return that.positionTTTop(d3.event.pageY);\n });\n }\n })\n .on(\"mouseout\", function (d) {\n d3.select(this).selectAll(\"line\").style(\"stroke\", that.color);\n d3.select(this).selectAll(\"rect\").style(\"fill\", that.color);\n d3.select(this).selectAll(\"text\").style(\"opacity\", \"0.6\").style(\"fill\", that.color);\n tt.transition()\n .delay(500)\n .duration(200)\n .style(\"opacity\", 0);\n })\n .each(that.drawTrx);\n\n\n tx.exit().remove();\n that.svg.selectAll(\".legend\").remove();\n var legend = [];\n if (that.gsvg.txType == \"protein\") {\n legend = [{color: \"#DFC184\", label: \"Ensembl\"}, {color: \"#7EB5D6\", label: \"RNA-Seq\"}];\n } else if (that.gsvg.txType == \"long\") {\n legend = [{color: \"#B58AA5\", label: \"Ensembl\"}, {color: \"#CECFCE\", label: \"RNA-Seq\"}];\n } else if (that.gsvg.txType == \"small\") {\n legend = [{color: \"#FFCC00\", label: \"Ensembl\"}, {color: \"#99CC99\", label: \"RNA-Seq\"}];\n } else if (that.gsvg.txType == \"liverTotal\") {\n legend = [{color: \"#bbbedd\", label: \"Liver RNA-Seq\"}];\n } else if (that.gsvg.txType == \"mergedTotal\") {\n legend = [{color: \"#9F4F92\", label: \"Merged RNA-Seq\"}];\n }\n\n that.drawLegend(legend);\n };\n\n that.calcY = function (d, i) {\n return (i + 1) * 15;\n }\n\n that.redrawLegend = function () {\n };\n if (typeof that.gsvg.selectedData.getAttribute(\"extStart\") !== 'undefined') {\n that.txMin = parseInt(that.gsvg.selectedData.getAttribute(\"extStart\"), 10);\n that.txMax = parseInt(that.gsvg.selectedData.getAttribute(\"extStop\"), 10);\n } else {\n that.txMin = parseInt(that.gsvg.selectedData.getAttribute(\"start\"), 10);\n that.txMax = parseInt(that.gsvg.selectedData.getAttribute(\"stop\"), 10);\n }\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).attr(\"height\", (1 + data.length) * 15);\n d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).selectAll(\".trx\" + that.gsvg.levelNumber).remove();\n var tx = d3.select(\"#Level\" + that.gsvg.levelNumber + that.trackClass).selectAll(\".trx\" + that.gsvg.levelNumber)\n .data(data, key)\n .attr(\"transform\", function (d, i) {\n return \"translate(\" + that.xScale(d.getAttribute(\"start\")) + \",\" + that.calcY(d, i) + \")\";\n });\n\n tx.enter().append(\"g\")\n .attr(\"class\", \"trx\" + that.gsvg.levelNumber)\n //.attr(\"transform\",function(d,i){ return \"translate(\"+txXScale(d.getAttribute(\"start\"))+\",\"+i*15+\")\";})\n .attr(\"transform\", function (d, i) {\n return \"translate(0,\" + that.calcY(d, i) + \")\";\n })\n .attr(\"id\", function (d) {\n return \"tx\" + d.getAttribute(\"ID\");\n })\n //.attr(\"pointer-events\", \"all\")\n .style(\"cursor\", \"pointer\")\n .on(\"mouseover\", function (d) {\n if (that.gsvg.isToolTip == 0) {\n d3.select(this).selectAll(\"line\").style(\"stroke\", \"green\");\n d3.select(this).selectAll(\"rect\").style(\"fill\", \"green\");\n d3.select(this).selectAll(\"text\").style(\"opacity\", \"0.3\").style(\"fill\", \"green\");\n tt.transition()\n .duration(200)\n .style(\"opacity\", 1);\n tt.html(that.createToolTip(d))\n .style(\"left\", function () {\n return that.positionTTLeft(d3.event.pageX);\n })\n .style(\"top\", function () {\n return that.positionTTTop(d3.event.pageY);\n });\n }\n })\n .on(\"mouseout\", function (d) {\n d3.select(this).selectAll(\"line\").style(\"stroke\", that.color);\n d3.select(this).selectAll(\"rect\").style(\"fill\", that.color);\n d3.select(this).selectAll(\"text\").style(\"opacity\", \"0.6\").style(\"fill\", that.color);\n tt.transition()\n .delay(500)\n .duration(200)\n .style(\"opacity\", 0);\n })\n .each(that.drawTrx);\n\n\n tx.exit().remove();\n that.redrawLegend();\n that.scaleSVG.transition()\n .duration(300)\n .style(\"opacity\", 1);\n that.svg.transition()\n .duration(300)\n .style(\"opacity\", 1);\n that.redraw();\n return that;\n}",
"function createLineTooltip(id){\n\tvar t = id.split('||');\n\tvar destination = t[0];\n\tvar source = t[1];\n\tvar type = t[2].split(\"_\");\n\tvar s = t[0].split(\".\");\n\tvar d = t[1].split(\".\");\n\tvar t3 = type[0];\n\tvar text = \"\";\n\ttext = getPortInfo2(s[0],d[0],source,destination,t3,text);\n\ttext = getOtherPorts(s[0],d[0],t[2],text);\n\treturn text;\n}",
"parseTotalCommand() {\n if (this.commandLocked) {\n return this.totalCommand;\n }\n\n // Call vartools\n fullCommand = \"vartools\";\n // Add the input index file\n // fullCommand += \" -l \" + this.outDir() + \"formatted_input/lc_list \"\n fullCommand += \" -l {infile} \"\n\n this.commands.forEach(command => {\n fullCommand += command.cmd();\n });\n\n this.flags.forEach(flag => {\n fullCommand += \" \" + flag.value();\n })\n\n fullCommand = this.removeExtraWhitespace(fullCommand);\n // fullCommand = fullCommand.split(\"{outdir}\").join(this.outDir() + \"vartools/\")\n return fullCommand;\n }",
"function yinyang_cps_00_02() {\n call_cc_cps(k => k, (cc) => {\n const yin = ((cc) => {\n process.stdout.write(\"@\");\n return cc;\n })(cc);\n call_cc_cps(k2 => k2, (cc2) => {\n const yang = ((cc2) => {\n process.stdout.write(\"*\");\n return cc2;\n })(cc2);\n yin(yang);\n })\n })\n}",
"drawNote() {\n push();\n colorMode(HSB, 360, 100, 100);\n stroke(this.color, 100, 100, 100);\n fill(this.color, 100, 100, 100);\n let v = this;\n let v2 = createVector(v.x + 5, v.y - 15);\n circle(v.x, v.y, 7);\n strokeWeight(3);\n line(v.x + 3, v.y, v2.x, v2.y);\n quad(v2.x, v2.y, v2.x + 5, v2.y + 2, v2.x + 6, v2.y, v2.x, v2.y - 2);\n pop();\n }",
"function plotQtl(div, symptom){\n\t$.get('/scripts/plot_qtl/run?symptom='+symptom).done(function(data){\n\t\tvar data = extractBodyFromHTML(data);\n\t\t//var dataURI = createDataUri(data);\n\t\t$(div).html(data);\n\t\trunScanone();\n\t});\n}",
"function horizontalChart() {\n var result = '';\n var numOfArgs = arguments.length;\n\n for (var i = 0; i < numOfArgs; i++) {\n for (var j = 0; j < arguments[i]; j++) {\n result += '*'\n }\n result += '\\n';\n }\n return result;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CODING CHALLENGE 531 Create a function which validates whether a number n is exclusively within the bounds of lower and upper. Return false if n is not an integer. | function intWithinBounds(n, lower, upper) {
return n >= lower && n < upper && Number.isInteger(n);
} | [
"function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds)\n return value;\n else\n return !value;\n}",
"function between(i, min, max) {//check if int provided is within provided range. https://alvinalexander.com/java/java-method-integer-is-between-a-range\n if (i >= min && i <= max) {\n return true;\n } else {\n return false;\n }\n}",
"inRange (number, start, end) {\n if (end === undefined) {\n end = start\n start = 0\n }\n if (start > end) {\n let temp = end\n end = start\n start = temp\n }\n let isInRange = (number >= start && number < end)\n return isInRange\n }",
"function controlloRangeNumeri(min, max, number) {\n var result = false;\n if (number >= min && number <= max) {\n result = true;\n }\n return result;\n }",
"function checkRangeOfInt(int1, int2, int3) {\n if (\n (int1 >= 50 && int1 <= 99) ||\n (int2 >= 50 && int2 <= 99) ||\n (int3 >= 50 && int3 <= 99)\n ) {\n return true;\n } else {\n return false;\n }\n}",
"function areNumbersInRange(puzzle) {\n for (var i = 0; i < puzzle.length; i++) {\n if (puzzle[i] < 0 || puzzle[i] > 9) {\n return false;\n }\n }\n return true;\n }",
"function boundary(N) {\n // if(N > 20 && N <= 100) {\n // return true\n // }\n // if(N === 400) {\n // return true\n // }\n // else {\n // return false;\n // }\n\n if ((N > 20 && N <= 100) || N === 400) {\n return true;\n } else {\n return false;\n }\n}",
"function validNumber(n) {\n if(topBottom === \"top\") {\n n = (Math.round((n - topStart) / incrementTop) * incrementTop) + topStart;\n if(!isInRange(n, topStart, topEnd)) {\n if(!topInverted) {\n n = n < topStart ? topStart : topEnd;\n } else {\n n = n < topStart ? topEnd : topStart;\n }\n }\n } else {\n n = (Math.round((n - bottomStart) / incrementBottom) * incrementBottom) + bottomStart;\n if(!isInRange(n, bottomStart, bottomEnd)) {\n if(!bottomInverted) {\n n = n < bottomStart ? bottomStart : bottomEnd;\n } else {\n n = n < bottomStart ? bottomEnd : bottomStart;\n }\n }\n }\n return n;\n }",
"inRange(num, start, end) {\r\n /* Initial version */\r\n /*\r\n // Check if parameter values are provided.\r\n if (num === undefined) {return 'Provide a number'};\r\n if (start === undefined &&\r\n end === undefined ) {return 'Provide atleast one range'};\r\n var lStart;\r\n var lEnd;\r\n var temp;\r\n\r\n //If no end value is provided to the method, the start value will be 0\r\n //and the end value will be the provided start value\r\n\r\n end === undefined ? lStart = 0 : lStart = start;\r\n end === undefined ? lEnd = start : lEnd = end;\r\n\r\n //If the provided start value is larger than the provided end value, the\r\n //two values should be swapped\r\n\r\n if (lStart > lEnd) {\r\n temp = lStart;\r\n lStart = lEnd;\r\n lEnd = temp;\r\n };\r\n\r\n if (num < lStart) {return false} else {\r\n if (num >= lEnd) {return false} else { return true };\r\n };\r\n */\r\n\r\n // Improved/Consise final version below\r\n\r\n // Check if parameter values are provided.\r\n var lStart;\r\n var lEnd;\r\n var temp;\r\n\r\n if (num === undefined) {\r\n return 'Provide a number'\r\n };\r\n\r\n if (start === undefined &&\r\n end === undefined) {\r\n return 'Provide atleast one range'\r\n };\r\n\r\n\r\n //If no end value is provided to the method, the start value will be 0\r\n //and the end value will be the provided start value\r\n\r\n end === undefined ? lStart = 0 : lStart = start;\r\n end === undefined ? lEnd = start : lEnd = end;\r\n\r\n //If the provided start value is larger than the provided end value, the\r\n //two values should be swapped\r\n\r\n if (lStart > lEnd) {\r\n temp = lStart;\r\n lStart = lEnd;\r\n lEnd = temp;\r\n };\r\n\r\n return ((num < lStart) || (num >= lEnd) ? false : true);\r\n\r\n\r\n }",
"function checkRange(input) {\n //checks integer range values for min/max order\n if (input < 0) {\n return true;\n }\n //converts every input into a String\n let stringTest = input.toString();\n // Take their input and split it at the '-' (hyphen mark)\n // numbers variable will then look like this\n // numbers = ['value1', 'value2']\n let numbers = stringTest.split(\"-\");\n //removes empty strings in array (caused by edge case of negative min to max range ex: \"-100-300\")\n let filterednumbers = numbers.filter((item) => item);\n // parseFloat parses argument and returns floating point number, then point numbers are compared using the < (less than) mathematical symbol\n // Because we are using the < in the return, this will only return a true or false based off the values.\n return parseFloat(filterednumbers[0]) < parseFloat(filterednumbers[1]);\n}",
"function isInBound(x,y){\n\treturn x>-1&&x<9&&y>-1&&y<9;\n}",
"function CheckBadNumberRange(str, min, max, defMsg, msg, isQuite)\n{\n var result = false;\n var num = parseInt(str);\n if (!((num >= min && num <= max) && (IsNumeric(str))))\n {\n if (isQuite != true)\n {\n if (msg == null)\n {\n alert(GL(\"verr_bad_num\",\n { 1 : defMsg, 2 : min, 3 : max }));\n }\n else\n {\n alert(msg);\n }\n }\n result = true;\n }\n return result;\n}",
"inRangeIdea (num, start, end) {\n let startRange\n let endRange\n if (!end) {\n startRange = 0\n endRange = start\n } else if (start > end) {\n startRange = end\n endRange = start\n } else {\n startRange = start\n endRange = end\n }\n return this.checkRangeIdea(num, startRange, endRange)\n }",
"function constrain(n, min, max) {\n if (n < min) n = min;\n if (n > max) n = max;\n return n;\n}",
"function valueInBounds(v, [min, max]) {\n return v >= min && (max === undefined || v <= max);\n }",
"function bound (n, min, max) {\n return Math.min(max, Math.max(min, n))\n}",
"function isValidStat(stat) {\n return (stat >= 0 && stat <= 5);\n}",
"function isUserNumberValid(v) {\n return v <= 100 && v >= 1 && v != NaN && v % 1 == 0;\n}",
"function numGreaterThan10v2(n) {\n if (n > 10) {\n alert(\"true\");\n }\n else {\n alert(\"number is less than 10\");\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initializes the keyboard gets any mapped keys from the local storage and sets default keys if there are none | function initKeyboard(){
myKeyboard = null;
myKeyboard = input.Keyboard();
var fireKey = JSON.parse(localStorage.getItem('fireKey'));
var rotateLeftKey = JSON.parse(localStorage.getItem('rotateLeftKey'));
var rotateRightKey = JSON.parse(localStorage.getItem('roateRightKey'));
var accelKey = JSON.parse(localStorage.getItem('accelKey'));
if(fireKey != null){
myKeyboard.registerCommand(fireKey, myShip.fire);
}
else{
localStorage['fireKey'] = JSON.stringify(KeyEvent.DOM_VK_W);
localStorage['fireChar'] = 'w';
myKeyboard.registerCommand(KeyEvent.DOM_VK_W, myShip.fire);
}
if(rotateLeftKey != null){
myKeyboard.registerCommand(rotateLeftKey, myShip.rotateLeft);
}
else{
localStorage['rotateLeftKey'] = JSON.stringify(KeyEvent.DOM_VK_A);
localStorage['rotateLeftChar'] = 'a';
myKeyboard.registerCommand(KeyEvent.DOM_VK_A, myShip.rotateLeft);
}
if(rotateRightKey != null){
myKeyboard.registerCommand(rotateRightKey, myShip.rotateRight);
}
else{
localStorage['roateRightKey'] = JSON.stringify(KeyEvent.DOM_VK_D);
localStorage['roateRightChar'] = 'd';
myKeyboard.registerCommand(KeyEvent.DOM_VK_D, myShip.rotateRight);
}
if(accelKey != null){
myKeyboard.registerCommand(accelKey, myShip.moveUp);
}
else{
localStorage['accelKey'] = JSON.stringify(KeyEvent.DOM_VK_S);
localStorage['accelChar'] = 's';
myKeyboard.registerCommand(KeyEvent.DOM_VK_S, myShip.moveUp);
}
//register escape key for exit game
myKeyboard.registerCommand(KeyEvent.DOM_VK_ESCAPE,pauseGame);
} | [
"function initKeyboard(){\n\tkeyStates = {\n\t\t'Left': false,\n\t\t'Right': false,\n\t\t'Up': false,\n\t\t'Down': false,\n\t\t'Shift': false,\n\t\t'Control': false,\n\t\t'Space': false,\n\t\t'E': false,\n\t}\n\n\tconsole.log(\"Now listening for keyboard presses...\");\n\tdocument.addEventListener('keydown', function(event) {\n\t\tlet keyPressed = event.code;\n\t\tif (event.repeat){\n\t\t\t// ignore repeat (held down) key presses\n\t\t\treturn;\n\t\t}\n\t\tif (keyPressed === 'KeyA' || keyPressed === 'ArrowLeft'){\n\t\t\tkeyStates['Left'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyW' || keyPressed === 'ArrowUp'){\n\t\t\tkeyStates['Up'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyD' || keyPressed === 'ArrowRight'){\n\t\t\tkeyStates['Right'] = true;\n\t\t}\n\t\telse if (keyPressed === 'KeyS' || keyPressed === 'ArrowDown'){\n\t\t\tkeyStates['Down'] = true;\n\t\t}\n\t\telse if (keyPressed === 'ShiftLeft' || keyPressed === 'ShiftRight'){\n\t\t\tkeyStates['Shift'] = true;\n\t\t}\n\t\telse if (keyPressed === 'ControlLeft' || keyPressed === 'ControlRight'){\n\t\t\tkeyStates['Control'] = true;\n\t\t}\n\t\telse if (keyPressed === \"KeyR\" ){\n\t\t\tresetFunction();\n\t\t}\n\n\t\t// note space is queued up and only unset by the player and not keyup event\n\t\telse if (keyPressed === \"Space\" ){\n\t\t\tkeyStates['Space'] = true;\n\t\t}\n\n\t\telse if (keyPressed === \"KeyE\"){\n\t\t\tkeyStates['E'] = true;\n\t\t\tendGame()\n\t\t}\n\n\t})\n\t/* when a key is realeased, remove it from the keystates list */\n\tdocument.addEventListener('keyup', function(event) {\n\t\tlet keyReleased = event.code;\n\n\t\tif (keyReleased === 'KeyA' || keyReleased === 'ArrowLeft'){\n\t\t\tkeyStates['Left'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyW' || keyReleased === 'ArrowUp'){\n\t\t\tkeyStates['Up'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyD' || keyReleased === 'ArrowRight'){\n\t\t\tkeyStates['Right'] = false;\n\t\t}\n\t\telse if (keyReleased === 'KeyS' || keyReleased === 'ArrowDown'){\n\t\t\tkeyStates['Down'] = false;\n\t\t}\n\t\telse if (keyReleased === 'ShiftLeft' || keyReleased === 'ShiftRight'){\n\t\t\tkeyStates['Shift'] = false;\n\t\t}\n\t})\n}",
"function Keymap(){\r\n this.map = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',\r\n 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'backspace', 'enter', 'shift', 'delete'];\r\n }",
"function virtual_keyboard_set_up() {\r\n\t//populate all key buttons array\r\n\tfor (i = 0; i < 46; i++) {\r\n\t\tkey_array[i] = document.getElementsByClassName(\"key_button_and_name\")[i];\r\n\t\tkey_button_array[i] = document.getElementsByClassName(\"key_button\")[i];\r\n\t}\r\n\t//populate alphanumeric_puncutation key names arrays with lowrcase text\r\n\tfor (i = 0; i < 28; i++) {\r\n\t\tmirrored_font_alphanumeric_punctuation_key_names_arrray[i] = document.getElementsByClassName(\"mirrored_font_key_name alphanumeric_punctuation\")[i];\r\n\t\tmirrored_font_alphanumeric_punctuation_key_names_arrray[i].textContent = String.fromCharCode(lowercase_letter_comma_period_utf_8_array[i]); \r\n\t\tmirrored_alphanumeric_punctuation_key_names_arrray[i] = document.getElementsByClassName(\"mirrored_key_name alphanumeric_punctuation\")[i];\r\n\t\tmirrored_alphanumeric_punctuation_key_names_arrray[i].textContent = String.fromCharCode(lowercase_letter_comma_period_utf_8_array[i]); \r\n\t}\r\n \t//populate single state key names array\r\n\tfor (i = 0; i < 4; i++) {\r\n\t\tmirrored_font_single_state_key_names_array[i] = document.getElementsByClassName(\"single_state_key_names mirrored_font_key_name\")[i];\r\n\t\tmirrored_single_state_key_names_array[i] = document.getElementsByClassName(\"single_state_key_names mirrored_key_name\")[i];\r\n\t}\r\n\t//populate two state key names array\r\n\tfor (i = 0; i < 12; i++) {\r\n\t\tmirrored_font_two_state_key_names_array[i] = document.getElementsByClassName(\"two_state_key_names mirrored_font_key_name\")[i];\r\n\t\tmirrored_two_state_key_names_array[i] = document.getElementsByClassName(\"two_state_key_names mirrored_key_name\")[i];\r\n\t}\r\n\t//populate options key names arrays\r\n\tfor (i = 0; i < 7; i++) {\r\n\t\tmirrored_font_option_key_names_array[i] = document.getElementsByClassName(\"option_key_names mirrored_font_key_name\")[i];\r\n\t\tmirrored_option_key_names_array[i] = document.getElementsByClassName(\"option_key_names mirrored_key_name\")[i];\r\n\t}\r\n\r\n\t//populate mirrored_font_key_name_array\r\n\tmirrored_font_key_name_array.push(mirrored_font_alphanumeric_punctuation_key_names_arrray);\r\n\tmirrored_font_key_name_array.push(mirrored_font_single_state_key_names_array);\r\n\tmirrored_font_key_name_array.push(mirrored_font_two_state_key_names_array);\r\n\tmirrored_font_key_name_array.push(mirrored_font_option_key_names_array);\r\n\t//populate mirrored_key_name_array\r\n\tmirrored_key_name_array.push(mirrored_alphanumeric_punctuation_key_names_arrray);\r\n\tmirrored_key_name_array.push(mirrored_single_state_key_names_array);\r\n\tmirrored_key_name_array.push(mirrored_two_state_key_names_array);\r\n\tmirrored_key_name_array.push(mirrored_option_key_names_array);\r\n\r\n\tmirror_text_type_selection();\r\n\r\n\tinput(\"click\"); //mouse click events\r\n\tinput(\"touchend\"); //touch screen events\r\n\tinput(\"keydown\"); //physical keyboard events\r\n\r\n\tdocument.addEventListener(\"keydown\", function(event) {\r\n\t\tif (event.defaultPrevented) {\r\n\t\t\treturn; // Do nothing if event already handled\r\n\t\t}\r\n\t\tif (event.key == \"Control\" || event.key == \"Alt\" || event.key == \"Shift\"){\r\n\t\t\ttoggle_button(event.target);\r\n\t\t\tmodifier_key_pressed = true;\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t});\r\n\r\n\tdocument.addEventListener(\"keyup\", function(event) {\r\n\t\tif (event.defaultPrevented) {\r\n\t\t\treturn; // Do nothing if event already handled\r\n\t\t}\r\n\t\tif (event.key == \"Control\" || event.key == \"Alt\" || event.key == \"Shift\") {\r\n\t\t\ttoggle_button(event.target);\r\n\t\t\tmodifier_key_pressed = false;\r\n\t\t\tevent.preventDefault();\r\n\t\t}\r\n\t});\r\n\r\n\t//switch arrow key directions because the textarea is mirrored\r\n textarea_element.addEventListener(\"keydown\", function(event) {\r\n if (event.defaultPrevented) {\r\n\t\t\treturn; // Do nothing if event already handled\r\n\t\t}\r\n if (event.code == \"ArrowLeft\") {\r\n start = textarea_element.selectionStart;\r\n textarea_element.selectionEnd++;\r\n textarea_element.selectionStart = textarea_element.selectionEnd;\r\n scroll_to_cursor();\r\n event.preventDefault();\r\n }\r\n if (event.code == \"ArrowRight\") {\r\n end = textarea_element.selectionEnd;\r\n\t\t\tif (textarea_element.selectionStart > 0) {\r\n\t\t\t\ttextarea_element.selectionStart--;\r\n } else if (textarea_element.selectionStart <= 0) {\r\n\t\t\t\ttextarea_element.selectionStart = 0;\r\n\t\t\t}\r\n textarea_element.selectionEnd = textarea_element.selectionStart;\r\n scroll_to_cursor();\r\n event.preventDefault();\r\n }\r\n\t\t//Select with arrow keys\r\n if (event.code == \"ArrowLeft\" && modifier_key_pressed == true) {\r\n end = textarea_element.selectionEnd++;\r\n textarea_element.setSelectionRange(start, end);\r\n scroll_to_cursor();\r\n event.preventDefault();\r\n }\r\n if (event.code == \"ArrowRight\" && modifier_key_pressed == true) {\r\n\t\t\tif (textarea_element.selectionStart > 0) {\r\n\t\t\t\tstart = textarea_element.selectionStart--;\r\n } else if (textarea_element.selectionStart <= 0) {\r\n\t\t\t\tstart = 0;\r\n\t\t\t}\r\n textarea_element.setSelectionRange(start, end);\r\n scroll_to_cursor();\r\n event.preventDefault();\r\n }\r\n });\r\n}",
"resetToDefault() {\n const command = this.edits.rowEl.dataset.command;\n const defaultMapping = Commands.defaultMappings.normal[command];\n this.edits.keyStrings = defaultMapping ? defaultMapping.split(Commands.KEY_SEPARATOR) : [];\n this.displayKeyString(this.edits.rowEl.querySelector(\".shortcut\"), defaultMapping);\n this.commitChange();\n }",
"function init() {\n var savedLeaderboard = JSON.parse(localStorage.getItem(\"leaderboard\"));\n if (savedLeaderboard === null) {\n return;\n }\n else {\n leaderboardArr = savedLeaderboard;\n } \n}",
"loadKeysToActions() {\n // Clear beforehand in case we're reloading.\n this.keysToActions.clear();\n this.actions.forEach((action) => {\n const keys = action.getKeys();\n // TODO: For local co-op/split screen, set player-specific bindings.\n keys.forEach((key, inputType) => {\n // Get if this key is for a specific player, denoted by a \"-[0-9]\".\n if (SPLIT_SCREEN_REG.test(inputType)) {\n // This is a split-screen binding, add the player number to the key.\n const playerNumber = inputType.split('-').pop();\n key = `${key}-${playerNumber}`;\n }\n if (!this.keysToActions.has(key)) {\n this.keysToActions.set(key, new Array());\n }\n this.keysToActions.get(key).push(action);\n });\n });\n }",
"function Keymap(keys, options) {\n\t this.options = options || {}\n\t this.bindings = Object.create(null)\n\t if (keys) this.addBindings(keys)\n\t }",
"function loadEventListeners() {\n addKeyCallback(Phaser.Keyboard.ONE, changeState, 1);\n}",
"function initLocalStorage(){\n if (!localStorage.hasOwnProperty('closeLoginWarning')){\n localStorage['closeLoginWarning'] = false;\n }\n \n if (!localStorage.hasOwnProperty('list')){\n localStorage['list'] = JSON.stringify([DEFAULT_ITEM]);\n }\n \n if (!localStorage.hasOwnProperty('loginStatus')){\n localStorage['loginStatus'] = false;\n }\n}",
"static kx_RefreshDefaults() {\n // each standard alphabet as key in the translator.\n if (!SizedBigInt.kx_tr) {\n SizedBigInt.kx_tr={};\n SizedBigInt.kx_baseLabel = {\n \"2\": { base:2, alphabet:\"01\", ref:\"ECMA-262\" } // never used here, check if necessary to implement\n ,\"2h\": { // BitString representation\n base:2, alphabet:\"01\",\n isDefault:true,\n isHierar:true, // use leading zeros (0!=00).\n ref:\"SizedNaturals\"\n }\n ,\"4h\": {\n base:4,\n isHierar:true, // use hDigit and leading zeros.\n alphabet:\"0123GH\", case:\"upper\",\n regex:'^([0123]*)([GH])?$',\n ref:\"SizedNaturals\"\n }\n ,\"8h\": {\n base:8,\n isHierar:true,\n alphabet:\"01234567GHJKLM\", // 2*8-2=14 characters\n regex:'^([0-7]*)([GHJ-M])?$',\n ref:\"SizedNaturals\"\n }\n ,\"16h\": {\n base:16,\n isHierar:true,\n alphabet:\"0123456789abcdefGHJKLMNPQRSTVZ\", //2*16-2=30 characters\n regex:'^([0-9a-f]*)([GHJ-NP-TVZ])?$',\n ref:\"SizedNaturals\"\n }\n ,\"4js\": { alphabet:\"0123\", isDefault:true, ref:\"ECMA-262\" }\n ,\"8js\": { alphabet:\"01234567\", isDefault:true, ref:\"ECMA-262\" }\n ,\"16js\": { alphabet:\"0123456789abcdef\", isDefault:true, ref:\"ECMA-262\" } // RFC 4648 sec 8 is upper\n ,\"32hex\": { alphabet:\"0123456789abcdefghijklmnopqrstuv\", isDefault:true, ref:\"RFC 4648 sec. 7\" }\n ,\"32nvu\": { alphabet:\"0123456789BCDFGHJKLMNPQRSTUVWXYZ\", ref:\"No-Vowels except U (near non-syllabic)\" }\n ,\"32rfc\": { alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\", ref:\"RFC 4648 sec. 6\" }\n ,\"32ghs\": { alphabet:\"0123456789bcdefghjkmnpqrstuvwxyz\", ref:\"Geohash, classical of 2008\" }\n ,\"64url\": {\n alphabet:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_\",\n isDefault:true, ref:\"RFC 4648 sec. 5\"\n }\n };\n SizedBigInt.kx_baseLabel_setRules();\n // to prepare cache, for example Bae16h, run here SizedBigInt.kx_trConfig('16h')\n } // \\if\n }",
"async initialize () {\n await this.generateKey()\n }",
"function keyTyped() {\n mode = key;\n}",
"setKeyStateOrder() {\n this.keyStates = [this.KEY_LEFT, this.KEY_UP, this.KEY_RIGHT, this.KEY_DOWN]\n }",
"function iglooKeys () {\n\tthis.mode = 'default';\n\tthis.keys = ['default', 'search', 'settings'];\n\tthis.cbs = {\n\t\t'default': {},\n\t\t'search': {\n\t\t\tnoDefault: true\n\t\t},\n\t\t'settings': {}\n\t};\n\n\t//This registers a new keybinding for use in igloo\n\t//And then executes the function under the right circumstances\n\tthis.register = function (combo, mode, func) {\n\t\tvar me = this;\n\t\tif ($.inArray(mode, this.keys) !== -1 && iglooUserSettings.useKeys === true) {\n\t\t\tthis.cbs[mode][combo] = func;\n\n\t\t\tMousetrap.bind(combo, function(e, input) {\n\t\t\t\tif (!me.cbs[igloo.piano.mode].noDefault || input === 'f5') {\n\t\t\t\t\tif (e.preventDefault) {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// internet explorer\n\t\t\t\t\t\te.returnValue = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tme.cbs[igloo.piano.mode][input]();\n\t\t\t});\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t};\n}",
"init() {\n let localStore = model.getLocalStore();\n if (_.isNull(localStore)) {\n localStorage.setItem('vanillaPress', JSON.stringify(jsonData));\n localStore = model.getLocalStore();\n }\n }",
"function main() {\n drawMap();\n setupKeyboardControls();\n }",
"buildKeyboard() {\n\t\tconst keybed = this.keyboard.getElementsByClassName('keybed');\n\t\tconst octaves = window.innerWidth / (window.innerWidth < 800 ? 600 : 500);\n\t\tkeybed[0].innerHTML = this.generateKeys(octaves, window.innerWidth < 800 ? 3 : 2);\n\t\tthis.keyboard.style.display = '';\n\t\tthis.initKeyListeners();\n\t}",
"function initLocalStorage() {\n if (typeof (Storage) !== \"undefined\") {\n // restore the localStorage, if storage is empty, will init new one\n allObjects.forEach((item) => {\n if (getItem(clickMap, item.title) != \"buttonGreen\") {\n setItem(clickMap, item.title, \"buttonGrey\");\n }\n })\n } else {\n allObjects.forEach((item) => {\n setItem(clickMap, item.title, \"buttonGrey\");\n })\n }\n}",
"constructor() {\n this.game = undefined;\n\n this.mapKey = undefined; // should be string with name of map\n this.playerProperties = undefined; // should be object with properties of player\n this.monsterProperties = undefined; // should be array of objects with properties of each monster\n this.defaultAbilities = undefined; // should be array of default abilities\n\n this.player = undefined; // defined in createPlayer(); included here to avoid IDE warning\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function for auto refreshing the page | function AutoRefresh(t) {
setTimeout("location.reload();", t);
} | [
"function refresh() {\n\tsetInterval(function() {\n\t\tconsole.log(\"refresh\");\n\t\twindow.location.reload();\n\t}, 20000);\n}",
"function clickedRefresh(event) {\n console.log(\"refresh\")\n window.location.reload();\n}",
"function refreshPage() {\r\n var url = location.href;\r\n // Strip of information after the \"?\"\r\n if (url.indexOf('?') > -1) {\r\n url = url.substring(0, url.indexOf('?'));\r\n }\r\n\r\n url = buildMenuQueryString(\"\", url);\r\n url = removeParameterFromUrl(url, \"policyViewMode\");\r\n url += \"&policyViewMode=WIP\";\r\n url += \"&refreshParentPageRequired=Y\";\r\n // add parameters for loading VL Coverage page\r\n if (getObject(\"coverageBaseRecordId\")) {\r\n url += \"&coverageBaseRecordId=\" + getObjectValue(\"coverageBaseRecordId\");\r\n }\r\n if (getObject(\"coverageStatus\")) {\r\n url += \"&coverageStatus=\" + getObjectValue(\"coverageStatus\");\r\n }\r\n if (getObject(\"coverageBaseStatus\")) {\r\n url += \"&coverageBaseStatus=\" + getObjectValue(\"coverageBaseStatus\");\r\n }\r\n if (getObject(\"coverageEffectiveFromDate\")) {\r\n url += \"&coverageEffectiveFromDate=\" + getObjectValue(\"coverageEffectiveFromDate\");\r\n }\r\n // end adding parameters for loading VL Coverage page\r\n setWindowLocation(url);\r\n}",
"function refresh_content() {\n $('.refresh').on('click', function() {\n show_content();\n });\n }",
"function updateWidget() {\n window.location.reload();\n}",
"function url_force_reload(url) { \n var date_now = new Date();\n return url + '?v=' + date_now.getTime(); \n}",
"function newScrape() {\n $.ajax(\"/scrape\", {\n type: \"GET\"\n }).then(function(){\n location.reload();\n });\n}",
"function genRefresh(){\n var button = document.createElement('button');\n button.setAttribute('onClick', 'refreshPage()')\n button.setAttribute('type','button')\n button.setAttribute('id','refresh')\n button.appendChild(document.createTextNode('Click to Play New Game'));\n document.body.appendChild(button);\n }",
"function gifRefresh() {\n window.location.reload();\n}",
"function refreshMainPage() {\n MainPageAjaxUpdate(main_page_accumulate_page, main_page_current_sort, document.getElementById(\"main_page_search_input\").value);\n}",
"function reloadWindow() {\n location.reload()\n}",
"function autoRefresh() {\n /*\n 1) going from off to any interval\n 2) going from any interval to off\n 3) going from one interval to another\n */\n\n if (hasMap()) {\n newInterval = $(\"#refreshSelect\").val();\n\n if (currentInterval > 0) { // currently running at an interval\n\n if (newInterval > 0) { // moving to another interval (3)\n clearInterval(intervalID);\n intervalID = setInterval(\"getRouteForMap();\", newInterval * 1000);\n currentInterval = newInterval;\n }\n else { // we are turning off (2)\n clearInterval(intervalID);\n newInterval = 0;\n currentInterval = 0;\n }\n }\n else { // off and going to an interval (1)\n intervalID = setInterval(\"getRouteForMap();\", newInterval * 1000);\n currentInterval = newInterval;\n }\n\n // show what auto refresh action was taken and after 5 seconds, display the route name again\n showMessage($(\"#refreshSelect option:selected\").text());\n setTimeout('showRouteName();', 5000);\n }\n else {\n alert(\"Please select a route before trying to refresh map.\");\n refreshSelect.selectedIndex = 0;\n }\n }",
"reload() {\n this.requestWebsites();\n }",
"function scheduleRefresh() {\r\n if (refreshEvent) {\r\n clearTimeout(refreshEvent);\r\n }\r\n refreshEvent = setTimeout(function() {refresh(); refreshEvent = null;}, refreshDelay);\r\n}",
"async function attemptReload() {\n await fetch(''); // Check the server really is back\n location.reload();\n }",
"function refreshAll() {\r\n\tgenerateNotes();\r\n\tdetermineInterval();\r\n\tsetTimeout(function() {\r\n\tplayNotes();\r\n\t}, 100)\r\n}",
"refresh(timeNow, enableAnimation) {\n }",
"function reloadIE(id, display, url)\n\t{\n\t\tif (!first && $.browser.msie)\n\t\t{\n\t\t\t// window.location.href = window.location.href;\n\t\t}\n\n\t\tif (first == false)\n\t\t{\n\t\t\tvar data = {\n\t\t\t\t\tname: 'theme',\n\t\t\t\t\tvalue: id\n\t\t\t};\n\n\t\t\t$.post(save_url, data,\n\t\t\t\t\tfunction(result)\n\t\t\t\t\t{\n\t\t\t\t\t});\n\t\t}\n\n\t\tfirst = false;\n\t}",
"function replay() {\n\tlocation.reload();\n}",
"function autoRefrescar3() {\n\tif ($(\"#verUsuarioNormal\").length>0) {\n\t$(\"#verUsuarioAdministrador\").DataTable().ajax.reload(null, false);\n\t$(\"#verUsuarioNormal\").DataTable().ajax.reload(null, false); // user paging is not reset on reload\n\t}\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Integer GetListIndex(String prElement, String prList) Gets the 0based index of a specified element inside of a string. Returns 1 if item not found. | function GetListIndex(prElement, prList) {
var cReg = "";
var szElement = "";
var nIndex = -1;
//Loop over the length of the passed list
for(var nIndexStr = 0; nIndexStr <= prList.length; nIndexStr++) {
//Get the current character in this list
cReg = prList.charAt(nIndexStr);
if(cReg == "," || nIndexStr == prList.length) {
//if we have just finished a list element, compare it against the element stored in szElement
nIndex++;
if(szElement == prElement) {
//if the two are identical, return the index.
return nIndex;
}
else {
//otherwise, set the stored element blank.
szElement = "";
}
}
else {
//if we are in the middle of a list element, append the current character to the stored element.
szElement += cReg;
}
}
return -1;
} | [
"function getElIndex(nList, el){\n\n var index = 0\n\n for(element of nList){\n\n if(element == el){\n return index\n }\n index++\n }\n\n}",
"getIndexOfLI (librin)\n {\n const my = this\n const LIs = my.LIlist\n let i = 0, len = LIs.length\n for (; i < len ; ++i){\n if ( LIs[i].id == librin.id ) return i ;\n }\n return null\n }",
"function GetNumElements(prList) {\r\n\tvar bLoop = true;\r\n\tvar nElements = 0;\r\n\tvar nIndexStr = -1;\r\n\t\r\n\t//Loop over the passed list. If the character is a comma, increment the number of elements.\r\n\tif(prList != \"\") {\r\n\t\twhile(bLoop){\r\n\t\t\tnIndexStr = prList.indexOf(\",\", nIndexStr + 1);\r\n\t\t\tif(nIndexStr != -1 && nIndexStr < prList.length)\r\n\t\t\t\tnElements++;\r\n\t\t\telse\r\n\t\t\t\tbLoop = false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(prList != \"\") nElements++;\r\n\t\r\n\treturn nElements;\r\n}",
"function getIndexOfId(list, item) {\n return list.map(function(e) {\n return e.ID;\n }).indexOf(item);\n}",
"function printedToRealIdxInStr(pStr, pIdx)\n{\n\tif (typeof(pStr) != \"string\")\n\t\treturn -1;\n\tif ((pIdx < 0) || (pIdx >= pStr.length))\n\t\treturn -1;\n\n\t// Store the character at the given index if the string didn't have attribute codes.\n\t// Also, to help ensure this returns the correct index, get a substring with several\n\t// characters starting at the given index to match a word within the string\n\tvar strWithoutAttrCodes = strip_ctrl(pStr);\n\tvar substr_len = 5;\n\tvar substrWithoutAttrCodes = strWithoutAttrCodes.substr(pIdx, substr_len);\n\tvar printableCharAtIdx = strWithoutAttrCodes.charAt(pIdx);\n\t// Iterate through pStr until we find that character and return that index.\n\tvar realIdx = 0;\n\tfor (var i = 0; i < pStr.length; ++i)\n\t{\n\t\t// tempStr is the string to compare with substrWithoutAttrCodes\n\t\tvar tempStr = strip_ctrl(pStr.substr(i)).substr(0, substr_len);\n\t\tif ((pStr.charAt(i) == printableCharAtIdx) && (tempStr == substrWithoutAttrCodes))\n\t\t{\n\t\t\trealIdx = i;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn realIdx;\n}",
"function indexOfElement(arrayContainer, element){\n\t//loop thru elements of container\n\tvar index = 0;\n\tfor( ; index < arrayContainer.length; index++ ){\n\t\t//compare currently iterated array entry to the given element\n\t\tif( arrayContainer[index] == element ){\n\t\t\t//if found, return index\n\t\t\treturn index;\n\t\t}\n\t}\n\t//not found, return -1\n\treturn -1;\n}",
"function firstOcc(string, character) {\n for (var i = 0; i < string.length; i++) {\n if (string[i] === character) {\n return i;\n }\n }\n return -1;\n}",
"function myIndexOf(string, searchTerm) {}",
"function linearSearch(list, key) {\n let index = -1;\n for (let i = 0; i < list.length; i++) {\n if (list[i] == key) {\n index = i;\n break;\n }\n }\n return index;\n}",
"function getListIndex()\n{\n\tvar prmstr = window.location.search.substr(1);\n\tvar prmarr = prmstr.split (\"&\");\n\tvar params = {};\n\n\tfor ( var i = 0; i < prmarr.length; i++) {\n\t var tmparr = prmarr[i].split(\"=\");\n\t params[tmparr[0]] = tmparr[1];\n\t}\n\tlistIndex = params.listindex;\n}",
"function getOptionIndex(optionRoot, checkString)\n{\n\tif(optionRoot && checkString)\n\t{\n\t\tvar optionsCount = optionRoot.options.length;\n\t\tfor(var i=0; i<optionsCount; i++)\n\t\t\tif(checkString.indexOf(optionRoot.options[i].value) >= 0)\n\t\t\t\treturn i;\n\t}\n\n\treturn -1;\n}",
"function findWordIndex(word) {\n\t\tfor (var i = 1; i <= 3; i++) {\n\t\t\tfor (var j = 0; j < 16; j++) {\n\t\t\t\tvar menu_item = \"#\" + i + \"_\" + j + \"\";\n\t\t\t\t// might be item.target.text\n\t\t\t\tif($(menu_item).text() === word) {\n\t\t\t\t\t// return menu_item;\n\t\t\t\t\treturn j;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// return \"#none\";\n\t\treturn -1;\n\t}",
"function getIndexInParent(element)\n{\n\tvar parent = element.parentElement;\n\tfor (let i = 0; i < parent.childNodes.length; i++)\n\t{\n\t\tif (parent.childNodes[i] == element)\n\t\t\treturn i;\n\t}\n\treturn -1;\n}",
"function findIndexOfItem(array, item){\r\n for (var x = 0; x < array.length; x++) {\r\n if (array[x][1] == item[1]) {\r\n return x;\r\n }\r\n}\r\n }",
"function findPidByName(nameString, studentList, org) {\n if (!nameString)\n return false;\n\n const activeStudents = studentList.filter((doc) => doc.profile);\n\n for (let i = 0; i < activeStudents.length; i++) {\n const doc = activeStudents[i];\n // activeStudents.forEach((doc) => {\n if (doc.profile) {\n // first check \"Full Name\" field\n const foundLabels = doc.profile.org.filter((label) => label === (`${org}_Full Name_${nameString}`));\n if (foundLabels.length > 0)\n return doc.pid;\n if (doc.profile.name === `${nameString}~c`)\n return doc.pid;\n // else loop on\n }\n }\n // if not found and returned above, generate failure\n return `-- Unrecognized name: ${nameString} --`;\n}",
"getIndexForPositionString (positionString = 'a1') {\n const { row, column } = this.getCoordinatesForPositionString(positionString)\n let index = Math.abs(column - 8) + (row * 8)\n index = Math.abs(index - 64)\n return index\n }",
"function checkForDrum(drumList, drum) {\n for (var i = 0; i < drumList.length; i++) {\n if (drumList[i].name === drum.name) {\n return i;\n }\n }\n return -1;\n}",
"function getPhraseIndex(arr){\n const phraseIndex = arr.indexOf(chosenPhrase);\n return phraseIndex;\n}",
"function getIndexOfPoly(poly) {\n if (poly != null) {\n for (var i=0; i<polys.length; ++i) {\n if(polys[i].fabricPoly === poly) {\n return i;\n }\n }\n }\n return polys.length;\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Goes through the graph and draws lines onto the map | function draw_lines(results){
for(i in results.distances){
for(j in results.distances[i]){
var line = results.distances[i][j].line;
// Construct the polygon
var poly = new google.maps.Polyline({
path: google.maps.geometry.encoding.decodePath(line),
geodesic: true,
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 2
});
poly.setMap(map);
}
}
} | [
"function load_graph_to_map(results){\n load_markers(results.locations);\n //draw_lines(results);\n draw_spanning_tree(results);\n\n}",
"function drawPolyLine() {\n\n\n //Keys of the station objects in order from north to south so that the polyline\n //connects them in the right order. \n //Note: I will draw the branch as a separate polyline.\n var stationOrderMain = [ \"alfcl\", \"davis\", \"portr\", \"harsq\", \"cntsq\", \"knncl\",\n \"chmnl\", \"pktrm\", \"dwnxg\", \"sstat\", \"brdwy\", \"andrw\", \"jfk\",\n \"nqncy\", \"wlsta\", \"qnctr\", \"qamnl\", \"brntn\"\n ];\n \n\n //Get the location of each station so we can draw the line.\n var stationLocations = [];\n for (var i = 0; i < stationOrderMain.length; ++i){\n stationLocations.push( Stations[ stationOrderMain[i]].position);\n\n };\n \n //draw the line\n var lineToDraw = new google.maps.Polyline({\n path: stationLocations,\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 4\n });\n lineToDraw.setMap(map); //set line to map\n\n //Now do the same as above for the branch that forks from JFK.\n var stationOrderBranch = [ \"jfk\", \"shmnl\", \"fldcr\", \"smmnl\", \"asmnl\"]\n stationLocations = [];\n for (var i = 0; i < stationOrderBranch.length; ++i){\n stationLocations.push( Stations[ stationOrderBranch[i]].position);\n };\n \n \n lineToDraw2 = new google.maps.Polyline({\n path: stationLocations,\n geodesic: true,\n strokeColor: '#FF0000',\n strokeOpacity: 1.0,\n strokeWeight: 4\n });\n lineToDraw2.setMap(map);\n\n}",
"drawGraph() {\r\n this.ctx.fillStyle = this.bgColor;\r\n this.ctx.fillRect(0, 0, this.width, this.height);\r\n\r\n if (this.drawGrid) this.drawLines();\r\n const graphInfo = {\r\n ctx: this.ctx,\r\n gtc: this.gtc,\r\n sgtc: this.sgtc,\r\n ctg: this.ctg,\r\n sctg: this.sctg,\r\n width: this.width,\r\n height: this.height,\r\n };\r\n this.layers.forEach(layer => layer.forEach(obj => obj.draw(graphInfo)));\r\n }",
"function draw_travels() {\n removeLines();\n for (var i = 0, len = data.length; i < len; i++) {\n drawLine(data[i])\n }\n}",
"function renderLine () {\n // Render each data point\n ctx.beginPath();\n ctx.strokeStyle = typeof dataset['strokeStyle'] !== 'undefined' ? dataset['strokeStyle'] : '#ffffff';\n ctx.lineWidth = typeof dataset['lineWidth'] !== 'undefined' ? dataset['lineWidth'] : 2;\n ctx.moveTo(points[0].x, points[0].y);\n\n for (var j = 1; j < points.length; j++) {\n ctx.lineTo(points[j].x, points[j].y);\n }\n\n ctx.stroke();\n }",
"function drawRoad(counter){\n //set background\n background(50);\n //Space between lines\n let space = width / 4;\n //Gap between dashed lines\n let step = height / 10;\n //Line width\n let lineW = 10;\n //Road lines\n //Remove outline on shapes\n noStroke();\n //Dashed lines\n for (i = - 2; i < height; i++) {\n //Yellow lines\n fill(255,i * 25, 0);\n rect(space, step * i + counter, 10, 30);\n rect(space * 3, step * i + counter, 10, 30);\n }\n for(i = 0; i < maxH; i++){\n let val = map(i, 0, maxH, 0, 255);\n stroke(255, val, 0);\n line(0, i, lineW, i);\n \n line(space * 2 - lineW, i, space * 2 - lineW * 2, i);\n line(space * 2 + lineW, i, space * 2 + lineW * 2, i);\n line(maxW - lineW, i, maxW, i); \n }\n}",
"lineGraph(ts1, ts2, labels, yRanges, labelHorizontalSeperation, labelVerticalSeperation, x, y, w, h, font) {\n this.ctx.strokeStyle = this.labelColor;\n this.ctx.font = font;\n\n this.ctx.beginPath();\n this.ctx.moveTo(x, y + h * 0.9);\n this.ctx.lineTo(x + w, y + h * 0.9);\n this.ctx.stroke();\n\n this.ctx.fillStyle = this.labelColor;\n this.ctx.textBaseline = \"middle\";\n this.ctx.textAlign = \"center\";\n for (let i = labelHorizontalSeperation / 2; i < w * 0.9; i += labelHorizontalSeperation) {\n this.ctx.fillText(Math.round(this.map(i, 0, w * 0.9, ts1, ts2) / this.round) / (1 / this.round), i + x, y + h * 0.95);\n }\n\n for (let i = 0; i < labels.length; i++) {\n let data;\n for (let j = 0; j < this.data.length; j++) {\n if (this.data[j].label == labels[i]) {\n data = this.data[j];\n }\n }\n\n this.ctx.fillStyle = data.color;\n this.ctx.strokeStyle = data.color;\n this.ctx.textAlign = \"left\";\n for (let j = labelVerticalSeperation / 2; j < h * 0.9; j += labelVerticalSeperation) {\n this.ctx.fillText(Math.round(this.map(j, 0, h * 0.9, yRanges[i][1], yRanges[i][0]) / data.roundAmt) / (1 / data.roundAmt), x + w * (0.905 + i * (0.1 / labels.length)), y + j);\n }\n\n let points = [];\n for (let j = 0; j < data.data.length; j++) {\n if (data.data[j].ts >= ts1 && data.data[j].ts <= ts2) {\n if (points.length == 0 && j !== 0) {\n points.push(data.data[j - 1]);\n }\n points.push(data.data[j]);\n }\n }\n\n this.ctx.beginPath();\n this.ctx.moveTo(x + w * (0.9 + i * (0.1 / labels.length)), y);\n this.ctx.lineTo(x + w * (0.9 + i * (0.1 / labels.length)), y + h);\n this.ctx.stroke();\n\n this.ctx.beginPath();\n this.ctx.moveTo(this.map(points[0].ts, ts1, ts2, x, x + w * 0.9), this.map(points[0].value, yRanges[i][0], yRanges[i][1], y + h * 0.9, y));\n for (let j = 1; j < points.length; j++) {\n this.ctx.lineTo(this.map(points[j].ts, ts1, ts2, x, x + w * 0.9), this.map(points[j].value, yRanges[i][0], yRanges[i][1], y + h * 0.9, y));\n }\n this.ctx.stroke();\n }\n }",
"_drawLines(keypoint) {\n if (keypoint.indexLabel < 0) return;\n if (!this._edges.hasOwnProperty(keypoint.indexLabel)) return;\n\n let otherIndices = this._edges[keypoint.indexLabel];\n otherIndices.forEach(i => {\n let k2 = this._labelled[i];\n if (!k2) return;\n\n let edge = [keypoint.indexLabel, i];\n this._drawLine(edge, keypoint, k2);\n });\n }",
"function drawSvg(track){\n\t// Get the data\n\tvar data = [];\n\tfor(var i = 0; i < track.altitudes_jump_60.length; i++){\n\t\tif(i*60 > track.distances.length){\n\t\t\tdata.push({\"altitude\": track.altitudes_jump_60[i], \"distance\": track.distances[track.distances.length - 1]});\n\t\t} else{\n\t\t\tdata.push({\"altitude\": track.altitudes_jump_60[i], \"distance\": track.distances[i*60]});\n\t\t}\n\t}\n\n\t// Set width and margin\n\tvar margin = {\n\t\ttop: 20,\n\t\tright: 10,\n\t\tbottom: 30,\n\t\tleft: 50\n\t },\n\t width = $('#data').width() - margin.left - margin.right,\n\t height = 300 - margin.top - margin.bottom;\n\n\tvar x = d3.scale.linear()\n\t .range([0, width]);\n\n\tvar y = d3.scale.linear()\n\t .range([height, 0]);\n\n\t// define the area\n\tvar area = d3.svg.area()\n\t\t.x(function(d) { return x(d.distance); })\n\t\t.y0(height)\n\t\t.y1(function(d) { return y(d.altitude); });\n\n\tvar color = d3.scale.category10();\n\n\tvar xAxis = d3.svg.axis()\n\t .scale(x)\n\t .orient(\"bottom\");\n\n\tvar yAxis = d3.svg.axis()\n\t .scale(y)\n\t .orient(\"left\");\n\n\tvar line = d3.svg.line()\n\t //.interpolate(\"basis\") // FIXME: uncomment if rounded curve is needed\n\t .x(function(d) {\n\t\treturn x(d.distance);\n\t })\n\t .y(function(d) {\n\t\treturn y(d.altitude);\n\t });\n\td3.select(\"#data\").select(\"svg\").remove();\n\tvar svg = d3.select(\"#data\").append(\"svg\")\n .attr('id', 'elevation-graph')\n\t .attr(\"width\", width + margin.left + margin.right)\n\t .attr(\"height\", height + margin.top + margin.bottom)\n\t .append(\"g\")\n\t .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\tcolor.domain(d3.keys(data[0]).filter(function(key) {\n\t return key !== \"distance\";\n\t}));\n\n\tvar cities = color.domain().map(function(name) {\n\t return {\n\t\tname: name,\n\t\tvalues: data\n\t };\n\t});\n\n\tx.domain(d3.extent(data, function(d) {\n\t return d.distance;\n\t}));\n\n\ty.domain([\n\t d3.min(cities, function(c) {\n\t\treturn d3.min(c.values, function(v) {\n\t\t return v.altitude;\n\t\t});\n\t }),\n\t d3.max(cities, function(c) {\n\t\treturn d3.max(c.values, function(v) {\n\t\t return v.altitude;\n\t\t});\n\t })\n\t]);\n\n\tvar legend = svg.selectAll('g')\n\t .data(cities)\n\t .enter()\n\t .append('g')\n\t .attr('class', 'legend');\n\n\tsvg.append(\"g\")\n\t .attr(\"class\", \"x axis\")\n\t .attr(\"transform\", \"translate(0,\" + height + \")\")\n\t .call(xAxis)\n\t .append(\"text\")\n\t .attr(\"transform\", \"translate(\" + width + \", 0)\")\n\t .attr(\"y\", -15)\n\t .attr(\"dy\", \".71em\")\n\t .style(\"text-anchor\", \"end\")\n\t .text(\"Distance (m)\");\n\n\tsvg.append(\"g\")\n\t .attr(\"class\", \"y axis\")\n\t .call(yAxis)\n\t .append(\"text\")\n\t .attr(\"transform\", \"rotate(-90)\")\n\t .attr(\"y\", 6)\n\t .attr(\"dy\", \".71em\")\n\t .style(\"text-anchor\", \"end\")\n\t .text(\"Altitude (m)\");\n\n\tvar city = svg.selectAll(\".city\")\n\t .data(cities)\n\t .enter().append(\"g\")\n\t .attr(\"class\", \"city\");\n\n\tcity.append(\"path\")\n\t .attr(\"class\", \"line\")\n\t .attr(\"d\", function(d) {\n\t\treturn line(d.values);\n\t })\n\t .style(\"stroke\", function(d) {\n\t\treturn color(d.name);\n\t });\n\n\t// add the area\n\tsvg.append(\"path\")\n\t\t.data([data])\n\t\t.attr(\"class\", \"area\")\n\t\t.attr(\"d\", area);\n\n\tvar mouseG = svg.append(\"g\")\n\t .attr(\"class\", \"mouse-over-effects\");\n\n\tmouseG.append(\"path\") // this is the black vertical line to follow mouse\n\t .attr(\"class\", \"mouse-line\")\n\t .style(\"stroke\", \"black\")\n\t .style(\"stroke-width\", \"1px\")\n\t .style(\"opacity\", \"0\");\n\n\tvar lines = document.getElementsByClassName('line');\n\n\tvar mousePerLine = mouseG.selectAll('.mouse-per-line')\n\t .data(cities)\n\t .enter()\n\t .append(\"g\")\n\t .attr(\"class\", \"mouse-per-line\");\n\n\tmousePerLine.append(\"circle\")\n\t .attr(\"r\", 7)\n\t .style(\"stroke\", function(d) {\n\t\treturn color(d.name);\n\t })\n\t .style(\"fill\", \"none\")\n\t .style(\"stroke-width\", \"1px\")\n\t .style(\"opacity\", \"0\");\n\n\tmousePerLine.append(\"text\")\n\t .attr(\"transform\", \"translate(10,3)\");\n\n\tmouseG.append('svg:rect') // append a rect to catch mouse movements on canvas\n\t .attr('width', width) // can't catch mouse events on a g element\n\t .attr('height', height)\n\t .attr('fill', 'none')\n\t .attr('pointer-events', 'all')\n\t .on('mouseout', function() { // on mouse out hide line, circles and text\n\t\td3.select(\".mouse-line\")\n\t\t .style(\"opacity\", \"0\");\n\t\td3.selectAll(\".mouse-per-line circle\")\n\t\t .style(\"opacity\", \"0\");\n\t\td3.selectAll(\".mouse-per-line text\")\n\t\t .style(\"opacity\", \"0\");\n\n\t\t trackPoint.setMap(null);\n\t })\n\t .on('mouseover', function() { // on mouse in show line, circles and text\n\t\td3.select(\".mouse-line\")\n\t\t .style(\"opacity\", \"1\");\n\t\td3.selectAll(\".mouse-per-line circle\")\n\t\t .style(\"opacity\", \"1\");\n\t\td3.selectAll(\".mouse-per-line text\")\n\t\t .style(\"opacity\", \"1\");\n\n\t\ttrackPoint.setMap(trailDetailsMap);\n\n\t })\n\t .on('mousemove', function() { // mouse moving over canvas\n\t\tvar mouse = d3.mouse(this);\n\t\td3.select(\".mouse-line\")\n\t\t .attr(\"d\", function() {\n\t\t\tvar d = \"M\" + mouse[0] + \",\" + height;\n\t\t\td += \" \" + mouse[0] + \",\" + 0;\n\t\t\treturn d;\n\t\t });\n\n\t\td3.selectAll(\".mouse-per-line\")\n\t\t .attr(\"transform\", function(d, i) {\n\t\t\tvar xDate = x.invert(mouse[0]),\n\t\t\t\tbisect = d3.bisector(function(d) { return d.distance; }).right;\n\t\t\t\tidx = bisect(d.values, xDate);\n\n\t\t\tvar beginning = 0,\n\t\t\t\tend = lines[i].getTotalLength(),\n\t\t\t\ttarget = null;\n\n\t\t\twhile (true){\n\t\t\t target = Math.floor((beginning + end) / 2);\n\t\t\t pos = lines[i].getPointAtLength(target);\n\t\t\t if ((target === end || target === beginning) && pos.x !== mouse[0]) {\n\t\t\t\t break;\n\t\t\t }\n\t\t\t if (pos.x > mouse[0]) end = target;\n\t\t\t else if (pos.x < mouse[0]) beginning = target;\n\t\t\t else break; //position found\n\t\t\t}\n\n\t\t\td3.select(this).select('text')\n\t\t\t .text(y.invert(pos.y).toFixed(2) + 'm');\n\n\n\t\t\t// Display the point on map\n\t\t\t// Find the right distances\n\t\t\tvar distPos = 0;\n\t\t\tfor(distPos = 0; distPos < track.distances.length; distPos++){\n\t\t\t\tif(x.invert(pos.x).toFixed(2) < track.distances[distPos]){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar point = track.points[distPos];\n\n\t\t\t// To avoid resizing the circle, use a marker instead\n\t\t\ttrackPoint.setPosition(point);\n\n\t\t\t// Update the progress bars\n\t\t\t$(\"#distance-progress-bar\").width(Math.floor(100 * x.invert(pos.x).toFixed(2) / track.distance_m).toString() + \"%\");\n\t\t\t$(\"#distance-progress-bar\").text(Math.round(x.invert(pos.x).toFixed(2)) + \"m\");\n\n\t\t\t$(\"#duration-progress-bar\").width(Math.floor(100 * track.estimatedTimes[distPos] / track.estimatedTime_s).toString() + \"%\");\n\t\t\t$(\"#duration-progress-bar\").text(track.estimatedTimes[distPos].toString().toHHhMM());\n\n\t\t\t$(\"#elevation-gain-progress-bar\").width(Math.floor(100 * track.elevationGains[Math.floor(distPos/60)] / track.elevationGain_m).toString() + \"%\");\n\t\t\t$(\"#elevation-gain-progress-bar\").text(Math.round(track.elevationGains[Math.floor(distPos/60)]) + \"m\");\n\n\t\t\t$(\"#elevation-loss-progress-bar\").width(Math.floor(100 * track.elevationLosses[Math.floor(distPos/60)] / track.elevationLoss_m).toString() + \"%\");\n\t\t\t$(\"#elevation-loss-progress-bar\").text(Math.round(track.elevationLosses[Math.floor(distPos/60)]) + \"m\");\n\t\t\t$(\"#progress-bars\").slideDown();\n\n\t\t\treturn \"translate(\" + mouse[0] + \",\" + pos.y +\")\";\n\t\t });\n\t }).on('mouseout', function() { // mouse moving over canvas\n\t\t$(\"#progress-bars\").slideUp();\n\t });\n}",
"function init(){\n svg.innerHTML = \"\";\n path = document.createElementNS(\"http://www.w3.org/2000/svg\",'path');\n path.setAttribute('d', `M ${anchors[anchors.length-2]} ${anchors[anchors.length-1]}`);\n path.setAttribute('fill','none');\n path.setAttribute('stroke','black');\n path.setAttribute('stroke-width','6');\n // stroke=\"black\" fill=\"none\"\n svg.appendChild(path);\n layerPoints = Array.from({length:anchors.length/2 });\n for(let i=0;i<layerPoints.length;i++){\n layerPoints[i] = Array.from({length:i+1});\n\n for(let j=0; j<layerPoints[i].length; j++){\n layerPoints[i][j] = { };\n cookSVGobj(layerPoints[i][j]);\n layerPoints[i][j].el = document.createElementNS(\"http://www.w3.org/2000/svg\",'circle');\n layerPoints[i][j].el.setAttribute('fill' ,`rgb(${Math.floor(Math.random()*256)} , ${Math.floor(Math.random()*256)} , ${Math.floor(Math.random()*256)})` );\n layerPoints[i][j].el.setAttribute('r',\"4\");\n svg.appendChild(layerPoints[i][j].el);\n }\n }\n\n layerLines = Array.from({length:anchors.length/2 });\n for(let i=0 ; i<layerLines.length;i++){\n layerLines[i] = Array.from({length:i});\n\n for(let j=0; j<layerLines[i].length;j++){\n layerLines[i][j] = {};\n cookSVGobj(layerLines[i][j]);\n\n layerLines[i][j].el = document.createElementNS(\"http://www.w3.org/2000/svg\",'line');\n layerLines[i][j].el.setAttribute('stroke' , `rgb(${Math.floor(Math.random()*256)} , ${Math.floor(Math.random()*256)} , ${Math.floor(Math.random()*256)})` );\n\n // layerLines[i][j].x1 = layerPoints[i][j].x;\n // layerLines[i][j].y1 = layerPoints[i][j].y;\n // layerLines[i][j].x2 = layerPoints[i][j+1].x;\n // layerLines[i][j].y2 = layerPoints[i][j+1].y;\n\n svg.appendChild(layerLines[i][j].el);\n\n }\n }\n \n}",
"function drawLine(svg){\t\n\t\t\tsvg.style.strokeOpacity = '0.6';\n\t\t\tvar length = svg.getTotalLength();\n\t\t\t// Clear any previous transition\n\t\t\tsvg.style.transition = svg.style.WebkitTransition ='none';\n\t\t\t// Set up the starting positions\n\t\t\tsvg.style.strokeDasharray = length + ' ' + length;\n\t\t\tsvg.style.strokeDashoffset = length;\n\t\t\t// Trigger a layout so styles are calculated & the browser\n\t\t\t// picks up the starting position before animating\n\t\t\tsvg.getBoundingClientRect();\n\t\t\t// Define our transition\n\t\t\tsvg.style.transition = svg.style.WebkitTransition = 'stroke-dashoffset 2s ease-in-out';\n\t\t\t// Go!\n\t\t\tsvg.style.strokeDashoffset = '0';\n\t\t}",
"function drawLineGraph(request, receivedData) {\n\tif(receivedData.length == 1) {\n\t\t// error occured - probably the form isn't completely filled in\n\t\treturn;\n\t}\n\tvar minYear = 1e1000;\n\tvar maxYear = -1e1000;\n\tvar maxValue = -1e1000;\n\tvar minI = -1;\n\tvar maxI = -1;\n\n\tfor(var i=1; i<receivedData.length; i++) {\n\t\tif(parseFloat(receivedData[i][2]) > maxValue) {\n\t\t\tmaxValue = parseFloat(receivedData[i][2]);\n\t\t}\n\t\tif(parseFloat(receivedData[i][2]) != 0 &&\n\t\t\tparseFloat(receivedData[i][1]) < minYear) {\n\t\t\tminYear = parseFloat(receivedData[i][1]);\n\t\t\tminI = i;\n\t\t}\n\t\tif(parseFloat(receivedData[i][2]) != 0 &&\n\t\t\tparseFloat(receivedData[i][1]) > maxYear) {\n\t\t\tmaxYear = parseFloat(receivedData[i][1]);\n\t\t\tmaxI = i;\n\t\t}\n\t}\n\n\tcvs.width = cvs.width;\n\n\tvar w = cvs.width;\n\tvar h = cvs.height;\n\n\tc.font = \"24px Arial\";\n\tfontSize = 24;\n\t// EX: \"Population of Nebraska (1972 - 2012)\"\n\tvar titleStr = \"\";\n\ttitleStr += receivedData[0][2];\n\ttitleStr += \" of \" + request[\"state\"];\n\ttitleStr += \" (\" + minYear + \" - \" + maxYear + \")\";\n\tdrawLabel(titleStr, w/2, 50);\n\tc.font = \"12px Arial\";\n\tfontSize = 12;\n\n\tc.beginPath();\n\tc.moveTo(45, 150);\n\tc.lineTo(55, 150);\n\tc.stroke();\n\tc.fillText(numberToString(maxValue), 0, 156);\n\n\tc.lineWidth = 4;\n\tdrawArrow(50, h-50, 50, 100);\n\tdrawArrow(48, h-50, w-20, h-50);\n\n\tc.beginPath();\n\tvar x = 0;\n\tvar y = parseFloat(receivedData[minI][2])/maxValue;\n\tc.moveTo((w-100)*x+50, (h-200) * (1-y) + 150);\n\tfor(var i=minI+1; i<=maxI; i++) {\n\t\tx = (parseFloat(receivedData[i][1])-minYear)/(maxYear-minYear);\n\t\ty = parseFloat(receivedData[i][2])/maxValue;\n\t\tc.lineTo((w-100)*x+50, (h-200) * (1-y) + 150);\n\t}\n\tc.stroke();\n\n\tif(minYear != maxYear) {\n\t\tfor(var i=minYear; i<=maxYear; i+=10) {\n\t\t\tvar t = Math.floor(i/10)*10;\n\t\t\tx = (t-minYear)/(maxYear-minYear);\n\t\t\tdrawLabel(t, (w-100)*x+50, h-40, Math.PI/2);\n\t\t}\n\n\t\tc.beginPath();\n\t\tfor(var i=minYear; i<=maxYear; i+=10) {\n\t\t\tvar t = Math.floor(i/10)*10;\n\t\t\tx = (t-minYear)/(maxYear-minYear);\n\t\t\tc.moveTo((w-100)*x+50, h-45);\n\t\t\tc.lineTo((w-100)*x+50, h-55);\n\t\t}\n\t}\n}",
"function draw_lines_between_gnodes() {\n\n // gnodes is a global var\n gnodes.each( function(d, i) {\n // - for each node/d\n for (i in d.talksto) {\n // - find all they talk to\n d3.selectAll(\"image#\" + d.talksto[i] )\n .each( function(dd, ii) {\n //\n //draw_a_line( d, dd);\n\n //console.log( d.midx, d.midy, dd.midx, dd.midy);\n var cls1 = d.id + \"-\" + dd.id;\n var cls2 = dd.id + \"-\" + d.id;\n\n if (d3.selectAll('line.' + cls1).size() ||\n d3.selectAll('line.' + cls2).size() ) {\n console.log(\"not line: \" + cls1 + \" /or/ \" + cls2 );\n } else {\n classes = [ cls1, cls2, d.system, dd.system ]\n svg.append('line')\n .style(\"stroke\", \"black\") // look up CRYPTO RISK\n .attr(\"x1\", d.midx)\n .attr(\"y1\", d.midy)\n .attr(\"x2\", dd.midx)\n .attr(\"y2\", dd.midy)\n .attr('class', unique(classes).join(\" \") );\n }\n }); //each\n } // NOPE\n });\n }",
"function createMapLine(){\n\tvar pointX = portMapInfo[0].X;\n\tvar pointY = portMapInfo[0].Y;\n\tvar pointX2 = portMapInfo[0].X2;\n\tvar pointY2 = portMapInfo[0].Y2;\n\tvar mapLine = new Kinetic.Line({\n\t\tpoints: [pointX, pointY, pointX2, pointY2],\n\t\tstroke: 'black',\n\t\tstrokeWidth: 3,\n\t\tlineCap: 'round',\n\t\tlineJoin: 'round',\n\t\tDestination: portMapInfo[0].Destination,\n\t\tSource: portMapInfo[0].Source\n\t});\n\treturn mapLine;\n}",
"addLineToLinesDrawn() {\n if (!Array.isArray(this._currentLineCoordinates)) throw Error('Line coordinates must be an array')\n this._linesDrawn.push(this._currentLineCoordinates)\n }",
"function displayLineGraph_Production(Data, countryName) {\n\n // Filter production Data to return only data for matching country name\n let productionData = Data.filter(production => production.Attribute == \"Production\");\n let countryProduction = productionData.filter(country => country.Country_Name == countryName);\n countryProduction = countryProduction.filter(country => country.Year >= 1990);\n\n // Filter Arabica Data to return only data for matching country name\n let ArabicaData = Data.filter(production => production.Attribute == \"Arabica Production\");\n let ArabicaProduction = ArabicaData.filter(country => country.Country_Name == countryName);\n ArabicaProduction = ArabicaProduction.filter(country => country.Year >= 1990);\n\n // Filter Robusta Data to return only data for matching country name\n let RobustaData = Data.filter(production => production.Attribute == \"Robusta Production\");\n let RobustaProduction = RobustaData.filter(country => country.Country_Name == countryName);\n RobustaProduction = RobustaProduction.filter(country => country.Year >= 1990);\n\n\n\n\n let yearsP = [];\n let productionValues = [];\n\n for (let i=0; i < countryProduction.length; i++) {\n // Extract years and production values from data \n yearsP.push(countryProduction[i].Year);\n productionValues.push(countryProduction[i].Value);\n }\n\n let yearsA = [];\n let ArabicaValues = [];\n\n for (let i=0; i < ArabicaProduction.length; i++) {\n // Extract years and production values from data \n yearsA.push(ArabicaProduction[i].Year);\n ArabicaValues.push(ArabicaProduction[i].Value);\n }\n\n let yearsR = [];\n let RobustaValues = [];\n\n for (let i=0; i < RobustaProduction.length; i++) {\n // Extract years and production values from data \n yearsR.push(RobustaProduction[i].Year);\n RobustaValues.push(RobustaProduction[i].Value);\n }\n\n\n\n\n // Plot Production data points\n let lineData_prod = {\n x: yearsP,\n y: productionValues,\n name: \"Total Production\",\n type: \"scatter\",\n mode: \"lines+markers\"\n };\n \n\n // Plot Arabica Production points\n let lineData_arabica = {\n x: yearsA,\n y: ArabicaValues,\n color: \"orange\",\n name: \"Arabica Production\",\n type: \"line\"\n };\n\n // Plot Robusta Production points\n let lineData_robusta = {\n x: yearsR,\n y: RobustaValues,\n color: \"green\",\n name: \"Robusta Production\",\n type: \"line\"\n };\n\n\n // // Place both data sets together in array\n let lineData = [lineData_prod, lineData_arabica, lineData_robusta]; // , lineData_predicted\n\n // Set title for line graph and x and y axes\n let lineLayout = {\n title: countryName + \" - Coffee Production Total, Arabica and Robusta Separate 1990 to 2020\",\n xaxis: { title: \"Years\" },\n yaxis: { title: \"Production (1000 * 60 Kg Bags)\" }\n };\n \n // Use plotly to display line graph at div ID \"line2\" with lineData and lineLayout\n Plotly.newPlot('prodLine', lineData, lineLayout);\n}",
"draw(ctx) {\r\n if (this.isDistanced) {\r\n this.distanceGraph();\r\n }\r\n // draw all nodes and store them in grid array\r\n this.nodeList.forEach(node => {\r\n node.draw(ctx);\r\n storeNodeAt(node, node.x, node.y);\r\n });\r\n\r\n // draw all edges\r\n this.edgeList.forEach(edge => {\r\n edge.draw(ctx);\r\n });\r\n\r\n\r\n }",
"function setGraticule(map, path){\n //create graticule generator\n var graticule = d3.geoGraticule()\n .step([8, 8]); //place graticule lines every 5 degrees of longitude and latitude\n //create graticule background\n var gratBackground = map.append(\"path\")\n .datum(graticule.outline())//bind graticule background\n .attr(\"class\", \"gratBackground\") //assign class for style\n .attr(\"d\", path); //project graticule\n\n //create graticule lines\n var gratLines = map.selectAll(\".gratLines\") //select graticule elements that will be created\n .data(graticule.lines()) //bind graticule lines to each element that will be created\n .enter()\n .append(\"path\") //append each element to the svg as a path element\n .attr(\"class\", \"gratLines\") //assign class for styling\n .attr(\"d\", path);\n }",
"function drawRoute(map, route, color) {\n for (var i = 0; i < route.length; i++) {\n stop = route[i][0];\n var edge = [];\n edge.push(stop.coords);\n\n /* loop to handle forks */\n for (var j = 0; j < route[i][1].length; j++) {\n edge.push(route[i][1][j].coords)\n var path = new google.maps.Polyline({\n path: edge,\n geodesic: true,\n strokeColor: color,\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n path.setMap(map);\n edge.pop();\n }\n }\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Encodes a single segment of a resource path into the given result | function encodeSegment(segment, resultBuf) {
var result = resultBuf;
var length = segment.length;
for (var i = 0; i < length; i++) {
var c = segment.charAt(i);
switch (c) {
case '\0':
result += escapeChar + encodedNul;
break;
case escapeChar:
result += escapeChar + encodedEscape;
break;
default:
result += c;
}
}
return result;
} | [
"function encodeUriPath(pathParam) { \n /*if (uriPath.indexOf(\"/\") === -1) {\n return encodeUriPathComponent(uriPath);\n }\n var slashSplitPath = uriPath.split('/');\n for (var pathCptInd in slashSplitPath) {\n slashSplitPath[pathCptInd] = encodeUriPathComponent(slashSplitPath[pathCptInd]); // encoding ! NOT encodeURIComponent\n }\n return slashSplitPath.join('/');\n //return encodeURI(idValue); // encoding !\n // (rather than encodeURIComponent which would not accept unencoded slashes)*/\n var encParts, part, parts, _i, _len;\n if (pathParam.indexOf(\"/\") === -1) {\n return encodeUriPathComponent(pathParam);\n } else if (pathParam.indexOf(\"//\") !== -1) { // else '//' (in path param that is ex. itself an URI)\n // would be equivalent to '/' in URI semantics, so to avoid that encode also '/' instead\n return encodeURIComponent(pathParam);\n } else {\n parts = pathParam.split(\"/\");\n encParts = [];\n for (_i = 0, _len = parts.length; _i < _len; _i++) {\n part = parts[_i];\n ///encParts.push(encodeURIComponent(part));\n encParts.push(encodeUriPathComponent(part));\n }\n return encParts.join(\"/\");\n }\n }",
"function encodeURL(path)\n{\n return encodeURIComponent(path).replace(/%2F/g,'/');\n}",
"function genRouteCode(routeConfig, res) {\n const { path: routePath, component, modules = {}, context, routes: subroutes, priority, exact, ...props } = routeConfig;\n if (typeof routePath !== 'string' || !component) {\n throw new Error(`Invalid route config: path must be a string and component is required.\n${JSON.stringify(routeConfig)}`);\n }\n if (!subroutes) {\n res.routesPaths.push(routePath);\n }\n const routeHash = (0, utils_1.simpleHash)(JSON.stringify(routeConfig), 3);\n res.routesChunkNames[`${routePath}-${routeHash}`] = {\n // Avoid clash with a prop called \"component\"\n ...genChunkNames({ __comp: component }, 'component', component, res),\n ...(context &&\n genChunkNames({ __context: context }, 'context', routePath, res)),\n ...genChunkNames(modules, 'module', routePath, res),\n };\n return serializeRouteConfig({\n routePath: routePath.replace(/'/g, \"\\\\'\"),\n routeHash,\n subroutesCodeStrings: subroutes?.map((r) => genRouteCode(r, res)),\n exact,\n props,\n });\n}",
"function addPath(uri, path) {\n\t\turi = uri.split(\"?\")[0].split(\"#\")[0];\n\t\tif (uri.substr(-1) !== '/') {\n\t\t\turi += '/';\n\t\t}\n\n\t\t// remove special characters from the string (e.g., '/', '..', '?')\n\t\tvar lastSegment = path.replace(/[^\\w\\s\\-_]/gi, '');\n\t\treturn uri + encodeURIComponent(lastSegment)\n\t}",
"function pathify(path, filename) {\r\n return path + '\\\\' + filename;\r\n}",
"function makePath(path){\n return '/' + [prefix, path].join('/');\n }",
"GenerateSegments(argument) {\n var result = argument.split(\"/\");\n if (result.length > 0) {\n if (result[0] == \"\") {\n result.shift();\n }\n }\n if (result.length > 0) {\n if (result[result.length - 1] == \"\") {\n result.pop();\n }\n }\n return result;\n }",
"function simplify(result, character)\n {\n // a '/' indicates a new possible match needs to be evaluated, and the\n //previous match data is stored into the result variable and clears\n //the buffers\n if(character === '/')\n {\n result += `${xBuffer}${oBuffer}/`;\n xBuffer = 0;\n oBuffer = 0;\n }\n //checks if tile contains an x or an o and then increases the respective\n //buffer\n else if(character === 'x')\n {\n xBuffer++;\n }\n else if(character === 'o')\n {\n oBuffer++;\n }\n return result;\n }",
"function convert(element) {\n let segments = [],\n pathSegList = element.pathSegList\n\n let prev = pathSegList[0]\n for (let i = 1; i < pathSegList.length; i++) {\n let cur = pathSegList[i]\n segments.push(converters[cur.pathSegType](prev, cur))\n prev = cur\n }\n\n return segments\n}",
"function resolve (cid, path, callback) {\n let value\n\n doUntil(\n (cb) => {\n self.block.get(cid, (err, block) => {\n if (err) return cb(err)\n\n const r = self._ipld.resolvers[cid.codec]\n\n if (!r) {\n return cb(new Error(`No resolver found for codec \"${cid.codec}\"`))\n }\n\n r.resolver.resolve(block.data, path, (err, result) => {\n if (err) return cb(err)\n value = result.value\n path = result.remainderPath\n cb()\n })\n })\n },\n () => {\n const endReached = !path || path === '/'\n\n if (endReached) {\n return true\n }\n\n if (value) {\n cid = new CID(value['/'])\n }\n\n return false\n },\n (err) => {\n if (err) return callback(err)\n if (value && value['/']) return callback(null, new CID(value['/']))\n callback()\n }\n )\n }",
"function joinPath(portion1, portion2) {\n\tlet a = [...portion1].filter(x => x.match(/[a-z0-9]/gi));\n\tlet b = [...portion2].filter(x => x.match(/[a-z0-9]/gi));\n\n\ta.push(\"/\");\n\t\n\treturn [...a, ...b].join(\"\");\n}",
"get pathPart() {\n return this.getStringAttribute('path_part');\n }",
"function encode_root(v) {\n return v;\n }",
"function concatPath(a, b) {\n if (NodePath.sep === \"\\\\\") {\n return NodePath.normalize(a + \"/\" + b).replace(/\\\\/g, \"/\");\n }\n else {\n return NodePath.normalize(a + \"/\" + b);\n }\n}",
"static serializePath(startPos, path, color = \"orange\") {\n let serializedPath = \"\";\n let lastPosition = startPos;\n this.circle(startPos, color);\n for (let position of path) {\n if (position.roomName === lastPosition.roomName) {\n new RoomVisual(position.roomName).line(position, lastPosition, {color: color, lineStyle: \"dashed\"});\n serializedPath += lastPosition.getDirectionTo(position);\n }\n lastPosition = position;\n }\n return serializedPath;\n }",
"function concatURI(a, b) {\n let started = b[0] === \"/\";\n let ended = a[a.length - 1] === \"/\";\n if (started && ended) {\n return `${a}${b.substr(1)}`;\n }\n if (started || ended) {\n return `${a}${b}`;\n }\n return `${a}/${b}`;\n}",
"function reduce(map, path) {\n\t\tvar mapNode, prefix, split, splits = getResourcePathSplits(path),\n\t\t\tsubValue, suffix;\n\t\twhile (splits.length) {\n\t\t\tsplit = splits.shift();\n\t\t\tsuffix = split[1];\n\t\t\tprefix = suffix ? split[0] + '/' : split[0];\n\t\t\tmapNode = map[prefix];\n\t\t\tif (mapNode) {\n\t\t\t\tif (!suffix || typeof mapNode === 'string') {\n\t\t\t\t\treturn { map: mapNode, prefix: prefix, suffix: suffix };\n\t\t\t\t}\n\t\t\t\tif (typeof mapNode === 'object') {\n\t\t\t\t\tsubValue = reduce(mapNode, suffix);\n\t\t\t\t\tif (subValue) {\n\t\t\t\t\t\tsubValue.prefix = prefix + '/' + subValue.prefix;\n\t\t\t\t\t\treturn subValue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn { map: map, prefix: '', suffix: path };\n\t}",
"function _createResource({domain, path, contentType, token, args}) {\n //Remove the path if we are running in function mode, so paths in original action work\n return post.func(args)({\n domain,\n token,\n path: '/resources',\n headers: {\n 'Content-Type': contentType\n },\n data: {}\n }).then(({response}) => {\n var id = response.headers.location.split('/')\n id = id[id.length-1]\n\n return put.func(args)({\n domain,\n path,\n token,\n headers: {\n 'Content-Type': contentType\n },\n data: {\n _id:'resources/'+id,\n _rev: '0-0'\n }\n });\n });\n}",
"function getSegmentId(category){\n\tif(category === \"Music\") {\n\t\treturn \"KZFzniwnSyZfZ7v7nJ\";\n\t} else if(category === \"Sports\") {\n\t\treturn \"KZFzniwnSyZfZ7v7nE\";\n\t} else if(category === \"Arts & Theatre\") {\n\t\treturn \"KZFzniwnSyZfZ7v7na\";\n\t} else if(category === \"Film\") {\n\t\treturn \"KZFzniwnSyZfZ7v7nn\";\n\t} else if(category === \"Miscellaneous\") {\n\t\treturn \"KZFzniwnSyZfZ7v7n1\";\n\t} else {\n\t\treturn \"\";\n\t}\n}",
"static sanitizeUssPathForRestCall(ussPath) {\n let sanitizedPath = path.posix.normalize(ussPath);\n if (sanitizedPath.charAt(0) === \"/\") {\n // trim leading slash from unix files - API doesn't like it\n sanitizedPath = sanitizedPath.substring(1);\n }\n return encodeURIComponent(sanitizedPath);\n }"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check XRef types (whether the file uses tables or streams) | checkXrefType() {
// check for xref .... trailer occurrences in file
const xrefTableMatch = /[^start]xref(.*?)(?=trailer)/gs
this.xrefTables = this.docString.match(xrefTableMatch)
// check for /XRef dictionary entries
const xrefStreamMatch = /\/XRef/gms
this.xrefStreams = this.docString.match(xrefStreamMatch)
} | [
"function isReqXml( req ) {\n\tlet headers = req.headers;\n\treturn ( 'content-type' in headers\n\t\t\t && ( headers['content-type'].includes( 'xml' ) ||\n\t\t\t\t headers['content-type'].includes( 'XML' )));\n}",
"function fileTypeValidate(fileName,fileType){\r\n\r\n\t//get file name and extention name\r\n\t//var fileName=$(\"PB__FileInput\").value;\r\n\tvar fileExName=getFileExName(fileName);\r\n\tfileExName=fileExName.toLowerCase();\r\n\t\r\n\t//define file type list\r\n\t//image file list\r\n\tvar imageList=new Array(\"jpg\",\"gif\",\"jpeg\",\"bmp\",\"png\");\r\n\r\n\r\n\t//text file list\r\n\tvar textList=new Array(\"txt\",\"log\",\"text\",\"csv\");\r\n\r\n\t\r\n\t//binary file list\r\n\tvar binList=new Array(\"exe\",\"swf\",\"zip\",\"rar\");\r\n\t\r\n\t//other file list\r\n\tvar oList=new Array(\"doc\",\"docx\",\"xls\",\"xlsx\",\"ppt\",\"pptx\",\"pdf\",\"odt\",\"ods\",\"odp\",\"zip\",\"rar\");\r\n\t\r\n\t//image file validate\r\n\tif(fileType==\"IMAGE\"){\r\n\t\tfor(var i=0;i<imageList.length;i++){\r\n\t\t\tif(imageList[i].toString()==fileExName){\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t//text file validate\r\n\t}else if(fileType==\"TEXT_FILE\"){\r\n\t\tfor(var i=0;i<textList.length;i++){\r\n\t\t\tif(textList[i].toString()==fileExName){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t//binary file validate\r\n\t}else if(fileType==\"BINARY_FILE\"){\r\n\t\tfor(var i=0;i<textList.length;i++){\r\n\t\t\tif(textList[i].toString()==fileExName){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}else if(fileType==\"PRODUCT_BROCHURE\" || fileType==\"ASSEMBLY_LIST\" || fileType==\"QUALITY_ASSURANCE\" ){\r\n\t\tfor(var i=0;i<oList.length;i++){\r\n\t\t\tif(oList[i].toString()==fileExName){\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\t\r\n\treturn false;\r\n}",
"visitXmltype_storage(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitXmltype_table(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function cs_contains_invalid_file_types(files, accepted_file_types){\r\n\t\r\n\tvar uploaded_files = files;\r\n\t\r\n\tvar invalid_file_types = 0;\r\n\t\r\n\tfor(var i = 0; i < uploaded_files.length; i++){\r\n\t\tif(!cs_validate_file_type(uploaded_files[i], accepted_file_types))\r\n\t\t\tinvalid_file_types++;\r\n\t}\r\n\t\r\n\treturn (invalid_file_types > 0) ? true : false;\r\n\t\r\n}",
"function isDataSet( stream, typeSource ){\n\n let readStream = new RW.ReadStream( stream );\n\n //readStream.increment( 23 );//для тестирования\n\n let checkDataElement = true;\n\n if (typeSource === 'File'){\n\n console.log('File');\n\n //1 признак\n //let sum = 0; for(i = 0; i < 32; i++) sum+=readStream.read(C.TYPE_UINT32);\n let checkPrefix = true; for(i = 0; i < 32; i++) checkPrefix = checkPrefix&&( readStream.read(C.TYPE_UINT32) === 0 );\n\n //2 признак\n let checkSign = (readStream.readString(4,C.TYPE_ASCII) === 'DICM');\n\n\n checkDataElement = checkPrefix&&checkSign;\n\n\n console.log( checkPrefix + ' ; ' + checkSign );\n\n\n }\n else{\n console.log('Other');\n }\n\n\n if(checkDataElement){//делаем анализ, если checkDataElement = true и не был изменен на false в блоке if(typeSource === 'File') {}\n\n\n }\n else{\n console.log(' it is not DataSet !!! ');\n return false;\n }\n\n}",
"function checkRefopts ( )\n {\n \tparams.reftypes = getCheckList(\"pm_reftypes\");\n \tif ( params.reftypes == \"auth,class\" ) params.reftypes = 'taxonomy';\n \telse if ( params.reftypes == \"auth,class,ops\" ) params.reftypes = 'auth,ops';\n \telse if ( params.reftypes == \"auth,class,ops,occs,colls\" ) params.reftypes = 'all'\n \telse if ( params.reftypes == \"auth,ops,occs,colls\" ) params.reftypes = 'all'\n \tupdateFormState();\n }",
"function verifyMimeType(execptedMimeType, test) {\n return function (err, file) {\n test.expect(2);\n if (err) {\n throw err;\n }\n var stream = fs.createReadStream(file);\n magic(stream, function (err, mime, output) {\n if (err) {\n throw err;\n }\n test.equal(mime.type, execptedMimeType);\n var targetFile = path.join(tempfile, path.basename(file));\n var writeStream = fs.createWriteStream(targetFile);\n output.pipe(writeStream);\n writeStream.on(\"finish\", function () {\n var source = fs.readFileSync(file);\n var target = fs.readFileSync(targetFile);\n test.ok(source.equals(target), \"Source and target file contents must match.\");\n test.done();\n });\n });\n }\n}",
"function isDefinitionFile(fileName) {\n return /\\.d\\.tsx?$/i.test(fileName || '');\n}",
"function check (xml, path) {\n var error = false;\n\n if (!xml) {\n error = 'There is a syntax error.';\n }\n\n if (xml.documentElement.nodeName == 'parsererror') {\n error = xml.documentElement.textContent;\n }\n\n if (path && error) {\n miniLOL.error('Error while parsing #{path}\\n\\n#{error}'.interpolate({\n path: path,\n error: error\n }), true);\n\n return error;\n }\n\n return error;\n }",
"static parseTypedFiles(callback){\n //klassenvariablen mit Dateinamen im typ ordner\n BinaryBRTypedFile.BR_TYPE_FILES =[\n \"myStruct\"\n // \"fatdumb\"\n //mit komma weitere dateien einhängen...\n ];\n //hier werden rohinformationen der Structs abgelegt\n BinaryBRTypedFile.brStructs = [];\n //zähler für gefundene structs, interne nutzung\n BinaryBRTypedFile.brStructsParsed = 0;\n BinaryBRTypedFile.filesParsed = 0;\n\n var rq = new Array(BinaryBRTypedFile.BR_TYPE_FILES.length);\n\n BinaryBRTypedFile.BR_TYPE_FILES.forEach(function(typ_e, index){ //geht durch alle BR_TYPE_FILES im ordner\n\n rq[index] = new XMLHttpRequest();\n rq[index].responseType=\"text\";\n rq[index].open('GET', '\\\\typ\\\\' + typ_e + '.typ', true);\n rq[index].onload = function(){\n var s=rq[index].response;\n s=s.replace(/\\s/g,''); //entfernt whitespaces\n s=s.replace(/\\(\\*(.*?)\\*\\)/g,'');\t//entfernt kommentare\n s=s.substr(4,s.length - 12);\t//entfernt hauptrahmen TYPE/END_TYPE\n\n while (s.indexOf(\":STRUCT\")!=-1){//alle struct container übernehmen und splitten\n var n=s.substr(0,s.indexOf(\":STRUCT\")); //holt structname\n if (BinaryBRTypedFile.brStructs.find(parsed_structs_e => parsed_structs_e.name==n)!=undefined) {\n alert(\"multiple use of \" + n + \" in B&R structfile: \" + typ_e);\n return 0;\n }else{\n var struct = new BRStructType(n);//erzeugt neue hüllklasse\n s=s.substr(s.indexOf(\":STRUCT\")+7); //entfernt struct header structname\n //alert(s);\n n=s.substr(0,s.indexOf(\"END_STRUCT;\")-1); //extrahiert in neuen string ohne struct tail, -1 für letztes semikolon (split)\n //alert(n);\n s=s.substr(s.indexOf(\"END_STRUCT;\") + 11); //entfernt entnommenen teilstring\n //alert(s.length);\n struct.brRawParse=n.split(\";\"); //kindelemente schon im 2 dimensionalen arry aufbereiten (0-nameStr,1-typStr)[unterelement]\n for (var i=0; i<struct.brRawParse.length;i++){ //alle unterstrukturen\n //pauschal initialisierung z.B. \":=1\" am ende abschneiden\n if (struct.brRawParse[i].indexOf(\":=\")!=-1){\n struct.brRawParse[i]=struct.brRawParse[i].substr(0,struct.brRawParse[i].indexOf(\":=\"));\n //\talert(element);\n }\n var test = struct.brRawParse[i].split(':');\n //alert(test[1]);\n //alert(singleChildStr[0] + \"--\" + singleChildStr[1] + \"--\" + singleChildStr);\n if (test.length!=2) {\n alert(\"child element not formed well: \"+ struct.brRawParse[i] + \" in \" + struct.name);\n return 0;\n }\n struct.brRawParse[i]=[test[0],test[1]];\n }\n //alert (struct.brRawParse[0]);\n }\n BinaryBRTypedFile.brStructs.push(struct); //object\n BinaryBRTypedFile.brStructsParsed++;\n }//end_while\n BinaryBRTypedFile.filesParsed++;\n if (BinaryBRTypedFile.filesParsed === BinaryBRTypedFile.BR_TYPE_FILES.length){\n //alert(callback);\n BinaryBRTypedFile.brStructs.forEach(function(struct_e, index){ //geht durch erzeugte structs und hängt wert für nachkorrektur an\n //alert(BinaryBRTypedFile.getCorrectionOperatorFromRawParse(struct_e.brRawParse));\n BinaryBRTypedFile.brStructs[index].moduloOperatorForOffsetCorrection=BinaryBRTypedFile.getCorrectionOperatorFromRawParse(struct_e.brRawParse);\n });\n\n if (typeof(callback) != \"undefined\") {\n callback();\n }else {\n //alert(BinaryBRTypedFile.filesParsed);\n }\n }\n };\n\n rq[index].send();\n });\n }",
"function ISREF(value) {\n if (!value) return false;\n return value.isRef === true;\n}",
"function areValidRuns(){\n // Check consistency of file types\n var re = /(?:\\.([^.]+))?$/; // Regex for file type\n var ext = re.exec(importPaths.runs)[1];\n var is_consistent = true;\n\n if (importPaths.runs.length) {\n for (let i = 0; i < importPaths.runs.length; i++) {\n let test = re.exec(importPaths.runs[i])[1]\n if (test != ext) {\n is_consistent = false;\n break;\n }\n \n }\n }\n return is_consistent;\n}",
"function check(...types) {\n for (const type of types) {\n if (type === currentToken().type) {\n return true;\n }\n }\n return false;\n }",
"function ProcessableXML() {\n\n}",
"function isTypeScriptFile(fileName) {\n return /\\.tsx?$/i.test(fileName || '');\n}",
"parseXML(rawText) {\n // TODO: different code paths for XLIFF 1.2 vs. 2.0 (this is the only way to support both)\n // Document.init();\n // Working - just return the Document object from this function\n const deferred = $q.defer();\n const self = this;\n\n // <xliff xmlns=\"urn:oasis:names:tc:xliff:document:2.0\" version=\"2.0\"\n\n const xml = parser.parseFromString(rawText, 'text/xml');\n\n // Parsing error?\n const parserError = xml.querySelector('parsererror');\n // if (parserError !== null) {\n if (xml.documentElement.nodeName == 'parsererror') {\n console.log('Error while parsing XLIFF file');\n $log.error('Error while parsing');\n const errorString = new XMLSerializer().serializeToString(parserError);\n $log.error(errorString);\n\n $log.error(new XMLSerializer().serializeToString(xml));\n self.parsingError = true;\n return;\n } else {\n self.parsingError = false;\n }\n\n const Document = {};\n // Set Document DOM to the parsed result\n Document.DOM = xml;\n // Working - the XLIFF parser returns a Document representation of the XLIFF\n Document.segments = [];\n Document.sourceLang = sourceLang;\n Document.targetLang = targetLang;\n\n Document.segmentStates = [];\n\n const file = xml.querySelector('file');\n const xliffTag = xml.querySelector('xliff');\n\n $log.log('xliff version: ');\n $log.log(xliffTag.getAttribute('version'));\n\n // TODO: fork here, depending on xliff version -- we want to support both 2.0 and 1.2 for the time being\n\n // Read the source and target language - set defaults to English and German\n var sourceLang = file.getAttribute('source-language');\n if (!sourceLang) sourceLang = 'en';\n Document.sourceLang = sourceLang;\n\n var targetLang = file.getAttribute('target-language');\n if (!targetLang) targetLang = 'de';\n Document.targetLang = targetLang;\n\n // Working -- segmentation with <seg-source> and <mrk> tags is Optional\n // add support for pure <source> and <target>\n const sourceSegments = this.getTranslatableSegments(xml);\n\n // for every segment, get its matching target mrk, if it exists - note: it may not exist\n const targetSegments = _.map(sourceSegments,\n (seg) => {\n if (seg.nodeName === 'mrk') {\n return self.getMrkTarget(xml, seg);\n }\n // there's no mrks inside <target>, just a <target> -- TODO: do we require target nodes to exist?\n return seg.parentNode.querySelector('target');\n },\n );\n\n // we can assume that translators will want to translate every segment, so there should be at least an\n // empty target node corresponding to each source node\n const sourceWithTarget = _.zip(sourceSegments, targetSegments);\n _.each(sourceWithTarget,\n (seg) => {\n const sourceText = seg[0].textContent;\n const targetText = seg[1] ? seg[1].textContent : '';\n if (!seg[1]) {\n const mid = seg[0].getAttribute('mid');\n $log.info('Target segment missing: ' + mid);\n seg[1] = self.createNewMrkTarget(Document.DOM, seg[0], '', targetLang);\n }\n\n const segPair = {\n source: seg[0].textContent,\n target: seg[1].textContent,\n sourceDOM: seg[0],\n targetDOM: seg[1],\n // TODO: the segment state should be taken from the XLIFF see XliffTwoParser\n state: 'initial',\n };\n\n // Add the pairs so we can access both sides from a single ngRepeat\n Document.segments.push(segPair);\n\n // TODO: make this useful\n // Document.translatableNodes.push(seg);\n });\n\n // TODO: remove the document-loaded event, and use the result of the resolved promise directly\n // tell the world that the document loaded\n $log.log('Xliff parser returning');\n // $log.log(Document);\n deferred.resolve(Document);\n\n // return Document;\n return deferred.promise;\n }",
"function isStringType(contentType){\n var stringTypes = ['text/plain', 'application/javascript', 'text/html', 'text/css', 'application/json',\n 'application/ld+json','application/manifest+json', 'image/svg+xml'];\n\n return stringTypes.includes(contentType);\n}",
"function verifyByteRangeAsString(fileEntry, offset, contents, onSuccess)\n{\n verifyFileContents(fileEntry, verifyByteRangeAsStringHelper, offset, contents, onSuccess);\n}"
] | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.