query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Description: Constructs an html representation of NCX navPoints, based on an object of navPoint information Rationale: This is a recursive method, as NCX navPoint elements can nest 0 or more of themselves as children | function addNavPointElements($navPointDOM, $ol) {
// Add the current navPoint element to the TOC html
var navText = $navPointDOM.children("navLabel").text().trim();
var navHref = $navPointDOM.children("content").attr("src");
var $navPointLi = $('<li class="nav-elem"></li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function review_make_dot_nav() {\n var nav_html = '', total_page, i;\n // find out how many pages\n total_page = Math.ceil($('.reviews_list .one_review').length / per_page);\n // append one span for each page\n for (i = 1; i <= total_page; i++) {\n nav_html = nav_html ... | [
"0.5361079",
"0.5348208",
"0.51471287",
"0.5126762",
"0.50669813",
"0.50641215",
"0.5023749",
"0.50090843",
"0.49954113",
"0.49905363",
"0.49780083",
"0.49646667",
"0.49459743",
"0.4921388",
"0.48212117",
"0.4810258",
"0.4801293",
"0.47928154",
"0.47898248",
"0.4780181",
"0.4... | 0.62268966 | 1 |
parse: process xml doc according to the given json template | function parse( template, xmldoc, node ) {
if( node === undefined ) {
node = xmldoc;
}
if( typeOf( template ) === 'array' ) {
return parseArray( template, xmldoc, node );
}
else if( typeOf( template ) === 'object' ) {
return parseObject( template, xmldoc, node );
}
else {
return parseItem( template, xmld... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readTemplates(xml) {\n\t/*\n\t * Lecture des éléments du template au format de stockage définitif.\n\t * Si pas d'élément template, voir ci-deesous 'else'\n\t */\n\tif (!xml) return;\n\tvar eltDesc = $(xml).find(\"templateDesc\");\n if (eltDesc.length>0) {\n trjs.log.alert('Old format: check and... | [
"0.5788729",
"0.54563844",
"0.536026",
"0.5308152",
"0.53024304",
"0.5287388",
"0.5276617",
"0.5176402",
"0.5174911",
"0.5174911",
"0.513169",
"0.5099659",
"0.5080961",
"0.5026921",
"0.49585694",
"0.49581292",
"0.495664",
"0.49531546",
"0.49437028",
"0.49353695",
"0.49263766"... | 0.723919 | 0 |
Loads offscreen tree images into cache | function preloadTreeImages()
{
icons[0] = new Image();
icons[0].src = top.path + '/images/empty.gif';
icons[1] = new Image();
icons[1].src = top.path + '/images/line.gif';
icons[2] = new Image();
icons[2].src = top.path + '/images/root.gif';
icons[3] = new Image();
icons[3].src = top.path + '/images/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preload(){\r\n\r\n\tboy = loadImage(\"images/boy.png\");\r\n\r\n\ttreeObj = loadImage(\"images/tree.png\");\r\n\r\n }",
"function preload(){\r\n\r\n\tboy = loadImage(\"images/boy.png\");\r\n\r\n\ttreeObj = loadImage(\"images/tree.png\");\r\n\r\n }",
"function init() {\n cacheDom();\n loadImage... | [
"0.65321404",
"0.65321404",
"0.6474754",
"0.6444214",
"0.6339555",
"0.6297121",
"0.6269741",
"0.62525266",
"0.616797",
"0.61638796",
"0.61464137",
"0.6069587",
"0.6058959",
"0.60520315",
"0.5946102",
"0.5935103",
"0.59346896",
"0.5927668",
"0.5923723",
"0.5841995",
"0.5833834... | 0.7668066 | 0 |
This class provides the methods to create an HTML tree dynamically. Creation usually takes the following form: var tree = new Tree ('my tree'); var firstChild = tree.createNode (icon, 'tooltip text 1', value1); var secondChild = tree.createNode (icon, 'tooltip text 2', value2); tree.appendChild (firstChild); tree.appen... | function Tree (name)
{
this.hidden = false;
this.target = null;
this.id = '0';
this.value = name;
this.tooltip = 'root';
this.parent = null;
this.root = this;
this.nodes = new Array();
this.children = new Array();
this.dom = document.createElement ('div');
this.dom.setAttribute ('id', name +'_div_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static create_tree() {\n return new Tree();\n }",
"function NamTree(div){ //div is the <div> DOM element where this tree is to be displayed\n\t//standard/default iamges\n\tthis.imagesDir\t\t= '/egi/resources/erp2/images/';\n\tthis.collapsedGif\t= this.imagesDir + 'plus.gif';\n\tthis.expandedGif\t= this... | [
"0.7192487",
"0.69126743",
"0.6836215",
"0.6822025",
"0.6707562",
"0.6665366",
"0.66059285",
"0.6595262",
"0.6560371",
"0.6527166",
"0.6527166",
"0.6480515",
"0.64750886",
"0.64596057",
"0.6455626",
"0.64371216",
"0.64351034",
"0.64185",
"0.64127654",
"0.63676685",
"0.6350662... | 0.7076227 | 1 |
Global function to reset one cluster | function resetOneCluster(node, options, network){
if(node !== undefined){
if(node.options.isHardToRead !== undefined){ // we have to reset this node
if(node.options.isHardToRead){
var final_shape;
var shape_group = false;
var is_group = false;
// have a group information & a sha... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetClusters() {\n if (this.clusterer)\n this.clusterer.clearMarkers()\n\n this.clusterer = new MarkerClusterer(this.map, this.markers,\n {\n maxZoom: 22,\n minimumClusterSize: 2,\n cssClass: this.clusterClass,\n gridS... | [
"0.7005716",
"0.7005716",
"0.67094",
"0.66045386",
"0.64688635",
"0.636638",
"0.6298555",
"0.62951845",
"0.6237073",
"0.6228779",
"0.62244445",
"0.6055664",
"0.5928041",
"0.5924531",
"0.5918785",
"0.59159195",
"0.58710617",
"0.5846653",
"0.5830854",
"0.57975537",
"0.57677937"... | 0.7577312 | 0 |
Global function to reset one node | function resetOneNode(node, options, network){
if(node !== undefined){
if(node.isHardToRead !== undefined){ // we have to reset this node
if(node.isHardToRead){
var final_shape;
var shape_group = false;
var is_group = false;
// have a group information & a shape defined in group... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static reset(){\n _NODE_UID = 0;\n }",
"function resetNodes() {\r\n allNodes.forEach(node => {\r\n node.visited = false;\r\n });\r\n}",
"function nodeReset (n) {\n n.strokeColor=selVarColor;\n n.strokeWidth=\"1\";\n n.nodeCol=n.baseCol;\n}",
"function simpleResetNode(node, type){\n if(type ==... | [
"0.78106546",
"0.7331423",
"0.7305619",
"0.70375323",
"0.69768673",
"0.69512206",
"0.6929528",
"0.69028366",
"0.6885998",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
"0.68837094",
... | 0.7581067 | 1 |
functions to set nodes as hard to read for classic node | function simpleNodeAsHardToRead(node, hideColor1, hideColor2, type){
// classic nodes
if(type === "node"){
// saving color information (if we have)
if (node.hiddenColor === undefined && node.color !== hideColor1 && node.color !== hideColor2) {
node.hiddenColor = node.color;
}
// set "hard... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setnodevals()\n\t{\t\t\t\n\t\tnode.attr(\"dx\", nodedx)\n\t\t\t.attr(\"dy\", \".31em\")\n\t\t\t.attr(\"transform\", nodetrans)\n\t\t\t.style(\"text-anchor\", nodeanchor);\t\t\t\n\t}",
"setNodes(editor, props) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n ... | [
"0.6984518",
"0.6405715",
"0.63939553",
"0.6354629",
"0.63052505",
"0.6298385",
"0.6292919",
"0.6263544",
"0.61470455",
"0.6107297",
"0.6079905",
"0.6031417",
"0.6026595",
"0.60257185",
"0.6014905",
"0.60095614",
"0.5977013",
"0.5954083",
"0.5910607",
"0.5908806",
"0.5890939"... | 0.6452734 | 1 |
Revrite HTMLWidgets.dataframeToD3() for passing custom properties directly in data.frame (color.background) for example | function visNetworkdataframeToD3(df, type) {
// variables we have specially to control
/*var nodesctrl = ["color", "fixed", "font", "icon", "shadow", "scaling", "shapeProperties", "chosen", "heightConstraint", "image", "margin", "widthConstraint"];
var edgesctrl = ["color", "font", "arrows", "shadow", "smooth", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function style(feature) {\n return {\n fillColor: getColor(feature.properties[redi_column]),\n weight: 1,\n opacity: 0.5,\n color: '',\n dashArray: '',\n fillOpacity: 1\n };\n}",
"function getData()\n{\n\treturn [{\n\n\t type: 'scatter3d',\n\n\t // Set the X, Y and Z values to the selec... | [
"0.55235213",
"0.55010456",
"0.549764",
"0.52562934",
"0.5225275",
"0.52055794",
"0.5193102",
"0.5190066",
"0.5110286",
"0.51042336",
"0.50943816",
"0.5092124",
"0.50686985",
"0.5066975",
"0.50619555",
"0.50612295",
"0.50581586",
"0.5057087",
"0.50425714",
"0.50316787",
"0.50... | 0.55101836 | 1 |
id node list selection init | function setNodeIdList(selectList, params, nodes){
if(params.style !== undefined){
selectList.setAttribute('style', params.style);
}
selectList.style.display = 'inline';
option = document.createElement("option");
option.value = "";
if(params.main === undefined){
option.text = "Select by id";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function choiceNodeStart(d) {\n d3.selectAll('.id' + d.id).style('visibility', 'visible');\n // console.log(d.id);\n }",
"_construct() {\n this._nodesById = {}\n }",
"function select(id)\n {\n // allow subscribes to prevent selection change\n if (me.triggerEvent('beforeselect'... | [
"0.66309583",
"0.6430987",
"0.63363636",
"0.63011205",
"0.62343436",
"0.62252516",
"0.61342186",
"0.61269706",
"0.6104464",
"0.5957432",
"0.5900511",
"0.585579",
"0.5841772",
"0.5788758",
"0.5778722",
"0.57676965",
"0.5756292",
"0.57193834",
"0.57021433",
"0.56849086",
"0.568... | 0.70398015 | 0 |
hiding the popup through css and a timeout | function myHidePopup(delay) {
popupTimeout = setTimeout(function() {vispopup.style.visibility = 'hidden';}, delay);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dohide(){\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t $( \"#popupMenu\" ).popup( \"close\" );\n\t\t },1);\n\t}",
"function popupHide(elem){\n document.body.style.overflow = '';\n elem.classList.add('popup_hide');\n \n setTimeout(function(){\n elem.classList.remove('popup_error')... | [
"0.76092935",
"0.7497523",
"0.7278366",
"0.7272023",
"0.7227284",
"0.7227284",
"0.7218792",
"0.7218792",
"0.7218792",
"0.7218792",
"0.7218792",
"0.7218792",
"0.7218792",
"0.7164377",
"0.7163915",
"0.7154243",
"0.71517843",
"0.71357507",
"0.7127051",
"0.711918",
"0.71013594",
... | 0.818261 | 0 |
array1 = ['abc', 'abc', 'xyz', 'cde', 'uvw'] // array2 = ['abc', 'cde', 'uap'] How many times do the elements in array2 appear in array1? 'abc' appears twice in the first array (2) 'cde' appears only once (1) 'uap' does not appear in the first array (0) Therefore, solve(array1, array2) = [2, 1, 0] | function solve(a,b){
let arr = [];
for(let i = 0; i < b.length; i++){
let count = 0;
for(let j = 0; j < a.length; j++){
if(b[i] === a[j])
count++;
}
arr.push(count)
}
return arr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function solve(a,b){\r\n let finalArray = [];\r\n let currentCount = 0;\r\n //go through b and compare each element in b to each element in a\r\n for(let i = 0; i < b.length; i++){\r\n currentCount = 0;\r\n for(let x = 0; x <= a.length; x++){\r\n if(b[i] === a[x]){\r\n currentCo... | [
"0.72240794",
"0.7206455",
"0.71799827",
"0.7138413",
"0.7106573",
"0.70792115",
"0.7030987",
"0.7026241",
"0.6970841",
"0.6960603",
"0.69502777",
"0.694791",
"0.6945098",
"0.69032407",
"0.6840728",
"0.6821942",
"0.6808268",
"0.6795178",
"0.6758197",
"0.6746166",
"0.67266303"... | 0.7481017 | 0 |
Toggles Post Title field input form | togglePostField() {
this.setState({ toggleInput: !this.state.toggleInput });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleSearchOptionsTitle()\n{\n\tif ($(searchForm).css(\"display\") === \"none\") {\n\t\t$(searchOptionsBtn).text('Hide Search Options');\n } \n\telse {\n \t$(searchOptionsBtn).text('Show Search Options');\n }\n}",
"function titleIn() {\n $('#title').on('change', function() {\n ... | [
"0.6923714",
"0.6636479",
"0.65388894",
"0.63191384",
"0.6270781",
"0.6248076",
"0.6246244",
"0.6215276",
"0.61997753",
"0.6112815",
"0.60543096",
"0.60450155",
"0.60431653",
"0.6029902",
"0.601825",
"0.6007929",
"0.5974829",
"0.59563476",
"0.5952079",
"0.5951252",
"0.5950628... | 0.7043026 | 0 |
Validate the id of an element, ensuring it is present and not yet assigned | function validateId(element) {
if (!element.id) {
throw new Error('element must have an id');
}
if (elementRegistry.getById(element.id)) {
throw new Error('element with id ' + element.id + ' already exists');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateId () {\r\n\tvar idEl = getFormElementById('numeroidentificacion_c');\r\n\tvar tipoIdEl = getFormElementById('tipoidentificacion_c');\r\n\tvar tipoId = 'nif';\t// Indica si el tipo de documento es un NIF o NIE (puede ser pasaporte)\r\n\tif (! tipoIdEl) {\r\n\t\tconsole.warn(\"No se ha definido el ... | [
"0.68835425",
"0.6654123",
"0.6611141",
"0.66077644",
"0.6547183",
"0.65281975",
"0.65217406",
"0.64908147",
"0.64287525",
"0.64272785",
"0.6421489",
"0.638908",
"0.63626343",
"0.63303286",
"0.62997603",
"0.62907207",
"0.6277789",
"0.62761563",
"0.62495047",
"0.6210298",
"0.6... | 0.82356066 | 0 |
A draggable implementation that fires drag related events whenever the given gfx changes. | function Draggable(gfx, options) {
options = _.extend({
threshold: DEFAULT_THRESHOLD,
payload: {},
}, options || {});
function isThresholdReached(delta) {
return Math.abs(delta.x) > options.threshold ||
Math.abs(delta.y) > options.threshold;
}
var self = this;
var externalEvents;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addDragListeners() {\n document.addEventListener(\"dragstart\", function (e) {\n draggedCircle = e.target;\n e.target.classList.add(\"dragging\");\n\n // Set the drag preview to be invisible\n let elem = document.createElement(\"div\");\n elem.id = \"drag-ghost\";\n elem.s... | [
"0.61768234",
"0.606317",
"0.5997637",
"0.5984751",
"0.597844",
"0.593595",
"0.59345925",
"0.59345925",
"0.58847314",
"0.58847314",
"0.58847314",
"0.58847314",
"0.58847314",
"0.58847314",
"0.58833283",
"0.58814824",
"0.58251125",
"0.5819841",
"0.58155805",
"0.57978576",
"0.57... | 0.7618682 | 1 |
Reverts a move shape operation | function revert(ctx) {
var dx = ctx.dx * -1,
dy = ctx.dy * -1,
shapes = ctx.shapes,
oldParents = ctx.oldParents;
var all = getAllMovedShapes(shapes);
_.forEach(all.shapes, function(s) {
var newX = s.x + dx,
newY = s.y + dy;
s.x = newX;
s.y = newY;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveShape(x, y) {\r\n\tvar shape = previousSelectedShape;\r\n\tif (shape instanceof Circle || shape instanceof Rectangle) {\r\n\t\tshape.x1 = x - offsetX;\r\n\t\tshape.y1 = y - offsetY;\r\n\t} else {\r\n\t\tvar diffX = shape.x2 - shape.x1;\r\n\t\tvar diffY = shape.y2 - shape.y1;\r\n\t\tshape.x1 = x - offs... | [
"0.6736912",
"0.6508126",
"0.64699733",
"0.6323418",
"0.63232267",
"0.6319628",
"0.6232725",
"0.6155323",
"0.6132931",
"0.61265504",
"0.61265504",
"0.6123464",
"0.60894084",
"0.6043885",
"0.6027252",
"0.60189086",
"0.6017526",
"0.60151255",
"0.6005482",
"0.59925646",
"0.59882... | 0.6895222 | 0 |
Translate a shape Move shape to shape.x + x and shape.y + y | function translateShape(shape, x, y) {
'use strict';
shape.x += x;
shape.y += y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveShape(x, y) {\r\n\tvar shape = previousSelectedShape;\r\n\tif (shape instanceof Circle || shape instanceof Rectangle) {\r\n\t\tshape.x1 = x - offsetX;\r\n\t\tshape.y1 = y - offsetY;\r\n\t} else {\r\n\t\tvar diffX = shape.x2 - shape.x1;\r\n\t\tvar diffY = shape.y2 - shape.y1;\r\n\t\tshape.x1 = x - offs... | [
"0.7403421",
"0.7271602",
"0.69507486",
"0.6714999",
"0.67016464",
"0.6616667",
"0.6569827",
"0.65468377",
"0.6528609",
"0.64593035",
"0.6451583",
"0.6407229",
"0.6362595",
"0.63430566",
"0.633654",
"0.6335183",
"0.6315066",
"0.63041556",
"0.6293681",
"0.6293681",
"0.62758774... | 0.85097295 | 0 |
Sets up the click handlers on the form. Next/reset. =================================================== | function setupClickHandlers() {
// Show next form on continue click
$('button[type="submit"]').on('click', function(event) {
event.preventDefault();
var $currentForm = $(this).parents('.js-form-step');
showNextForm($currentForm);
});
// Reset form on reset button click
$('.js-reset').on('click', functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"events() {\n // Next step\n this.$next.forEach(btn => {\n btn.addEventListener(\"click\", e => {\n e.preventDefault();\n this.currentStep++;\n this.updateForm();\n });\n });\n\n // Previous step\n this.$prev.forEach(btn => {\n btn.addEventLis... | [
"0.6863816",
"0.6863816",
"0.6863816",
"0.6863816",
"0.6863816",
"0.6863816",
"0.6863578",
"0.6846845",
"0.6745368",
"0.6694581",
"0.66605324",
"0.66550857",
"0.66435933",
"0.6634171",
"0.6571282",
"0.65106636",
"0.6495095",
"0.6492423",
"0.64715964",
"0.6438995",
"0.63974077... | 0.8449818 | 0 |
Sets up and handles the float labels on the inputs. ===================================================== | function setupFloatLabels() {
// Check the inputs to see if we should keep the label floating or not
$('form input').not('button').on('blur', function() {
// Different validation for different inputs
switch (this.tagName) {
case 'SELECT':
if (this.value > 0) {
this.className = 'hasInput';
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function floatLabel(inputType) {\n $(inputType).each(function () {\n var $this = $(this);\n $this.focus(function () {\n $this.next().addClass(\"active\");\n });\n $this.blur(function () {\n if ($this.val() === \"\" || $this.val() === \"blank\") {\n $this.next().removeC... | [
"0.6384731",
"0.6252481",
"0.6076362",
"0.6022391",
"0.5845121",
"0.57373893",
"0.5699771",
"0.568607",
"0.5684682",
"0.5663305",
"0.5661837",
"0.5637045",
"0.56042993",
"0.5595074",
"0.55904794",
"0.5566293",
"0.55517244",
"0.55498034",
"0.55209136",
"0.55149996",
"0.5491327... | 0.7057884 | 0 |
Normalises any indentation and commenting style structure into a consistent format for parsing | function normalise(comment) {
comment = comment.replace(/\/\*/, '')
comment = comment.replace(/\*\//, '')
comment = comment.trim().replace(/^\*/, '').replace(/\n \* |\n \*|\n /g, '\n').replace(/\n /g, '\n ')
if (!comment.match('```') && comment.match(' ')) {
comment = comment.replace(/ |```\n ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatting(comment) {\n // Object for output\n var output = {}\n // Normalise the content and abstract styling\n var content = normalise(comment)\n var styling = source.split(comment)[1].split(/\\/\\*/)[0]\n // If the comment contains any code braces\n if (content.match(/```/)) {\n // Break down... | [
"0.60489017",
"0.60015565",
"0.5884309",
"0.58194435",
"0.5746794",
"0.57102185",
"0.5696065",
"0.5696065",
"0.5685544",
"0.56774086",
"0.56200445",
"0.56105983",
"0.5597873",
"0.5585881",
"0.5498785",
"0.5497111",
"0.5466273",
"0.54530776",
"0.54524136",
"0.54480815",
"0.539... | 0.6131288 | 0 |
Formats a stylesheet markdowncomment block into an Object and returns the properties: comment, result, markup and style | function formatting(comment) {
// Object for output
var output = {}
// Normalise the content and abstract styling
var content = normalise(comment)
var styling = source.split(comment)[1].split(/\/\*/)[0]
// If the comment contains any code braces
if (content.match(/```/)) {
// Break down the content in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getStyle() {\n const style = {};\n if (this.blockDef.bold) {\n style.fontWeight = \"bold\";\n }\n if (this.blockDef.italic) {\n style.fontStyle = \"italic\";\n }\n if (this.blockDef.underline) {\n style.textDecoration = \"underline\";\n ... | [
"0.58225346",
"0.5639202",
"0.5331132",
"0.53105986",
"0.529938",
"0.5298067",
"0.5298067",
"0.52745223",
"0.52549964",
"0.5250088",
"0.5248751",
"0.52425736",
"0.5238276",
"0.520257",
"0.5191413",
"0.51713413",
"0.51610535",
"0.5095991",
"0.5052661",
"0.50358725",
"0.5016205... | 0.73377496 | 0 |
Ensure temp directory exists | function ensureTempDir(done) {
console.log('Ensuring temp directory exists.');
mkdirRecursive.mkdir(tempFolder, function(err) {
if (err && err.code !== 'EEXIST') {
console.error(err);
}
done(err);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async tempDir() {\n let dir = await mkdtemp(resolve(tmpdir(), 'peon-test-'))\n pendingCleanup.push(async() => {\n await remove(dir)\n })\n return dir\n }",
"function createTempDir() {\n let now = Date.now(); // Returns unix-time seconds as our unique name for the tempdir\n if (!fs.existsSync(... | [
"0.77554345",
"0.75465673",
"0.7476048",
"0.6962847",
"0.69522095",
"0.6715853",
"0.66473293",
"0.6581007",
"0.6546477",
"0.6545825",
"0.644476",
"0.64356416",
"0.63915324",
"0.6388036",
"0.63873863",
"0.6370488",
"0.6355241",
"0.6286048",
"0.6206159",
"0.6191829",
"0.6191829... | 0.768878 | 1 |
Clears the used fonts list from all the font face menulists. | function ClearUsedFonts() {
let userFontSeps = document.querySelectorAll(
"menuseparator.fontFaceMenuAfterDefaultFonts"
);
for (let userFontSep of userFontSeps) {
while (true) {
let nextNode = userFontSep.nextSibling;
if (nextNode.tagName != "menuseparator") {
nextNode.remove();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearFonts(){\n\n spinner.text = 'removing fonts...';\n spinner.start();\n\n shell.rm('-r', path.join(fontPath,'/*') );\n shell.touch( path.join(fontPath,'/fonts.css') );\n\n spinner.succeed();\n}",
"function clearFont() {\n fontArea.innerHTML = \"\";\n}",
"function clearLists() {\r... | [
"0.7623342",
"0.6536559",
"0.64624554",
"0.64365566",
"0.6381831",
"0.63365287",
"0.62607145",
"0.6222253",
"0.61140984",
"0.61140984",
"0.61110103",
"0.60443705",
"0.6016976",
"0.5999383",
"0.5910968",
"0.5910968",
"0.58687216",
"0.58578545",
"0.58364826",
"0.58125937",
"0.5... | 0.80431885 | 0 |
Creates a menuitem element for the font faces menulist. Returns the menuitem but does not add it automatically to the menupopup. | function createFontFaceMenuitem(aFontLabel, aFontName, aMenuPopup) {
let itemNode = document.createXULElement("menuitem");
itemNode.setAttribute("label", aFontLabel);
itemNode.setAttribute("value", aFontName);
itemNode.setAttribute(
"value_parsed",
aFontName.toLowerCase().replace(/, /g, ",")
);
item... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddMenuItem(htmlElementParent, name, cssClass, functionOnClick, elementType ) {\r\n\tif (elementType==null) elementType = \"div\";\r\n\tvar item = document.createElement(elementType);\r\n\tif (cssClass!=null) item.className=cssClass;\r\n\tif (name!=null) item.innerHTML=name;\r\n\thtmlElementParent.appendC... | [
"0.6673393",
"0.6381154",
"0.6381154",
"0.6253534",
"0.6248427",
"0.62445354",
"0.6163767",
"0.6150548",
"0.60510373",
"0.6008958",
"0.5992647",
"0.59691393",
"0.5947447",
"0.5905027",
"0.5878666",
"0.58655083",
"0.5793962",
"0.5784782",
"0.5782606",
"0.5772434",
"0.5770062",... | 0.8417073 | 0 |
Helper function that changes the button color. commandID The ID of the command element. id The ID of the button needing to be changed. defaultColor The default color the button gets set to. | function ChangeButtonColor(commandID, id, defaultColor) {
var commandNode = document.getElementById(commandID);
if (commandNode) {
var color = commandNode.getAttribute("state");
var button = document.getElementById(id);
if (button) {
button.setAttribute("color", color);
// No color or a mix... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setButtonColor(buttonId, buttonValue) {\n // Load which button by DOM ID\n var whichButton = document.getElementById(buttonId);\n // If false, then set to the following values\n if (buttonValue === false) {\n whichButton.style.backgroundColor = \"transparent\";\n whichButton.styl... | [
"0.6224465",
"0.62238294",
"0.6163143",
"0.615674",
"0.61544913",
"0.61511385",
"0.6133356",
"0.6034736",
"0.6034736",
"0.60252404",
"0.59232545",
"0.5911921",
"0.5896009",
"0.5883533",
"0.58740693",
"0.5784005",
"0.5780174",
"0.57786566",
"0.57679224",
"0.57669723",
"0.57651... | 0.89309186 | 0 |
Call this with insertAllowed = true to allow inserting if not in existing table, else use false to do nothing if not in a table | function EditorInsertOrEditTable(insertAllowed) {
if (IsInTable()) {
// Edit properties of existing table
window.openDialog(
"chrome://editor/content/EdTableProps.xhtml",
"_blank",
"chrome,close,titlebar,modal",
"",
"TablePanel"
);
gContentWindow.focus();
} else if (ins... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkInsertIsAble () {\n function error (parameter) {\n throw new Error (`Parameter '${parameter}' is forbidden in INSERT query`)\n }\n if (this._selectStr.length > 1) error('only')\n if (this._orderStr) error('orderBy')\n if (this._limitStr) error('limit')\n if (this._offsetStr) error('off... | [
"0.6375912",
"0.6062853",
"0.5924372",
"0.5783183",
"0.56334764",
"0.5598225",
"0.5580604",
"0.55365723",
"0.5522624",
"0.55152166",
"0.54883206",
"0.54720825",
"0.5397072",
"0.53958017",
"0.53709924",
"0.52958935",
"0.5274182",
"0.52549076",
"0.5218113",
"0.5210261",
"0.5182... | 0.6629654 | 0 |
Find another HTML editor window to associate with the InsertChar dialog or close it if none found (May be a mail composer) | function SwitchInsertCharToAnotherEditorOrClose() {
if ("InsertCharWindow" in window && window.InsertCharWindow) {
var enumerator;
try {
enumerator = Services.wm.getEnumerator(null);
} catch (e) {}
if (!enumerator) {
return;
}
// TODO: Fix this to search for command controllers an... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EditorCleanup() {\n SwitchInsertCharToAnotherEditorOrClose();\n}",
"get WindowsEditor() {}",
"openEditor() {\n cy\n .getIframeBody('#page-composer-frame')\n .find('.gwt-Frame.window-iframe.x-noshim.x-component')\n .its('0.contentDocument.body')\n .sh... | [
"0.6518271",
"0.61215204",
"0.58529747",
"0.571434",
"0.56240714",
"0.5623659",
"0.55890125",
"0.55458903",
"0.55458903",
"0.55379325",
"0.5529544",
"0.5514909",
"0.5472526",
"0.54299295",
"0.5413374",
"0.5403351",
"0.5394437",
"0.5378272",
"0.5376021",
"0.5348881",
"0.533518... | 0.8193122 | 0 |
retrive form fields based on category params (category_code, entity_object, sm_group, sm_category) | function getFormFor(category_code, entity_object, sm_group, sm_category) {
var deferred = $q.defer(),
categoryFor ={},
cacheKey = "categoryForm_" + category_code,
categoryFormData = self.categoryFormCache.get(cacheKey);
if(category_code){
categoryFor.CATEGORY_CODE = category_code;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"injectCategoryDataIntoFormFields() {\n let pulledFields = productFields\n // We cycle through the fields AND IF its the category field:\n // we'll want to add the array of categories to the options on the category field\n let options = []\n pulledFields.forEach((field) => {\n if (field.name ===... | [
"0.6165321",
"0.61405987",
"0.588152",
"0.55661964",
"0.5536856",
"0.53892756",
"0.5220809",
"0.5205295",
"0.5110901",
"0.509619",
"0.50633216",
"0.50555265",
"0.5035254",
"0.5023847",
"0.4959945",
"0.4952384",
"0.4921714",
"0.48950535",
"0.48694593",
"0.48622832",
"0.4847555... | 0.703898 | 0 |
Retriving all states that belongs to Country code | function states(code) {
var deferred = $q.defer(),
cacheKey = "states_"+code,
geoStateDataCache = self.geoStateDataCache.get(cacheKey);
if (geoStateDataCache) {
//console.log("States Found in Cache", geoStateDataCache);
$("#loadingWidget").fadeOut('slow');
deferred.resol... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStateByCountryId(countryId) {\r\n states = filterFilter(countries, { Id: parseInt(countryId) }, true)[0].State;\r\n return states;\r\n }",
"getCSList() {\r\n this.sql_getCSList = `SELECT id, country_name, state_name FROM country_state_tb ORDER BY id ASC`;\r\n return... | [
"0.71967113",
"0.6838977",
"0.67872393",
"0.67220175",
"0.667608",
"0.667441",
"0.6673382",
"0.6659086",
"0.664372",
"0.6533481",
"0.65133595",
"0.6511247",
"0.6495036",
"0.6456523",
"0.6456523",
"0.6456523",
"0.6456523",
"0.6412247",
"0.63940734",
"0.6391168",
"0.6337298",
... | 0.7147391 | 1 |
This will broadcast to all players that a update has taken place. The id of the opposite player will be sent so that that player can update their display. | function notifyUpdate(){
var update = {}
//get the opponent's id
for(var i = 0;i<connections.length;++i){
/**
* Look for the player opposite that of the one
* sending the ID.
*/
if(connections[i].id !== connections[index].id){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendPlayerUpdates() {\n\t\t// console.log(\"Sending player updates\");\n\t\tlet update = this.stage.getUpdatedStageState();\n\n\t\tlet updatedState = JSON.stringify({\n\t\t\ttype: \"stage-update\",\n\t\t\tplayerActors: update.players,\n\t\t\tbulletActors: update.bullets,\n\t\t\tenvironmentActors: update.environmen... | [
"0.6608453",
"0.6298214",
"0.61995846",
"0.6114929",
"0.60810626",
"0.60462207",
"0.60385764",
"0.60146445",
"0.6011609",
"0.6008412",
"0.5998219",
"0.5900691",
"0.5887402",
"0.5886873",
"0.5857465",
"0.5805817",
"0.58013684",
"0.57678664",
"0.5741644",
"0.57223606",
"0.57212... | 0.76870817 | 0 |
This method is invoked when the token request is failed | function getTokenFailure(error) {
inAppBrowserObject.close();
$("#overlay-div").css("display", "none");
if (error.status === 0) {
$("#message-to-display").html("The server is taking too long to respond");
} else {
$("#message-to-display").html("There was an error loading the details.<br>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onAuthenticationFailure(response) {}",
"function errorCallback(data) {\n if (data.errorCode === 200) {\n clicked = false;\n jQuery('.ld-loading-main-complete_booking').hide();\n tokenRequest();... | [
"0.7235454",
"0.67747366",
"0.67570806",
"0.6570638",
"0.6498481",
"0.6460143",
"0.6435675",
"0.63729477",
"0.6368007",
"0.63597125",
"0.63469166",
"0.63284904",
"0.6324346",
"0.6316897",
"0.6289586",
"0.6191609",
"0.61100054",
"0.6106226",
"0.6106226",
"0.6092682",
"0.609268... | 0.68375087 | 1 |
Complete the roadsAndLibraries function below. find the minimum cost of making libraries accessible to all the citizens and print it on a new line. | function roadsAndLibraries(n, c_lib, c_road, cities) {
// n - number of cities (vertices)
// c - roads (edges)
// c_lib - cost to build a library
// c_road - cost to rebuild a road
let mincost = 0;
let P = {};
let ds = new DisjointSet(n);
for(let [u,v] of cities) {
ds.Union(u,v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function done() {\n console.log(\"*** 5 Most expensive items *** \");\n var pResults = answers.mostExpensiveItems();\n var a = Object.keys(pResults);\n a.forEach(function (key) {\n console.log(\"category: \", key, pResults[key].getMostExpensive());\n });\n\n var lCds = answers.longRunningCDs();\n console... | [
"0.547252",
"0.54114795",
"0.53959036",
"0.51278824",
"0.50571007",
"0.50501907",
"0.4917317",
"0.4896085",
"0.4888321",
"0.4829956",
"0.4828014",
"0.48175964",
"0.4804754",
"0.4803848",
"0.4780236",
"0.47782516",
"0.477219",
"0.47446173",
"0.4742102",
"0.47405958",
"0.471231... | 0.56799287 | 0 |
i'm not even sure if we need to pass SIGTERM to the workers... | function terminate() {
if (terminating) return;
terminating = true;
// don't restart workers
cluster.removeListener('disconnect', onDisconnect)
// kill all workers
Object.keys(cluster.workers).forEach(function (id) {
console.log('[worker %s] receiving kill signal', id);
cluster.workers[id].kill('SI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function terminate() {\n if (terminating) return\n terminating = true\n \n // don't restart workers\n cluster.removeListener('disconnect', onDisconnect)\n // kill all workers\n Object.keys(cluster.workers).forEach(function (id) {\n console.log('sending kill signal to worker %s', id)\n ... | [
"0.71972424",
"0.6859264",
"0.6533305",
"0.6495066",
"0.64838606",
"0.64787585",
"0.64659035",
"0.64355487",
"0.64337397",
"0.6348803",
"0.6345239",
"0.63238883",
"0.6305915",
"0.62893885",
"0.6231871",
"0.6215438",
"0.62065816",
"0.6191695",
"0.6189272",
"0.6172357",
"0.6108... | 0.7208923 | 0 |
Gets SVG path string for a group of scores. | function path_string( center, points, scores){
var vertex = [];
for( var i = 0; i < points.length; i++){
var x = lined_on( center.x, points[i].x, scores[i]);
var y = lined_on( center.y, points[i].y, scores[i]);
vertex.push( "" + x + " " + y);
}
return "M " + vertex.join("L ") + "z";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function barPath(groups) {\n var path = [],\n i = -1,\n n = groups.length,\n d;\n while (++i < n) {\n d = groups[i];\n path.push(\"M\", x(d.key), \",\", height, \"V\", y(d.value), \"h9V\", height);\n }\n ... | [
"0.57048136",
"0.5691856",
"0.5689914",
"0.5618886",
"0.5522574",
"0.55023056",
"0.54684865",
"0.54660934",
"0.54660934",
"0.54660934",
"0.54011226",
"0.5395334",
"0.5392772",
"0.5367245",
"0.5339244",
"0.5317813",
"0.52774847",
"0.5239119",
"0.5209025",
"0.51761764",
"0.5168... | 0.6074443 | 0 |
splitting a sentence for sub classification (for compound sentences) | function splitSentence(split_id){
//1 split the sentence display
var sentence_id = parseInt(split_id.split(".")[0]),
word_id = parseInt(split_id.split(".")[1]);
var sentence = getSentence(sentence_id-1).split(" ");
console.log(sentence)
//
var sentence_part1 = sentence.slice(0,word_id).join(" "),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitSentence(sentence) {\n var tokens = String(),\n depth = Number();\n\n for (var index = 0; index < sentence.length; index++) {\n\n depth = updateDepth(sentence, index, depth);\n tokens = appendTokens(sentence, index, depth, tokens);\n\n if(index == (sentence.len... | [
"0.7060763",
"0.7024148",
"0.68612427",
"0.6829642",
"0.63770777",
"0.62859666",
"0.6166568",
"0.6117221",
"0.58824563",
"0.5825323",
"0.5809969",
"0.5699247",
"0.56563663",
"0.5639029",
"0.55367285",
"0.5519241",
"0.5496794",
"0.5444478",
"0.54436225",
"0.544232",
"0.5431782... | 0.7904497 | 0 |
Functions needed for site functionality & style / update_bar Change search bar placeholder with file name | function update_bar()
{
var cfile = $("#file").val();
/* Only change content of search bar if searching for file */
if ($("#search-switch").hasClass('file'))
$("#search-bar").attr("value", cfile);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showSearchBar()\r\n{\r\n document.getElementsByClassName(name_searchBar)[0].style.display = 'inline-block';\r\n document.getElementsByClassName(name_searchBar)[0].placeholder = ' Search parks';\r\n}",
"function setupSearchBar(){\n\t//set up search bar button\n\t//search is declared within utilitie... | [
"0.6227214",
"0.6157023",
"0.6147736",
"0.61305404",
"0.61193657",
"0.6036261",
"0.5931507",
"0.5825211",
"0.5730545",
"0.56777537",
"0.56554943",
"0.5645412",
"0.5625836",
"0.5621192",
"0.559547",
"0.5590299",
"0.5580061",
"0.5559739",
"0.55594516",
"0.5548782",
"0.5548191",... | 0.7543909 | 0 |
flip_switch visually adjust search bar depending on search type | function flip_switch()
{
var flip = $("#search-switch");
var sb = $("#search-bar");
if (flip.hasClass('file')) {
/* Change onoffswitch class to .text */
flip.addClass('text');
flip.removeClass('file');
/* Adjust search bar placeholder for normal Google Search */
sb.attr("value", "");
sb.attr("place... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleSearchMode() {\n self.searchMode = !self.searchMode;\n }",
"switchToSearchMode() {\n\t\tthis.setState({\n\t\t\theaderInput: this.defaultSearchHeaderActions,\n\t\t\tdisplayMode: DISPLAY_MODE_SEARCH,\n\t\t});\n\t}",
"function searchActivated() {\n $('.search-text').toggle();\n $('#fl... | [
"0.6643229",
"0.6548271",
"0.65149075",
"0.6500404",
"0.6451503",
"0.64135796",
"0.63419914",
"0.63359743",
"0.6331391",
"0.631648",
"0.6303431",
"0.62616533",
"0.6245238",
"0.6239956",
"0.6200515",
"0.6200491",
"0.6197716",
"0.6185178",
"0.6175646",
"0.6175243",
"0.6173973",... | 0.7337928 | 0 |
toggle_help manages the help window | function toggle_help()
{
var h = $("#help-window");
/* HELP WINDOW IS CURRENTLY OPEN (VISIBLE) */
if (h.hasClass('open')) {
/* Close the help window */
h.removeClass('open');
h.addClass('closed');
}
/* HELP WINDOW IS CURRENTLY CLOSED (HIDDEN) */
else {
/* Open the help window */
h.removeClass('closed');... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toggleHelp() {\n\ttoggleAnalyserPanel('help');\n}",
"toggleHelp() {\n this.setState({ showingHelp: !this.state.showingHelp });\n }",
"function initHelp() {\n $('#showHelp').click(function () {\n var height = $('#mainHelp').css('height');\n $('#mainHelp').animate(... | [
"0.85981685",
"0.76908857",
"0.7604466",
"0.74863327",
"0.7424594",
"0.7338519",
"0.7210824",
"0.716973",
"0.71632534",
"0.71138376",
"0.711246",
"0.71111643",
"0.7090932",
"0.7071378",
"0.7066346",
"0.7064296",
"0.70434153",
"0.70389193",
"0.70331544",
"0.7003272",
"0.695839... | 0.80166173 | 1 |
Pushes previously collected input chunks as single output chunk. | _definitelyPush() {
// create copy of collected chunks to be pushed as single output chunk
const chunks = this.chunks.slice();
this.push( {
finished: this.finished,
chunks
} );
// reset internal list of collected chunks
this.chunks.splice( 0, chunks.length );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_write(chunk, enc, callback) {\n //console.log(`got output chunk: '${chunk.toString()}'`);\n setImmediate(() => this.push(`${Number(chunk.toString())}\\n`));\n //console.log(`current outputs: ${this.outputs}`);\n callback();\n }",
"pushOrBuffer(chunk) {\n // Add the chunk to the buffer\n ... | [
"0.63536114",
"0.58792895",
"0.58703583",
"0.58703583",
"0.57230353",
"0.56565654",
"0.55836475",
"0.5562252",
"0.5509053",
"0.54929173",
"0.54796773",
"0.5464912",
"0.5464912",
"0.5437343",
"0.5424108",
"0.5386715",
"0.5382081",
"0.53211904",
"0.5316831",
"0.53079873",
"0.52... | 0.7257692 | 0 |
gets the assignment information for update | function getAssignmentUpdate(res, mysql, context, id, complete){
var sql_query = "SELECT assignment.tourGuide_travelLocation AS assignment_ID, assignment.booking_ID as booking_ID, " +
"assignment.tourGuide_ID as guide_ID FROM assignment WHERE tourGuide_travelLocation = ?";
var in... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEditAssignmentData() {\r\n //Assignment Data\r\n ///Object to store the assignment data\r\n var assignmentData = {};\r\n\r\n assignmentData.ID = getSelectedID();\r\n\r\n ///The name of the assignment\r\n assignmentData.name = $(\"#edit-assignment-name\").val();\r\n\r\n ///The descr... | [
"0.69052935",
"0.63696826",
"0.6147833",
"0.6119533",
"0.61065936",
"0.6070317",
"0.60455585",
"0.58244294",
"0.5796395",
"0.5738867",
"0.5731951",
"0.56517327",
"0.56347775",
"0.56227046",
"0.55428165",
"0.5522232",
"0.5494493",
"0.5457598",
"0.5442377",
"0.5421715",
"0.5417... | 0.6631524 | 1 |
gets booking ID numbers for dropdown | function getBookingID(res, mysql, context, complete) {
mysql.pool.query("SELECT bookings.booking_ID AS booking_ID FROM bookings " +
"ORDER BY bookings.booking_ID",
function (error, results, fields) {
if (error) {
res.write(JSON.stringify(er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_selected_bookings_id_in_booking_listing(){\n\n var checkedd = jQuery(\".booking_list_item_checkbox:checked\");\n var id_for_approve = \"\";\n\n // get all IDs\n checkedd.each(function(){\n var id_c = jQuery(this).attr('id');\n id_c = id_c.substr(20,id_c.length-20);\n i... | [
"0.66404676",
"0.5858352",
"0.5857371",
"0.58061683",
"0.56490177",
"0.56408334",
"0.56292754",
"0.5599936",
"0.5535553",
"0.55277705",
"0.5481918",
"0.54434276",
"0.5439683",
"0.5437736",
"0.5432574",
"0.5416615",
"0.53852075",
"0.537693",
"0.5352862",
"0.53517896",
"0.53503... | 0.6035554 | 1 |
gets bookingID that has not been assigned yet | function getUnassignedBookingID(res, mysql, context, complete) {
mysql.pool.query("SELECT bookings.booking_ID FROM bookings WHERE bookings.booking_ID " +
"NOT IN (SELECT assignment.booking_ID FROM assignment) " +
"ORDER BY bookings.booking_ID",
f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBookingID(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT bookings.booking_ID AS booking_ID FROM bookings \" +\n \"ORDER BY bookings.booking_ID\",\n function (error, results, fields) {\n if (error) {\n res.write(JSO... | [
"0.5957215",
"0.55054224",
"0.54530424",
"0.5406202",
"0.5390209",
"0.5384754",
"0.53198224",
"0.5314431",
"0.5288983",
"0.5255308",
"0.5213693",
"0.51729715",
"0.5120293",
"0.5103223",
"0.5035218",
"0.49931812",
"0.49866316",
"0.4956392",
"0.49461192",
"0.49145645",
"0.49065... | 0.7672857 | 0 |
Handles server message from channel or other means types: update_song remove_listener update_listener remove_session upload_song open_page parameters: listeners: list of listeners of session curSongKey: current song key for session hostEmail: email of host curSongIdx: current song index (used to reconnect host) newSong... | function handleServerMessage(message) {
console.log('handleServerMessage');
console.log(message.data);
message = message.data;
// fix weird json encoding issues (http://stackoverflow.com/questions/9036429/convert-object-string-to-json)
//message = $.parseJSON(JSON.stringify(eval('(' + message.data + ')')));
w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function messagereceivedHandler(e) {\n var messageSize = e.detail.length;\n for (var i = 0; i < messageSize; i++) {\n for (var key in e.detail[i].data) {\n switch (key) {\n case Messages.ServerStarted:\n serverStarted = true;\n break;\n ... | [
"0.64743245",
"0.64152646",
"0.63787776",
"0.6291201",
"0.6281351",
"0.61700064",
"0.61595666",
"0.6155571",
"0.6090752",
"0.60617536",
"0.6000492",
"0.5962794",
"0.58487016",
"0.5839367",
"0.5839367",
"0.5839367",
"0.5828332",
"0.58052933",
"0.57653385",
"0.57200813",
"0.569... | 0.7701787 | 0 |
Pauses current song, sends update to server. | function userPauseSong() {
console.log('userPauseSong()');
// only pause if current song is already playing
if (!isSongPaused()) {
pauseSong();
updateChannel(0, 0, 0);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pauseCurrentSong() {\n\t\t// If there isn't any audio available yet, do nothing\n\t\tif (!app.audioObject) {\n\t\t\tconsole.log(\"Necessary? pause\");\n\t\t\treturn;\n\t\t}\n\t\tapp.audioObject.pause();\n\n\t\t// Tell Vue objects that the current song has been paused\n\t\tapp.$emit(\"songPlaying\", false);\n\t}",
... | [
"0.7039592",
"0.6993301",
"0.6860157",
"0.6837125",
"0.68245107",
"0.6635984",
"0.6629756",
"0.6595446",
"0.6568778",
"0.65476865",
"0.6484386",
"0.6479586",
"0.6479479",
"0.6472927",
"0.6464307",
"0.6464307",
"0.6463359",
"0.64294726",
"0.642318",
"0.64097285",
"0.6406883",
... | 0.77919024 | 0 |
Gets upload URL for uploading file from server and updates form action | function getUploadUrl() {
$.get('/generate_upload_url',
{},
function(message) {
console.log('/generate_upload_url response:' + message);
$('#upload_song_form').attr('action', message);
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setUploadAction() {\n\t\taction = buildLocationURL('upload', locXFine, locYFine, displayW, displayH);\n\t\t// action = '/upload&x='+ locX.toFixed(2) + ',y='+locY.toFixed(2);\n\t\tdocument.getElementById(\"upload_form\").action = action;\n\t}",
"function upload(form) {\n \n}",
"function uploadOnChan... | [
"0.7252407",
"0.6614155",
"0.6578543",
"0.65214694",
"0.61179936",
"0.60955715",
"0.60743564",
"0.60322016",
"0.6022067",
"0.59900856",
"0.5900049",
"0.58833045",
"0.5879132",
"0.5818804",
"0.58086073",
"0.5802277",
"0.57500064",
"0.5749182",
"0.57408863",
"0.5738584",
"0.573... | 0.7376416 | 0 |
build gulpfile this has to be a sync method because gulp won't change core to allow async task loading | build () {
// glob tasks
let done = [];
let tasks = glob.sync (this.files ('tasks/*.js'));
let watchers = [];
let installers = [];
// loop tasks
for (var i = 0; i < tasks.length; i++) {
// load task
let task = parser.task (tasks[i]);
// create tas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"gulpTask() {\n return (\n gulp\n .src(this.src.path)\n .pipe(this.webpack())\n .on('error', this.onError())\n .pipe(this.minify())\n .on('error', this.onError())\n .pipe(this.saveAs(gulp))\n .pipe(this.onSuccess())\n ... | [
"0.696281",
"0.682764",
"0.67821085",
"0.6715926",
"0.6621539",
"0.6581237",
"0.65044403",
"0.6494309",
"0.64436036",
"0.6431905",
"0.6407768",
"0.6362346",
"0.63344365",
"0.63333553",
"0.6330309",
"0.63298035",
"0.63153464",
"0.626858",
"0.6255706",
"0.6238952",
"0.62006676"... | 0.76924574 | 0 |
Get the tabbable elements and detach/attach the keydown event. Called after the iframe has fully loaded so we have all the elements we need. Called again each time a Tab gets clicked. | function handleTabbables() {
var $firstAndLast;
// Get all the tabbable elements.
$tabbables = $( ':tabbable', $iframeBody );
// Our first tabbable element is always the "Close" button.
$firstTabbable = tbWindow.find( '#TB_closeWindowButton' );
// Get the last tabbable element.
$lastTabbable = $tabbables.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndF... | [
"0.6785301",
"0.6785301",
"0.60754526",
"0.6013891",
"0.58278114",
"0.58017117",
"0.5767562",
"0.5767562",
"0.5757631",
"0.56951106",
"0.5385684",
"0.5385684",
"0.53140867",
"0.52391845",
"0.5235672",
"0.52347535",
"0.52166986",
"0.5172257",
"0.5154641",
"0.5089716",
"0.50808... | 0.6909842 | 0 |
Get stock limit for product | function getStockLimit(idProduct) {
return $.post(
'/app/plugin/shop/process/shipping.php',
{
GETLIMITSTOCK: 'OK',
idProduct: idProduct
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calculateQuantity() {\n console.log('Calculating quantity... ');\n const symbol = this.symbol.meta;\n const minQuantity = symbol.minQty;\n const maxQuantity = symbol.maxQty;\n const quantitySigFig = symbol.quantitySigFig;\n const stepSize = symbol.stepSize; //minimum quan... | [
"0.63048214",
"0.6263471",
"0.6248491",
"0.6203355",
"0.61984265",
"0.619414",
"0.60757875",
"0.6046321",
"0.59989214",
"0.59844863",
"0.59588957",
"0.59481657",
"0.592361",
"0.5923565",
"0.58588034",
"0.5851822",
"0.5850094",
"0.58239913",
"0.5806502",
"0.5781936",
"0.577724... | 0.76412857 | 0 |
Add product to shopping card | function addToShoppingCard(Product) {
return $.post(
'/app/plugin/shop/process/shipping.php',
{
ADDPRODUCTTOCARD: 'OK',
idProduct: Product.idProduct,
name: Product.name,
quantity: Product.quantity,
singlePrice: Product.price,
to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addProduct() {\n el('cart').style.display = 'inline-block';\n el('order').style.display = 'none';\n const title = el('products').value;\n const quantity = parseFloat(el('quantity').value);\n cart[title] = (cart[title] || 0) + quantity;\n saveCart();\n showCart();\n}",
"function addProductToCart(p... | [
"0.7750658",
"0.7706357",
"0.76545966",
"0.7641375",
"0.755151",
"0.755151",
"0.7475554",
"0.7440687",
"0.74356097",
"0.7403038",
"0.7349466",
"0.7331717",
"0.73309445",
"0.7288007",
"0.7174764",
"0.71708506",
"0.7164623",
"0.71634036",
"0.7149554",
"0.7137434",
"0.71132946",... | 0.79234904 | 0 |
Get count of shipping card | function getCountShippingCard() {
return $.post(
'/app/plugin/shop/process/shipping.php',
{
GETCOUNTSHIPPINGCARD: 'OK'
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async count () {\n return await this.client.zCard(this.ZSET_KEY)\n }",
"cardCount(card) {\n return this.state.currentDeck.reduce((n, val) => {return n + (val === card);}, 0);\n }",
"count()\n\t{\n\t\treturn this.numCards;\n\t}",
"function getCount(){\ncardCounts = [{'name':'-1', 'value':0}, {'n... | [
"0.6982075",
"0.67778426",
"0.655832",
"0.65059614",
"0.64626086",
"0.6425049",
"0.6290331",
"0.62618816",
"0.61060935",
"0.6024322",
"0.5979833",
"0.5934643",
"0.5889267",
"0.5875316",
"0.58409566",
"0.5837149",
"0.5828319",
"0.5817092",
"0.5805453",
"0.5805453",
"0.5805453"... | 0.8326636 | 0 |
A player wins by connecting four of their discs horizontally, vertically or diagonally. Given a multidimensional array representing a Connect Four board, your task is to create a function which can determine who won the game. Your connectFour function will be passed an array matrix similar to this: [['','','','','','',... | function connectFour(board) {
var emptyCounter=0;
for (let i=0; i< board.length; i++){
for (let j=0; j<board[i].length; j++){
let currentColor=board[i][j];
//now I want to check if any of the eight discs around me match mine.
if (currentColor==="-"){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function didWin(player){\n //asign the length of the boardArray to a variable\n var arrLength = boardArray.length;\n \n //checks for a diagnol win / top-left to bottom-right\n if(boardArray[0][0] == player && boardArray[1][1] == player && boardArray[2][2] == player){\n return \"\\\\\";\n }... | [
"0.7306854",
"0.6726679",
"0.6697006",
"0.6693673",
"0.6673324",
"0.6672208",
"0.66036564",
"0.6578302",
"0.65719754",
"0.65709007",
"0.6558733",
"0.6555831",
"0.65487546",
"0.6525015",
"0.6522438",
"0.65098155",
"0.6479622",
"0.6470263",
"0.6461426",
"0.64423496",
"0.6431517... | 0.76370466 | 0 |
Use requestIdleCallback() if available, else fall back to setTimeout(). Throttle so as not to run too frequently. | function throttleIdleTask(func) {
var doIdleTask = typeof requestIdleCallback === 'function' ? requestIdleCallback : setTimeout;
var running = false;
return function throttled() {
if (running) {
return;
}
running = true;
doIdleTask(function () {
running = false;
func();
});... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"scheduleIdleCallback() {\n if (!this.idleScheduled) {\n ChromeUtils.idleDispatch(this.onIdle, {timeout: LOW_PRIORITY_TIMEOUT_MS});\n this.idleScheduled = true;\n }\n }",
"function setIdleTimeout() {\n kony.application.registerForIdleTimeout(2, idleTimeout_callback);\n}",
"_throttler(callbac... | [
"0.69215107",
"0.6773308",
"0.66601217",
"0.6355099",
"0.6111695",
"0.6011705",
"0.5986635",
"0.59623986",
"0.596194",
"0.59576154",
"0.5952749",
"0.5925865",
"0.5910985",
"0.5903143",
"0.5758724",
"0.57584834",
"0.56996286",
"0.5659521",
"0.56586885",
"0.56508034",
"0.561416... | 0.718447 | 0 |
Get flow configuration from the backend and initialize the state here | componentDidMount() {
this.setState({
configuration: {
flow: {
name: "sample1",
id: "01",
components: [
{
type: "http-listener",
id: "http-list-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async init() {\n this.cfgObj = await this.getCfgFromFile();\n }",
"async function initializeState() {\n const sdgConfig = await (await fetch(SDG_CONFIG)).json();\n STATE.sdg = sdgConfig;\n}",
"async configure() { }",
"constructor(config) {\r\n if (!config) {\r\n throw new Error(\"Config is ... | [
"0.6061698",
"0.57816017",
"0.57625",
"0.5728077",
"0.57215536",
"0.5663037",
"0.5653192",
"0.5646339",
"0.56233764",
"0.5606087",
"0.560558",
"0.55621594",
"0.55265796",
"0.55153114",
"0.5505886",
"0.5503885",
"0.54889745",
"0.54781765",
"0.54780006",
"0.5472226",
"0.5463362... | 0.5968259 | 1 |
function: FrameIt object constructor param: element a DOM object param: options plugin options param: sndopt second options, allows to alter first options | function FrameIt(element, options, sndopt) {
// auto reference the frameit object
var f = this;
// jQuery has an extend method that merges the
// contents of two or more objects, storing the
// result in the first object. The first object
// is generally empty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(options, element) {\n super(options, element);\n }",
"constructor(options, element) {\n super(options, element);\n }",
"function Plugin( element, options ) {\n this.element = element;\n this.options = $.extend( {}, defaults, options) ;\n \n this._defa... | [
"0.64706075",
"0.64706075",
"0.60901684",
"0.6012232",
"0.5979554",
"0.59764755",
"0.5796057",
"0.5774885",
"0.57452667",
"0.57192785",
"0.57161283",
"0.56227875",
"0.55757976",
"0.55573285",
"0.55488527",
"0.5530994",
"0.5519582",
"0.551739",
"0.55118406",
"0.5502912",
"0.54... | 0.75654614 | 0 |
preloads all images within the frame preset when all images are loaded executes callback | function pre(allLoadedCallback) {
var allImg = [],
imgLoaded = 0,
uncached = function (src) {
if (!src || src=='') return false;
var img = new Image();
img.src = src;
return !img.comp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preLoadImages( callback){\n var imagesLoaded=0;\n for(var i=0;i<gameConfig.sources.length;i++){\n var image = new Image();\n image.src= gameConfig.sources[i].url;\n images[gameConfig.sources[i].name]= image;\n image.onload=f... | [
"0.77637696",
"0.73582417",
"0.72989184",
"0.7246604",
"0.71462077",
"0.71237147",
"0.7106689",
"0.7106341",
"0.7090557",
"0.70242125",
"0.7020406",
"0.69992",
"0.6992485",
"0.69801867",
"0.69535184",
"0.6931677",
"0.6927504",
"0.6916788",
"0.6915326",
"0.69039416",
"0.690333... | 0.8209264 | 0 |
init / Retrives an offset to the frame image based on information given on the background position within the style declaration for the container element | function getOffset(o) {
var imgOffset = (o.css('background-position')) ? o.css('background-position').split(" ") : '0px 0px'.split(" ");
return {
x: parseInt(imgOffset[0].replace("[a-zA-Z]","")),
y: parseInt(imgOffset[1].replace("[a-zA-Z]",""))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function position() {\n var yOffset = window.pageYOffset * o.speed;\n self.css('background-position',\n \"50% \" + yOffset + 'px'\n );\n }",
"getBackgroundImagePadding(){return this.__background.imagePadding}",
"getBackgroundPosition() {\n let bgX;\... | [
"0.62721217",
"0.6034273",
"0.6013074",
"0.5976192",
"0.5886651",
"0.58853805",
"0.58160543",
"0.5804963",
"0.58004266",
"0.57587296",
"0.5740054",
"0.57313246",
"0.5690997",
"0.56807476",
"0.5672124",
"0.56591606",
"0.56506884",
"0.5635432",
"0.56197447",
"0.56077725",
"0.55... | 0.64952403 | 0 |
Process image properties needed for locate the image and get the best fit size inside the container | function processImage() {
// if there is an image tag inside the container
// and it has a src setted
if(f.o.src && f.o.src != "")
{
// if container size if not setted resize it to the image size
if (Math.floor(f.$el.height()) <= 0) { f.o.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _fitImage(data) {\n\t\tif (data.isWide) {\n\t\t\t//WIDE\n\t\t\tdata.targetImageWidth = data.viewportWidth;\n\t\t\tdata.targetImageHeight = data.targetImageWidth * data.ratioHorizontal;\n\t\t\t\n\t\t\tif (data.targetImageHeight > data.viewportHeight) {\n\t\t\t\tdata.targetImageHeight = data.viewportHeight... | [
"0.682718",
"0.6810971",
"0.67293257",
"0.67251694",
"0.65769506",
"0.65627164",
"0.6558262",
"0.6553085",
"0.65181935",
"0.64975286",
"0.63898677",
"0.6361514",
"0.6361514",
"0.63560957",
"0.63437724",
"0.63417923",
"0.6330047",
"0.6319983",
"0.627476",
"0.6233011",
"0.62074... | 0.6858693 | 0 |
Process the frame information Calculate the size and position based on values setted in properties | function processFrame(c, idx) {
// here we'll calculate the frame width and height
var framehg, framewd,
bestfit = (f.o.imghg < f.o.imgwd) ? f.o.imghg : f.o.imgwd;
if (c.bordersize > 0 && c.bordersize <= 1)
c.bordersize = Math.floor((c.borde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateSize() {\n this.w = this.ent.width + this.wo;\n this.h = this.ent.height + this.ho;\n }",
"function onUpdateDrawingProperties(){\r\n let newH = document.getElementById(\"property_height\").value;\r\n let newW = document.getElementById(\"property_width\").value;\r\n let newS= document.getEle... | [
"0.60106903",
"0.5928131",
"0.59034914",
"0.58016455",
"0.5722931",
"0.5691217",
"0.5679365",
"0.5675129",
"0.5675129",
"0.565036",
"0.5647749",
"0.56446326",
"0.5644056",
"0.5635346",
"0.56051487",
"0.55377984",
"0.55211085",
"0.55029505",
"0.54873174",
"0.5426725",
"0.54254... | 0.6105518 | 0 |
Detect support for CSS backgroundsize. | function bgsizeSupport() {
var a = document.createElement('a'),
p = ['backgroundSize','MozBackgroundSize','WebkitbackgroundSize','ObackgroundSize'];
for ( var i in p) if ( a.style[p[i]] !== undefined ) return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function backgroundWithSize(decl) {\n return 'background-size' == decl.property;\n}",
"function checkCSSsupport(){\n\t\tvar isSupported = true;\n\t\n\t\t\tswitch(testNumber){\n\t\t\t\tcase 0:\n\t\t\t\tif (typeof document.body.style.boxShadow == \"undefined\" && typeof document.body.style.WebkitBoxShadow == \"un... | [
"0.71100193",
"0.58619565",
"0.5760856",
"0.56982666",
"0.569762",
"0.559816",
"0.55970263",
"0.55698913",
"0.55635583",
"0.5528481",
"0.5498904",
"0.5486246",
"0.5417632",
"0.540006",
"0.5391065",
"0.5365427",
"0.52866566",
"0.5276854",
"0.52652264",
"0.52629757",
"0.5257181... | 0.7790823 | 0 |
Draws a shadow and sets the css attributes calculated based on frame's size and position Called only when shadow effect is true | function drawShadow(c, $frame, onupdate) {
var $shadow
if(isCircle(c)) {
if( onupdate ) {
$('.source-shadow',$frame)
.css('margin-top', c.framehg - 68 + c.bordersize)
.css('width', c.framewd * (.5))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shadowExp()\n{\n kony.print(\"\\n**********in shadowExp*******\\n\");\n frmShodowView.flxShadow.shadowDepth = 30;\n frmShodowView.flxShadow.shadowType = constants.VIEW_BOUNDS_SHADOW;\n}",
"function generateShadow(content) {\n var wd, ht, X = 0, Y = 0, zIdx = 0, txt, dpObj, puObj, bS = '', aPos... | [
"0.690199",
"0.6713343",
"0.65810823",
"0.6500182",
"0.6494741",
"0.6285557",
"0.6281228",
"0.62201285",
"0.6194481",
"0.6185624",
"0.61199665",
"0.60961616",
"0.60609096",
"0.605546",
"0.60471696",
"0.60076314",
"0.60006785",
"0.5973357",
"0.59409416",
"0.5938115",
"0.592660... | 0.74365175 | 0 |
Determines is a frame is drawe as a circle based on his class | function isCircle(item){
return (item.cssclass && item.cssclass.indexOf("circle") > 0)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawCircles() {\r\n placing = Placing.CIRCLE;\r\n}",
"function Circle (){\n this.x = Math.random()*150+80;\n this.y = Math.random()*150+80;\n this.r = Math.random()*50;\n this.c = \"Blue\";\n this.getX = function () { return this.x; }\n this.getY = function () { return this.y; }\n this.getR = ... | [
"0.65577316",
"0.64931715",
"0.64361066",
"0.6342943",
"0.6233626",
"0.6215889",
"0.61859",
"0.61701",
"0.61631835",
"0.6149108",
"0.61381245",
"0.61357707",
"0.61291105",
"0.6100745",
"0.60989785",
"0.60824496",
"0.60776293",
"0.60514325",
"0.60499525",
"0.60499525",
"0.6048... | 0.68014055 | 0 |
Animates all frames within the animation stack passed by parameter. The stack must have a preconfigured frame with properties correctly setted. | function animateFrame(frameStack) {
$.each(frameStack, function() {
// here this represents the frame object
var it = this
// check if frame has no animation setted
if(!f.o.doanimate) {
// the frame its just po... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animate() {\n // if (stackHelper) {\n // stackHelper.index += 1;\n // if (stackHelper.outOfBounds === true) {\n // stackHelper.orientation = (stackHelper.orientation + 1) % 3;\n // stackHelper.index = 0;\n // }\n // }\n\n controls.update();\n renderer.render(scene,... | [
"0.6815852",
"0.65981746",
"0.652749",
"0.6486165",
"0.6481433",
"0.64550346",
"0.63364136",
"0.6294623",
"0.62143344",
"0.6184074",
"0.61552596",
"0.61285377",
"0.60935885",
"0.6090998",
"0.6086726",
"0.6042065",
"0.6027185",
"0.6025915",
"0.6022226",
"0.60166115",
"0.601661... | 0.739711 | 0 |
handles when frame animations end and fires the a callback when all finished | function frameAnimationEnd() {
f.animatedFrames = f.animatedFrames || 0;
f.animatedFrames++;
if(f.animatedFrames == f.frameItems.length){
f.finished = true;
f.o.cbFinished.call(f);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }",
"function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }",
"onAnimationEnd() {\n\n }",
"_onAnimationEnd() {\n ... | [
"0.77137333",
"0.7612322",
"0.73989785",
"0.73540634",
"0.7348827",
"0.7200785",
"0.7181866",
"0.7168255",
"0.7079866",
"0.7059742",
"0.7022637",
"0.69236475",
"0.6813853",
"0.67146754",
"0.670063",
"0.66698694",
"0.66685194",
"0.666315",
"0.66373134",
"0.6602917",
"0.6558618... | 0.835496 | 0 |
Loads selected image and unencodes image bytes for Rekognition DetectFaces API | function ProcessImage(file) {
$("#loading").css("display", "block");
// Load base64 encoded image
var reader = new FileReader();
reader.onload = (function (theFile) {
return function (e) {
//loaderOn();
var img = document.createElement('img');
var image = null;
img.src = e.target.res... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ProcessImage(screenshot) {\n\n var image = atob(screenshot.split(\"data:image/jpeg;base64,\")[1]);\n\n //unencode image bytes for Rekognition DetectFaces API \n var length = image.length;\n var imageBytes = new ArrayBuffer(length);\n var ua = new Uint8Array(imageBytes);\n for (var i = 0; i < length; i++) {\n... | [
"0.7006483",
"0.63534194",
"0.6325845",
"0.6027526",
"0.5948471",
"0.5937702",
"0.59151185",
"0.58654594",
"0.57249045",
"0.56999964",
"0.56796837",
"0.56698054",
"0.5609699",
"0.55219996",
"0.54904836",
"0.5453832",
"0.54369885",
"0.5417313",
"0.54139173",
"0.54118574",
"0.5... | 0.6789884 | 1 |
Returns the matching alias for the given namespace | getPathAlias(namespace) {
return Object.keys(this.list).find((alias) => {
return namespace.startsWith(`${alias}/`);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"extractAlias(namespace) {\n if (namespace.alias && namespace.alias.type === AliasType_1.AliasType.Mosaic) {\n return new MosaicAlias_1.MosaicAlias(namespace.alias.type, new MosaicId_1.MosaicId(namespace.alias.mosaicId));\n }\n else if (namespace.alias && namespace.alias.type === Ali... | [
"0.6776434",
"0.64455533",
"0.62149495",
"0.600016",
"0.59531575",
"0.5850014",
"0.5667095",
"0.56027466",
"0.5590431",
"0.5501024",
"0.54878604",
"0.54680866",
"0.5466136",
"0.5406174",
"0.5393402",
"0.5313359",
"0.52576745",
"0.52506244",
"0.518047",
"0.51804274",
"0.508402... | 0.6911951 | 0 |
Returns path for a given alias | makeAliasPath(namespace, alias) {
return path_1.normalize(namespace.replace(alias, this.list[alias]));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getPathAlias(namespace) {\n return Object.keys(this.list).find((alias) => {\n return namespace.startsWith(`${alias}/`);\n });\n }",
"getFile(alias) {\n if (this._fileAlias.hasOwnProperty(alias)) {\n return this._fileLoaded[this._fileAlias[alias]]\n }\n }",
... | [
"0.6532209",
"0.63073146",
"0.6081291",
"0.60013324",
"0.59933215",
"0.59486395",
"0.59486395",
"0.5943064",
"0.587978",
"0.5800343",
"0.57894766",
"0.57543206",
"0.56895894",
"0.56828207",
"0.5650785",
"0.56440496",
"0.5527961",
"0.5519732",
"0.5500555",
"0.5474553",
"0.5474... | 0.7422883 | 0 |
Get current request's provisioning_status field | function getProvisioningStatus(payload) {
var status = 'running';
for (var i = 0; i < payload.hosts.length; i++) {
var instance_status = payload.hosts[i].status.toLowerCase();
gs.log(current.number + ": Get Provisioning Status: payload.hosts[i].status: " + instance_status, source);
if (instance_stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getStatus() {\n return status;\n }",
"function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }",
"getStatus() {\n\t\treturn this.status;\n\t}",
"getStatus() {\n return this.status;\n }",
"get status () {\n retur... | [
"0.64265853",
"0.61212564",
"0.6082288",
"0.6079842",
"0.60642236",
"0.60445464",
"0.5904244",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5795438",
"0.5786871",
"0.57775646",
"0.5775382",
"0.57719004",
"0.5704071",
"0.56801",... | 0.6843929 | 0 |
Convert Instance XML into JSON | function getInstanceJSON(instanceXML) {
if (instanceXML && instanceXML != '') {
var instanceXMLDoc = new XMLDocument(instanceXML, true);
var instance = {
"name": instanceXMLDoc.getNodeText("//ns1:hostname"),
"ip": instanceXMLDoc.getNodeText("//ns1:publicAddress"),
"status": instanceXMLDoc.getNodeText... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toJSON() {\n if (!this.text)\n return null;\n\n if (!this.json)\n this.json = xmlJS.xml2js(this.text, { compact: true });\n\n return this.json;\n }",
"function xmlToJson(xml) {\n \n // create the return object\n var obj = {};\n ... | [
"0.63679785",
"0.5981091",
"0.5964798",
"0.5957762",
"0.59439003",
"0.59429264",
"0.5920867",
"0.58978665",
"0.58881307",
"0.5824514",
"0.58231306",
"0.58189267",
"0.5817581",
"0.58061045",
"0.5758549",
"0.5741891",
"0.5738386",
"0.5727002",
"0.5715144",
"0.56991535",
"0.5680... | 0.6154518 | 1 |
Retrieve topology id from the reference record we should have gotten from the Search call | function getTopologyID(xml) {
var topologyRefXMLDoc = new XMLDocument(xml, true); // Output from Topology Search API REST call is a refernce to topology.
var topologyID = topologyRefXMLDoc.getNodeText("/ns1:Assetlist/ns1:Asset/ns1:id"); // Get the topology id
if (!topologyID) {
throw "Could not find topology f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nearest_feature(pos) {\n return vertices_source.getClosestFeatureToCoordinate(pos.getGeometry().getFirstCoordinate()).get('id');\n }",
"function getInstanceID()\n{\n\treturn getDCCAddrAndMotorSubAddr(this.normalRouteID);\n}",
"function getReferenceId(identifier, field) {\n if (!identifier ... | [
"0.52786404",
"0.52356523",
"0.51965034",
"0.507969",
"0.5043558",
"0.50422335",
"0.50346977",
"0.5034177",
"0.50227064",
"0.4990612",
"0.49802718",
"0.49551377",
"0.4924389",
"0.49117813",
"0.49014068",
"0.48977384",
"0.48486626",
"0.48413113",
"0.48392418",
"0.48349744",
"0... | 0.66839623 | 0 |
Retrive all Template IDs used within a specified topology (topologyID) | function getTemplateIDs(topologyID) {
var topologyXMLDoc = new XMLDocument(getTopologyXML(topologyID), true); // Output from getTopologyXML is a full-blown topology document.
var nodeList = topologyXMLDoc.getNodes("//ns1:anyOrder[ns1:rel='down']/ns1:id");
var templateIDs = [];
for (var i = 0; i < nodeList.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findReferencedTemplateIDs(parsedDOM) {\n const dependentTemplateIDs = new Set();\n\n parsedDOM\n .root()\n .find(\"[data-bind*=template]\")\n .each((index, element) => {\n const dataValue = parsedDOM(element).data(\"bind\");\n // Some template names are code to be executed instead of ... | [
"0.5749285",
"0.57290155",
"0.5484082",
"0.54528534",
"0.5409426",
"0.52923036",
"0.5175208",
"0.5169278",
"0.5094301",
"0.50875",
"0.5051759",
"0.497724",
"0.49556705",
"0.48845547",
"0.48831078",
"0.48665658",
"0.48606",
"0.48588234",
"0.48580918",
"0.48259678",
"0.4823387"... | 0.80420244 | 0 |
Retrieve Instance XML based on Template ID from Agility | function getInstanceXML(templateID) {
var templateXMLDoc = new XMLDocument(getTemplateXML(templateID), true); // Output from getTemplateXML is a full-blown template document.
var nodeList = templateXMLDoc.getNodes("/ns1:Template/ns1:instances[ns1:rel='down']/ns1:id");
if (nodeList && nodeList.getLength() > 0) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function activeTemplate(id){\n\t\tvar t = document.querySelector(id);\n\t\treturn document.importNode(t.content, true);\n\t}",
"function getTemplateXML(templateID) {\n\t\n\tvar params = [{\n\t\t'name': 'template_id',\n\t\t'value': templateID\n\t}];\n\t\n\treturn executeRESTCall(restMessageTemplateGetName, 'get',... | [
"0.58655775",
"0.55433947",
"0.5538627",
"0.5440184",
"0.5415999",
"0.531429",
"0.51813465",
"0.51267797",
"0.5069621",
"0.50608903",
"0.502606",
"0.5024881",
"0.50171137",
"0.50171137",
"0.50171137",
"0.50171137",
"0.49892586",
"0.49625647",
"0.49501216",
"0.49193114",
"0.48... | 0.6938124 | 0 |
4. Handling window resize events / When the window resizes we update: The dimensions of the three.js render area The font size, left offset, and width of the output text at the top of the screen (to try to ensure it's visible even when the window gets very small) The height of the main area, options panel, and overlay ... | function updateDimensions() {
windowHeight = main.innerHeight()-350;
windowWidth = virtualhand.innerWidth();
/*
* The three.js area and renderer are resized to fit the page
*/
var renderHeight = windowHeight - 5;
renderArea.css({width: windowWidth, height: renderHeight});
renderer.setSize(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onWindowResize() {\r\n\r\n windowHalfX = window.innerWidth / 2;\r\n windowHalfY = window.innerHeight / 2;\r\n\r\n width = $('#target').width();\r\n height = $('#target').height();\r\n\r\n camera.updateProjectionMatrix();\r\n\r\n renderer.setSize( width, height );\r\n postprocessing.co... | [
"0.7578371",
"0.751606",
"0.7512011",
"0.7464789",
"0.7464789",
"0.7453846",
"0.74289113",
"0.7413976",
"0.73984325",
"0.7380316",
"0.73755896",
"0.7367203",
"0.7307001",
"0.7270434",
"0.72688395",
"0.7256032",
"0.7249066",
"0.7248593",
"0.7230001",
"0.7228789",
"0.7228543",
... | 0.7687748 | 0 |
Creates a palm mesh | function createPalm() { return new THREE.Mesh(palmGeometry, material); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createMesh() {\n var element = this._element;\n var w = element.calculatedWidth;\n var h = element.calculatedHeight;\n\n var r = this._rect;\n\n // Note that when creating a typed array, it's initialized to zeros.\n // Allocate memory for 4 vertices, 8 floats per vertex, ... | [
"0.6567329",
"0.6531122",
"0.63896567",
"0.6212034",
"0.61060923",
"0.6095866",
"0.6076295",
"0.6038209",
"0.6022533",
"0.60113055",
"0.5995059",
"0.5987233",
"0.5971433",
"0.59714085",
"0.59607774",
"0.59436655",
"0.5917124",
"0.59024525",
"0.5899218",
"0.5890226",
"0.588627... | 0.8168583 | 0 |
Creates a finger mesh | function createFinger() { return new THREE.Mesh(fingerGeometry, material); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createMesh() {\n var element = this._element;\n var w = element.calculatedWidth;\n var h = element.calculatedHeight;\n\n var r = this._rect;\n\n // Note that when creating a typed array, it's initialized to zeros.\n // Allocate memory for 4 vertices, 8 floats per vertex, ... | [
"0.7099941",
"0.65288246",
"0.6303493",
"0.62117285",
"0.6164384",
"0.6127461",
"0.60623986",
"0.60209966",
"0.6018915",
"0.597432",
"0.5942565",
"0.59382963",
"0.5911029",
"0.58772403",
"0.58136266",
"0.5775527",
"0.57736236",
"0.57614285",
"0.5753194",
"0.57507545",
"0.5744... | 0.78781676 | 0 |
Updates the material of the palm and fingers created above. This function is called when recording starts and ends, in order to modify how visible hands look during recording. | function setHandMaterial(m) {
palms[0].material = m;
palms[1].material = m;
for (var i = 0, l = fingers.length; i < l; i++) { fingers[i].material = m; }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setMaterial(material) {\r\n\r\n\r\n\r\n\t}",
"updateAppliedTexture()\n {\n this.quadMaterial.setTexture(this.textures[this.selectedTexture]);\n }",
"fixMaterials() {\n const baseMaterial = this.getObjectByName('handle').material;\n\n baseMaterial.shininess = 15;\n\n this.refs.touchpad.mat... | [
"0.6097312",
"0.5763582",
"0.5736369",
"0.5576737",
"0.55172217",
"0.5423319",
"0.5382377",
"0.5335729",
"0.53245807",
"0.53177994",
"0.53136706",
"0.52897567",
"0.52882135",
"0.52416575",
"0.5219905",
"0.519746",
"0.5185751",
"0.516811",
"0.5133753",
"0.51187146",
"0.5099921... | 0.7156493 | 0 |
Removes the currently rendered gesture, if any. | function clearGesture() {
new TWEEN.Tween(camera.position).to({x: cameraInitialPos.x, y: cameraInitialPos.y, z: cameraInitialPos.z}).easing(TWEEN.Easing.Exponential.Out).start();
new TWEEN.Tween(camera.rotation).to({x: 0, y: 0, z: 0}).easing(TWEEN.Easing.Exponential.Out).start();
for (var i = 0, l = renderedH... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unregisterTouchGestures_() {\n if (!this.gestures_) {\n return;\n }\n this.gestures_.cleanup();\n this.gestures_ = null;\n }",
"removeGesture (objName, gesture) {\n try {\n var elem = this.getElemFromName(objName);\n var gestureStr = this.gestureStr(gesture);\n return elem.unb... | [
"0.69580543",
"0.6646728",
"0.628935",
"0.6286861",
"0.6218074",
"0.6217299",
"0.620385",
"0.620385",
"0.6163951",
"0.6160569",
"0.61195725",
"0.6077572",
"0.6057806",
"0.6040688",
"0.6002869",
"0.5982236",
"0.59635735",
"0.59373486",
"0.5925752",
"0.59219813",
"0.59013796",
... | 0.7098501 | 0 |
This function is called when a training gesture is saved and when a gesture is recognized. It depends on the LeapTrainer Controller providing a renderableGesture array. | function renderGesture() {
if (!webGl) { return; } // Gesture renders are entirely disabled for canvas renderers (it's just too slow at the moment!)
/*
* Only one gesture is rendered at a time, so first the current gesture - if any - is removed.
*/
clearGesture();
/*
* The LeapTrainer controller s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setup(){if(GestureDetector.READY){return;}// find what eventtypes we add listeners to\nEvent.determineEventTypes();// Register all gestures inside GestureDetector.gestures\nUtils.each(GestureDetector.gestures,function(gesture){Detection.register(gesture);});// Add touch events on the document\nEvent.onTou... | [
"0.53260523",
"0.5278937",
"0.5255846",
"0.519105",
"0.5144869",
"0.5023074",
"0.5023074",
"0.50227606",
"0.5013318",
"0.50076216",
"0.50016594",
"0.49385852",
"0.49268162",
"0.48993844",
"0.48951146",
"0.48898035",
"0.4878237",
"0.487081",
"0.487081",
"0.487081",
"0.487081",... | 0.6578534 | 0 |
Function to choose a random component from an array | function getComponent(array) {
return array[Math.floor(Math.random() * (array.length - 1))]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomPick(array){\n let choice = Math.floor(Math.random()*array.length);\n return array[choice]\n}",
"function randomPick(array){\n\tlet choice = Math.floor(Math.random() * array.length);\n\treturn array[choice];\n}",
"function choose(array) {\n\t\treturn array[getRandomInt(array.length)];\n\t}... | [
"0.7912739",
"0.78808606",
"0.7873778",
"0.78090036",
"0.78090036",
"0.7749829",
"0.7741945",
"0.7687317",
"0.76150596",
"0.7602951",
"0.75675154",
"0.75675154",
"0.7558744",
"0.7554749",
"0.7548523",
"0.75068265",
"0.7491333",
"0.7489933",
"0.74871796",
"0.74842054",
"0.7480... | 0.7984171 | 0 |
Realtime is just a stronger Conn. This class helps you subscribe and listen realtime event from the realtime server additional features compare to conn: + auto recreate and resub if the last conn is dead + don't subscribe already subscribed events | function Realtime(apiUrls, credential, callAPI) {
if (typeof apiUrls === 'string' || apiUrls instanceof String) apiUrls = [apiUrls]
credential = credential || {}
if (!credential.getAccessToken) {
credential.getAccessToken = function () {
return Promise.resolve('')
}
}
var pubsub = new Pubsub()
// holds a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"on(event, callback) {\n if (!this._realtime.isConnected()) {\n this._realtime.connect();\n }\n return this._subscription.on(event, callback);\n }",
"async connect(){\n\t\ttry {\n\t\t\tthis.token = await Global.key('token');\n\t\t\tLogger.info(\"Connecting to Ably message servic... | [
"0.5902338",
"0.58093995",
"0.572515",
"0.5541139",
"0.5494606",
"0.5399633",
"0.5395807",
"0.53664494",
"0.5363489",
"0.53422695",
"0.53389335",
"0.53371817",
"0.53212994",
"0.53071076",
"0.5306619",
"0.5283758",
"0.52711284",
"0.5269891",
"0.52632606",
"0.5240676",
"0.52393... | 0.6705785 | 0 |
calcNextBackoff returns number of seconds we must wait before sending a next request the results is determind based on exponential backoff algorithm see | function calcNextBackoff(attempts) {
var RECONNECT_INTERVAL = 1000
var MAX_RECONNECT_INTERVAL = 10000
var RECONNECT_DECAY = 1.5
if (!attempts || attempts === -1) return 0 // first time connect
var delaytime = RECONNECT_INTERVAL * Math.pow(RECONNECT_DECAY, attempts)
return Math.min(MAX_RECONNECT_INTERVAL, delayti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"customBackoff(retryCount, err) { // eslint-disable-line\n if (!err.retryable) { return -1; }\n return 100 + retryCount * 100;\n // returns delay in ms\n }",
"function calculateBackoffMillis(backoffCount) {\r\n // Calculates an exponentially increasing value.\r\n // Deviation: calculates v... | [
"0.7163808",
"0.702568",
"0.702568",
"0.6841499",
"0.65892386",
"0.6368785",
"0.6368785",
"0.62453383",
"0.61674595",
"0.61674595",
"0.61651564",
"0.61651564",
"0.60694736",
"0.60694736",
"0.60643584",
"0.6032779",
"0.6032779",
"0.6032779",
"0.6032779",
"0.6032779",
"0.603277... | 0.779042 | 0 |
init for search/movie page firebase funcs gets user data if user is signed in | function profileInit() {
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// User is signed in.
console.log('user signed in');
console.log(user);
console.log('user uuid ' + user.uid);
userUID = user.uid;
$('body').addClas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initApp() {\n firebase.auth().onAuthStateChanged(function(user)\n {\n if (user)\n {\n // User is signed in.\n uid = user.uid;\n var data = db.collection(\"users\").doc(uid);\n data.get().then(function(doc)\n {\n if (doc.exists)\n {\n ... | [
"0.64617705",
"0.640188",
"0.63448775",
"0.6297228",
"0.6253782",
"0.62394655",
"0.6188962",
"0.61519796",
"0.61355066",
"0.6132782",
"0.6115932",
"0.607411",
"0.60550463",
"0.6053569",
"0.6042378",
"0.60004646",
"0.5994236",
"0.5993251",
"0.5978287",
"0.59699214",
"0.5945467... | 0.7640286 | 0 |
It checks if a collision with a wall has occurred and starts the end of the game procedure, if any. | checkWallCollision() {
if ((this.center.x + this.width / 4) >= this.wall.x &&
((this.center.x - this.width / 4)) <= this.wall.x + this.wall.width &&
this.center.y >= GAME_CONFIG.GAME_HEIGHT - this.wall.height) {
this.gameOver();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkWallCollision(){\n\t// check to see if the snake hit a wall\n\tif(snakeBody[0].x < 0 || snakeBody[0].x > cw){\t// we've come into contact with the left or right walls\n\t\talert(\"A snake collision has occurred on the left or right wall\");\n\t\tresumeGame = false;\n\t}\n\t\n\tif(snakeBody[0].y < 0 |... | [
"0.72820616",
"0.7113412",
"0.70944345",
"0.7087766",
"0.70727545",
"0.70186573",
"0.6902219",
"0.68980867",
"0.68932635",
"0.6853138",
"0.6840366",
"0.6792507",
"0.6734583",
"0.6733843",
"0.6696853",
"0.6681623",
"0.66505504",
"0.66501856",
"0.664907",
"0.6601132",
"0.659944... | 0.7226777 | 1 |
continue calling the blurring() function until clearInterval() is called. | function blurring(){
load++;
loadingText.innerHTML = load + '%';
loadingText.style.opacity = 1 - (load/100);
// bg.style.opacity = load / 100;
bg.style.filter = `blur(${20 - load/100 * 30}px)`;
if(load > 99){
clearInterval(timer);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function blurLoop(){\n\t\tlet interval = setInterval(()=>{\n\t\t\tif(!isLooping){\n\t\t\t\tlet length = durations[Math.floor(Math.random()*durations.length)];\n\t\t\t\tblurRound(length);\n\t\t\t}\n\t\t}, 1000);\n\t}",
"function blurred() {\n\t\t\tsettings.hasFocus = false;\n\t\t}",
"function blurring() {\r\n ... | [
"0.78400546",
"0.7162857",
"0.6806166",
"0.6753046",
"0.6738143",
"0.665746",
"0.665746",
"0.665746",
"0.665746",
"0.665746",
"0.665746",
"0.665746",
"0.6636777",
"0.66327465",
"0.66327465",
"0.66327465",
"0.66327465",
"0.66327465",
"0.66148144",
"0.66044325",
"0.66044325",
... | 0.74206716 | 1 |
injectSVG: Inject SVG data once document is ready | function injectSVG() {
var ajax = new XMLHttpRequest();
ajax.open('GET', 'assets/img/svg.svg?v=4', true);
ajax.send();
ajax.onload = function(e) {
var div = document.createElement('div');
div.id = 'svgInject';
div.innerHTML = ajax.responseText;
document.body.insertBefore(div, document.body.childN... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertSVG() {\t\r\n\tjQuery(document).ready(function() {\r\n\t\tjQuery('img.svg').each(function(){\r\n\t\t\tvar $img = jQuery(this);\r\n\t\t\tvar imgID = $img.attr('id');\r\n\t\t\tvar imgClass = $img.attr('class');\r\n\t\t\tvar imgURL = $img.attr('src');\r\n\t\t\t\r\n\t\t\tjQuery.get(imgURL, function(data... | [
"0.7124129",
"0.6833374",
"0.67064464",
"0.6648929",
"0.6556984",
"0.6520077",
"0.6467064",
"0.6443922",
"0.6442455",
"0.6430477",
"0.6388749",
"0.63625056",
"0.6335524",
"0.63101614",
"0.62860054",
"0.6252392",
"0.62391853",
"0.62299144",
"0.61769974",
"0.6115635",
"0.608999... | 0.8140236 | 0 |
waitForImages: Wait until images are loaded | function waitForImages() {
// the rest of the code does not apply to IE9, so exit
if ( classie.has(elHTML, 'ie9') ) {
return;
}
var elLoader = document.getElementById('loader_overlay'),
elPreloadImage = document.getElementById('bg-image');
// listen for the end of <header> fadeIn animation
e... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function countLoadedImagesAndLaunchIfReady() {\n picsToLoad--;\n // console.log(picsToLoad);\n if (picsToLoad == 0) {\n imageLoadingDoneSoStartGame();\n } // wait for images to finish loading\n} // end of function",
"function waitForImage() {\n document.querySelectorAll(\".loading\").forEac... | [
"0.67411894",
"0.6695995",
"0.66927093",
"0.667183",
"0.6577361",
"0.65213656",
"0.6493556",
"0.6473913",
"0.64712334",
"0.64683694",
"0.64551103",
"0.64198065",
"0.6390421",
"0.637663",
"0.63712746",
"0.6359765",
"0.6341971",
"0.63327116",
"0.63203895",
"0.63201904",
"0.6314... | 0.72386765 | 0 |
Refresh the payment list | function refreshList(data){
$('#payment-body').empty();
data.forEach(function(element){
$('#payment-body').append("<tr>"
+"<td>"+element.date+"</td>"
+"<td>"+element.value+"</td>"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshPage() {\n var where = {\n firstParm: 'archived',\n operater: '==',\n secondParm: true\n };\n\n return Q.all([\n datacontext.getEntityList(paymentsList, model.entityNames.customerPayment, false, null, null,... | [
"0.7104112",
"0.63575125",
"0.63085973",
"0.6299025",
"0.6185583",
"0.6146934",
"0.6142497",
"0.6133794",
"0.6093419",
"0.6060186",
"0.6033276",
"0.5944932",
"0.5877676",
"0.5872201",
"0.5841736",
"0.58374065",
"0.5833483",
"0.58253866",
"0.58176225",
"0.5785082",
"0.5779488"... | 0.695714 | 1 |
Check wither or not the window object exists. | windowExists():void {
if (window) {
this.window = window;
} else {
this.windowDoesntExist();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isWindow(obj) {\n return obj !== null && obj === obj.window;\n }",
"function isWindow(obj) {\n return obj !== null && obj === obj.window;\n }",
"function isWindow(obj) {\n return obj !== null && obj === obj.window;\n }",
"function isWindow(obj) {\n return obj !== null && obj === obj.w... | [
"0.7606502",
"0.7606502",
"0.7606502",
"0.7606502",
"0.7606502",
"0.7606502",
"0.7588726",
"0.7588706",
"0.75859696",
"0.75859696",
"0.7582012",
"0.7582012",
"0.75717527",
"0.75717527",
"0.75717527",
"0.75717527",
"0.75717527",
"0.75717527",
"0.75717527",
"0.75717527",
"0.757... | 0.83070505 | 0 |
A function called when the step is exited | exit(direction) {
this.stepExit.emit(direction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"exit() {\n this.exit();\n }",
"_exit(): void {\n this.props.onExampleExit && this.props.onExampleExit();\n }",
"exitTest(ctx) {\n\t}",
"terminating() {}",
"exitSuite(ctx) {\n\t}",
"finish() {}",
"function onEndExecution() {\n endExecutionHook();\n}",
"function handleStepExit(response) ... | [
"0.7022384",
"0.692477",
"0.6723621",
"0.6662515",
"0.6658342",
"0.658027",
"0.6572048",
"0.65665966",
"0.6560598",
"0.6540545",
"0.65362775",
"0.6497292",
"0.64925575",
"0.64664143",
"0.64159966",
"0.6386791",
"0.6379742",
"0.63712937",
"0.6368831",
"0.63471484",
"0.63471377... | 0.7038977 | 0 |
Imposes additional restrictions for `canGoToStep` in current navigation mode. The base implementation allows transition iff the given step is navigable from the navigation bar (see `isNavigable`). However, in some navigation modes `canTransitionToStep` can be more relaxed to allow navigation to certain steps by previou... | canTransitionToStep(wizard, destinationIndex) {
return this.isNavigable(wizard, destinationIndex);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"canGoToStep(wizard, destinationIndex) {\n const hasStep = wizard.hasStep(destinationIndex);\n const movingDirection = wizard.getMovingDirection(destinationIndex);\n const canExitCurrentStep = (previous) => {\n return previous && wizard.currentStep.canExitStep(movingDirection);\n ... | [
"0.68303406",
"0.6577796",
"0.6577796",
"0.6327763",
"0.55556077",
"0.55556077",
"0.55556077",
"0.55556077",
"0.55556077",
"0.5551775",
"0.55138344",
"0.5404448",
"0.53895056",
"0.5182764",
"0.5017139",
"0.4875861",
"0.48343638",
"0.48070723",
"0.4788225",
"0.47724319",
"0.47... | 0.6839638 | 0 |
Tries to transition to the wizard step, as denoted by the given destination index. When entering the destination step, the following actions are done: the old current step is set as completed the old current step is set as unselected the old current step is exited the destination step is set as selected the destination... | goToStep(wizard, destinationIndex, preFinalize, postFinalize) {
this.canGoToStep(wizard, destinationIndex).then(navigationAllowed => {
if (navigationAllowed) {
// the current step can be exited in the given direction
const movingDirection = wizard.getMovingDirection(d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"transition(wizard, destinationIndex) {\n wizard.currentStepIndex = destinationIndex;\n }",
"canTransitionToStep(wizard, destinationIndex) {\n return this.isNavigable(wizard, destinationIndex);\n }",
"canGoToStep(wizard, destinationIndex) {\n const hasStep = wizard.hasStep(destination... | [
"0.82284415",
"0.7163162",
"0.7112572",
"0.6758242",
"0.6573454",
"0.6461002",
"0.63318837",
"0.6314422",
"0.6314422",
"0.6314422",
"0.6314422",
"0.6314422",
"0.62974787",
"0.6272726",
"0.62482053",
"0.6229105",
"0.61173177",
"0.60917187",
"0.5968351",
"0.59378654",
"0.585004... | 0.7582851 | 1 |
Transitions the wizard to the given step index. Can perform additional actions in particular navigation mode implementations. | transition(wizard, destinationIndex) {
wizard.currentStepIndex = destinationIndex;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function goToStepNumber(step){this._currentStepNumber=step;if(typeof this._introItems!==\"undefined\"){nextStep.call(this);}}",
"goToStep(wizard, destinationIndex, preFinalize, postFinalize) {\n this.canGoToStep(wizard, destinationIndex).then(navigationAllowed => {\n if (navigationAllowed) {\n ... | [
"0.6928772",
"0.6914811",
"0.68469095",
"0.6743607",
"0.6739935",
"0.6707533",
"0.6707533",
"0.6707533",
"0.6707533",
"0.6707533",
"0.6705956",
"0.670468",
"0.6671212",
"0.6513847",
"0.64720017",
"0.6418284",
"0.6329839",
"0.62689114",
"0.62623626",
"0.6246538",
"0.6239458",
... | 0.83191246 | 0 |
Resets the state of this wizard. A reset transitions the wizard automatically to the first step and sets all steps as incomplete. In addition the whole wizard is set as incomplete. | reset(wizard) {
this.ensureCanReset(wizard);
// reset the step internal state
wizard.wizardSteps.forEach(step => {
step.completed = step.initiallyCompleted;
step.selected = false;
step.editing = false;
});
// set the first step as the current s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reset() {\n this._setIsResetting(true);\n this._setFinish(false);\n this.activeStep = undefined;\n this.nextStep = undefined;\n for (let i = 0; i < this._steps.length; i++) {\n const step = this.getStepById(i);\n step.reset(this.openFirstStepOnStartup);\n ... | [
"0.8124807",
"0.7656724",
"0.72668433",
"0.68692744",
"0.6849559",
"0.68291724",
"0.67871284",
"0.67624104",
"0.6700702",
"0.66630584",
"0.6604209",
"0.65540314",
"0.6543506",
"0.6532197",
"0.6495718",
"0.6391639",
"0.63638437",
"0.6300636",
"0.6288578",
"0.6281977",
"0.62625... | 0.7887553 | 1 |
The initially selected step, represented by its index Beware: This initial default is only used if no wizard step has been enhanced with the `selected` directive | get defaultStepIndex() {
// This value can be either:
// - the index of a wizard step with a `selected` directive, or
// - the default step index, set in the [[WizardComponent]]
const foundDefaultStep = this.wizardSteps.find(step => step.defaultSelected);
if (foundDefaultStep) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get selected() {\n // @breaking-change 8.0.0 Change return type to `CdkStep | undefined`.\n return this.steps ? this.steps.toArray()[this.selectedIndex] : undefined;\n }",
"function selectStep(step) {\n $scope.model.currentStep = step;\n }",
"setCurrentStep() {\n sco... | [
"0.6855058",
"0.64826286",
"0.64677644",
"0.6120536",
"0.6102664",
"0.6102664",
"0.6027551",
"0.59952503",
"0.5971517",
"0.59474194",
"0.59097606",
"0.5890361",
"0.5783392",
"0.5733171",
"0.57331616",
"0.570569",
"0.57053643",
"0.569934",
"0.56842494",
"0.5659219",
"0.5656439... | 0.824686 | 0 |
Returns true if this wizard uses a horizontal orientation. The wizard uses a horizontal orientation, iff the navigation bar is shown at the top or bottom of this wizard | get horizontalOrientation() {
return this.navBarLocation === 'top' || this.navBarLocation === 'bottom';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isHorizontal() {\n return this.orientation === 'horizontal';\n }",
"isLandscape() {\n return !this.isPortrait();\n }",
"get isHorizontal() {\n return true;\n }",
"get isHorizontal() {\n return true;\n }",
"layoutHorizontalAlign () {\n return false;\n //return this... | [
"0.774482",
"0.64205575",
"0.64128983",
"0.64128983",
"0.6345039",
"0.6307737",
"0.6115579",
"0.60689265",
"0.6041386",
"0.59891665",
"0.5887611",
"0.5882245",
"0.56933546",
"0.5667822",
"0.56354266",
"0.5616472",
"0.5616088",
"0.5508862",
"0.54737926",
"0.5465162",
"0.544660... | 0.79702216 | 0 |
Returns true if this wizard uses a vertical orientation. The wizard uses a vertical orientation, iff the navigation bar is shown at the left or right of this wizard | get verticalOrientation() {
return this.navBarLocation === 'left' || this.navBarLocation === 'right';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isOtherDeviceVerticalView() {\n return (this.verticalAlign && this.orientationVertical);\n }",
"get horizontalOrientation() {\n return this.navBarLocation === 'top' || this.navBarLocation === 'bottom';\n }",
"function isPortrait(){\n switch (window.orientation) { \n case ... | [
"0.7113484",
"0.6722498",
"0.65358293",
"0.63777274",
"0.629169",
"0.62259",
"0.6207673",
"0.6180913",
"0.60850877",
"0.60520864",
"0.5887337",
"0.57019514",
"0.5697493",
"0.5668554",
"0.56614125",
"0.56427145",
"0.5642507",
"0.5610589",
"0.56021935",
"0.55729055",
"0.5551317... | 0.7759187 | 0 |
The WizardStep object belonging to the currently visible and selected step. The currentStep is always the currently selected wizard step. The currentStep can be either completed, if it was visited earlier, or not completed, if it is visited for the first time or its state is currently out of date. If this wizard contai... | get currentStep() {
if (this.hasStep(this.currentStepIndex)) {
return this.wizardSteps[this.currentStepIndex];
}
else {
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isCurrent(wizardStep) {\n return wizardStep.selected;\n }",
"isCurrent(wizardStep) {\n return wizardStep.selected;\n }",
"function getCurrentStep ( ) {\n\n\t\t// Check all locations, map them to their stepping point.\n\t\t// Get the step point, then find it in the input list.\n\t\tvar retou... | [
"0.6872552",
"0.6872552",
"0.61790717",
"0.6143805",
"0.61434865",
"0.612815",
"0.60980725",
"0.60980725",
"0.60951585",
"0.60698724",
"0.6040387",
"0.5872516",
"0.58474106",
"0.5796433",
"0.56462836",
"0.560584",
"0.56015027",
"0.55912817",
"0.55798703",
"0.55704707",
"0.554... | 0.805214 | 0 |
The completeness of the wizard. If the wizard has been completed, i.e. all steps are either completed or optional, this value is true, otherwise it is false | get completed() {
return this.wizardSteps.every(step => step.completed || step.optional);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }",
"isCompleted(wizardStep) {\n return wizardStep instanceof WizardCompletionStep && this.wizard.completed;\n }",
"isDone(wizardStep) {\n return wizardStep.completed;\n }",
... | [
"0.76394063",
"0.76394063",
"0.74141884",
"0.74141884",
"0.7088882",
"0.70543844",
"0.69941825",
"0.6732887",
"0.6637293",
"0.6543937",
"0.64841646",
"0.64484775",
"0.6372535",
"0.63377464",
"0.6325532",
"0.6291761",
"0.6265164",
"0.6259544",
"0.6252449",
"0.61741334",
"0.617... | 0.7914891 | 0 |
Updates the wizard steps to the new array | updateWizardSteps(wizardSteps) {
// the wizard is currently not in the initialization phase
if (this.wizardSteps.length > 0 && this.currentStepIndex > -1) {
this.currentStepIndex = wizardSteps.indexOf(this.wizardSteps[this.currentStepIndex]);
}
this._wizardSteps = wizardSteps... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setSteps(steps) {\n this.steps = steps;\n }",
"function setSteps() {\n scope.stepsToShow = scope.steps.filter(function (s) {\n return s.type === 'QUESTION';\n });\n\n setStepStyles();\n }",
"static resetStepArray() {\n steps.leng... | [
"0.66604763",
"0.65027744",
"0.63526505",
"0.6112108",
"0.6097925",
"0.60662794",
"0.6025172",
"0.5996598",
"0.5965721",
"0.5959192",
"0.5904084",
"0.585852",
"0.5857981",
"0.5818388",
"0.5811015",
"0.5801018",
"0.5761949",
"0.57095367",
"0.5695076",
"0.5658005",
"0.5652357",... | 0.7872994 | 0 |
Checks if a given index `stepIndex` is inside the range of possible wizard steps inside this wizard | hasStep(stepIndex) {
return this.wizardSteps.length > 0 && 0 <= stepIndex && stepIndex < this.wizardSteps.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"canTransitionToStep(wizard, destinationIndex) {\n return this.isNavigable(wizard, destinationIndex);\n }",
"canGoToStep(destinationIndex) {\n return this.navigation.canGoToStep(this, destinationIndex);\n }",
"canGoToStep(wizard, destinationIndex) {\n const hasStep = wizard.hasStep(de... | [
"0.6512617",
"0.63418186",
"0.62844086",
"0.6246219",
"0.59490615",
"0.58895105",
"0.58122754",
"0.5760924",
"0.57143766",
"0.5711697",
"0.56986433",
"0.56986433",
"0.559315",
"0.5454748",
"0.54398954",
"0.5390316",
"0.53798664",
"0.5365718",
"0.53358954",
"0.52795637",
"0.52... | 0.71703815 | 0 |
Checks if this wizard has a previous step, compared to the current step | hasPreviousStep() {
return this.hasStep(this.currentStepIndex - 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isTherePreviousStep() {\n\tif ((recipe[(current_step - 1)]) == undefined) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\t\n}",
"function _previousStep() {\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._current... | [
"0.8223669",
"0.7804214",
"0.7780017",
"0.77780515",
"0.77780515",
"0.77780515",
"0.77780515",
"0.77780515",
"0.70818603",
"0.69567025",
"0.6946974",
"0.6940863",
"0.68686414",
"0.68168485",
"0.6770924",
"0.6769006",
"0.67468274",
"0.6742591",
"0.67071515",
"0.66808766",
"0.6... | 0.8743094 | 0 |
Checks if this wizard has a next step, compared to the current step | hasNextStep() {
return this.hasStep(this.currentStepIndex + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _nextStep() {\n\t\t\tvar $step = wizard.settings.steps[currentStep];\n\n\t\t\t_clearFutureSteps($step);\n\n\t\t\tif($step.isDependent) {\n\t\t\t\t$step = _getDependentStep($step);\n\t\t\t}\n\n\t\t\t// Updating the data regarding current step.\n\t\t\tif(!_recordStepData($step)) {\n\t\t\t\treturn false;\n\t... | [
"0.79405373",
"0.73181987",
"0.7281727",
"0.7205945",
"0.7093517",
"0.693741",
"0.6679754",
"0.6679754",
"0.6646028",
"0.6511969",
"0.64641577",
"0.64641577",
"0.6352707",
"0.6352707",
"0.63405406",
"0.6315657",
"0.6307842",
"0.6257189",
"0.6257189",
"0.61865413",
"0.6174269"... | 0.7866498 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.